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
! moment.js locale configuration
function t(e,t,n,r){var i={s:["थोडया सॅकंडांनी","थोडे सॅकंड"],ss:[e+" सॅकंडांनी",e+" सॅकंड"],m:["एका मिणटान","एक मिनूट"],mm:[e+" मिणटांनी",e+" मिणटां"],h:["एका वरान","एक वर"],hh:[e+" वरांनी",e+" वरां"],d:["एका दिसान","एक दीस"],dd:[e+" दिसांनी",e+" दीस"],M:["एका म्हयन्यान","एक म्हयनो"],MM:[e+" म्हयन्यानी",e+" म्हयने"],y:["एका वर्सान","एक वर्स"],yy:[e+" वर्सांनी",e+" वर्सां"]};return r?i[n][0]:i[n][1]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[n],+e)}", "function Os(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "function At(e,t,a){return\"m\"===a?t?\"хвилина\":\"хвилину\":\"h\"===a?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var a=e.split(\"_\");return t%10==1&&t%100!=11?a[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?a[1]:a[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[a],+e)}", "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "function hd(i,ee,te){return i+\" \"+function kd(i,ee){return 2===ee?function ld(i){var ee={m:\"v\",b:\"v\",d:\"z\"};return void 0===ee[i.charAt(0)]?i:ee[i.charAt(0)]+i.substring(1)}\n//! moment.js locale configuration\n//! locale : bosnian (bs)\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n(i):i}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[te],i)}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\t\tmom._locale = localeData;\n\t\t}", "function Io(e,t,n){var i={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+i[n]}//! moment.js locale configuration", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale ' + key + ' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else\n {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else\n {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\", 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:1880\");\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "static getLocale() {\n return 'en_US';\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}" ]
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.6094649", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.6077035", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029" ]
0.0
-1
! moment.js locale configuration
function t(e,t){var n=e.split("_");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[n],+e)}", "function Os(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "function At(e,t,a){return\"m\"===a?t?\"хвилина\":\"хвилину\":\"h\"===a?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var a=e.split(\"_\");return t%10==1&&t%100!=11?a[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?a[1]:a[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[a],+e)}", "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "function hd(i,ee,te){return i+\" \"+function kd(i,ee){return 2===ee?function ld(i){var ee={m:\"v\",b:\"v\",d:\"z\"};return void 0===ee[i.charAt(0)]?i:ee[i.charAt(0)]+i.substring(1)}\n//! moment.js locale configuration\n//! locale : bosnian (bs)\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n(i):i}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[te],i)}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\t\tmom._locale = localeData;\n\t\t}", "function Io(e,t,n){var i={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+i[n]}//! moment.js locale configuration", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale ' + key + ' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else\n {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else\n {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\", 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:1880\");\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "static getLocale() {\n return 'en_US';\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}" ]
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.6094649", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.6077035", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029" ]
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){var i={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?i[n][0]:i[n][1]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[n],+e)}", "function Os(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "function At(e,t,a){return\"m\"===a?t?\"хвилина\":\"хвилину\":\"h\"===a?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var a=e.split(\"_\");return t%10==1&&t%100!=11?a[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?a[1]:a[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[a],+e)}", "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "function hd(i,ee,te){return i+\" \"+function kd(i,ee){return 2===ee?function ld(i){var ee={m:\"v\",b:\"v\",d:\"z\"};return void 0===ee[i.charAt(0)]?i:ee[i.charAt(0)]+i.substring(1)}\n//! moment.js locale configuration\n//! locale : bosnian (bs)\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n(i):i}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[te],i)}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\t\tmom._locale = localeData;\n\t\t}", "function Io(e,t,n){var i={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+i[n]}//! moment.js locale configuration", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale ' + key + ' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else\n {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else\n {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\", 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:1880\");\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "static getLocale() {\n return 'en_US';\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}" ]
[ "0.82627255", "0.80355096", "0.7878359", "0.75476736", "0.72037613", "0.71981734", "0.71757025", "0.7170814", "0.71322805", "0.7130772", "0.7044428", "0.667163", "0.667163", "0.6334324", "0.6292554", "0.62773275", "0.62773275", "0.62773275", "0.62773275", "0.62090504", "0.6093498", "0.60916936", "0.60916936", "0.60916936", "0.60916936", "0.60916936", "0.60770184", "0.60770184", "0.60770184", "0.60770184", "0.60770184", "0.60770184", "0.60759085", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914" ]
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){var i={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?i[n][0]:i[n][1]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[n],+e)}", "function Os(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "function At(e,t,a){return\"m\"===a?t?\"хвилина\":\"хвилину\":\"h\"===a?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var a=e.split(\"_\");return t%10==1&&t%100!=11?a[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?a[1]:a[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[a],+e)}", "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "function hd(i,ee,te){return i+\" \"+function kd(i,ee){return 2===ee?function ld(i){var ee={m:\"v\",b:\"v\",d:\"z\"};return void 0===ee[i.charAt(0)]?i:ee[i.charAt(0)]+i.substring(1)}\n//! moment.js locale configuration\n//! locale : bosnian (bs)\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n(i):i}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[te],i)}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\t\tmom._locale = localeData;\n\t\t}", "function Io(e,t,n){var i={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+i[n]}//! moment.js locale configuration", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale ' + key + ' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else\n {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else\n {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\", 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:1880\");\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "static getLocale() {\n return 'en_US';\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}" ]
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.6094649", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.6077035", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029" ]
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){var i={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?i[n][0]:i[n][1]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[n],+e)}", "function Os(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "function At(e,t,a){return\"m\"===a?t?\"хвилина\":\"хвилину\":\"h\"===a?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var a=e.split(\"_\");return t%10==1&&t%100!=11?a[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?a[1]:a[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[a],+e)}", "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "function hd(i,ee,te){return i+\" \"+function kd(i,ee){return 2===ee?function ld(i){var ee={m:\"v\",b:\"v\",d:\"z\"};return void 0===ee[i.charAt(0)]?i:ee[i.charAt(0)]+i.substring(1)}\n//! moment.js locale configuration\n//! locale : bosnian (bs)\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n(i):i}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[te],i)}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\t\tmom._locale = localeData;\n\t\t}", "function Io(e,t,n){var i={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+i[n]}//! moment.js locale configuration", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale ' + key + ' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else\n {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else\n {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\", 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:1880\");\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "static getLocale() {\n return 'en_US';\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}" ]
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.6094649", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.6077035", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029" ]
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){var i={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return t?i[n][2]?i[n][2]:i[n][1]:r?i[n][0]:i[n][1]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[n],+e)}", "function Os(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "function At(e,t,a){return\"m\"===a?t?\"хвилина\":\"хвилину\":\"h\"===a?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var a=e.split(\"_\");return t%10==1&&t%100!=11?a[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?a[1]:a[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[a],+e)}", "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "function hd(i,ee,te){return i+\" \"+function kd(i,ee){return 2===ee?function ld(i){var ee={m:\"v\",b:\"v\",d:\"z\"};return void 0===ee[i.charAt(0)]?i:ee[i.charAt(0)]+i.substring(1)}\n//! moment.js locale configuration\n//! locale : bosnian (bs)\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n(i):i}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[te],i)}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\t\tmom._locale = localeData;\n\t\t}", "function Io(e,t,n){var i={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+i[n]}//! moment.js locale configuration", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale ' + key + ' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else\n {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else\n {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\", 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:1880\");\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "static getLocale() {\n return 'en_US';\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}" ]
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.6094649", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.6077035", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029" ]
0.0
-1
Creates a User in the Database If the User exists, return error if it exists
static createUser(req, res){ // Form validation const { errors, isValid } = validateRegisterInput(req.body); // Check validation if (!isValid) { return res.status(400).json(errors); } User.findOne({ username: req.body.username }) .then(user => { if (user) { return res.status(400).json({ username: "Username already exists" }); } const newUser = new User({ username: req.body.username, password: req.body.password, //privileges : req.body.privileges, admin_creator: req.body.admin_creator, isAdmin: req.body.isAdmin, isNetIDLogin: req.body.isNetIDLogin, comment: req.body.comment, }); // Hash password before saving in database bcrypt.genSalt(10, (err, salt) => { bcrypt.hash(newUser.password, salt, (err, hash) => { if (err) throw err; newUser.password = hash; newUser .save() .then(user => res.json(user)) .catch(err => console.log(err)); }); }); } ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createUser(){\n let username = getUsername();\n let password = getPassword();\n\n if (username.length != 0){\n if (allUsers.has(username)){\n throw new Error(\"User with us\");\n }\n allUsers.set(username, password);\n console.log(\"User added: \" + username + \" \" + password);\n } else{\n throw new Error(\"Username is empty\");\n }\n}", "function createUser (user, db = connection) {\n return userExists(user.user_name, db)\n .then(exists => {\n if (exists) {\n throw new Error('User already exists')\n }\n return null\n })\n .then(passwordHash => {\n return db('users').insert({ user_name: user.user_name, hash: passwordHash })\n })\n}", "function createUser(userObj) {\n var name = userObj.name;\n var username = userObj.username;\n var email = userObj.email;\n var password = userObj.password;\n var confirmPassword = userObj.confirmPassword;\n return User.create(name, username, email, password)\n .then(data => {\n return User.find(email)\n .then(data => {\n return data.rows[0];\n })\n .catch(err => {\n console.log(err);\n });\n })\n .catch(err => {\n throw \"user exists\";\n });\n}", "function createUser() {\n var newUser = {\n username: $usernameFld.val(),\n password: $passwordFld.val(),\n firstName: $firstNameFld.val(),\n lastName: $lastNameFld.val(),\n role: $roleFld.val()\n };\n try {\n userService\n .createUser(newUser)\n .then(function (userServerInfo) {\n users.push(userServerInfo);\n renderUsers(users);\n resetInputFields();\n clearSelected();\n });\n }\n catch (err) {\n console.log(err.name + \": \" + err.message);\n }\n }", "async createUser () {\n\t\t// first create the user, unregistered...\n\t\tconst { email, fullName, username, passwordHash, timeZone, preferences } = this.request.body.user;\n\t\tconst user = await new UserCreator({\n\t\t\trequest: this,\n\t\t\texistingUser: this.existingUser\n\t\t}).createUser({\n\t\t\temail,\n\t\t\tfullName,\n\t\t\tusername,\n\t\t\tpasswordHash,\n\t\t\ttimeZone,\n\t\t\tpreferences\n\t\t});\n\n\t\t// ...then confirm...\n\t\treturn this.confirmUser(user);\n\t}", "function createUser(req, res) {\n\n var user = req.body;\n\n if(null == user){\n res.sendStatus(500);\n return;\n }\n userModel.createUser(user)\n .then(function (dbUser) {\n\n if(null == dbUser){\n res.sendStatus(500);\n } else {\n res.send(dbUser);\n }\n\n }, function (err) {\n res.sendStatus(500).send(err);\n });\n }", "createUser (user) {\n\t\treturn User.create(user).exec();\n\t}", "async function createUser(user) {\n const dbUser = new User(user);\n try {\n const result = await dbUser.save();\n return true;\n } catch (err) {\n return false;\n }\n}", "function register (req, res, next) {\n users.exists(req.body.username)\n .then(exists => {\n if (exists) {\n return res.status(400).send({message: 'User exists'})\n }\n users.create(req.body.username, req.body.password)\n .then(() => next())\n })\n .catch(err => {\n res.status(400).send({message: err.message})\n })\n}", "function createUser() {}", "function createUser( res, data ){\n\n var newUser = new User({\n email: data.email,\n username: data.user,\n password: data.pass,\n userType: userTypes['admin']\n });\n\n // save user to database\n\n User.find({'userType': userTypes['admin']}, function(err, docs){\n\n var noAdmin = docs.length === 0;\n\n if(noAdmin)\n newUser.save(function(err) {\n if(err)\n res.end(JSON.stringify(new comm(false, '', true, 'Account could not be created.')));\n else\n res.end(JSON.stringify(new comm(true, data.user, false, '')));\n });\n else\n res.end(JSON.stringify(new comm(false, '', true, 'Cannot create duplicate admin account.')));\n });\n }", "function createUser(req, res, next) {\n const data = dropProperties(req.body, immutables);\n User.create(data)\n .then(user => res.status(HTTPStatus.OK).send(user))\n .catch(err => {\n if (err.code === 11000) {\n return res.status(HTTPStatus.CONFLICT).json('User already exists');\n }\n const message = get(err, 'errors.password.message');\n if (message) {\n return res.status(HTTPStatus.BAD_REQUEST).json({ error: message });\n }\n return next(err);\n });\n}", "function createUser(req, res, next){\n // Check for an existing user with the same email\n User.findOne({\n \"email\": req.body.email\n }, function(err, user){\n // If an error occured while finding an existing user\n if (err){\n return res.status(500).send(\n utils.errorResponse('ER_SERVER', err)\n );\n }\n // If an existing user with the same email is found\n if (user){\n return res.status(400).send(\n utils.errorResponse('ER_USER_EXISTS')\n );\n }\n // If no user with the same email is found, create a new user\n var newUser = new User(req.body);\n newUser.save(function(err){\n // If an error occured with saving the new user\n if (err){\n return res.status(500).send(\n utils.errorResponse('ER_SERVER', err)\n );\n }\n return res.sendStatus(200);\n });\n });\n}", "async addUser(username) {\n // Check if user already exists is in database\n const exists = await this.loadUser(username);\n\n // If user already exists, do not add User to Database\n if (exists) return false;\n\n return this.client.query(QUERIES.ADD_USER(username))\n .then(() => true)\n .catch((err) => {\n error(err);\n this.client.end();\n return false;\n });\n }", "function createNewUser(username, password, email) {\n return dbinit.then(function(initDB) {\n\t\treturn initDB.User.create({\n\t username: username,\n\t\t\tpassword: password,\n\t\t\temail: email\n\t });\n\t})\n}", "function createUser (user, db = connection) {\n return userExists(user.username, db)\n .then(exists => {\n if (exists) {\n throw new Error('Bird already in flock')\n }\n return false\n })\n .then(() => generateHash(user.password))\n .then(passwordHash => {\n return db('users').insert({\n username: user.username,\n hash: passwordHash,\n is_admin: false\n })\n })\n}", "function createUser(req, res) {\n userService.create(req.body)\n .then(function () {\n res.sendStatus(200);\n })\n .catch(function (err) {\n res.status(400).send(err);\n });\n}", "function createUser(req, res, next) {\n const sql = sqlString.format(`INSERT INTO users SET ?`, req.body)\n\n db.execute(sql, (err, result) => {\n if (err) return next(err)\n res.send('New user added successfully')\n })\n}", "createUser({ body }, res) {\n // use create method\n User.create(body)\n // create user\n .then((dbUserData) => res.json(dbUserData))\n // if error exists, catch and return error\n .catch((err) => res.status(400).json(err));\n }", "async create(req, res) {\n try {\n validateUser(req.body);\n await userRepository.create(req.body);\n res.json('User registered successfully.');\n } catch (err) {\n res.json({ err });\n }\n }", "static async createUser({ username, password, first_name, last_name, email }) {\n try {\n const res = await this.request(`users`, { username, password, first_name, last_name, email }, 'post')\n return res;\n } catch (err) {\n return { errors: err };\n }\n }", "function register (req, res, next) {\n const { username, password } = req.body\n createUser({username, password})\n .then(([id]) => {\n res.locals.userId = id\n next()\n })\n .catch(({message}) => {\n // todo research how this works in Postgres\n if(message.includes('UNIQUE constraint failed: users.username')){\n return res.status(400).json({\n ok: false,\n message: 'Username already exists.'\n })\n }\n res.status(500).json({\n ok: false,\n message: \"Something bad happend. We don't know why.\"\n })\n })\n}", "function create(req, res) {\n db.User.create(req.body, function(err, user) {\n if (err) { console.log('error', err); }\n res.json(user);\n });\n}", "function create(req, res) {\n db.User.create(req.body, function(err, user) {\n if (err) { console.log('error', err); }\n res.json(user);\n });\n}", "function createUser(req, res) {\n var user = req.body;\n userModel.createUser(user)\n .then(function(response) {\n return res.status(201).json(response);\n }).catch(function(error) {\n console.error('Error creating user' + error);\n return res.status(500).json('Failed to create user');\n });\n\n}", "createUser(body, cb) {\n\t\ttry {\n\t\t\tglobal.dbController.insert('users', body, (userData) => {\n\t\t\t\tif (userData.status) {\n\t\t\t\t\tcb && cb(userData, statusCodes.SUCCESSFULLY_CREATED)\n\t\t\t\t} else {\n\t\t\t\t\tcb && cb(userData, statusCodes.FORBIDDEN_REQUEST)\n\t\t\t\t}\n\t\t\t})\n\t\t} catch (e) {\n\t\t\t// console.log('error catched in createUser handler ', e.message)\n\t\t\tvar error = {\n\t\t\t\tstatus: false,\n\t\t\t\tresult: { err: e.message }\n\t\t\t}\n\t\t\tcb && cb(error, statusCodes.INTERNAL_SERVER_ERROR)\n\t\t}\n\t}", "function registerUserInDB(username, password){\n let newUser = new User({username: username, password: password});\n return newUser.save();\n}", "function create_user(username, password, password_confirmation, email_address, phone, callback) {\n if(password !== password_confirmation) {\n callback('Password does not match confirmation');\n } else {\n db.all('SELECT username FROM users WHERE username = ?', [username], function(err, rows) {\n if(rows.length > 0) {\n callback('User already exists');\n return;\n }\n\n // Hash the password using a salt, hashSync(data, salt).\n // More info: https://www.npmjs.com/package/bcrypt-nodejs\n var pw_hash = bcrypt.hashSync(password, 10);\n\n // Notice the database stores all passwords hashed.\n db.run('INSERT INTO users (username, password, email, phone) VALUES (?, ?, ?, ?)', [username, pw_hash, email_address, phone], function(err) {\n callback(err, username);\n });\n });\n }\n}", "static async create(username, password, name) {\n // First check to see if username is already in database\n try {\n const response = await axios.post(`${BASE_URL}/signup`, {\n user: {\n username,\n password,\n name,\n },\n });\n\n // build a new User instance from the API response\n const newUser = new User(response.data.user);\n\n // attach the token to the newUser instance for convenience\n newUser.loginToken = response.data.token;\n return newUser;\n // Throw error if username already exists in database\n } catch (err) {\n alert(err.response.data.error.message);\n }\n }", "function createUser() {\n var username = $('#usernameFld').val();\n var password = $('#passwordFld').val();\n var firstName = $('#firstNameFld').val();\n var lastName = $('#lastNameFld').val();\n var role = $('#roleFld').val();\n\n var user = new User(username,password,firstName,lastName,role,null,null,null);\n\n userService\n .createUser(user)\n .then(findAllUsers)\n .then(emptyUserForm);\n }", "function doesUserExist(req, res, callback) {\n var user = req.body.username,\n pass = req.body.password;\n\n User.find({\n email: user\n }).count(function (err, count) {\n if (count > 0) {\n //username already exists\n console.log(\"Signup Error: \" + user + \" already exists\");\n res.jsonp({\n message: \"This user name already exists\"\n });\n } else {\n //username does not exist, create it\n console.log(\"User does not exist\");\n callback(req);\n res.jsonp({\n message: \"The user has been added\"\n });\n }\n });\n}", "function create(req, res, next) {\n\n\tvar body = req.body,\n\t\tuser;\n\n\t// do we have the appropriate parameters?\n\tif (!body || !body.username || !body.password) {\n\t\treturn res.status(httpStatus.BAD_REQUEST).json({\n\t\t\treason: reasonCodes.BAD_SYNTAX,\n\t\t\tmessage: 'Bad request'\n\t\t});\n\t}\n\n\tuser = new User({\n\t\tusername: body.username,\n\t\tpassword: body.password\n\t});\n\n\tuser.save(function (err) {\n\n\t\tvar saveError;\n\n\t\tif (err) {\n\n\t\t\t// if its a known validation error then return a\n\t\t\t// a bad request\n\t\t\tsaveError = processSaveError(err);\n\t\t\tif (saveError) {\n\t\t\t\treturn res.status(httpStatus.BAD_REQUEST).json(saveError);\n\t\t\t}\n\n\t\t\t// ok - this is a genuine exception - return a 500\n\t\t\treturn next(err);\n\n\t\t} else {\n\t\t\tres.status(httpStatus.CREATED).json({\n\t\t\t\tmessage: 'Created'\n\t\t\t});\n\t\t}\n\t});\n}", "function createUser(){\n var info = getUserInfo();\n if (info.user.name === \"\" || info.user.username === \"\" || info.user.password === \"\"){\n alert(\"Must enter a Name, Username and Password\");\n }else{\n createUserAjax(info);\n }\n }", "function CreateSuperUser(callback) {\n Modal.User.find({username: 'admin'}, function (err, data) {\n if (err) {\n log.error(err);\n } else {\n if (data.length == 0) {\n new Modal.User({\n username: \"admin\",\n password: \"admin\"\n }).save(function (err, result) {\n if (err) {\n log.error(\"Error Save Record: \" + err);\n } else {\n log.cool('Super User Created Successfully');\n }\n })\n } else {\n log.cool('Super User Already Available');\n }\n }\n callback(err, 'user saved');\n });\n }", "function createUser() {\n return UserDataService.signup(props.onLogin, setValidation, values);\n }", "async function signUp ({ email, password, name, avatar}){\n\n const clientFound= await Users.findOne({email})\n if (clientFound){\n throw new Error('User already exists')\n }\n\n const encryptedPassword = await bcrypt.hash(password)\n\n return Users.create({ email, password: encryptedPassword, name, avatar})\n}", "function createUser(usersDb, body) {\n const id = Math.random().toString(36).substring(2, 8);\n const { email, password } = body;\n const hashedPassword = bcrypt.hashSync(password, 10);\n\n if (!email || !password) {\n return { user: null, error: \"Invalid Fields\" };\n }\n //Checking to see if user alredy exist\n if (checkUser(usersDb, email)) {\n return { user: null, error: \"User Already Exist!\" };\n }\n usersDb[id] = { id, email, hashedPassword };\n return { user: usersDb[id], error: null };\n}", "function create_user(username, password, password_confirmation, callback) {\n if(password !== password_confirmation) {\n callback('Password does not match confirmation');\n } else {\n db.all('SELECT username FROM users WHERE username = ?', [username], function(err, rows) {\n if(rows.length > 0) {\n callback('User already exists');\n return;\n }\n\n // Hash the password using a salt, hashSync(data, salt).\n // More info: https://www.npmjs.com/package/bcrypt-nodejs\n var pw_hash = bcrypt.hashSync(password, 10);\n\n // Notice the database stores all passwords hashed.\n db.run('INSERT INTO users (username, password) VALUES (?, ?)', [username, pw_hash], function(err) {\n callback(err, username);\n });\n });\n }\n}", "function registerUser(){\n Cloud.Users.create({\n username: \"push123x\",\n password: \"push123x\",\n password_confirmation: \"push123x\",\n first_name: \"Firstname\",\n last_name: \"Lastname\"\n }, function (e) {\n if (e.success) {\n \talert(\"User Created\");\n \tloginUser();\n } else {\n \talert(\"Error :\"+e.message);\n }\n });\n}", "function new_user(user) {\n return new Promise((resolve, reject) => {\n /* Perhaps check for email too instead of user ID */\n\n // Check if the user with user.userID currently exists or not.\n if (userDB[user.userID])\n return reject(new Error('ERR: User already exists'));\n\n // Insert user object into the database as value of the userID key\n userDB[user.userID] = user;\n resolve(); // Resolves without anything to end the Promise.\n });\n}", "function createUser(\n username,\n email,\n full_name,\n password,\n profile_picture,\n done\n) {\n const role = \"ROLE_USER\";\n\n create(\n username,\n email,\n full_name,\n password,\n profile_picture,\n role,\n (err, doc) => {\n if (err) {\n return done(err);\n } else {\n return done(false, doc);\n }\n }\n );\n}", "function create(req, res)\n{\n\t//Validate username\n\tvar username = req.body.username;\n\tif (!username)\n\t{\n\t\treturn res.status(400).json({\n\t\t\tsuccess: false,\n\t\t\tmessage: 'Must provide a username'\n\t\t});\n\t}\n\tusername = username.trim().toLowerCase();\n\n\tif (!username.match(/^[A-Za-z0-9\\.\\-\\_]*$/))\n\t{\n\t\treturn res.status(400).json({\n\t\t\tsuccess: false,\n\t\t\tmessage: 'Usernames must only consist of letters, numbers, and the symbols .-_'\n\t\t});\n\t}\n\n\tif (username.length < 3)\n\t{\n\t\treturn res.status(400).json({\n\t\t\tsuccess: false,\n\t\t\tmessage: 'Usernames must be at least 3 characters long'\n\t\t});\n\t}\n\n\tif (username.length > 24)\n\t{\n\t\treturn res.status(400).json({\n\t\t\tsuccess: false,\n\t\t\tmessage: 'Usernames must be 24 or fewer characters long'\n\t\t});\n\t}\n\n\t//Validate password\n\tvar password = req.body.password;\n\tif (!password)\n\t{\n\t\treturn res.status(400).json({\n\t\t\tsuccess: false,\n\t\t\tmessage: 'Must provide a password'\n\t\t});\n\t}\n\n\tpassword = password.trim();\n\tif (password.length < 8)\n\t{\n\t\treturn res.status(400).json({\n\t\t\tsuccess: false,\n\t\t\tmessage: 'Password must be at least 8 characters long'\n\t\t});\n\t}\n\n\tif (password.length > 24)\n\t{\n\t\treturn res.status(400).json({\n\t\t\tsuccess: false,\n\t\t\tmessage: 'Password must be 24 or fewer characters long'\n\t\t});\n\t}\n\n\tpassword = bcrypt.hashSync(password, 10);\n\n\tvar user = new User({\n\t\tusername: username,\n\t\tpassword: password\n\t});\n\tuser.save(function(error){\n\t\tif (error)\n\t\t{\n\t\t\treturn res.status(500).json({\n\t\t\t\tsuccess: false,\n\t\t\t\tmessage: 'A user with that name already exists'\n\t\t\t});\n\t\t}\n\n\t\treturn res.status(200).json({\n\t\t\tsuccess: true\n\t\t});\n\t});\n}", "function CreateNewUser(isClosed){\n\tvar result = validateUserFields()\n\tif(result){\n\t\tsaveUserData(0,isClosed)\n\t}\n}", "async function signUp ( {name, email, password} ) {\n\n // Inicio de la funcion userFound para saber si el email ya existe\n const userFound = await Users.findOne( {email: email} )\n\n if (userFound) {\n throw new Error('User already exist')\n } \n // Fin de la funcion userFound\n\n // Para encryptar el password\n const encryptedPassword = await bcrypt.hash(password)\n\n return Users.create({ \n name, \n email, \n password: encryptedPassword\n })\n}", "function createUser(user) {\n const queryP = db.one(`\n INSERT INTO users (username, password)\n VALUES ($/username/, $/password/)\n RETURNING *\n `, user\n );\n return queryP;\n}", "async function newUser({ name, email, phone }) {\n const newUser = await User.create({ name, email, phone });\n return newUser.get({ plain: true });\n}", "function createUser(user) {\n return __awaiter(this, void 0, void 0, function* () {\n return api_1.post('users.create', user, true, /already in use/i);\n });\n}", "function create(\n username,\n email,\n full_name,\n password,\n profile_picture,\n role,\n done\n) {\n var newUser = new User({\n username,\n email,\n full_name,\n password,\n profile_picture,\n role,\n });\n newUser.save((err, doc) => {\n if (err) {\n return done(err);\n }\n const { _id, username, email, full_name, role } = doc;\n return done(false, { _id, username, email, full_name, role });\n });\n}", "async store(req, res) {\n const { email, name, password, isAdmin } = req.body;\n\n const alreadyExists = await User.findOne({\n email,\n });\n\n if (alreadyExists) {\n return res.status(400).json({\n error: 'Already have an user with this e-mail',\n });\n }\n\n const userCreate = await User.create({\n email,\n name,\n password,\n isAdmin,\n });\n\n return res.status(200).json(userCreate);\n }", "async register(req, res) {\n User.create(req.body).then(user => {\n res.status(201).send({\n success: true,\n message: 'User successfully registered!',\n user\n })\n }).catch((err) => {\n res.status(500).send({\n success: false,\n message: 'Something went wrong!',\n error: err[0].message\n })\n })\n }", "function createNewUser(name, email, passwd, phone, date, zip) {\n var newUser = new UserObject();\n newUser.set(\"username\", email);\n newUser.set(\"password\", passwd);\n newUser.set(\"name\", name);\n newUser.set(\"email\", email);\n if (phone != \"\") newUser.set(\"phone\", phone);\n if (date != \"\") newUser.set(\"weddingDate\", date);\n newUser.set(\"zipCode\", zip);\n return newUser.signUp();\n}", "function createUser(user){\n // user is the json object that we will receive with username and password and email\n //users.push(user);\n console.log(\"[createUser - model] trying to create a new user\");\n var username = user.username;\n var password = user.username;\n var email = user.email;\n \n var userToInsert = {\n username: username,\n password: password,\n email: email\n }\n \n var deferred = q.defer();\n \n UserModel.create(userToInsert, function(err, doc){\n if(err){\n console.log(\"[createUser - model] There was an issue during creation of the user\");\n }else{\n deferred.resolve(doc);\n }\n });\n return deferred.promise();\n }", "signup(user_id, username) {\n \n return this._genAuthToken().then(auth_token => {\n return {user_id, username, auth_token};\n })\n .then(user => {\n return this._run(r.table('users').insert(user)).then(result => {\n if (result.errors) {\n return Promise.reject(result.first_error);\n }\n return user;\n });\n });\n }", "function createUser (userParam) {\n\n\tlet deferred = Q.defer();\n\n\t// Comprovamos si el usuario existe\n\tgetUserByEmail(userParam.email)\n\t.then(user => {\n\t\t// Usuario ya registrado, enviamos el error\n\t\tif (user){\n\t\t\tdeferred.reject(\"Usuario ya registrado\");\n\t\t}else{\n\t\t\t// Crea el objecto usuario con los parametros pasados y lo devuelve\n\t\t\tnew User (userParam) \n\t\t\t.save()\n\t\t\t.then(createdUser => {\n\t\t\t\tdeferred.resolve(createdUser);\n\t\t\t})\n\t\t\t.catch(err => {\n\t\t\t\tdeferred.reject(err);\n\t\t\t});\n\t\t}\n\t})\n\t.catch(err => {\n\t\tdeferred.reject(err);\n\t});\n\n\treturn deferred.promise;\n\n}", "function _createUser(FirstName, LastName, Email, Role, Birthday, Sex, password, callback) // this creates a user\n{\n validate.valUser(Email, password, Role, function (data)\n {\n console.log(\"her er val data: \" + data);\n if (data === true)\n {\n User.createUser(FirstName, LastName, Email, Role, Birthday, Sex, password, function (data2)\n {\n if (data2){\n stripeCustomer.createStripeCustomer(data2.email, function (customer) {\n if (customer){\n User.putGiveUserStripeCustomerID(customer.email, customer.id, function (data3) {\n if (data3){\n callback(true)\n }\n })\n } else {\n console.log(\"something went wrong with createStripeCustomer, but user has been created.\")\n callback(true)\n }\n })\n\n } else {\n callback(false)\n }\n })\n } else\n {\n callback(false)\n }\n })\n}", "async addUser(name){\n return user.create(name)\n }", "function findOrCreate (user, cb) {\n console.log('IN FUNCTION FINDORCREATE' + JSON.stringify(user, null, 4));\n client.getUser(user.username, (err, usr) => {\n console.log('GET USER ERROR FINDORCREATE' + JSON.stringify(err, null, 4));\n console.log('GET USER FINDORCREATE' + JSON.stringify(usr, null, 4));\n if (err) {\n console.log('entro al if error')\n return client.saveUser(user, cb)\n }\n\n // llamando cb sin ningun error y le mando el user obtenido de la DB\n cb(null, usr)\n })\n }", "async function signUp(req, res) {\n const email = req.body.email;\n const existingUser = await User.findOne({ email: email });\n if (existingUser) {\n res.status(601).json({ message: \"User with this mail already registered\" });\n } else {\n try {\n const { password, name, email } = req.body;\n const first_name = name.first_name;\n const last_name = name.last_name;\n\n const token = uid2(16);\n const salt = uid2(16);\n const hash = SHA256(password + salt).toString(encBase64);\n\n const newUser = new User({\n email,\n name: {\n first_name,\n last_name\n },\n token,\n salt,\n hash\n });\n await newUser.save();\n const user = {\n id: newUser._id,\n email: newUser.email,\n name: newUser.name\n };\n\n res.status(200).json({ message: \"User sign up\", user });\n } catch (err) {\n res.status(400).json({ error: err.message });\n }\n }\n}", "function checkIfUserExist() {\n user\n .findOne()\n .or([{ email: email }, { username: username }])\n .exec(function(err, result) {\n if (err) throw err;\n if (result === [] || result === null || result === undefined) {\n // * SAVE NEW USER\n var userInstance = new user({\n firstName: firstName.toLowerCase(),\n lastName: lastName.toLowerCase(),\n username: username,\n email: email,\n password: password,\n role: \"user\"\n });\n\n // * HASH PASSWORD AND SAVE PROFILE\n bcrypt.genSalt(saltRounds, function(err, salt) {\n bcrypt.hash(password, salt, function(err, hash) {\n userInstance.password = hash;\n userInstance\n .save()\n .then(result => {\n req.session.userId = result._id;\n req.session.role = result.role;\n req.session.userName = result.username;\n\n // * CREATE POSTER PROFILE\n\n poster\n .findOne( { username: username } )\n .exec(function(err, resultPoster) {\n if (err) throw err;\n if (resultPoster === [] || resultPoster === null || resultPoster === undefined) {\n // * SAVE NEW USER\n var posterInstance = new poster({\n ownerUserName: username,\n });\n\n posterInstance\n .save()\n .then(resultPoster => {\n console.log(resultPoster);\n return res.redirect(\"/\");\n })\n .catch(function(err) {\n console.log(err);\n });\n }\n });\n\n })\n .catch(function(err) {\n console.log(err);\n });\n });\n });\n } else {\n let flashError = \"\";\n if (result.username === username) {\n flashError = \"Ce pseudo est déjà utilisé.\";\n }\n if (result.email === email) {\n flashError = \"Cet email est déjà utilisé.\";\n }\n if (result.username === username && result.email === email) {\n flashError = \"Ce pseudo et cet email sont déjà utilisés.\";\n }\n req.flash(\n \"wrong signup\",\n flashError + \" Veuillez réessayer.\"\n );\n return res.redirect(\"/account/signup\");\n }\n });\n }", "function createUser(userData) {\n\t\tuserAuth.register(userData, function(err) {\n\t\t\tif(err){ \n\t\t\t\t$rootScope.flashMessage = {data: \"Something went wrong please try again\", type: \"error\"}\n\t\t\t}else{\n\t\t\t\tif($rootScope.currentUser.role == \"Author\"){\n\t\t\t\t\t$location.path('/info');\n\t\t\t\t\t$rootScope.flashMessage = {data: \"Kindly fill your profile details\", type: \"success\"}\n\t\t\t\t\tvm.showForm = true;\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\t$location.path('/');\n\t\t\t\t$rootScope.flashMessage = {data: \"Successfully Logged In\", type: \"success\"}\n\t\t\t}\n\t\t});\n\t}", "function createUser(decode){\n let index = db.auth ? db.auth.findIndex(auth => auth.login == email) : -2;\n if (index>=0) return -2; //Cannot user already exists\n let id =uuidv4();\n var now = Date.now();\n //User will have no valid login if only type is passed (external SSO like azure)\n db.auth.push( {id:id,login:email,hash:(password ? hash(password) : type),\n roles:['default'],createdBy:id.toString(),updatedBy:id.toString(),\n createdAt:now,updatedAt:now});\n db.users.push({id:id,email:email,name:decode['name'],createdBy:id.toString(),updatedBy:id.toString(),\n createdAt:now,updatedAt:now});\n index = db.auth ? db.auth.findIndex(auth => auth.login == email) : -2;\n if (myOptions.logLevel>1) console.log(\"Added user\",email);\n server.db.write();\n return index;\n }", "async function createUser (email, password, fname, lname) {\n try {\n const user = await User.create({email: email, password: password, firstName: fname, lastName: lname})\n return user\n } catch (err) {\n logger.error('Failed to create user. Error occured as :: '+err)\n return null\n }\n}", "function createUser(name, callback) {\n if (!getUser(socket.id)) {\n console.log(`${socket.id} checked in with name \"${name}\"`);\n const user = { id: socket.id, name: name };\n users.push(user);\n if (callback) callback();\n }\n else {\n if (callback) callback(\"User already exists\");\n }\n }", "function postUser(req, res) {\n User.create({\n name: req.body.name,\n email: req.body.email,\n password: req.body.password\n },\n function (err, user) {\n if (err) return res.status(500).send(\"There was a problem adding the information to the database.\");\n res.status(200).send(user);\n });\n}", "function registerUser(req, res) {\n userService.create(req.body)\n .then(function () {\n res.sendStatus(200);\n })\n .catch(function (err) {\n res.status(400).send(err);\n });\n}", "function registerUser(req, res) {\n userService.create(req.body)\n .then(function () {\n res.sendStatus(200);\n })\n .catch(function (err) {\n res.status(400).send(err);\n });\n}", "createNewUser(userName, fullName, unhashedPassword, phone, countryCode, callback) {\n authy.register_user(userName, phone, countryCode, (err, res) => {\n if (err) {\n return callback(err);\n }\n let authyID = res.user.id;\n\n this.saveUser(unhashedPassword, userName, fullName, phone, countryCode, authyID, callback);\n });\n }", "function createUser(req, res, next) {\r\n\treq.body.age = parseInt(req.body.age);\r\n\r\n\tvar auth = _hashPassword(req.params.password);\r\n\r\n\tdb.none(`insert into users(first_name, last_name, email, password)` +\r\n\t `values(${first_name}, ${last_name}, ${email}, ${password})`,\r\n\t req.body)\r\n\t.then(function () {\r\n\t\tres.status(200)\r\n\t\t.json({\r\n\t\t\tstatus: 'success',\r\n\t\t\tmessage: 'Inserted one user'\r\n\t\t});\r\n\t})\r\n\t.catch(function (err) {\r\n\t\treturn next(err);\r\n\t});\r\n}", "function create(req, res) {\n console.log(req.body);\n User.createSecure(req.body.email, req.body.password, function (err, newUser) {\n if (err){\n console.log('user creation error:', err);\n sendServerError(res);\n } else {\n console.log('user created with email:', newUser.email);\n req.session.userId = newUser._id; // log the user in immediately\n res.json(newUser);\n }\n });\n}", "function createUser(req, res) {\n const { firstName, lastName, email, password, phoneNumber } = req.body;\n const values = [firstName, lastName, email, password, phoneNumber];\n const createUserStr = 'INSERT INTO users (user_firstname, user_lastname, user_email, user_password, user_phone) VALUES ($1, $2, $3, $4, $5) RETURNING *;';\n pgClient.query(createUserStr, values, (err, result) => {\n if (err) res.status(400).json({ error: 'Unable to create a new user' });\n else {\n res.status(200).json({\n message: 'New user has been successfully created',\n user: result.rows[0],\n });\n }\n });\n}", "newUser(req, res, next) {\n // EXTRACT FORM DATA\n const { username, email, password } = req.body;\n\n // INSERT USER DATA INTO AN OBJECT\n let newUser = { username, email, password };\n\n // USE MODEL TO REGISTER A NEW USER\n User.addUser(newUser)\n .then(user => {\n res.status(201).json({\n success: true,\n message: 'User registered',\n user: {\n id: user.id,\n username: user.username,\n email: user.email\n }\n });\n })\n .catch(err => console.error(err));\n }", "function createUser(newUser){\n\n UserService\n .createUser(newUser)\n .then(\n function (doc) {\n vm.user = null;\n init();\n });\n }", "async createUser(req, res, next) {\n const { body } = req;\n try {\n await UsersService.createUser({ ...body });\n res.status(HTTPStatus.CREATED);\n res.json({ success: true });\n } catch (error) {\n next(extendError(error, { task: 'Controller/createUser', context: { body } }));\n }\n }", "create(user) {\n const { firstName, lastName, email, password, role, refreshToken } = user;\n const stmt = this.db.prepare(\n \"INSERT INTO users (firstName, lastName, email, password, role, refreshToken) VALUES (?, ?, ?, ?, ?, ?)\"\n );\n return stmt.run(firstName, lastName, email, password, role, refreshToken);\n }", "function _newUserCreated(req, res) {\n let {\n names,\n surnames,\n username,\n password,\n } = req.body;\n let u = new User();\n u.names = names;\n u.surnames = surnames;\n u.username = username;\n u.created_at = moment().unix();\n\n\n if (!password) {\n return res.status(403).send({\n message: 'La contraseña es necesaria!'\n })\n }\n\n\n /* now we need encrypt the new user password, we're going to use the library bcrypt */\n bcrypt.hash(password, 10).then(hashed => {\n u.password = hashed;\n /* save user */\n u.save().then(user => {\n\n res.status(200).send({\n user: user\n });\n }).catch(err => res.status(500).send({\n err,\n message: 'El campo email ha sido duplicado!'\n }));\n }).catch(err => res.status(401).send({\n message: err + ', la contraseña no pudo ser encriptada, porque no se ha colocado ninguna'\n }));\n}", "function createNewUser(email, password, type, name) {\n firebase.auth().createUserWithEmailAndPassword(email, password).then(function(user) {\n writeUserData(name, email, type); // Optional\n }, function(error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n console.log(errorCode + \": \" + errorMessage);\n errorToScreenAuth(errorCode + \": \" + errorMessage, \"error-signup-id\");\n });\n}", "async createUser(req, res) {\n try {\n console.log(\"creating employee\")\n const dbUserData = await User.create(req.body);\n console.log(dbUserData);\n res.json({ message: \"new employee added\" })\n } catch (err) {\n console.log(err);\n res.status(500).json(err);\n }\n }", "function registerUser(req, res) {\n\n console.log(`authRoutesMethods: registerUser: req.body is:`, req.body);\n\n //query db to see if the user exists already\n userDBHelper.doesUserExist(req.body.username, (sqlError, doesUserExist) => {\n\n //check if the user exists\n if (sqlError !== null || doesUserExist){\n\n //message to give summary to client\n const message = sqlError !== null ? \"Operation unsuccessful\" : \"User already exists\"\n\n //detailed error message from callback\n const error = sqlError !== null ? sqlError : \"User already exists\"\n\n sendResponse(res, message, sqlError)\n\n return\n }\n\n //register the user in the db\n userDBHelper.registerUserInDB(req.body.username, req.body.password, dataResponseObject => {\n\n //create message for the api response\n const message = dataResponseObject.error === null ? \"Registration was successful\" : \"Failed to register user\"\n\n sendResponse(res, message, dataResponseObject.error)\n })\n })\n }", "async function addUser(req, res, next) {\n const user = new userModel_1.default(req.body);\n try {\n await user.save();\n return res.status(200).json({\n status: \"okay\",\n message: \"User successfully signed up\",\n });\n }\n catch (err) {\n res.status(400).json({\n error: dbErrorHandler_1.default.getErrorMessage(err),\n });\n }\n}", "async function create(params) {\n // validate\n if (await db.User.findOne({ where: { email: params.email } })) {\n throw 'Email \"' + params.email + '\" already exists';\n }\n\n // hash password\n if (params.password) {\n params.hash = await bcrypt.hash(params.password, 10);\n }\n\n // save user\n return await db.User.create(params);\n}", "function registerUser(req, res) {\n\n // return console.log(errors)\n\n usermodel.User.create({\n fname: req.body.fname,\n lname: req.body.lname,\n email: req.body.email,\n password: req.hashvalue,\n img: req.body.image,\n role:\"user\",\n status: \"normal\"\n\n })\n .then(function(err, user) {\n\n res.status(200).send({ message: \"registered successfully\" })\n })\n .catch(function(err) {\n\n res.status(500).send({ message: err.message })\n })\n}", "async createUser({\n email,\n firstName,\n lastName,\n userName,\n password,\n isAdmin,\n instrumentPermission = false,\n modelPermission = false,\n calibrationPermission = false,\n calibrationApproverPermission = false,\n }) {\n const response = { message: '', success: false };\n const validation = validateUser({\n firstName, lastName, password, email,\n });\n if (!this.checkPermissions()) {\n response.message = 'ERROR: User does not have permission.';\n return JSON.stringify(response);\n }\n if (!validation[0]) {\n // eslint-disable-next-line prefer-destructuring\n response.message = validation[1];\n return JSON.stringify(response);\n }\n await this.findUser({ userName }).then((value) => {\n if (value) {\n response.message = 'Username already exists!';\n } else {\n this.store.users.create({\n email,\n firstName,\n lastName,\n userName,\n password,\n isAdmin,\n instrumentPermission: isAdmin || modelPermission || instrumentPermission,\n modelPermission: isAdmin || modelPermission,\n calibrationPermission: isAdmin || calibrationPermission,\n calibrationApproverPermission: isAdmin || calibrationApproverPermission,\n });\n response.message = 'Account Created!';\n response.success = true;\n }\n });\n return JSON.stringify(response);\n }", "function createShadowUser(req, firstName, lastName, phone) {\n var db = req.db;\n var User = db.get('usercollection');\n \n // Check ther is no user with that phone number\n var myUser = findUserByPhone(req, phone);\n if(myUser){\n console.log(\"There was an error while creating a shadow user. Code : 1, user already exists\");\n return myUser;\n }\n\n // Create a new user\n User.insert({\n \"firstName\" : firstName,\n \"lastName\": lastName,\n \"phone\": phone,\n \"type\": \"shadowUser\"\n }, function(err, result) {\n if (err) {\n console.log(\"There was an error while creating a shadow user. Code : 2\");\n return;\n }\n // Return the created user\n console.log(\"User created \" + result._id);\n return result;\n });\n}", "async function createUser(req, res) {\n try {\n const { name, email, country } = req.body; // deconstruct the request body to get the data\n const newUser = await User.create({name, email, country}); // use the data to create a new user\n\n // return response if the actions are successful\n res.json({\n message: \"Successfully created new user\",\n data: newUser\n });\n\n } catch(err) {\n res.json({\n message: \"There was an error saving the user\",\n data: err.message\n });\n }\n\n\n}", "handleSignUp() {\n const usersFound = firebase.database().ref('Usernames/').orderByKey().equalTo(this.state.username);\n usersFound.once('value', (snapshot) => {\n if (snapshot.val() !== null) {\n // username already exists, ask user for a different name\n console.log(\"username already exists\");\n this.setState({ errorMessage: \"Username already exists\" });\n }\n else {\n //username does not yet exist, go ahead and add new user\n console.log(\"username does not yet exist\");\n firebase\n .auth()\n .createUserWithEmailAndPassword(this.state.email, this.state.password)\n .then(() => this.createUser(this.state.username, this.state.email))\n .then(() => this.props.navigation.navigate('Login'))\n .catch(error => this.setState({ errorMessage: error.message }))\n }\n })\n }", "createUser({ body }, res) {\n User.create(body)\n .then((dbUserData) => res.json(dbUserData))\n .catch((err) => res.status(400).json(err));\n }", "async store ({ request, response }) {\n try {\n // getting data passed within the request\n const data = request.only(['username', 'email', 'password'])\n\n // looking for user in database\n const userExists = await User.findBy('email', data.email)\n\n // if user exists don't save\n if (userExists) {\n return response\n .status(400)\n .send({ message: { error: 'User already registered' } })\n }\n\n // if user doesn't exist, proceeds with saving him in DB\n const user = await User.create(data)\n\n return user\n } catch (err) {\n return response\n .status(err.status)\n .send(err)\n }\n }", "async insert(user) {\n\n // format user attributes to table structure\n user = this._formatTableValue(this.table, user);\n user.createAt = Date.parse(new Date());\n \n // email or password doesn't exist\n if (!user.email || !user.password) {\n return false;\n }\n\n // user exists\n if (await this.exists(user.email)) {\n return false;\n }\n\n // insert a user into table users\n try {\n await this._insert('users', user);\n return true;\n } catch (err) {\n this.logger.error(err);\n return false;\n }\n }", "async function createNewUser() {\n try {\n const user1 = await User.create({\n name: \"Born From Query\",\n email: \"[email protected]\",\n phone: 0005060455,\n password: \"12355\",\n });\n return user1.toJSON();\n } catch (e) {\n console.error(e);\n }\n}", "function userCreate(userDetail, cb) \n{\n let newUser = new User(userDetail);\n \n newUser.save(function (err) \n {\n if (err) \n {\n cb(err, null);\n return;\n }\n console.log('New User: ' + newUser);\n cb(null, newUser);\n \n });\n\n}", "static signup({username, password}) {\n var hashedPassword = bcrypt.hashSync(password, 10);\n return mongo.db.user.findAndModify({\n query: {username},\n update: {\n $setOnInsert: {\n username,\n hashedPassword,\n }\n },\n upsert: true\n }).then((data) => {\n if (data) {\n throw 'There is already a user with this username.';\n } else {\n return auth.createToken({username});\n }\n });\n }", "async register (req, res) {\n try {\n // Create a user using the body that was passed in on the request\n const user = await User.create(req.body)\n // If successful, send back the info as JSON\n res.send(user.toJSON())\n } catch (err) {\n // If any errors get caught\n res.status(400).send({\n error: `🤬 This email address is already in use.`\n })\n }\n\n }", "function createUser(cedula,apellido,email, nombre, telefono, pass){\n const password = pass;\n var userId=\"\";\n \n auth.createUserWithEmailAndPassword(email, password)\n .then(function (event) {\n user = auth.currentUser;\n userId = user.uid;\n console.log(\"UserID: \"+userId);\n insertar(cedula,apellido,email, nombre, telefono, userId);\n })\n .catch(function(error) {\n alert(error.message);\n console.log(error.message);\n });\n}", "static async register({ username, password, profilePicture, bio, isAdmin }) {\n /** Check for a duplicate username before registering */\n\n const duplicateCheck = await db.query(\n `SELECT username\n FROM users\n WHERE username = $1`,\n [username]\n );\n\n if (duplicateCheck.rows[0]) {\n throw new BadRequestError(`Duplicate username: ${username}`);\n }\n\n const hashedPassword = await bcrypt.hash(password, BCRYPT_WORK_FACTOR);\n\n const result = await db.query(\n `INSERT INTO users\n (username,\n password,\n profile_picture,\n bio,\n is_admin)\n VALUES ($1, $2, $3, $4, $5)\n RETURNING username, is_admin AS \"isAdmin\"`,\n [username, hashedPassword, defaultImg, defaultBio, isAdmin]\n );\n\n const user = result.rows[0];\n\n return user;\n }", "function addUserToDb(args, onSuccess, onError){\n const user = new User(args)\n user.save((err, success) => {\n if (err) {\n console.log(err)\n onError(err)\n }\n else {\n console.log(\"Created a user\")\n onSuccess(success)\n }\n })\n}", "async createUser(req,res,next) {\n try {\n const user = this.postBody(req)\n await this.controller.createUser(user)\n return res.status(httpStatus.OK)\n } catch (e) {\n next(e)\n }\n }", "function addUser() {\n var user = {\n primaryEmail: '[email protected]',\n name: {\n givenName: 'Elizabeth',\n familyName: 'Smith'\n },\n // Generate a random password string.\n password: Math.random().toString(36)\n };\n user = AdminDirectory.Users.insert(user);\n Logger.log('User %s created with ID %s.', user.primaryEmail, user.id);\n}", "async addUser(data) {\n if (!data) throw new UserInputError('No provided credentials');\n\n const foundEmail = await User.findOne({ email: data.email });\n\n if (foundEmail) {\n throw new AuthenticationError(`User with ${data.email} already exists`)\n }\n\n data.password = await this.hashPassword(data.password);\n\n const user = await User.create(data);\n\n const payload = {\n id: user._id,\n username: user.username,\n email: user.email\n };\n const token = await this.createToken(payload);\n\n if (user) {\n user.emailVerificationToken = await this.getEmailVerifierToken(user.username);\n await user.save();\n\n const message = await this.getEVTTemplate('Registration was successful', user.emailVerificationToken);\n const subject = 'Account Verification';\n await this.sendMail(user.email, message, subject);\n\n return { token }\n }\n }", "createUser({ body }, res) {\n User.create(body)\n .then((dbUserData) => {\n res.json(dbUserData);\n })\n .catch((err) => {\n res.json(err);\n });\n }", "static async create(username, password, name) {\n try {\n const response = await axios.post(`${BASE_URL}/signup`, {\n user: {\n username,\n password,\n name\n }\n }); \n // build a new User instance from the API response\n const newUser = new User(response.data.user);\n \n // attach the token to the newUser instance for convenience\n newUser.loginToken = response.data.token;\n \n return newUser;\n } catch (error) {\n axiosErrorHandler(error);\n if (error.response.status === 409){\n alert(\"Sorry, this username already exists!\")\n }\n }\n return null;\n }" ]
[ "0.7957954", "0.7681373", "0.7451359", "0.74320155", "0.7305778", "0.7285215", "0.7270234", "0.7251168", "0.7222616", "0.7220852", "0.71930665", "0.7150304", "0.7131933", "0.71188504", "0.70968115", "0.7096152", "0.70905375", "0.70550555", "0.7050348", "0.70347613", "0.70138454", "0.6997665", "0.69783735", "0.69783735", "0.6962355", "0.69608986", "0.69442225", "0.6940126", "0.69363934", "0.6927388", "0.6915569", "0.6907072", "0.6878611", "0.6876249", "0.687177", "0.68604136", "0.68496376", "0.6829553", "0.6823936", "0.6818299", "0.6815987", "0.6815231", "0.6805942", "0.67912614", "0.67868507", "0.67815346", "0.67797816", "0.67758167", "0.67560655", "0.6748467", "0.6746448", "0.67338383", "0.67148757", "0.67147315", "0.6711545", "0.6711259", "0.67030483", "0.66953975", "0.66937023", "0.6687651", "0.66830236", "0.6675343", "0.6671746", "0.6651989", "0.6650341", "0.6650341", "0.6640845", "0.6636579", "0.66324776", "0.6626134", "0.6625837", "0.662212", "0.66202176", "0.6617952", "0.66170096", "0.66159064", "0.66141254", "0.6605646", "0.660463", "0.6603373", "0.6602917", "0.6601201", "0.6598347", "0.6594673", "0.65889794", "0.6587474", "0.6585131", "0.65804833", "0.6579942", "0.6574929", "0.65722096", "0.6570336", "0.65649813", "0.6562537", "0.65583885", "0.65564674", "0.65446573", "0.6532802", "0.65322727", "0.6532228" ]
0.6661426
63
Gets all Users in the database
static getAllUsers(req, res){ User.find((err, users) => { if (err) return res.json({ success: false, error: err }); return res.json({ success: true, data: users }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUsers() {\n User.query(function(data){\n return self.all = data.users;\n });\n }", "function getAllUsers() {\n var allUsers = User.find(function (err, users) {\n if (err) return handleError(err);\n return users\n })\n return allUsers\n}", "function getAllUsers() {\n return Users.find({});\n}", "function getAllUsers(){\n return UserService.getAllUsers();\n }", "async getAllUsers() {\n return User.findAll();\n }", "allUsers() { return queryAllUsers() }", "function findAllUsers() {\n return fetch(self.url).then(response => response.json())\n }", "function getAllUsers() {\n return User.find();\n}", "static async getAll() {\n\t\tconst usersRes = await db.query(`SELECT * FROM users ORDER BY username`);\n\t\treturn usersRes.rows;\n\t}", "function getUsers() {\n return db(\"users\").select(\"users.*\");\n}", "static async getAll() {\n return await user_model.find({});\n }", "function findAllUsers() {\n return UserModel.find();\n }", "static async getAllUsers() {\n try {\n logger.info('[user]: listing all users');\n const userList = await UserService.findAllUsers();\n\n return userList;\n } catch (e) {\n throw new InternalServerException();\n }\n }", "function findAllUsers() {\n userService\n .findAllUsers()\n .then(renderUsers);\n }", "function getUsers (db = connection) {\n return db('users').select()\n}", "function findAllUsers() {\n return fetch('https://wbdv-generic-server.herokuapp.com/api/alkhalifas/users')\n .then(response => response.json())\n }", "getAllUsers() {\n return Api.get(\"/admin/user-list\");\n }", "allUsers() {\r\n this.log(`Getting list of users...`);\r\n return this.context\r\n .retrieve(`\r\n SELECT emailAddress, password\r\n FROM Users\r\n `\r\n )\r\n }", "function getUsers() {\n return db('users')\n .select('id', 'username')\n}", "static async getAllUsers() {\n try {\n //establish connection with db server\n const [ db, client ] = await getConnection();\n\n //retrieve CURSOR OBJECT containing pointers to all users from database\n const result = await db.collection('users').find({});\n\n //get object array from cursor\n const resultArray = await result.toArray();\n\n //if no users, throw 404\n if (!resultArray.length) throw new ExpressError('There are no users in the database', 404);\n\n //close database connection\n client.close();\n\n //return array\n return resultArray;\n } catch(err) {\n //throw express error\n if (client) client.close();\n throw new ExpressError(err.message, err.status || 500);\n }\n }", "function getUsers(db){\n return db('users')\n .select('*')\n}", "static async findAllUsers() {\n const userList = await User.find({});\n return userList;\n }", "async function getUsers() {\n const allUsers = await User.findAll();\n return allUsers.map((user) => user.get({ plain: true }));\n}", "function get_users(){\n\tconst q = datastore.createQuery(USER);\n\treturn datastore.runQuery(q).then( (entities) => {\n\t\t\treturn entities[0].map(ds.fromDatastore);\n\t\t});\n}", "async list() {\n\t\treturn this.store.User.findAll()\n\t}", "function getAllUsers() {\n return User.find({}).select({username: \"test\", email: \"[email protected]\", whitelisted: true});\n}", "function findAllUsers(req, res, next){\r\n connection.query('SELECT * FROM Usuarios', function (error, results){\r\n if(error) throw error;\r\n res.send(200, results);\r\n return next();\r\n });\r\n}", "function fetchAllUsers() {\n return fetch(`${SERVER_URL}/users`, {\n headers: {\n Authorization: `Bearer ${userToken}`,\n },\n })\n .then(response => response.json())\n .then(data => setAllUsers(data))\n }", "function findAll () {\n return UserModel.findAll()\n }", "async AllUsers(p, a, { app: { secret, cookieName }, req, postgres, authUtil }, i) {\n const getUsersQ = {\n text: 'SELECT * FROM schemaName.users'\n }\n\n const getUsersR = await postgres.query(getUsers)\n\n return getUsersR.rows\n }", "function getUsers() {\n\n intakeTaskAgeDatalayer.getUsersInFirm()\n .then(function (response) {\n self.allUser = response.data;\n }, function (error) {\n notificationService.error('Users not loaded');\n });\n }", "function get_users(){\n var q = datastore.createQuery(USERS);\n\n return datastore.runQuery(q).then( (entities) => {\n return entities;\n });\n}", "async getUsers() {\n let userResult = await this.request(\"users\");\n return userResult.users;\n }", "function getAllUsers (req, res, next) {\n db.any('SELECT * FROM \"user\";')\n .then((users) => {\n res.rows = users;\n next();\n })\n .catch(err => next(err));\n}", "function fetchAllUsers() {\n var deferred = $q.defer();\n $http.get(REST_SERVICE_URI)\n .then(\n function (response) {\n deferred.resolve(response.data);\n },\n function(errResponse){\n console.error('Error while fetching Users');\n deferred.reject(errResponse);\n }\n );\n return deferred.promise;\n }", "function getallusers() {\n\n\t}", "function getAllUsers(req, res) {\n User.find((err, users) => {\n if (err) {\n res.status(500).send(\"No se pudo traer los usuarios\");\n } else {\n res.status(200).send(users);\n }\n });\n}", "getAllUsers() {\n return dbConnection.sync().then(() => {\n return User.findAll().then((users) => {\n //** Check for users records in db, if no usres recored return err message */\n if (users.length == 0) {\n return Promise.reject(\"No users in db yet!\")\n }\n console.log(`All users, num of users: ${users.length} => ${users}`);\n return Promise.resolve(users);\n });\n });\n }", "async function getAllUsers() {\n try {\n const { rows: userIds } = await client.query(`\n SELECT id\n FROM users;\n `);\n\n const users = Promise.all(userIds.map((user) => getUserById(user.id)));\n\n return users;\n } catch (error) {\n throw error;\n }\n}", "async function getAllUsers() {\n const aUsers = await throwIf(\n User.findAll({ raw: true }).then(users => {\n return users;\n }),\n {\n type: ERROR_TYPES.DB_ERROR,\n msg: \"Unable to fetch list of users\"\n }\n );\n\n return aUsers;\n}", "async getUsers(){\n let users = await db.query('SELECT id, name, email FROM users');\n\n return users;\n }", "function listUsers (req, res) {\n promiseResponse(userStore.find({}), res);\n}", "function getUsers() {\r\n apiService.getEntity('users')\r\n .then(function (response) {\r\n vm.users = response.data;\r\n notifyService.success('Users loaded.');\r\n }, function (error) {\r\n vm.message = 'Unable to load data: ' + error.message;\r\n });\r\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 getAllUsers(req, res) {\n User.find({}, function(err, users) {\n if (err) throw err;\n return res.json(users);\n }); \n}", "function getUsers(){\n\t\t\tgetUsersService.getUserList().then(function(data){\n\t\t\t\tlc.listOfUser = data;\n\t\t\t})\n\t\t\t.catch(function(message){\n\t\t\t\texception.catcher('getUserList Service cannot succeed')(message);\n\t\t\t});\n\t\t}", "function getAllUsers() {\n var getUser = partial(getValue, relationsCache);\n return map(getUser, Object.keys(relationsCache));\n}", "get allUsers() {\n\t\tif (!Object.keys(this.userFields).length) {\n\t\t\tthis.requestError();\n\t\t\treturn false;\n\t\t}\n\t\treturn this._allUsers.fetch();\n\t}", "function getUsers(req, res) {\n User.find({}, function (err, users) {\n if (err) return res.status(500).send(\"There was a problem finding the users.\");\n res.status(200).send(users);\n });\n}", "async getAllUsers(){\n data = {\n URI: `${ACCOUNTS}`,\n method: 'GET'\n }\n return await this.sendRequest(data)\n }", "static async getAllUsers(req, res, next) {\n try {\n const users = await this.database.getAllUsers();\n return res.send(users);\n } catch (error) {\n next(error);\n }\n }", "async readAllUsers() {\n try {\n wlogger.silly(\"Enteried cassandra-db/readUser()\")\n\n await this.client.connect()\n\n const data = await this.client.execute(`\n SELECT * FROM users\n `)\n\n //console.log(`users: ${JSON.stringify(data.rows, null, 2)}`)\n return data.rows\n } catch (err) {\n wlogger.error(`Error in cassandra-db/readAllUsers()`, err)\n throw err\n }\n }", "getAllUsers(callback) {\r\n\r\n\t\tthis._connection.query('SELECT * FROM users', function (err, rows, fields) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n\r\n callback(null, rows);\r\n }\r\n );\r\n\r\n this._connection.end();\r\n }", "function getAllUsers(req, res, next) {\n db.any('select * from users')\n .then(function (data) {\n res.status(200)\n .json({\n status: 'success',\n data: data,\n message: 'Users found'\n });\n })\n .catch(function (err) {\n return next(err);\n });\n}", "static async getUsers() {\n return await this.request('users/', 'get');\n }", "function findAllUsers(callback) {\n \treturn fetch(this.url)\n .then(function(response) {\n return response.json();\n });\n }", "async getAllUsers() {\r\n\r\n const userCollection = await usersList();\r\n const listOfUsers = await userCollection.find().toArray();\r\n\r\n\r\n allusers = [];\r\n oneUser = {};\r\n\r\n //NM - Corrected spelling of orientation, added email and contact_info attributes\r\n for (var val of listOfUsers) {\r\n oneUser = {};\r\n oneUser._id = val._id;\r\n oneUser.user_id = val.user_id;\r\n oneUser.name = val.name;\r\n oneUser.hashedPassword = val.hashedPassword;\r\n oneUser.dob = val.dob;\r\n oneUser.gender = val.gender;\r\n oneUser.activity = val.activity;\r\n oneUser.location = val.location;\r\n oneUser.occupation = val.occupation;\r\n oneUser.email = val.email;\r\n oneUser.weight = val.weight;\r\n oneUser.activity = val.activity;\r\n allusers.push(oneUser);\r\n }\r\n\r\n return allusers;\r\n }", "function getAllUsers(con) {\n return function (req, res) {\n con.query(\n \"SELECT * FROM User\",\n function (err, result) {\n if (err) {\n console.error(\"error connecting: \" + err.stack);\n res.status(500).send(\"Error from database: \" + err.stack); // Internal server error code\n return;\n }\n res.send(result);\n }\n );\n };\n}", "function getAll(req, res, next) {\n getDB().then((db, err) => {\n if (err) return next(err);\n db.collection('users')\n .find()\n .toArray((retrieveError, data) => {\n if (retrieveError) return next(retrieveError);\n\n res.users = data;\n db.close();\n return next();\n });\n return false;\n });\n return false;\n}", "static getAllUsers(req, res) {\n userService.getAllUsers(db, function (returnvalue) {\n res.status(200).send(returnvalue);\n })\n\n }", "function get_users(){\n var q = datastore.createQuery(USER);\n return datastore.runQuery(q).then( (entities) => {\n return entities[0];\n });\n}", "function findAllUsers(req, res) {\n if(req.query.username) {\n findUserByUsername(req, res);\n } else {\n var users = userModel.findAllUsers().then(\n function (docs) {\n res.json(docs);\n },\n // send error if promise rejected\n function (err) {\n res.status(400).send(err);\n }\n )\n }\n }", "function getUsers() {\n return userService.getUsers().then(function (data) {\n vm.users = data;\n return vm.users;\n })\n }", "function getUsers(request, response) {\n User.find({}, function(err, users) {\n if(err) {\n response.status(500).json({message: \"No users were found.\"});\n }\n if(!users) {\n response.status(404).json({message: \"No users were found.\"});\n }\n var userList = [];\n users.forEach(function(element) {\n userList.push({name: element.fullName, userId: element.userId});\n })\n\n response.status(200).send(userList);\n })\n}", "async function getUsers(req, res) {\n try {\n const users = await User.find({}); // Use the model to retrieve all users\n res.json({\n message: \"Successfully retrieved all users\",\n data: users\n });\n } catch (err) {\n res.json({\n message: \"There was an error retrieving users\",\n data: err.message\n });\n }\n}", "async function listUsers() {\n try {\n const users = await UserModel.find();\n console.log(users);\n } catch (error) {\n console.log(error);\n }\n }", "function getUsers() {\n return userService.getUsers().then(function(data) {\n vm.users = data;\n vm.loading = false;\n return vm.users;\n });\n }", "async function getAllUsers(req, res) {\n try {\n const users = await userModel_1.default.find({}).select(\"name email createdAt\");\n res.status(200).json(users);\n }\n catch (err) {\n return res.status(400).json({\n error: dbErrorHandler_1.default.getErrorMessage(err),\n });\n }\n}", "getAllUsers() {\r\n return this.users;\r\n }", "function getUsers(req, res) {\n console.log('GET de todos los usuarios'.blue);\n UserSchema.find({}, (err, users) => {\n if (err) return res.status(500).send(err);\n if (!users) return res.status(404).send('No hay usuarios registrados');\n\n return res.status(200).send({ users });\n });\n}", "async function queryAllUsers(){\n return await user.findAll();\n}", "function getUsers() {\n\treturn fetch(userURL).then((resp) => resp.json())\n}", "function getAllUsers(){\n $.get(\"/getAllUsers\", function(users){\n let output =\n \"<table class='table table-striped table-bordered'>\" +\n \"<tr>\" +\n \"<th>Username</th>\" +\n \"</tr>\";\n\n for (const user of users){\n output +=\n \"<tr>\" +\n \"<td>\" + user.username + \"</td>\" +\n \"</tr>\";\n }\n output += \"</table>\";\n $(\"#allUsers\").empty().html(output);\n });\n }", "static getUsers() {\n return API.fetcher(\"/user\");\n }", "function getUsers(req, res) {\r\n User.getUsers((err, users) => {\r\n if (err) {\r\n res.status(500).send({ message: 'Error al obtener los usuarios' });\r\n } else {\r\n res.status(200).send({ users });\r\n }\r\n });\r\n}", "async function getUsers() {\n let serverResponse = await userService.getUsers();\n if (serverResponse.status === 200) {\n setUsers(serverResponse.data);\n };\n }", "function getAllUsers(req, res, callback) {\n userModel.User.find((err, users) => {\n if (err) callback(cbs.cbMsg(true, err));\n if (!users || users === [] || users.length === 0) {\n callback(cbs.cbMsg(true, { error: 'No users found!' }));\n } else {\n callback(cbs.cbMsg(false, users));\n }\n });\n}", "getUsers(callback) {\n let getUsers = `select * from user`;\n\n this._db.all(getUsers, function(err,resolve) {\n callback(err,resolve);\n })\n }", "function getUsers() {\n let ourQuery = 'SELECT employeeID, name FROM QAA.user_TB';\n return makeConnection.mysqlQueryExecution(ourQuery, mySqlConfig);\n}", "findAll(req, res) {\n UserModel.find()\n .then((users) => res.status(200).send(users))\n .catch((err) => res.status(500).send(err));\n }", "async getUsers (req, res) {\n try {\n const usersData = await UserDB.find();\n console.log(`All users data find: ${usersData}`);\n\n return res.json(usersData);\n } catch (error) {\n console.log(error);\n return;\n }\n }", "async function getAllUsers(_req, res) {\n const users = await User.find();\n if (users) {\n return res.json(users);\n }\n return res.send(\"There is no user.\");\n}", "async function getUsers(req, res) {\n try {\n var users = await usersController.findAllUsers()\n res.status(200).send(users)\n } catch (e) {\n res.status(500).send('No se encontraron Usuarios en la base de datos', e)\n }\n}", "async function getAllUsers(){\n const userCollection = await users();\n const allUsers = await userCollection.find({}).toArray();\n return allUsers;\n}", "function getAllUsers() {\n let todoUsersDB = storage.getItem('P1_todoUsersDB');\n\n if (todoUsersDB) { return JSON.parse(todoUsersDB); }\n else { return []; }\n }", "async function getAllUsers() {\n try {\n const params = {\n TableName: \"Users3\",\n };\n return await DocumentClient.scan(params).promise();\n } catch (e) {\n console.error(e);\n }\n}", "function getAllUsers(req, res) {\n db.many('select * from ' + dbConfig.schema + '.empleados')\n .then(function (data) {\n res.status(200).send({\n data: data\n });\n })\n .catch(function (err) {\n if(err.received == 0){\n res.status(404).send({message: 'No se han encontrado usuarios'});\n console.log(err);\n }else{\n res.status(500).send({message:'Error en el servidor'});\n }\n });\n}", "function listAllUsers() {\n var pageToken;\n var page;\n do {\n page = AdminDirectory.Users.list({\n domain: 'example.com',\n orderBy: 'givenName',\n maxResults: 100,\n pageToken: pageToken\n });\n var users = page.users;\n if (users) {\n for (var i = 0; i < users.length; i++) {\n var user = users[i];\n Logger.log('%s (%s)', user.name.fullName, user.primaryEmail);\n }\n } else {\n Logger.log('No users found.');\n }\n pageToken = page.nextPageToken;\n } while (pageToken);\n}", "function getAll() {\n var deferred = Q.defer();\n \n //db.users.find({role: {$ne : \"Admin\"}}).toArray(function(err, user) {\n db.users.find({}).toArray(function(err, user) {\n if (err) deferred.reject(err);\n \n if (user) {\n // return user (without hashed password)\n deferred.resolve(_.omit(user, 'hash'));\n } else {\n // user not found\n deferred.resolve();\n }\n });\n \n return deferred.promise;\n}", "function getAllUsers(callback) {\n requester.get('user', '', 'kinvey')\n .then(callback)\n}", "async function getUsers(req, res) {\n let users = await User.find({});\n res.json({\n status: \"success\",\n users: users\n });\n}", "async GetAllUsers(req, res) {\n //returns all users in array\n await User.find({})\n .populate('posts.postId')\n .populate('chatList.receiverId')\n .populate('chatList.msgId')\n .populate('notifications.senderId')\n .then(result => {\n res.status(httpStatus.OK).json({ message: 'All users', result });\n })\n .catch(err => {\n res.status(httpStatus.INTERNAL_SERVER_ERROR).json({ message: 'Error occured when getting all users' });\n });\n }", "function retrieve_all_users(){\n\tlet params = {\n\t\t\t\t method: \"GET\",\n\t\t\t\t url: \"/api/admin/all/\"\n \t\t\t\t}\n\t$.ajax(params).done(function(data) {\n\t\tvar allUsers = '<div style=\"border:1px solid black\"><h3>All users</h3><table><tr><th>Username</th>'+\n\t\t'<th>First Name</th><th>Last Name</th><th>e-mail</th><th>Account Type</th><th>Last Login</th></tr>';\n\t\tconsole.log(data[\"users\"].length);\n\t\tfor(i=0;i<data[\"users\"].length;i++){\n\t\t\tallUsers += \"<tr><th>\"+data[\"users\"][i].username+\"</th><th>\"+\n\t\t\tdata[\"users\"][i].firstName+\"</th><th>\"+data[\"users\"][i].lastName+\n\t\t\t\"</th><th>\"+data[\"users\"][i].email+\"</th><th>\"+data[\"users\"][i].userType+\n\t\t\t\"</th><th>\"+data[\"users\"][i].lastLogin+\"</th></tr>\";\n\t\t}\n\t\tallUsers+= \"</table>\";\n\t\t$(\"#allUsers\").html(allUsers);\n\t});\n}", "async function getAll(req, res) {\n const users = await User.find();\n return res.send(users);\n}", "function getAll(req, res, next){\n userModel.getAll()\n .then(function(data){\n res.send({ data })\n })\n .catch(next)\n}", "static getAllUsers() \n {\n return UserDao.showUsersList(); \n }", "users() {\r\n\t\treturn API.get(\"pm\", \"/list-users\");\r\n\t}", "function getAllUsers(req, res, next) {\n db.any('select last_name from users')\n .then(function (data) {\n res.status(200)\n .json({\n status: 'success',\n data: data,\n message: 'Retrieved ALL users'\n });\n })\n .catch(function (err) {\n return next(err);\n });\n}", "function getUsers() {\n fetch(userUrl)\n .then((res) => res.json())\n .then((users) => {\n sortUsers(users);\n displayLeaderBoard();\n })\n .catch((error) => console.error(\"ERROR:\", error));\n }", "function getUsers(cb) {\n const users = app.get('users');\n\n // Return a copy of the data\n const foundUsers = users.map(function(user) {\n return Object.assign({}, user);\n });\n\n debug(`#getUsers: found users: ${JSON.stringify(foundUsers, 0, 2)}`);\n return cb(null, foundUsers);\n}" ]
[ "0.8435582", "0.8349404", "0.83219576", "0.8249574", "0.8212433", "0.81940216", "0.8186476", "0.8135862", "0.8112837", "0.8103327", "0.80638486", "0.8045837", "0.802963", "0.8028524", "0.7982804", "0.7960093", "0.7951227", "0.7908858", "0.7899927", "0.7897573", "0.7848452", "0.7846482", "0.7810309", "0.77903557", "0.7769157", "0.77558166", "0.77523917", "0.77482206", "0.77259356", "0.77223194", "0.7714989", "0.7714361", "0.7700303", "0.7681819", "0.7670391", "0.76664305", "0.7664669", "0.7657176", "0.765234", "0.7636565", "0.7604424", "0.7596219", "0.758526", "0.7565795", "0.75646776", "0.75556463", "0.75484365", "0.7535506", "0.7533499", "0.75323594", "0.75238013", "0.74860764", "0.74857676", "0.74738467", "0.7444682", "0.7413808", "0.7410137", "0.7408148", "0.7403481", "0.7394869", "0.7357251", "0.73553073", "0.73407924", "0.7331976", "0.73207045", "0.7311403", "0.72881573", "0.7272282", "0.7252307", "0.724248", "0.7238748", "0.7238621", "0.7229623", "0.7226029", "0.722542", "0.722383", "0.72237176", "0.7221627", "0.72157484", "0.7213924", "0.71994853", "0.71976024", "0.71771044", "0.71733713", "0.71722126", "0.7164042", "0.71613604", "0.71551317", "0.71527654", "0.7151601", "0.7149242", "0.71385086", "0.7126324", "0.7122641", "0.71132344", "0.71092874", "0.7108909", "0.7107536", "0.7101036", "0.70872444" ]
0.7113229
95
function to parse data from the api and convert it to a form in which is useful to the user
function renderData(data){ let k=JSON.parse(data) let goodData=''; for(let i=0;i<k.count;i++){ goodData+= `<ul>` + `<a href=${k.recipes[i].source_url} target="_blank"> `+ `<li> ` + `<img src=${k.recipes[i].image_url} alt=you style="width:300px;height:300px;">` + `</li>` + `<div class ="content">` + `<h1> ${k.recipes[i].title} </h1>` + `</div>` + `</ul>` } return goodData }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dataParser() {\n let response = JSON.parse(this.responseText);\n window.fields = response.fields;\n window.rules = response.rules;\n\n generateForm();\n generateRules();\n}", "function parseData(response){ \n //if no result domain not registered\n if(response.results.length == 0){\n message(\"Lén er ekki skráð\");\n }else{\n //if domain registered\n let data = response.results[0];\n let results = document.querySelector(\".results\");\n results.innerHTML = \"\";\n \n let dl = document.createElement(\"dl\");\n \n //loop through all fields checks if data isavailable and append \n fields1.forEach( function(element, index) {\n if(data[element] != \"\" && data[element] != undefined){\n if(index == 1 || index == 2 || index == 3){ //if the field is a date field format it\n appendToList(dl,fields2[index],new Date(data[element]).toISODate()); \n }else{\n appendToList(dl,fields2[index],data[element]); \n } \n } \n });\n\n results.append(dl);\n }\n }", "function getFormattedData(formattedData, requestedFields) {\n console.log(\"In format method\");\n var finalResponse = {\"schema\": []};\n \n for(var m = 0; m < requestedFields.length; m++){\n\n var field = requestedFields[m];\n \n \n if(field == \"first_release_date\"){\n finalResponse.schema.push({\"name\": \"first_release_date\" , \"dataType\" :\"NUMBER\"});\n }\n if(field == \"rating\"){\n finalResponse.schema.push({\"name\" : \"rating\" , \"dataType\" : \"NUMBER\"});\n } \n if(field == \"name\"){\n finalResponse.schema.push({\"name\": \"name\" , \"dataType\" :\"STRING\"});\n }\n if(field == \"popularity\"){\n finalResponse.schema.push({\"name\" : \"popularity\" , \"dataType\" : \"NUMBER\"});\n }\n if(field == \"summary\"){\n finalResponse.schema.push({\"name\": \"summary\" , \"dataType\" :\"STRING\"});\n }\n if(field == \"url\"){\n finalResponse.schema.push({\"name\": \"url\" , \"dataType\" :\"STRING\"});\n }\n if(field == \"rating_count\"){\n finalResponse.schema.push({\"name\" : \"rating_count\" , \"dataType\" : \"NUMBER\"});\n }\n \n \n \n }\n \n \n \n //add data to response in proper format\n finalResponse.rows = formattedData; \n \n console.log(JSON.stringify(finalResponse));\n return finalResponse;\n}", "_normalizeResponse(response_text) {\n if (typeof response_text !== 'string') {\n // If the query short-circuits, we receive an empty list instead of a string\n return response_text;\n }\n const data = JSON.parse(response_text);\n return data.data;\n }", "function reformatData(response,request, requestedFields) {\n console.log(\"In reformat data method\");\n \n //do not parse\n var formattedData = [];\n \n for(var i = 0; i < response.length; i++){\n var row = {'values': []};\n for(var m = 0; m < requestedFields.length; m++){\n var field = requestedFields[m];\n row.values.push(response[i][field]);\n }\n formattedData.push(row);\n }\n \n console.log(\"formattedData: \" + JSON.stringify(formattedData));\n \n \n \n return formattedData;\n}", "function parseInput(data_string) {\n var split_array = data_string.split('|');\n var processed_data = {};\n processed_data.timestamp = split_array[0];\n processed_data.instrument_id = split_array[4].split('=')[1];\n processed_data.trade_volume = split_array[7].split('=')[1];\n processed_data.trade_type = split_array[15].split('=')[1];\n console.log(processed_data);\n return processed_data;\n}", "function processRequest(dataToParse) {\n //let body = dataToParse['data']; \n let responseJSON = filterJSONResponse(responseJSON);\n return (JSON.stringify(responseJSON, null, ' '));\n}", "getInfo() {\n let rv = {};\n let raw = this.getRawInfo();\n for (const key of Object.keys(raw)) {\n rv[key] = this.textDecoder.decode(raw[key]);\n }\n return rv;\n }", "static parse(data) {\r\n const parsedData = super.parse(data)\r\n\r\n parsedData.name = data.name\r\n parsedData.identificationNumber = data.identification_number\r\n parsedData.description = data.description\r\n\r\n parsedData.isService = 'is_service' in data ? data.is_service : data.price === null\r\n parsedData.qty = Number(data.qty)\r\n\r\n const currency = CurrencyRepository.findByKey(data.currency_code)\r\n\r\n parsedData.currency = currency\r\n parsedData.price = Money.create({\r\n amount: data.price,\r\n currency\r\n })\r\n\r\n return parsedData\r\n }", "function parseLDLAPIResultData(json) {\n // json.ret.day_10w = new Date(json.ret.day_10w);\n // json.ret.better_than_pct = (100 - parseInt(json.ret.rank_pct)) + '%';\n json.ret.completegoalrate = Math.round(100*(json.ret.completegoalday/json.ret.lifetime));\n json.ret.firstday_parsed = parseDate(json.ret.firstday);\n json.ret.dt_10w_parsed = parseDate(json.ret.dt_10w);\n json.ret.dt_100w_parsed = parseDate(json.ret.dt_100w);\n // console.log(json);\n return json;\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 formatData (data) {\n if (!data) return null;\n let dataObject = JSON.parse(data);\n const paramMeasurements = dataObject.map(element => {\n let m = {\n location: element['location'],\n value: Number(element['value']),\n unit: element['unit'],\n parameter: element['parameter'].replace(' ', ''),\n averagingPeriod: element['averagingPeriod'],\n date: sanitizeDate(element['date']),\n coordinates: element['coordinates'],\n attribution: element['attribution'],\n city: element['city']\n };\n if (m.parameter === 'SulfurDioxide') m.parameter = 'so2';\n return unifyParameters(m);\n });\n return paramMeasurements;\n}", "parse(response) {\n // separate the response into objects which will be separately parsed\n var _rawFeatures = _.pick(response, ['rows', 'data', 'columns']);\n var _rawGo = _.pick(response, ['go_slim_terms', 'go_slim_relationships']);\n var _rawPhenotypes = _.pick(response, [\n 'phenotype_slim_terms',\n 'phenotype_slim_relationships',\n ]);\n\n // return the parsed versions, using helper parse methods\n return {\n featuresData: this._parseFeatures(_rawFeatures),\n goData: this._parseGo(_rawGo),\n phenotypeData: this._parsePhenotypes(_rawPhenotypes),\n };\n }", "function processData (raw_api_response) {\n const data = [['Date', 'Server Side', 'Player side']];\n\n for (let n = (raw_api_response.length - 1); n >= 0 ; n--) {\n const elem_api = raw_api_response[n];\n\n const ssccu = elem_api.ssccu || elem_api.ccu;\n let csccu = 0;\n if ('csccu' in elem_api)\n csccu = elem_api.csccu;\n\n const elem_data = [\n elem_api.time, ssccu, csccu\n ];\n\n data.push(elem_data);\n }\n\n return Promise.resolve(google.visualization.arrayToDataTable(data));\n}", "formatNewsData(data) {\n let formattedData = [];\n // For every data returned from Neo4j\n for(let i = 0; i < data.length; i++) {\n let obj = {};\n // For every fields\n for(let j = 0; j < data[i]._fields.length; j++) {\n if(data[i].keys[j] == \"score\") {\n let key = \"score\";\n obj[key] = data[i]._fields[j];\n continue;\n }\n let key = data[i]._fields[j].labels[0];\n obj[key] = data[i]._fields[j].properties; \n }\n formattedData.push(this.createNews(obj));\n }\n return this.wrapData(formattedData);\n }", "function reformatResponse(res){\n\n var jsonObj = {};\n var jsonData = [];\n\n // res.forEach(function(data){\n jsonObj[\"source\"] = res.OriginLocation;\n jsonObj[\"destination\"] = res.DestinationLocation;\n //To Construct the json Object acc to our req from the searchResults data\n jsonData.push(jsonObj);\n // });\n console.log(jsonData);\n }", "function parseUserData(result) {\n console.log('common : parseUserdata '+result);\n\n var addresses = {};\n can.each(result['addresses'], function(address, index){\n var addressType = address['addressTypeName'];\n if(!isEmpty(address['city'])) {\n address['suburb'] = address['city'];\n delete address['city'];\n }\n addresses[addressType+\"Full\"] = address;\n addresses[addressType] = formatAddress(address);\n });\n \n can.extend(userData, result);\n\n userData['addresses'] = addresses;\n \n // Quick hack to conform date of birth with local string\n if(!isEmpty(userData['dateOfBirth'])) {\n userData['dob'] = userData['dateOfBirth'];\n delete userData['dateOfBirth'];\n }\n \n if(!isEmpty(userData['firstName'])) {\n userData['firstname'] = userData['firstName'];\n delete userData['firstName'];\n }\n \n if(!isEmpty(userData['lastName'])) {\n userData['lastname'] = userData['lastName'];\n delete userData['lastName'];\n } \n}", "static parse(data) {\n\t\tconsole.log(\"ahora deveria convertir Object en producto\")\n\t\tdata = JSON.parse(data)\n\n\t\tif (data instanceof Array ){//<-- Hay muchos Object\n\t\t\t/*vieja forma \n\t\t\tlet peliculas = new Array()\n\n\t\t\tdata.forEach(Item =>{\n\t\t\t\tlet pelicula = new pelicula(\n\t\t\t\t\tItem.idProducto,\n\t\t\t\t\tItem.titulo,\n\t\t\t\t \tItem.estreno,\n\t\t\t\t Item.descripcion,\n\t\t\t\t Item.poster,\n\t\t\t\t Item.trailer,\n\t\t\t\t \n\t\t\t\t )\n\n\t\t\t\tProductos.push( pelicula)\n\n\t\t\t})\n\n\t\t\treturn peliculas\n\t\t\t*/\n\n\t\t\t//nueva forma \n\t\t\treturn data.map((item =>\n\n\t\t\t\tnew pelicula(\n\t\t\t\t\tItem.idProducto,\n\t\t\t\t\tItem.titulo,\n\t\t\t\t \tItem.estreno,\n\t\t\t\t Item.descripcion,\n\t\t\t\t Item.poster,\n\t\t\t\t Item.trailer,\n\n\t\t\t\t )\n\n\n\t\t\t)\n\n\n\t\t} else if (data instanceof Object ){//<-- hay un solo Object\n\t\t\tlet producto = new pelicula(\n\t\t\t\tData.IdProducto,\n\t\t\t\tData.titulo,\n\t\t\t\tData.estreno,\n\t\t\t\tData.descripcion,\n\t\t\t\tData.poster,\n\t\t\t\tData.trailer \n\t\t\t\t\n\t\t\t\n\t\t\t\t)\n\t\t\t\n\n\n\t\t\treturn producto\n\n\t } else { //<-- no hay object (no sirve nada....)\n\t \treturn null\n\n\t } \n }", "function responseParser (response) {\n let data = [];\n response.data.results.forEach(character => {\n data.push({\n 'id': character.id,\n 'name': character.name,\n 'description': character.description,\n 'wiki': character.urls[0].url,\n 'comics': character.urls[1].url\n });\n });\n return data;\n}", "function parseData(data) {\n \n const dataArray = data.toString().split('\\n');\n const method = dataArray[0].split(' ')[0];\n const path = dataArray[0].split(' ')[1];\n\n const dataObj = {\n method,\n path,\n };\n\n return dataObj;\n}", "function parseOverview(data) {\n for (var i=0; i<data.length; i++) {\n data[i].pathways = Object.keys(data[i].pathways);\n data[i].classes = Object.keys(data[i].classes);\n data[i].features = Object.keys(data[i].features);\n data[i].subsystems = Object.keys(data[i].subsystems);\n data[i].reactions = Object.keys(data[i].reactions);\n }\n\n return data;\n }", "function transformResponse(data) {\n return data;\n }", "parseData(data) {\n let wodz = [];\n for (let dbWod of data.wodz) {\n wodz.push(this.parseWod(dbWod));\n }\n return wodz;\n }", "function formatData(data) {\n let address = buildAddress([data.house, data.street, data.suburb, data.town]);\n let obj = {photo: data.photo, roadid: data.roadid, erp: data.erp, footpathid: data.footpathid, \n side: data.side, latitude: data.latitude, longitude: data.longitude, dist: data.dist, address: address, ramm: data.ramm};\n return obj;\n}", "function convertir_json(data){\n let data_final = []\n let data_string = JSON.stringify(data)\n data_string = data_string.replace(\"{\",\"\")\n data_string = data_string.replace(\"}\",\"\")\n data_string = data_string.replace(/['\"]+/g, '')\n data_string = data_string.replace(/[',]+/g, ' ')\n data_string = data_string.split(' ')\n \n for(let i in data_string){\n data_final.push(data_string[i].split(':'))\n }\n data_string =[] \n for(let i in data_final){\n for(j in data_final[i]){\n if(j%2!=0){\n data_string.push(data_final[i][j])\n }\n }\n }\n data_string = data_string.toString()\n data_string = data_string.replace(/[',]+/g, ' ')\n return data_string\n}", "function parseData(response){\r\n \r\n vm.formData = response.data[0];\r\n\t\t // console.log(vm.formData);\r\n }", "_parseResult(data) {\n return data.map(item => {\n const fromWei = utils.fromWei(item.value);\n const value = BigNumber(fromWei).toFixed(4);\n const returnedValue = BigNumber(value).toNumber();\n const actualTimeStamp = BigNumber(item.timestamp)\n .times(1000)\n .toNumber();\n return [actualTimeStamp, returnedValue];\n });\n }", "function parseData() {\n return JSON.parse(document.getElementsByTagName('textarea')[0].value);\n}", "function Generatedata(){\n const zibvalue= zip.value\n const feelingsvalue=feelings.value\n\n gitWeatherApi(ApiUrl,zibvalue,ApiKey).then((res)=>{\n console.log(res);\n // make destructing object to filter data\n const{main:{temp},name:city,weather:[{description}]}=res\n const obsend={\n newdate,\n temp:Math.round(temp),\n city,\n description,\n feelingsvalue\n };\n postData(urlserver + '/add',obsend)\n fetchDataInUi()\n })\n}", "function parseData() {\n\treturn new Promise((resolve, reject) => {\n\t\t\tlet dataSet = JSONfetch;\n\t\t\tresolve(dataSet);\n\t\t}).then(data => {\n\t\t\t// maps array, calls up on normalizeAnswers() which loops through it and normalizes data is dataset.\n\t\t\treturn data.map(obj => {\n\t\t\t\tObject.keys(obj).forEach(key => {\n\t\t\t\t\tobj[key] = normalizeAnswers(obj[key])\n\t\t\t\t})\n\t\t\t\treturn obj;\n\t\t\t})\n\t\t}).then(json => json.map((v, i, arr) => {\n\t\t\t// keyCleanup() changes a key value in a object to a specified string. \n\t\t\tkeyCleanup(\"Wat is je oogkleur?\", \"oogkleur\", v)\n\t\t\tkeyCleanup(\"Wat is je favoriete soort huisdier?\", \"huisdier\", v)\n\t\t\tkeyCleanup(\"Wat is je favoriete windrichting?\", \"wind\", v)\n\t\t\tkeyCleanup(\"Op een schaal van 1 tot 10, hoeveel zin heb je in de Tech Track?\", \"zinin\", v)\n\t\t\tkeyCleanup(\"Kies zelf of je deze vraag beantwoord.\", \"kies\", v)\n\t\t\tkeyCleanup(\"Wat is je favoriete datum?\", \"datumFormat\", v)\n\t\t\tkeyCleanup(\"Wat is je favoriete datum, maar nu in tekst!\", \"datumString\", v)\n\t\t\tkeyCleanup(\"Wat is je favoriete zuivelproduct?\", \"zuivel\", v)\n\t\t\tkeyCleanup(\"Welke kleur kledingstukken heb je aan vandaag? (Meerdere antwoorden mogelijk natuurlijk...)\", \"kleding\", v)\n\t\t\tkeyCleanup(\"Op welke verdieping van het TTH studeer je het liefst?\", \"tth\", v)\n\t\t\tkeyCleanup(\"Wat wil je worden als je groot bent?\", \"profession\", v)\n\t\t\tkeyCleanup(\"Wat wilde je later worden als je groot bent, maar nu toen je zelf 8 jaar was.\", \"grootKlein\", v)\n\t\t\tkeyCleanup(\"Kaas is ook een zoogdier?\", \"kaas\", v)\n\t\t\tkeyCleanup(\"Als je later een auto zou kopen, van welk merk zou deze dan zijn?\", \"auto\", v)\n\t\t\treturn v\n\t\t}))\n\t\t// Catch to process error and logs this to console.\n\t\t.catch(err => {\n\t\t\tconsole.log(\"error\", err);\n\t\t})\n}", "static parseResponse(response) {\n\n const {data} = response;\n\n const createdAt = (data.gh_created_at) ? new Date(data.gh_created_at * 1000) : null;\n const updatedAt = (data.gh_last_updated_at) ? new Date(data.gh_last_updated_at * 1000) : null;\n const pushedAt = (data.gh_last_pushed_at) ? new Date(data.gh_last_pushed_at * 1000) : null;\n\n return {\n name: data.name,\n shortDescription: data.gh_description,\n fullDescription: data.description,\n url: data.gh_url,\n status: data.status,\n repoCreatedAt: createdAt,\n repoLastPushedAt: pushedAt,\n repoLastUpdatedAt: updatedAt,\n cloneUrl: data.gh_clone_url,\n homepage: data.gh_homepage,\n repoSize: data.gh_size,\n repoLanguages: data.gh_languages,\n owner: data.github_user\n };\n\n }", "function format_users() {\n\tvar users_fields = [];\n\tusers_data.forEach(function (user) {\n\t\tvar fields = [];\n\t\tfields.push(user.email);\n\t\tfields.push(user.user_name);\n\t\tfields.push(user.name.first);\n\t\tfields.push(user.name.last);\n\t\tfields.push(\"u of t\");\t\t//university\n\t\tfields.push(\"CS\");\t\t// departmnet\n\t\tfields.push(user.password);\n\t\tfields.push(user.phone);\n\n \t// console.log(fields);\n\t\tusers_fields.push(fields);\n\t});\n\n\treturn users_fields;\n}", "function transformResponse(data, len_vars){\n\n // length of data\n let len = data[0].structure.dimensions.observation[0].values.length\n let countries = [];\n\n // pulls countries used\n for (i = 0; i < len; i++) {\n countries.push(data[0].structure.dimensions.observation[0].values[i].name);\n }\n\n // pulls all values from dictionary\n let dict = data[0].dataSets[0].observations;\n let values = [];\n for (let key in dict){\n values.push(dict[key][0]);\n }\n\n let array = [];\n array.push(countries);\n\n // values are logically ordered (per country), so load them one for one in the datastructure\n for (i = 0; i < len_vars; i++) {\n array.push(values.slice(0 + i * len, (len - 1) + i * len));\n }\n\n // return end product\n return array;\n}", "function objectizeData(arg){\n \n var data = arg.split(\"&\");\n // console.log(data);\n var obj={};\n\n for(var key in data)\n {\n // console.log(data[key]);\n obj[data[key].split(\"=\")[0]] = data[key].split(\"=\")[1];\n }\n\n console.log(obj);\n return obj;\n}", "function detailsTransform(data) {\n var networksList = [];\n var t = data.data;\n\n for (var key in t) {\n // iterate over networks by region\n if (t.hasOwnProperty(key)) {\n // iterate over each network and extract necessary data\n\n angular.forEach(t[key].networks, function (network) {\n networksList.push({\n id: network.id,\n rrn: network.rrn,\n name: network.name,\n admin_state_up: network.admin_state_up ? \"Yes\" : \"No\",\n shared: network.shared ? \"Yes\" : \"No\",\n subnets: network.subnets,\n status: network.status,\n tenant_id: network.tenant_id\n });\n });\n }\n }\n\n return {\n labels: data.labels,\n data: networksList\n };\n }", "formatFields(fields, data) {\n let formattedData = [];\n // For every data returned from Neo4j\n for(let i = 0; i < data.length; i++) {\n let obj = {};\n // For every fields\n for(let j = 0; j < data[i]._fields.length; j++) {\n let key = fields[j];\n obj[key] = data[i]._fields[j];\n }\n formattedData.push(obj);\n }\n return this.wrapData(formattedData);\n }", "function parse(data) {\n var parser = new ClarinetParser(textEncoding$getString(data, \"utf-8\")),\n json = [],\n value;\n\n value = parser.nextValue();\n\n while(value !== undefined) {\n json.push(value);\n value = parser.nextValue();\n }\n\n return json;\n }", "function massageData(cryptoDataObject) {\n // declare two arrays\n var dataLabels = [];\n var dataPoints = [];\n\n // loop through the data object and obtain the required information\n for (i = 0; i < cryptoDataObject.length; i++) {\n dataPoints.push(cryptoDataObject[i].priceUsd);\n dataLabels.push(cryptoDataObject[i].date.substring(0, 10));\n }\n\n // now return the 2 arrays in a single object\n return {\n dataPoints: dataPoints,\n dataLabels: dataLabels,\n };\n}", "function parseResponse(data) {\n const status = data;\n return {id: status.id, status: status.status};\n}", "toApi() {\n let applicantContacts = [\n {\n \"Type\": \"e\",\n \"IsPrimary\": true,\n \"IsPrivate\": true,\n \"Email\": Url.stripHtml(this.email)\n },\n {\n \"Type\": \"p\",\n \"IsPrimary\": true,\n \"IsPrivate\": true,\n \"Phone\": this.mobile\n },\n {\n \"Type\": \"p\",\n \"IsPrimary\": false,\n \"IsPrivate\": true,\n \"Phone\": this.landline\n },\n {\n \"Type\": \"ad\",\n \"IsPrimary\": false,\n \"IsPrivate\": false,\n \"Address\": Url.stripHtml(this.address),\n \"City\": \"\",\n \"Suburb\": Url.stripHtml(this.suburb),\n \"CountryId\": this.countryId\n }\n ];\n\n if(!this.landline) {\n applicantContacts.splice(2, 1);\n }\n\n return {\n \"JobId\": this.jobId,\n \"ResumeFileStorageId\": this.resumeId,\n \"ApplicantInformation\": {\n \"FirstName\": Url.stripHtml(this.firstname),\n \"SurName\": Url.stripHtml(this.surname),\n \"BirthDay\": null,\n \"Sex\": null,\n \"Salutation\": null\n },\n \"ApplicantContacts\": applicantContacts\n };\n }", "formatData(data) {\n if(data && data.feed.entry) {\n data.feed.entry = data.feed.entry.slice(0,100);\n }\n return data;\n }", "parse (text) {\r\n var result = {}\r\n var find = null\r\n\r\n try {\r\n // CUIT\r\n find = text.match(/(?:C\\.U\\.I\\.T\\. )(\\d{2}-\\d{8}-\\d)/)\r\n result.CUIT = find[1]\r\n\r\n // Periodo (Mes/Año)\r\n find = text.match(/(\\d{2}\\/\\d{4})(?:\\sServicios\\sEventuales)/)\r\n result.Periodo = find[1]\r\n\r\n // Revisión - Orig. (0) - Rect. (1/9)\r\n find = text.match(/(?:Orig\\.\\s\\(0\\)\\s-\\sRect\\.\\s\\(1\\/9\\):\\s)(\\d+)/)\r\n result.Revision = parseInt(find[1], 10)\r\n\r\n // Empleados en Nomina\r\n find = text.match(/(?:Empleados\\sen\\snómina:\\s)(\\d+)/)\r\n result.EmpleadosEnNomina = parseInt(find[1], 10)\r\n\r\n // Suma de REM\r\n find = text.match(/(?:Suma\\sde\\sRem\\.\\s)(\\d):\\s([\\d\\.]+,[\\d]{2})/g)\r\n result.SumaDeREM = find.map(function (s) {\r\n var f = s.match(/(?:Suma\\sde\\sRem\\.\\s)(\\d):\\s([\\d\\.]+,[\\d]{2})/)\r\n return {\r\n REM: parseInt(f[1], 10),\r\n value: parseFloatB(f[2])\r\n }\r\n })\r\n\r\n // Montos que se Ingresan\r\n find = text.match(/(\\d{3})\\s-\\s([A-Za-z\\s\\.]+)([\\d\\.]+,[\\d]{2})/g)\r\n result.MontosQueSeIngresan = find.map(function (s) {\r\n var f = s.match(/(\\d{3})\\s-\\s([A-Za-z\\s\\.]+)([\\d\\.]+,[\\d]{2})/)\r\n return {\r\n code: parseInt(f[1], 10),\r\n name: f[2].trim(),\r\n value: parseFloatB(f[3])\r\n }\r\n })\r\n\r\n } catch (e) {\r\n console.log('Error', e)\r\n return null\r\n }\r\n\r\n return result\r\n }", "function getData () {\n return requestService.getTop()\n .then(response => {\n return parser.parseBody(response);\n })\n}", "dataParser(data) {\n // Parser si on a des resultat uniquement\n if (data.results > 0) {\n this.ligueName = data.response[0].league.name;\n for (var i = 0; i < data.response[0].league.standings[0].length; i++) {\n this.standings[i] = data.response[0].league.standings[0][i];\n this.tabInt[i] = i;\n }\n }\n }", "function parseOMDBResponse(data) {\r\n\r\n logContent(\"Title: \" + data.Title);\r\n logContent(\"Year: \" + data.Year);\r\n\r\n // Loop, format and print the movie ratings\r\n var ratings = data.Ratings;\r\n ratings.forEach(rating => {\r\n switch (rating.Source) {\r\n case \"Internet Movie Database\":\r\n logContent(\"IMDB Rating: \" + rating.Value);\r\n break;\r\n case \"Rotten Tomatoes\":\r\n logContent(\"Rotton Tomatoes Rating: \" + rating.Value);\r\n break;\r\n }\r\n });\r\n\r\n logContent(\"Country Produced: \" + data.Country);\r\n logContent(\"Language: \" + data.Language);\r\n logContent(\"Plot: \" + data.Plot);\r\n\r\n // Loop, format and print the actors on their own lines\r\n var actors = data.Actors.split(\", \");\r\n logContent(\"Actors:\");\r\n logContent(\"=======\");\r\n actors.forEach(actor => {\r\n logContent(\" \" + actor);\r\n });\r\n logContent(\"------------------------------------\");\r\n}", "function getData(request) {\n //resetAuth();\n var cc = DataStudioApp.createCommunityConnector();\n console.log(JSON.stringify(request));\n var requestedFields = [];\n var backupRequestedFields = [];\n \n for(var i = 0; i < request.fields.length; i++){\n requestedFields.push(request.fields[i].name);\n backupRequestedFields.push(request.fields[i].name);\n }\n \n console.log(JSON.stringify(requestedFields));\n\n try {\n \n var apiResponse = fetchDataFromApi(request, requestedFields);\n var combinedData = reformatData(apiResponse, request, backupRequestedFields);\n var data = getFormattedData(combinedData, backupRequestedFields);\n \n } catch (e) {\n \n console.log(\"Error\" + e);\n cc.newUserError()\n .setDebugText(\"Error fetching data from API. Exception details: \" + e)\n .setText(\n \"The connector has encountered an unrecoverable error. Please try again later.\"\n )\n .throwException();\n \n }\n \n \n console.log(\"data: \" + JSON.stringify(data))\n return data;\n}", "async getCryptoCurrencyList(){\nconst url = await fetch('https://data.messari.io/api/v2/assets?with-metrics&with-profiles')\n\n// return this as json \nconst cryptoCurrency = await url.json();\n\n// return this as an object\nreturn{\n cryptoCurrency\n}\n}", "function formDataToInputData(form) {\n /**\n Example form data coming in:\n {date=10/10/2018,\n timeOfDay=Afternoon,\n location=Heart Island,\n banded=[FALSE, FALSE],\n gender=[Drake, Drake],\n birds=[Ring-necked Duck, Ring-necked Duck],\n lost=[FALSE, FALSE],\n hunters=Steve,\n mounted=[FALSE, FALSE]}\n **/\n \n var input = {};\n input.date = form.date;\n input.timeOfDay = form.timeOfDay;\n input.location = form.location;\n input.huntersList = normalizeFormArrayField(form.hunters);\n \n input.birdsList = normalizeFormArrayField(form.birds);\n input.gendersList = normalizeFormArrayField(form.genders);\n input.lostList = normalizeFormArrayField(form.lost);\n input.bandedList = normalizeFormArrayField(form.banded);\n input.mountedList = normalizeFormArrayField(form.mounted);\n \n return input;\n}", "function rawData() {\n if(request.readyState == 4 && request.status == 200) {\n const data = JSON.parse(request.responseText);\n resolve(data);\n } else if(request.readyState == 4) {\n reject(\"Data error: Unable to fetch data\");\n }\n }", "parse(data) {\n return {\n editURL: data.editURL,\n id: data.id,\n integrationID: data.integrationID,\n itemState: data.enabled ? 'enabled' : 'disabled',\n name: data.name,\n };\n }", "function ParseJson(result) {\n if ( statusId == 'default' ) {\n for (var i = 0; i < result.response.venues.length; i++) {\n var venue = result.response.venues[i];\n dataStFull.push({\n name: venue.name,\n latlng: [venue.location.lat, venue.location.lng],\n distance: venue.location.distance,\n addressFull: venue.location.formattedAddress,\n address: venue.location.address,\n city: venue.location.city,\n id: venue.id,\n catName: venue.categories[0].name,\n catImage: venue.categories[0].icon.prefix + '32' + venue.categories[0].icon.suffix,\n shape: 'pinTarget'\n // shape : 'pin'\n });\n }\n } else if ( statusId == 'recomendation') {\n var tempItems = result.response.groups[0].items;\n for (var i = 0; i < tempItems.length; i++) {\n var venue = tempItems[i].venue;\n dataStFull.push({\n name: venue.name,\n latlng: [venue.location.lat, venue.location.lng],\n distance: venue.location.distance,\n addressFull: venue.location.formattedAddress,\n address: venue.location.address,\n city: venue.location.city,\n id: venue.id,\n catName: venue.categories[0].name,\n catImage: venue.categories[0].icon.prefix + '32' + venue.categories[0].icon.suffix,\n shape: 'pin'\n // shape : 'pin'\n });\n }\n } else {\n console.log('ERROR with URL');\n }\n}", "function getData(error, response) {\n if (error) throw error;\n\n // make json format from the data\n data = JSON.parse(response[0].responseText);\n\n // list for all the countries\n var countryArray = [];\n\n for(var i = 0; i < 30; i ++){\n countryArray.push(data.structure.dimensions.series[0].values[i][\"name\"])\n }\n\n // and a list with all the elements from api request\n var oecdArray = [];\n\n // place the values in the list\n for(var i = 0; i < countryArray.length; i ++){\n for(var j = 0; j < 4; j ++){\n var linking = i + \":\" + j + \":0\";\n oecdArray.push(data.dataSets[0].series[linking].observations);\n }\n }\n\n var values = [];\n\n // digging a little bit further so we skip non-values\n for(var i = 0; i < oecdArray.length; i ++){\n values.push(oecdArray[i][0][0]);\n }\n\n // list for all the internet access values\n var internetArray = [];\n\n // internet value is on 0th position in oecdArray\n for (var i = 0; i < values.length; i += 4){\n internetArray.push(values[i]);\n }\n\n // also for the voting turn out values\n var votesArray = [];\n\n // voting rate is on 1th position\n for(var i = 1; i < values.length; i += 4){\n votesArray.push(values[i]);\n }\n\n // share of people with secondary degree\n var secDegreeArray = [];\n\n // which is on the 2th position\n for(var i = 2; i < values.length; i += 4){\n secDegreeArray.push(values[i]);\n }\n\n // and one for the perception of corruption\n var perceptionArray = [];\n\n // which is on 3th position\n for(var i = 3; i < values.length; i += 4){\n perceptionArray.push(values[i]);\n }\n\n // making a dict for indexing later on\n // var wellBeingDict = [];\n\n // linking keys and values in dictionary\n for(var i = 0; i < 30; i++){\n wellBeingDict.push({\n country: countryArray[i],\n internet: internetArray[i],\n votes: votesArray[i],\n education: secDegreeArray[i],\n perception: perceptionArray[i]\n });\n }\n\n var w = 1200;\n var h = 600;\n var padding = 50;\n\n // create scale for width with extent returning the boundary as an array\n var xScale = d3.scaleLinear()\n .domain(d3.extent(wellBeingDict, function(d) {return d.perception}))\n .nice() // ensure scatters are within the range\n .range([0, w - padding]);\n\n // also for height\n var yScale = d3.scaleLinear()\n .domain([0, 100])\n .range([h - padding, 0]);\n\n // for the radius of a point\n var rScale = d3.scaleLinear()\n .domain(d3.extent(wellBeingDict, function(d) {return d.education}))\n .range([4, 20]);\n\n // and a function for sequential coloring (colorblind-friendly)\n var color = d3.scaleSequential(d3.interpolateRgb(\"#edf8fb\",\"#006d2c\"))\n .domain([d3.min(wellBeingDict, function(d) {return d.education}),\n d3.max(wellBeingDict, function(d) {return d.education})]);\n\n // function for creating x-axis later on\n var xAxis = d3.axisBottom()\n .scale(xScale);\n\n // and for y-axis\n var yAxis = d3.axisLeft()\n .scale(yScale);\n\n // update options\n var update = [\"Perception of corruption on x axis (%)\",\n \"Share of households with internet broadband access on x axis (%)\"];\n\n // creating tip box to show value\n var tip = d3.tip()\n .attr('class', 'd3-tip')\n .offset([-20, 0])\n .html(function(d, i) {\n return \"Country: \" + d.country\n + \"<br>\" + \"Share of households with internet broadband access: \" + d.internet + \"<br>\" +\n \" Voter turnout: \" + d.votes + \"<br>\" + \"Labour force withsecondary education: \" + d.education + \"<br>\" +\n \" Perception of corruption: \" + d.perception});\n\n // creating legend\n var legend = d3.legendColor()\n .labelFormat(d3.format(\".0f\"))\n .scale(color)\n .shapePadding(5)\n .shapeWidth(50)\n .shapeHeight(20)\n .labelOffset(12);\n\n // creating selection menu\n var select = d3.select('body')\n .append('select')\n \t.attr('class','select')\n .on('change',updateX)\n\n var options = select\n .selectAll('option')\n \t.data(update)\n .enter()\n \t.append('option')\n \t.text(function (d) {return d;})\n .classed('selected', function(d) {return d === xAxis;})\n .on('click', function(d) {\n xAxis = d;\n updateX();\n });\n\n // creating a canvas to draw my scatterplot on\n var svg = d3.select(\"body\")\n .append(\"svg\")\n .attr(\"width\", w)\n .attr(\"height\", h);\n\n // boxes with value's\n svg.call(tip);\n\n // drawing x-axis\n svg.append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(50,\" + (h - padding) + \")\")\n .call(xAxis)\n\n // adding label\n svg.append(\"text\")\n .attr(\"transform\", \"translate(1000, 585)\")\n .attr(\"class\", \"textClass\")\n .style(\"text-anchor\", \"middle\")\n .text(\"Perception of corruption (%)\");\n\n // drawing y-axis\n svg.append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(\" + padding + \")\")\n .call(yAxis)\n\n // adding label\n svg.append(\"text\")\n .attr(\"transform\", \"translate(15, 50) rotate(-90)\")\n .attr(\"class\", \"textClass\")\n .style(\"text-anchor\", \"end\")\n .text(\"Voter turnout (%)\");\n\n // placing legend\n svg.append(\"g\")\n .attr(\"transform\", \"translate(1100, 0)\")\n .call(legend);\n\n // drawing the scatters\n svg.selectAll(\"circle\")\n .data(wellBeingDict)\n .enter()\n .append(\"circle\")\n .attr(\"class\", \"point\")\n .attr(\"transform\", \"translate(50, 0)\")\n .attr(\"cx\", d => xScale(d.perception))\n .attr(\"cy\", d => yScale(d.votes))\n .attr(\"r\", d => rScale(d.education))\n .on('mouseover', tip.show)\n .on('mouseout', tip.hide)\n .style(\"fill\", d => color(d.education));\n\n function updateX() {\n\n // update axis and scale\n var independent = this.independent\n xScale.domain(d3.extent(wellBeingDict, function(d) {return d[independent]})).nice()\n xAxis.scale(xScale)\n\n // place new x-axis\n d3.select('#xAxis')\n .transition()\n .duration(750)\n .call(xAxis)\n\n // draw new scatters\n d3.selectAll('circle')\n .transition()\n .duration(750)\n .delay(function (d,i) {\n return i * 50\n })\n .attr('cx',function (d) {\n return xScale(d[independent])\n });\n\n };\n }", "function parse(data){\n try {\n return JSON.parse(data);\n } catch (e) {\n console.error(e);\n }\n}", "function convertRawResponseToExpectedFormat(rawResponeData){\n \n if(rawResponeData === null || rawResponeData === undefined){\n return;\n }\n \n var finalResponseData = {};\n var finalResponseResults = [];\n \n if(rawResponeData.result != null || rawResponeData.result !== undefined){\n var rawResponeDataResult = rawResponeData.result;\n \n for(var i=0; i<rawResponeDataResult.length; i++){\n if(rawResponeDataResult[i] != null){\n if(typeof(rawResponeDataResult[i]) == \"object\"){\n if($.isArray(rawResponeDataResult[i])){\n // Cluster level result set\n finalResponseResults = convertToExpectedObjectsFormat(rawResponeDataResult, \"\");\n break;\n \n }else if(rawResponeDataResult[i].member != null && rawResponeDataResult[i].member !== undefined){\n \n var responseForMember = {};\n responseForMember.member = rawResponeDataResult[i].member[0];\n responseForMember.result = convertToExpectedObjectsFormat(rawResponeDataResult[i].result, rawResponeDataResult[i].member[0][1]);\n \n // add into final results\n finalResponseResults.push(responseForMember);\n }\n }\n }\n }\n }\n \n finalResponseData.result = finalResponseResults;\n //responseResult = finalResponseData;\n return finalResponseData;\n}", "getTransformedData() {\n const form = this.getData();\n\n return Object.keys(form)\n .map((id) => [id, this.getTransformedValue(id)])\n .reduce((acc, [id, value]) => {\n acc[id] = value;\n return acc;\n }, {});\n }", "function convertResponseToAProjectDetailsObject(response,callback){\n\tvar details = {\n\t\t\tdescription:''\n\t\t\t, objective:''\n\t\t\t, contributors:new Array()\n\t\t\t, funding:''\n\t\t\t, tags:new Array()\n\t\t\t, stickyNotes: new Array()\n\t};\n\t\n\t//console.log(\"%%%\",response);\n\t\n\t//parse it\n\thtml = $.parseHTML(response);\n\t//console.log(\"!!!\",html);\n\t\n\t//Get the context\n\t$.each(html,function(i,el){\n\t\tswitch (el.nodeName){\n\t\tcase 'DESCRIPTION':{\n\t\t\t\tdetails.description= el.innerText;\n\t\t\t\tbreak;\n\t\t}\n\t\tcase 'OBJECTIVE':{\n\t\t\t\tdetails.objective= el.innerText;\n\t\t\t\tbreak;\n\t\t}\n\t\tcase 'CONTRIBUTORS':{\n\t\t\t\tvar text = el.innerText;\t\t\t\t\n\t\t\t\tdetails.contributors= text.split(\",\");\t\t\t\t\n\t\t}\n\t\tcase 'FUNDING':{\n\t\t\t\tvar text = el.innerText;\n\t\t\t\tdetails.funding= text.split(\",\");\n\t\t\t\tbreak;\n\t\t}\n\t\tcase 'TAGS':{\n\t\t\t\tvar text= el.innerText;\n\t\t\t\tdetails.tags = text.split(\",\");\n\t\t\t\tbreak;\n\t\t}\t\t\t\n\t\tcase 'STICKYNOTES':{\n\t\t\t\tvar text = el.innerText;\n\t\t\t\tconsole.log(text)\n\t\t\t\t//text='[{\"date\": \"05/20/14\",\"note\":\"Design Notes interface\"},{\"date\":\"05/18/14\",\"note\":\"Design the tags interface. Finish both backend and frontend implementation\"}]';\n\t\t\t\tdetails.stickyNotes = JSON.parse(text);\n\t\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t}\n\t});\n\tconsole.log(\">>>\",details);\n\t\n\treturn callback(details);\n}", "function getLADataFromAPI(){\n var endpoint = ' https://data.lacity.org/resource/a6pt-xt54.json'\n \n fetch(endpoint) // returns a promise\n .then(function(data){\n return data.json()\n })\n .then(function(json){\n console.log(json)\n var resultDiv = document.getElementById('result')\n var finalHTML = ''\n var newData = json.filter(function(item){\n return item.total_population === \"> 1000\"\n })\n json.forEach(function(item){\n var cardItem = \n `\n <div class=\"col s6 m4\">\n <div class=\"card\">\n <div class=\"card-image\">\n <img src=\"https://postalmuseum.si.edu/systemsatwork/images/global/mr_zip-01.jpg\">\n <span class=\"card-title\">${item.zip_code}</span>\n </div>\n <div class=\"card-content\">\n <p>\n Population based on area zip code ${item.zip_code} the total population is ${item.total_population}.\n </p>\n </div>\n </div>\n </div>\n `\n finalHTML += cardItem\n })\n resultDiv.innerHTML = finalHTML\n \n \n // resultDiv.innerHTML = JSON.stringify(json, undefined, 2)\n // var wantedData = json.map(function(item){\n // var title = item.department_title\n // var fSalary = item.female_average_salary\n // var mSalary = item.male_average_salary\n // return 'For the ' + title + ' department, men earn an average salary of ' + mSalary + ', and females earn an average salary of ' + fSalary + '.'\n // })\n // var htmlForWantedData = wantedData.map(function(string){\n // return '<li>' + string + '</li>'\n // })\n // var finalHTML = ''\n // htmlForWantedData.forEach(function(listItem){\n // finalHTML += listItem\n // })\n // resultDiv.innerHTML = finalHTML\n })\n .catch(function(error){\n console.log(error)\n })\n}", "function getData(data) {\n dataActivity = data.activity;\n dataType = data.type;\n dataAccessibility = data.accessibility;\n dataPrice = data.price;\n dataParticipants = data.participants;\n}", "data() {\n let data = {};\n\n for (let property in this.originalData) {\n let field = this[property];\n\n //if ( !field ) continue;\n\n if ( this.dateFields.includes(property) ) {\n field = this.parseAsDate(field);\n }\n\n if ( this.floatFields.includes(property) ) {\n field = this.parseAsFloat(field);\n }\n \n data[property] = field;\n }\n\n return data;\n }", "function responseToObject(s){\r\n\t//trim leading and trailing white spaces\r\n\ts = s.trim();\r\n\t//remove double quotes from first and last position\r\n\ts = s.substring(1, s.length-1);\r\n\t//remove backslashes from JSON\r\n\ts = s.replace(/\\\\\"+/g, '\"');\r\n\t//parse JSON\r\n\treturn JSON.parse(s);\r\n}", "function formatData(data) {\n let returnData = []\n for (let i in data) {\n let start = data[i].shift();\n let end = data[i].pop();\n let wp = []; //Waypoints\n for (let j in data[i]) {\n wp.push({\n location: data[i][j],\n stopover: false\n })\n }\n returnData.push({\n start: start,\n end: end,\n wp: wp\n });\n }\n return returnData;\n }", "function formatFetchData(username, data) {\n return [username, data[\"br_all\"][\"wins\"], data[\"br_all\"][\"kills\"], JSON.stringify(data[\"br_all\"][\"kdRatio\"]).substring(0, 5)]\n}", "function parseData(dataString) {\n let categoricalResponses = dataString.split(DEMARCATION).filter(str => str);\n const parsed = {};\n categoricalResponses.forEach(catRes => {\n let parsedRes = JSON.parse(catRes);\n let category = parsedRes.category;\n if (!parsed[category]) {\n parsed[category] = {};\n }\n parsedRes.data.forEach(queryData => {\n let { timestamp, query, response, timing } = queryData;\n if (!parsed[category][query]) {\n parsed[category][query] = [{ timestamp, response, timing }];\n } else {\n parsed[category][query].push({ timestamp, response, timing });\n }\n });\n });\n return parsed;\n}", "function processResponse(data) { \n\tvar output = '';\n\t\n\tfor (var i=data.startAt; i < data.maxResults; i++) {\n\t\n\t var key = data.issues[i].key;\n\t\tvar issueType = data.issues[i].fields.issuetype.name;\n\t\tvar epic = data.issues[i].fields.customfield_10001;\n\t\tvar initiative = getInitiative(epic);\n\t\tvar fixVersions = data.issues[i].fields.fixVersions;\n\t\tvar timeSpent = data.issues[i].fields.aggregatetimespent / 3600; // convert from seconds to hours\n\t\tvar sprintName = data.issues[i].fields.customfield_10000.toString().match(/name=(.*?),start/)[1];\t\n\t\tvar sprintStart = data.issues[i].fields.customfield_10000.toString().match(/startDate=(.*?)T/)[1];\t\n\t\tvar sprintEnd = data.issues[i].fields.customfield_10000.toString().match(/completeDate=(.*?)T/)[1];\t\n\t\t\n\t\toutput = key + ',' + issueType + ',' + epic + ',' + fixVersions + ',' + timeSpent + ',' + sprintName + ',' + sprintStart + ',' + sprintEnd; \n\t\tgetInitiative(epic,output);\n\t}\n}", "function transformResponseData(){\n const options = {\n method: 'post',\n url: 'https://jsonplaceholder.typicode.com/posts',\n data: {\n title: 'Hello World'\n },\n transformResponse: axios.defaults.transformResponse.concat(data => {\n data.title = data.title.toUpperCase();\n return data;\n })\n }\n axios(options).then(res => showOutput(res));\n}", "function getParsings(text) {\n const url = `${BASE_URL}/dep`\n return axios.post(url, { text });\n }", "function extractResponse() {\n // parse user login name, add it to the html\n setLoginName(validUserNameJason.login);\n // create html for repositories, pass repos url api and number of repositories\n setRepositories(validUserNameJason.repos_url, validUserNameJason.public_repos);\n // create html for followers repositories, pass followers url api and number of followers\n setFollowers(validUserNameJason.followers_url, validUserNameJason.followers);\n // show the user info html the was generated from the response\n let userSection = document.getElementById(\"userInfo\");\n showElement(userSection);\n }", "function processData(allText) {\n restJson = JSON.parse(allText);\n console.log(restJson);\n buildTable(restJson);\n }", "transformData(data) {\n return data.map((element) => {\n const newElement = {}\n newElement.id = element.id\n newElement.date = element.date\n newElement.content = element.content.rendered\n newElement.description = element.excerpt.rendered\n newElement.name = element.title.rendered\n newElement.slug = element.slug\n newElement.link = element.link\n newElement.parent = element.parent\n newElement.template = element.template\n return newElement\n })\n }", "function parseData(data){\n _.each(data, function(light, id){\n var device = network.get(\"device\").findWhere({\"serial\": light[\"uniqueid\"]});\n if(!device){\n toCreate = true;\n var deviceObj = {\n \"name\": light[\"name\"],\n \"type\": light[\"type\"],\n \"serial\": light[\"uniqueid\"],\n \"manufacturer\": light[\"manufacturername\"],\n \"communication\": \"always\",\n \"protocol\": \"hue\",\n \"included\": \"1\",\n \"product\": id\n };\n device = createDevice(deviceObj);\n _.each(light[\"state\"], function(lightVal, key){\n var valueObj = {\n \"name\": key,\n \"type\": deviceObj[\"type\"],\n \"permission\": \"rw\",\n \"status\": \"ok\",\n \"stateData\": lightVal //this will be state.data\n };\n var value = createValue(device, valueObj);\n device.get(\"value\").push(value);\n });\n network.get(\"device\").push(device);\n } else {\n _.each(light[\"state\"], function(lightVal, key){\n var value = device.get(\"value\").findWhere({name: key});\n if(value){\n var reportState = value.get(\"state\").findWhere({type: \"Report\"});\n if(reportState){\n var newData = convertToWappstoData(key, lightVal);\n if(reportState.get(\"data\") != newData){\n saveStateData(reportState, newData);\n }\n }\n }\n });\n }\n });\n}", "parse(data) {\n if (data instanceof Response) {\n if (!data.ok) {\n throw `Error retrieving data from ${data.url}: ${data.statusText}`;\n }\n return data.arrayBuffer().then(data => this.parse(data));\n }\n if (data instanceof Blob) {\n return data.arrayBuffer().then(data => this.parse(data));\n }\n\n if (has_binary_marker(data)) {\n let decoder = new Decoder(this, data);\n return decoder.readall();\n } else {\n let reader = new Reader(this, data);\n let obj = reader.parseall();\n return obj;\n }\n }", "function convertir_cadena(data){\n data_json=[]\n let data_separada = []\n data = data.split(\"\\n\")\n let data_clean=[]\n for(let i in data){\n data_separada.push(data[i].split(\" \"))\n }\n for(let i in data_separada){\n data_clean.push(data_separada[i].filter(Boolean))\n }\n \n data_clean.reduce((acumulador,actual,indice, array )=>{\n let cadena = \"\"\n for(let i in acumulador){\n if(i==0){\n cadena+=\"{\"\n }\n cadena += `\"${acumulador[i]}\":\"${actual[i]}\"`;\n if(i!=(acumulador.length-1)){\n cadena+=\",\"\n }\n if(i==(acumulador.length-1)){\n cadena+=\"}\"\n }\n }\n \n data_json.push(JSON.parse(cadena))\n return acumulador\n })\n return data_json\n}", "function getNutrientParsedData(foodData) {\n console.log(foodData);\n let parsedData = foodData.parsed;\n return parsedData;\n}", "massageData(data) {\n // Grab the unique list of counties from the dataset\n this.listOfCounties = [...new Set(data.map((x) => x.res_geo_short))].sort();\n\n // Group data by residential county\n const groupedData = this.groupBy(data, (item) => item.res_geo_short);\n\n // Convert necessary string to ints and add aggregate fields\n groupedData.forEach((county) => this.convertStrings(county));\n return groupedData;\n }", "dataParser(data) {\n console.log(\"Je commence fini\");\n for (var i = 0; i < data.results; i++) {\n this.responses[i] = data.response[i];\n this.tabInt[i] = i;\n }\n }", "function translate_obj( data ) {\n var table_data = {\"data\": []};\n for (var type_key in data) {\n var timestamp_data = data[type_key];\n\n for (var timestamp in timestamp_data) {\n var cmd_data = timestamp_data[timestamp];\n\n for (var cmd in cmd_data) {\n var status_data = cmd_data[cmd];\n console.log(page + \": parsing data from \\\"\" + type_key + \"-\" + timestamp + \"-\" + cmd + \"\\\"\");\n\n // getting all the status data sets\n additional_data = [];\n for (var status in status_data) {\n // adding code in each status object\n status_data[status][\"code\"] = status;\n // storing status into an array so that I can put it in dictionary later\n additional_data.push(status_data[status]);\n }\n\n // push into total data set\n data_set = {\"type\": type_key, \"cmd\": cmd, \"start_ts\": timestamp, \"status\": additional_data};\n table_data[\"data\"].push(data_set);\n }\n\n }\n }\n return table_data;\n}", "async getDataFromApi() {\n const response = await fetch(this.state.url);\n const jsonData = await response.json();\n \n this.setState(()=>{\n return{\n data: jsonData,\n pageContent: ReactHtmlParser(jsonData.content.rendered),\n pageTitle: ReactHtmlParser(jsonData.title.rendered),\n pageVideo: ReactHtmlParser(jsonData.acf.pagevideo),\n pageId: jsonData.id\n\n }\n }, () => { console.log(this.state.data, 'from api call')});\n }", "getInputData() {\n var data = {};\n\n Object.keys(this.elements).forEach(key => {\n let content = this.elements[key];\n data[key] = {};\n\n // * If given section contains only one input dataset\n // * (contains only from & to keys)\n if (Object.keys(content).includes('from')) {\n \n let {from, to} = content;\n\n switch (key) {\n case 'datetime': {\n data[key].from = from.value;\n data[key].to = to.value;\n } break;\n }\n \n } else { // * Contains more datsets splited into own dicts\n Object.keys(content).forEach(section_key => {\n if (content != \"search-flights\") {\n\n data[key][section_key] = {};\n let element = content[section_key];\n\n switch (section_key) {\n\n case 'currency': {\n data[key][section_key].curr = (element.curr).value;\n } break;\n\n case 'price': {\n data[key][section_key].from = Number((element.from).value);\n data[key][section_key].to = Number((element.to).value);\n } break;\n\n case 'iata': {\n data[key][section_key].from = (element.from).value;\n data[key][section_key].to = (element.from).value;\n } break;\n\n // * Checkboxes\n case 'direct_flights': {\n data[key][section_key] = element.checked;\n } break;\n\n case 'lowest_price': {\n data[key][section_key] = element.checked;\n } break;\n\n case 'biggest_price': {\n data[key][section_key] = element.checked;\n } break;\n }\n }\n }); \n }\n });\n\n return data;\n }", "function reformatData(obj) {\n\t\tvar data = [];\n\t\tvar repo = repoNameWOwner;\n\t\tif (obj[\"data\"].hasOwnProperty(repo)) {\n\t\t\tvar weeklyNodes = obj[\"data\"][repo];\n\t\t\tfor (var i=0; i<weeklyNodes.length; i++) {\n\t\t\t\tvar datpair = {date: weeklyNodes[i][\"week\"], value: weeklyNodes[i][\"total\"]};\n\t\t\t\tdata.push(datpair);\n\t\t\t}\n\t\t}\n\t\treturn data;\n\t}", "function convertQuestions() {\n console.log(\"Converting Questions\");\n let q = apiQuestions[0].question;\n let o = apiQuestions[0].incorrect_answers;\n let a = apiQuestions[0].correct_answer;\n let templateQuestion = {\n ask: q,\n options: o,\n answer: a\n };\n apiQuestions.forEach(function (question) {\n q = decodeURIComponent(decodeURIComponent(question.question));\n o = question.incorrect_answers;\n for (var i = 0; i < o.length; i++) {\n o[i] = decodeURIComponent(decodeURIComponent(o[i]));\n }\n a = decodeURIComponent(decodeURIComponent(question.correct_answer));\n o.push(a);\n question = {\n ask: q,\n options: o,\n answer: a\n };\n questions.push(question)\n });\n console.log(\"Successfully Converted Questions\");\n console.log(questions);\n}", "function postData() {\n \"use strict\";\n\n var response = [{name:'GOLDUD'},{name:'AUDUSD'},{name:'EURUSD'},{name:'GBPUSD'},{name:'NZDUSD'},{name:'USDCAD'},{name:'USDCHF'},{name:'USDJPY'},{name:'EURJPY'},{name:'GBPJPY'}];\n getDataRoot(response);\n }", "async getBasicInfo(){\n //<== Html selectors ==>\n const fieldNameClassName = \".gsc_oci_field\";\n const valueClassName = \".gsc_oci_value\";\n\n // <== Logic ==>\n\n // get fields \n const page = this.page;\n const fieldNameLst = await page.$$eval(fieldNameClassName, (options) =>\n options.map((option) => option.textContent\n ));\n const valueLst = await page.$$eval(valueClassName, (options) =>\n options.map((option) => option.textContent\n ));\n \n\n // <== Set data to json ==>\n for (var i in fieldNameLst){\n const fieldName = fieldNameLst[i];\n if (fieldName===\"Description\"){\n continue\n }\n if (fieldName==\"Total citations\"){\n continue\n }\n const value = valueLst[i];\n this.json[fieldName] = value\n }\n \n\n }", "function parseData(apiResponse, res,method) {\n apiData = ''\n apiResponse.on('data', function (chunk) {\n apiData += chunk;\n });\n apiResponse.on('end', function () {\n apiData = JSON.parse(apiData);\n if(method===\"post\"){\n res.send(JSON.stringify(apiData));\n res.end();\n }\n else{\n sendResponse(apiData,res);\n }\n });\n}", "function formatData(sdata) {\n\t\t\t\t\tvar p = sdata[\"Webpage Title/Link\"];\n\t\t\t\t\tvar paths = [];\n\t\t\t\t\tvar keys= [];\t\t\t\t\t\n\t\t\t\t\tvar numKeys = sdata.keys.length;\n\t\t\t\t\tvar numVals = sdata[\"% Visits \"].length;\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tfor(i=1; i < numKeys; i++){\n\t\t\t\t\t\tkeys[i-1]=(sdata.keys[i]);\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tfor(i=0; i < paths.length; i++){\n\t\t\t\t\t\tpaths[i] = ('\"'+p[i]+'\"');\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tvar data = [];\t\t\t\t\t\t\n\t\t\t\t\tfor(i=0; i < 3; i++){\n\t\t\t\t\t\tdata.push({\n\t\t\t\t\t\t\tkey: keys[i],\n\t\t\t\t\t\t\tvalues:[]\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor(j=0; j < sdata[\"Webpage Title/Link\"].length; j++){\n\t\t\t\t\t\t\tdata[i].values.push({\n\t\t\t\t\t\t\t\tx:j,\n\t\t\t\t\t\t\t\ty:sdata[sdata.keys[i+1]][j]\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\t\n\t\t\t\t return data;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}", "function fields() {\n personal_data = {\n 'my_name': ['Tim Booher'],\n 'grade': ['O-5'],\n 'ssn': ['111-22-2222'],\n 'address_and_street': ['200 E Dudley Ave'],\n 'b CITY': ['Westfield'],\n 'c STATE': ['NJ'],\n 'daytime_tel_num': ['732-575-0226'],\n 'travel_order_auth_number': ['7357642'],\n 'org_and_station': ['US CYBER JQ FFD11, MOFFETT FLD, CA'],\n 'e EMAIL ADDRESS': ['[email protected]'],\n 'eft': ['X'],\n 'tdy': ['X'],\n 'house_hold_goodies': ['X'],\n 'the_year': ['2018']\n }\n trip_data = { 'a DATERow3_2': ['07/19'], 'reason1': ['AT'], 'a DATERow5_2': ['07/19'], 'reason2': ['AT'], 'reason3': ['TD'], 'a DATERow7_2': ['07/21'], 'a DATERow9_2': ['07/15'], 'b NATURE OF EXPENSERow81': ['Capital Bikeshare'], 'a DATERow1_2': ['07/15'], 'b NATURE OF EXPENSERow41': ['Travel from summit to BOS'], 'b NATURE OF EXPENSERow1': ['Travel from IAD to Hotel'], 'from1': ['07/15'], 'to2': ['07/15'], 'to1': ['07/15'], 'from4': ['07/19'], 'to4': ['07/19'], 'to3': ['07/19'], 'from5': ['07/21'], 'from2': ['07/15'], 'to6': ['07/21'], 'from3': ['07/19'], 'to5': ['07/21'], 'reason4': ['TD'], 'reason5': ['AT'], 'from6': ['07/21'], 'reason6': ['MC'], 'c AMOUNTRow8': ['25.0'], 'c AMOUNTRow7': ['45.46'], 'c AMOUNTRow6': ['11.56'], 'c AMOUNTRow5': ['38.86'], 'c AMOUNTRow9': ['23.0'], 'b NATURE OF EXPENSERow7': ['Travel from EWR to HOR'], 'b NATURE OF EXPENSERow3': ['Travel between meetings'], 'a DATERow10_2': ['07/18'], 'c AMOUNTRow4': ['28.4'], 'c AMOUNTRow3': ['21.1'], 'c AMOUNTRow2': ['23.77'], 'c AMOUNTRow1': ['43.5'], 'mode6': ['CA'], 'a DATERow2_2': ['07/15'], 'mode5': ['CP'], 'mode4': ['CP'], 'a DATERow4_2': ['07/19'], 'mode3': ['CP'], 'ardep6': ['HOR'], 'a DATERow6_2': ['07/19'], 'a DATERow8_2': ['07/21'], 'b NATURE OF EXPENSERow6': ['Travel from hotel to IAD'], 'ardep1': ['EWR'], 'd ALLOWEDRow10': ['6.25'], 'b NATURE OF EXPENSERow2': ['Travel from BOS to Meeting'], 'ardep5': ['EWR'], 'ardep4': ['Arlington VA'], 'ardep3': ['BOS'], 'ardep2': ['Arlington VA'], 'c AMOUNTRow10': ['6.25'], 'mode2': ['CP'], 'mode1': ['CA'], 'b NATURE OF EXPENSERow9': ['Metro'], 'b NATURE OF EXPENSERow5': ['Travel from hotel to DCA'], 'd ALLOWEDRow1': ['43.5'], 'b NATURE OF EXPENSERow1': ['Travel from HOR to EWR'], 'd ALLOWEDRow3': ['21.1'], 'd ALLOWEDRow2': ['23.77'], 'd ALLOWEDRow5': ['38.86'], 'd ALLOWEDRow4': ['28.4'], 'd ALLOWEDRow7': ['45.46'], 'd ALLOWEDRow6': ['11.56'], 'd ALLOWEDRow9': ['23.0'], 'd ALLOWEDRow8': ['25.0'] }\n return Object.assign({}, personal_data, trip_data);\n}", "parsing(data) {\r\n let jsonStructure = new jsonParser(data);\r\n }", "getFormData(form) {\n const type = form['query_type'].value || 1\n \n let content = form['query_content'].value\n const values = {\n query: content,\n name: form['query_name'].value,\n uri: form['query_endpoint'].value.trim(),\n params: {\n type: type,\n period: [ content.includes(\"$beginYear\") ? +form['from_year'].value : '', \n content.includes(\"$endYear\") ? +form['to_year'].value : '' ],\n lab: [ content.includes(\"$lab1\") ? form['query_lab1'].value : '', \n content.includes(\"$lab2\") ? form['query_lab2'].value : '' ],\n country: content.includes(\"$country\") ? form['query_country'].value : '',\n list_authors: form['query_list_authors'].value.split(',').map(d => `\"${d.trim()}\"`)\n }\n };\n\n this.getVariables(values.params)\n\n values.params.prefixes = this.getPrefixes()\n \n return values;\n }", "function parseData(data) {\n try {\n return data && JSON.parse(data) || '';\n } catch (e) {\n return '';\n }\n }", "decodeAlectoV1(data, type) {\n let id = utils.bin2dec(data.slice(0, 8).reverse().join(''));\n let result = {\n id: id,\n data: {}\n }\n // Decode the data based on the type\n if (type === 'TH') {\n let temperature = data.slice(12, 24).reverse().join('');\n if (temperature[0] === '1') {\n // make it 32 bit, convert 2's complement\n temperature = ~~parseInt('11111111111111111111' + temperature, 2);\n } else {\n temperature = utils.bin2dec(temperature);\n }\n let humidity = utils.bin2dec(data.slice(28, 32).reverse().join(''))\n + utils.bin2dec(data.slice(24, 28).reverse().join(''))\n result.data.temperature = Number((temperature / 10).toFixed(1));\n result.data.humidity = Number(humidity);\n result.channel = Number(utils.bin2dec(data.slice(4, 6).reverse().join(''))) + 1;\n } else if (type === 'R') {\n let rain = utils.bin2dec(data.slice(16, 32).reverse().join(''));\n result.data.raintotal = rain * 0.25;\n } else if (type === 'W') {\n let val = utils.bin2dec(data.slice(24, 32).reverse().join('')) * 0.72; // km/h\n if (data.slice(12, 15).every(x => x === 1)) { // '111'\n result.data.direction = Number(utils.bin2dec(data.slice(15, 24).reverse().join('')));\n result.data.currentspeed = val; // gust\n } else {\n result.data.averagespeed = val;\n }\n }\n result.data.lowbattery = (data[8] === 1);\n\n return result;\n }", "function splitData(raw) {\n\tvar lines = raw.split( \"\\n\" );\n\tvar line = lines[0];\n\tvar vals = {};\n\tline.split(\" \").forEach(function(kvp){\n\t\tvar data = kvp.split(\":\");\n\t\tvals[data[0]] = data[1];\n\t});\n\tif ( lines.length > 1 ) {\n\t\tlines.splice( 0 , 1 );\n\t\tvals.body = lines;\n\t}\n\treturn vals;\n}", "function ResponseParser() {\r\n\r\n this.getStaticRatingListFromResponse = function (responseData) {\r\n var rates = responseData.rate || {};\r\n var staticRatingList = {};\r\n\r\n for (var meterName in rates) {\r\n var rate = rates[meterName];\r\n staticRatingList[meterName] = {\r\n 'name': meterName,\r\n 'rate': rate\r\n };\r\n }\r\n\r\n return staticRatingList;\r\n };\r\n\r\n /*this.getAdminListFromResponse = function (responseData) {\r\n var userStrings = responseData.uniqueMember || [];\r\n var userList = [];\r\n\r\n for (var i = 0; i < userStrings.length; i++) {\r\n var re = /uid=(.*?),/g;\r\n var matched = re.exec(userStrings[i]);\r\n\r\n if (matched && matched[1]) {\r\n userList.push(matched[1]);\r\n }\r\n }\r\n\r\n return userList;\r\n };*/\r\n\r\n this.getUserListFromResponse = function (responseData) {\r\n return responseData || [];\r\n };\r\n\r\n\r\n\r\n //We use a new method as now the json response and the requirements have changed\r\n //\r\n //this.getAdminStatusFromResponse = function(responseData) {\r\n // var groups = responseData.isMemberOf || \"\";\r\n //\r\n // if(groups instanceof Array) {\r\n // groups = groups.join();\r\n // }\r\n //\r\n // return /cn=CyclopsAdmin/g.test(groups);\r\n //};\r\n this.getAdminStatusFromResponse = function(responseData) {\r\n return responseData;\r\n }\r\n\r\n this.fetchUsersAndAdmins = function(users,admins){\r\n var userList = [];\r\n for (var i = 0; i<users.length;i++){\r\n userList[i] = users[i];\r\n }\r\n var l = userList.length;\r\n for (var o = 0; o<admins.length; o++){\r\n userList[l+o] = admins[o];\r\n }\r\n return userList;\r\n }\r\n }", "function rsToObj(data) {\n var object = {};\n var fields = data.split(\"`\");\n if (data == \"\" || data == \"null\") return null;\n if (fields.length > 1) {\n fields.forEach(function(item) {\n \n // now get the name/value and assign the object\n var pair = item.split(\"~\");\n if (pair[1] == \"\") {\n object[pair[0]] = null;\n } else {\n \n // check to make sure there are only two pairs\n // if there are more than two we need to combine everything after the first entry because they were separated using the same character\n if (pair.length > 2) {\n for (i=2; i<pair.length; i++) pair[1] += \"~\" + pair[i];\n object[pair[0]] = pair[1];\n } else {\n if ($.isNumeric(pair[1])) {\n object[pair[0]] = parseFloat(pair[1]);\n } else {\n if (pair[1].toLowerCase() == \"false\") object[pair[0]] = false;\n else if (pair[1].toLowerCase() == \"true\") object[pair[0]] = true;\n else object[pair[0]] = pair[1];\n }\n }\n }\n });\n } else object = null;\n return object;\n}", "function processData(input) {\n solucao(JSON.parse(input));\n}", "function parseResponseToFields(data, fieldContainer, wrapAround)\n{\t\n\twrapAround = wrapAround || {};\n\tif (data == null)\n\t\treturn;\n\tfieldContainer = $(fieldContainer);\n\t$.each(data, function(fieldName, fieldValue)\n\t{\t\n\t\tvar cell = fieldContainer.find(\".\" + fieldName).empty();\n\n\t\tif (!fieldValue)\n\t\t\treturn;\n\t\tif (fieldValue.constructor != Array)\n\t\t\tfieldValue = [fieldValue];\n\t\t\t\n\t\t$.each(fieldValue, function(index, value)\n\t\t{\n\t\t\tif (wrapAround[fieldName])\t//a WrapAround was provided! We expect HTML \n\t\t\t{\n\t\t\t\t\tcell.append($(wrapAround[fieldName]).text(value));\n\t\t\t}\n\t\t\telse //Simple text only\n\t\t\t{\n\t\t\t\tcell.text(value);\t\n\t\t\t}\t\t\n\t\t})\n\t})\n\n}", "function parse (data) {\n var platforms = utils.filterEmpty(data[0]);\n var clientsGroups = service.getClients(data[2]);\n var tests = service.getTests(data.splice(3));\n return {\n clients: service.mergePlatformClients(platforms, clientsGroups),\n tests: tests\n };\n}", "function extract_fax_info(sfax_response_obj){\n //var sfax_response_obj = JSON.parse('{\"inboundFaxItem\":{\"FaxId\":\"2190401201000980691\",\"Pages\":\"4\",\"ToFaxNumber\":\"18557916085\",\"FromFaxNumber\":\"5302731333\",\"FromCSID\":\"2731333\",\"FaxDateUtc\":\"4/1/2019 8:10:18 PM\",\"FaxSuccess\":\"1\",\"Barcodes\":{\"FirstBarcodePage\":1,\"TotalPagesWithBarcodes\":1,\"PagesWithBarcodes\":[1],\"BarcodeItems\":[{\"BarcodeSpacingXAxis\":0,\"BarcodeSpacingYAxis\":0,\"BarcodeType\":0,\"BarcodeMode\":1,\"BarcodeData\":\"9612019971424215517488\",\"BarcodeX\":157,\"BarcodeY\":1773,\"BarcodePage\":1,\"BarcodeScale\":0,\"BarcodeWidth\":684,\"BarcodeHeight\":303},{\"BarcodeSpacingXAxis\":0,\"BarcodeSpacingYAxis\":0,\"BarcodeType\":0,\"BarcodeMode\":1,\"BarcodeData\":\"[)>010295112840019971424215517488FDEB97142420501/12.0LBN725 E. Santa Clara Street, Ste 202San JoseCA 0610ZGD00811ZBetter Health Pharmacy12Z650488743423ZN22ZN20Z 028Z97142421551748831Z 33Z 34Z019KD261R818T33379P26Z1891\",\"BarcodeX\":116,\"BarcodeY\":1455,\"BarcodePage\":1,\"BarcodeScale\":0,\"BarcodeWidth\":556,\"BarcodeHeight\":245}]},\"InboundFaxId\":\"2190401201000980691\",\"FaxPages\":\"4\",\"FaxDateIso\":\"2019-04-01T20:10:18Z\",\"WatermarkId\":\"2190401201018997198\",\"CreateDateIso\":\"2019-04-01T20:10:18.1207720Z\"},\"isSuccess\":true,\"message\":null}')\n\n var res = {}\n \n if(!sfax_response_obj['inboundFaxItem']) return sfax_response_obj //if it's an error, then just return original content\n \n //debugEmail('SFax Response to Query about Inbound details', JSON.stringify(sfax_response_obj))\n \n res['faxPages'] = sfax_response_obj['inboundFaxItem']['FaxPages']\n res['faxSuccess'] = sfax_response_obj['inboundFaxItem']['FaxSuccess']\n var barcodes = sfax_response_obj['inboundFaxItem']['Barcodes']['BarcodeItems']\n var tracking_nums = []\n var rx = /971424215(\\d{6})/\n for(var i = 0; i < barcodes.length; i++){\n var parsed = barcodes[i]['BarcodeData'].toString().match(rx)\n if(parsed) tracking_nums.push(parsed[0].toString())\n }\n res['tracking_nums'] = \"\" + tracking_nums\n Logger.log(res)\n return res\n}", "decodeLabs(data) {\n\t let id = utils.bin2dec(data.slice(0, 4).reverse().join('') + data.slice(6, 8).reverse().join(''));\n\n\t let temperature = data.slice(12, 24).reverse().join('');\n\t if (temperature[0] === '1') {\n\t // make it 32 bit, convert 2's complement\n\t temperature = ~~parseInt('11111111111111111111' + temperature, 2);\n\t } else {\n\t temperature = utils.bin2dec(temperature);\n\t }\n\t let humidity = 100 - (255 - utils.bin2dec(data.slice(24, 32).reverse().join('')));\n\n\t\tlet result = {\n\t name: 'BL999',\n\t\t\tid: id,\n\t\t\tpid: 'labs', // override default 'tfa' protocol ID\n\t channel: Number(utils.bin2dec(data.slice(4, 6).join(''))),\n\t\t\tdata: {\n\t temperature: Number((temperature / 10).toFixed(1)),\n\t humidity: humidity,\n\t lowbattery: data[8] === '1'\n\t }\n\t\t}\n\n\t\treturn result;\n\t}", "function dataFormatter(formatData) {\n var formattedData = formatData.map(function(item){\n // Converts string dates from json into date objects for analysis and display\n item.createdAt = new Date(item.createdAt);\n // Converts price string into integer for analysis\n item.price = parseInt(item.price);\n return item;\n });\n\n return formattedData;\n}", "function processReleaseData(data) {\n let validData = data.filter(isValidData);\n return validData.map(release => ({ id: release.id, title: release.title }));\n}", "function parseData(arr) {\n var reformatted = {\n lat: [],\n lon: [],\n hover_text: []\n };\n\n // TODO: Create a loop that will parse through \"arr\" and push values to reformatted object.\n\n \n\n\n \n\n return reformatted;\n}", "function getWeather(){\n\treturn fetch(API_URL)\n\t.then(res => res.json())\n\t.then(data => {\n\t\tconst{\n\t\t\t//now i am destrustoring the data \n\t\t\tsol_keys,\n\t\t\tvalidity_checks,\n\t\t\t...solData\n\n\t\t} = data \n\t\tconsole.log(solData)\n\t\treturn Object.entries(solData).map(([sol, data]) => {\n\t\t\treturn {\n\t\t\t\t//getting the data from json file(The temp is already in celcious) \n\t\t\t\tsol: sol,\n\t\t\t\tmaxTemp: data.AT.mx,\n\t\t\t\tminTemp: data.AT.mn,\n\t\t\t\twindSpeed: data.HWS.av,\n\t\t\t\twindDirectionDegrees: data.WD.most_common.compass_degrees,\n\t\t\t\twindDirectionCardinal: data.WD.most_common.compass_point,\n\t\t\t\tdate: new Date(data.First_UTC)\n\t\t\t\t\n\n\t\t\t}\n\t\t\t\n\t\t})\n\t\t\n\t})\n}" ]
[ "0.6147708", "0.6057458", "0.59431505", "0.5918124", "0.5896365", "0.5892593", "0.57999253", "0.57798105", "0.57762975", "0.5774819", "0.5749179", "0.5745772", "0.57094795", "0.5703986", "0.5682805", "0.56591755", "0.56447613", "0.5608455", "0.56069785", "0.55969113", "0.55952704", "0.5594264", "0.5591342", "0.5585543", "0.55803514", "0.55752605", "0.5557366", "0.5545668", "0.5544786", "0.5528831", "0.55271614", "0.551658", "0.5515956", "0.54925025", "0.5491396", "0.54767036", "0.5464638", "0.54383194", "0.5434531", "0.543093", "0.54278487", "0.5426859", "0.5415022", "0.5413733", "0.540593", "0.5397626", "0.53852576", "0.53807855", "0.53806907", "0.5379192", "0.53733015", "0.5355455", "0.5354575", "0.53457737", "0.5344012", "0.5342698", "0.53401285", "0.5323651", "0.5323067", "0.5323014", "0.5321529", "0.53119963", "0.5311512", "0.53089994", "0.53081405", "0.5304897", "0.5295108", "0.5295097", "0.5292453", "0.5287059", "0.52857524", "0.5282117", "0.5280002", "0.5279755", "0.5279347", "0.52718514", "0.5268594", "0.5267327", "0.5267119", "0.5266431", "0.52609915", "0.5255031", "0.5254251", "0.52516484", "0.5244986", "0.524264", "0.52416486", "0.5237244", "0.5231095", "0.52276385", "0.52234924", "0.52163714", "0.5212248", "0.5201842", "0.5201307", "0.51949406", "0.5194208", "0.5191484", "0.51872504", "0.5184065", "0.5183604" ]
0.0
-1
Main Controller for the Parker Bank internation staff profile App.
function StaffController(StaffService, loggerFactory, $mdSidenav, $mdToast, $window) { var vm = this; vm.staffMembers = []; vm.appointment = {}; vm.selectedMember = null; vm.isFabOpen = false; vm.isSelected = false; vm.selectedMemberIndex = 0; vm.selectStaffMember = selectStaffMember; vm.toggleMemberList = toggleMemberList; vm.toggleSelection = toggleSelection; vm.openSideMenu = openSideMenu; vm.navigateTo = navigateTo; vm.desiredDate = new Date(); vm.currentTime = new Date().getTime(); activate(); /** * Initial execution function on page load. */ function activate() { return StaffService.getAllStaffMembers().then(function (data) { vm.staffMembers = data; vm.selectedMember = data[0]; loggerFactory.info('Staff Members: ', data); }, function (err) { loggerFactory.error('Get Staff Members: ', err); }); } /** * Select the current staff member. * @param memberId */ function selectStaffMember(member, index) { vm.isSelected = false; vm.selectedMemberIndex = index; vm.selectedMember = angular.isDefined(member) ? member : vm.staffMembers[0]; if (!$mdSidenav('left').isLockedOpen()) { $mdSidenav('left').close(); } } /** * Hide or Show the 'left' SideNav when small screen. */ function toggleMemberList() { $mdSidenav('left').toggle(); } function toggleSelection() { vm.isSelected = !vm.isSelected; if(vm.isSelected){ showFavoriteToast(); } } /** * Open the side menu when small screen. */ function openSideMenu($mdMenu, event) { $mdMenu.open(event); } /** * Open favorite selected tooltip. */ function showFavoriteToast() { $mdToast.show({ hideDelay: 3000, position: 'top right', controller: 'ToastController', controllerAs: 'toast', templateUrl: 'fav_toast_template.html', bindToController: true }); } /** * Go to requested URL.. * @param url */ function navigateTo(url){ $window.open(url, '_blank'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CommitteeHomeController(siteInfo, fellowResidents, $routeParams) {\n this.siteInfo = siteInfo;\n this.fellowResidents = fellowResidents;\n this.$routeParams = $routeParams;\n this.canManage = false;\n }", "function MainController() {\n\n }", "function userProfilePageController(){\r\n // data\r\n let data = {\r\n firstname: User.firstName,\r\n lastname: User.lastName,\r\n email: User.email,\r\n }\r\n // run App.loadPage\r\n App.loadPage('My Account', 'template-page-userProfile', data)\r\n}", "function UserController() {}", "function ProjectRoomInfoController(){}", "function HomeController($scope, //IScope,\n $state, $stateParams, authSvc, WebAPI) {\n // currently, simplest way to clear out the registration mode it to set it to false when you go to the dashboard.\n authSvc.registering = false;\n // recent trans.\n WebAPI.getRecentTransactions()\n .then(function (result) { $scope.recentTrans = result.data; });\n // accounts\n WebAPI.getAccounts()\n .then(function (result) { $scope.accounts = result.data; });\n }", "function main() {\n\n // Step 1: Load Your Model Data\n // The default code here will load the fixtures you have defined.\n // Comment out the preload line and add something to refresh from the server\n // when you are ready to pull data from your server.\n <%= class_name %>.server.preload(<%= class_name %>.FIXTURES) ;\n\n // TODO: refresh() any collections you have created to get their records.\n // ex: <%= class_name %>.contacts.refresh() ;\n\n // Step 2: Instantiate Your Views\n // The default code just activates all the views you have on the page. If\n // your app gets any level of complexity, you should just get the views you\n // need to show the app in the first place, to speed things up.\n SC.page.awake() ;\n\n // Step 3. Set the content property on your primary controller.\n // This will make your app come alive!\n\n // TODO: Set the content property on your primary controller\n // ex: <%= class_name %>.contactsController.set('content',<%= class_name %>.contacts);\n\n}", "function ZmProfileUserController(zmUserService) {\n var Ctrl = this;\n /** read personal details */\n Ctrl.readPersonalDetails = function readPersonalDetails(id){\n zmUserService.readPersonalDetails(id,function(data){\n Ctrl.about.contact[index] = data;\n });\n }\n\n /** read update details */\n Ctrl.updatePersonalDetails = function updatePersonalDetails (index,updatePersonalDetails){\n zmUserService.updatePersonalDetails(updatePersonalDetails,function(data){\n Ctrl.about.contact[index] = data;\n });\n }\n\n /** read company details */\n Ctrl.readCompanyDetails = function readCompanyDetails(id){\n zmUserService.readCompanyDetails(id,function(data){\n Ctrl.about.contact[index] = data;\n });\n }\n\n /** update company details */\n Ctrl.updateCompanyDetails = function updateCompanyDetails (index,updateCompanyDetails){\n zmUserService.updatePersonalDetails(updateCompanyDetails,function(data){\n Ctrl.contacts[index] = data;\n });\n }\n }", "function ViewController(){}//Extends Controller (at bottom of page).", "function userProfileController(){\n\n\t\t\t\tvar setup = $interval(function(){\n\n\t\t\t\t\tif(userService.getUserLoaded()){\n\n\t\t\t\t\t\t$interval.cancel(setup);\n\n\t\t\t\t\t\tif($stateParams.username === $rootScope.app.user.username){\n\t\t\t\t\t\t\t$scope.profile.meta.own = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$scope.profile.meta.role = $rootScope.app.user.role;\n\n\t\t\t\t\t\tvar string = '';\n\t\t\t\t\t\tif($rootScope.app.user.name){\n\t\t\t\t\t\t\tstring = $rootScope.app.user.name + '\\'s profile';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tstring = $rootScope.app.user.username + '\\'s profile';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$rootScope.app.stateTitle = string;\n\n\t\t\t\t\t\t$scope.profile.user = userService.getUser();\n\n\t\t\t\t\t\t$scope.profile.goals = {\n\t\t\t\t\t\t\tattainment: $scope.profile.user.attainmentGoal,\n\t\t\t\t\t\t\tattendance: $scope.profile.user.attendanceGoal\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif(!$scope.$$phase) $scope.$apply();\n\n\t\t\t\t\t\tinitGoalSliders();\n\n\t\t\t\t\t\tconsole.log($rootScope.app.user.enrolledModules);\n\t\t\t\t\t}\n\n\t\t\t\t}, 100);\n\t\t\t}", "function main($scope, mainFactory, loadMainController) {\n\t console.log(loadMainController);\n\t $scope.main = \"This is main page\";\n\t mainFactory.say();\n\t}", "function main() {\n ObjPortfolioController = new PortfolioController();\n ObjPortfolioController.ocultarElemento(\"formulario\");\n ObjPortfolioController.getTodosTable(divPortfolios);\n ObjPortfolioController.registrarEvento()\n}", "function userAccountController() {\n BaseController.call(this, [vm.table, vm.primaryId]);\n }", "function AppController() {\n}", "function Index(request, response){\r\n response.writeHead(200, commonHeaders); \r\n //get json from Treehouse\r\n var studentProfile = new Profile('honggao');\r\n \r\n //on \"end\"\r\n studentProfile.on(\"end\", function (profileJSON){\r\n //show profile\r\n //Store the values which we need\r\n var values = {\r\n avatarUrl: profileJSON.gravatar_url, \r\n username: profileJSON.profile_name,\r\n badges: profileJSON.badges.length,\r\n javascriptPoints: profileJSON.points.JavaScript\r\n }\r\n //Simple response\r\n renderer.view(\"index\", values, response);\r\n response.end();\r\n });\r\n \r\n}", "function ChooseHouseController($scope, //IScope,\n $state, $stateParams, authSvc, WebAPI) {\n // flag to signal if in registering mode or not.\n $scope.registering = authSvc.registering;\n // get house memebers\n WebAPI.getHouseholdMembers().then(function (r) {\n $scope.members = r.data;\n });\n // get user info\n WebAPI.getUser().then(function (r) {\n $scope.user = r.data;\n });\n // get invites\n function getInvites() {\n WebAPI.getInvites().then(function (r) {\n $scope.invites = r.data;\n });\n }\n getInvites();\n // if in registering mode, go to accounts next, instead of household.\n var destination = ($scope.registering) ? \"householdAccounts\" : \"household\";\n // make new home\n $scope.startHouse = function () {\n WebAPI.createNewHousehold().then(function (r) {\n $state.go(destination);\n });\n };\n // accept invite\n $scope.acceptInvite = function (inviteId) {\n WebAPI.acceptInvite(inviteId).then(function (r) {\n $state.go(\"household\");\n });\n };\n // decline invite\n $scope.declineInvite = function (inviteId) {\n WebAPI.declineInvite(inviteId).then(function (r) {\n getInvites();\n });\n };\n }", "function main() {\n tbody = $('tbody');\n template = $('.template');\n userService = new UserServiceClient();\n currentUserID = 0;\n $('.wbdv-create').click(createUser);\n $('.wbdv-update').click(updateUser);\n\n findAllUsers();\n\n }", "function runApp() {\n console.log('Please enter Manager information to begin building team');\n addManager();\n}", "function mainPage(req, res) {\n engine.checkAuth(req, res, function() {\n if (engine.currentQuiz) {\n engine.getUsers(function(err, users) {\n if (err) throw err;\n res.render('index', { user: req.user, engine: engine, users: users });\n });\n } else {\n res.render('index', { user: req.user, engine: engine });\n }\n });\n}", "function initController(){\n\n vm.writeReply= false;\n\n vm.workData ={};\n vm.workData = ProfileCourseService.GetWorkData();\n vm.userData = ProfileCourseService.GetProfileData();\n\n console.log(vm.workData);\n\n getComments();\n processComments();\n\n }", "function homeController($scope, data) {\n\t\t\t\t$scope.data = data;\n\t\t\t\tconsole.log(data);\n\t\t\t\tvar ownerInfo = notesService.getOwner(data);\n\t\t\t\townerInfo.then(function(response) {\n\n\t\t\t\t\t$scope.owner = response.data;\n\t\t\t\t\tconsole.log(response.data);\n\t\t\t\t})\n\t\t\t\t$scope.saveCollab = function(email, note) {\n\t\t\t\t\tvar resp = notesService.storeInfo(email, note);\n\n\t\t\t\t\tresp.then(function(response) {\n\t\t\t\t\t\t$mdDialog.hide();\n\t\t\t\t\t\tconsole.log(response.data);\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\t$scope.cancel = function() {\n\t\t\t\t\t$mdDialog.hide();\n\t\t\t\t}\n\n\t\t\t\t$scope.deleteCollabUser = function(email, data) {\n\t\t\t\t\tconsole.log(\"Response Date--->\" + email);\n\t\t\t\t\tnotesService.deleteCollaborator(email, data);\n\t\t\t\t}\n\t\t\t}", "function UserControllerfn() {\n \n \tvar uservm = this;\n \tuservm.user= {\n \t\t\t\"Name\" :\"bushan\",\n \t\t\t\"User-type\" : \"User\",\n \t\n \t\t \t}\n \t\t \t\n \t\n console.log('I am here at the User controller ');\n }", "function PublicController($rootScope, $scope, __Auth, appServices\n\t \t, appNotify, __DataStore, $state) {\n\n\t \tvar scope \t= this;\n\n\t \t__Auth.refresh(function(authInfo) {\n\t \t\tscope.auth_info = authInfo;\n\t \t});\n\n scope.unhandledError = function() {\n\n appNotify.error(__globals.getReactionMessage(19)); // Unhandled errors\n\n };\n\n\t \t$rootScope.$on('lw.events.state.change_start', function () {\n\t \t\tappServices.closeAllDialog(); \n });\n\n\t \t$rootScope.$on('lw.auth.event.reset', function (event, authInfo) {\n\t \t\tscope.auth_info = authInfo; \n });\n\n\t \t$rootScope.$on('lw.form.event.process.started', function (event, data) {\n\t \t\t$('button.lw-btn-process span').addClass('fa fa-spinner fa-spin');\n \t$('button.lw-btn-process').prop(\"disabled\", true);\n\n \t});\n\n\t \t$rootScope.$on('lw.form.event.process.finished', function (event, data) {\n\n \t$('button.lw-btn-process span').removeClass('fa fa-spinner fa-spin');\n \t$('button.lw-btn-process').prop(\"disabled\", false);\n\n \t} );\n\n $rootScope.$on('lw.form.event.fetch.started', __globals.showFormLoader );\n\n $rootScope.$on('lw.datastore.event.fetch.finished', __globals.hideFormLoader );\n\n $rootScope.$on('lw.form.event.process.error', scope.unhandledError );\n\n $rootScope.$on('lw.datastore.event.fetch.error', scope.unhandledError );\n\n $rootScope.$on('lw.update.cart.string', function (event, data) {\n\n \tscope.cart_string = data.cart_string;\n \tscope.status = data.status;\n \t\n \tif (scope.status == true) {\n\n\t $('.lw-shopping-cart-btn').fadeIn(\"highlight\", '#FFF',5000\n\t );\n \t}\n\n \t});\n\n \tscope.breadcrumbs = {};\n \tscope.store_info = window.store_info;\n \t$rootScope.isPublicApp = window.__appImmutables.publicApp;\n\n\n scope.formatAmount = function(amount, currencySymbol, currency, decimalValue) {\n \n return __globals.priceFormat(amount, currencySymbol, currency);\n\n };\n\n /**\n * set page title \n *\n * @param title\n *\n * @return string\n *---------------------------------------------------------------- */\n\n \tscope.setDocumentPageTitle = function(title) {\n\n\t var newTitle;\n\n\t if (_.isEmpty(scope.store_info.value)) {\n\n\t newTitle = title;\n\n\t } else {\n\t newTitle = scope.store_info.value+' - '+title;\n\t }\n\n\t angular.element(document).prop('title', newTitle);\n \n \t};\n\n\t // define breadcrumb array\n \tscope.breadcrumbs.items = [{\n \titem : 'Home',\n \turl : $state.href('display_products')\n }];\n\n \tscope.store_info = window.store_info;\n\n \t// BreadCrumb update event \n\t $rootScope.$on('lw.breadcrumb.update.event', function (event, breadcrumbsArrg) {\n\n\t \t// reset on state chage breadcrumb array\n \t\t$rootScope.$on('$stateChangeStart', \n\t\t\tfunction(event, toState, toParams, fromState, fromParams){ \n\t\t\t\t\n \t\t\tscope.breadcrumbs.items = [{\n\t\t \titem : 'Home',\n\t\t \turl : $state.href('display_products')\n\t\t }];\n\t\t\t});\n\t \t\n\t \t// push multilevel breadcrumb\n \t\tif (!_.isEmpty(breadcrumbsArrg[0].items)) {\n \t\t\t_.forEach(breadcrumbsArrg[0].items, function(item, key) {\n\t\t\t \t scope.breadcrumbs.items.push(item);\t\n\t\t \t});\t\n \t\t}\n\n \t\tscope.breadcrumbs.last_item = breadcrumbsArrg[0]['last_item'];\n\t });\n\n\n $rootScope.$on('lw.current.route.name', function(event, result){ \n scope.routeStatus = result.routeStatus;\n });\n\n /**\n * open cart model\n *\n * @param object param1 type \n *\n * @return void\n *---------------------------------------------------------------- */\n \n scope.openCartDialog = function(status) \n { \t\n \t$rootScope.$broadcast('lw.isCart.dialog', { dialog: status });\n\n \tif (status == true) {\n\n \t\t$('html, body').animate({\n\t\t\t scrollTop: $(\"#elementtoScrollToID\").offset().top\n\t\t\t }, 200);\n\n \t} else {\n\n appServices.showDialog(scope,\n {\n templateUrl : __globals.getTemplateURL(\n 'shoppingCart.cart-view'\n )\n },\n function(promiseObj) {\n \t\t\n });\n\n $rootScope.$on('ngDialog.opened', function (e, $dialog) {\n \n if ($('div.lw-shopping-cart-dialog-content').length) {\n $('div.ngdialog-content').addClass('lw-shopping-cart-dialog');\n }\n\n });\n \t\n \t}\n };\n\n\n /**\n\t * get cart btn string\n\t *\n\t * @return void\n\t *------------------------------------------------------------------------ */\n\t scope.loadCartStatus = false;\n\n\t scope.getCartString = function() {\n\n\t // get data using angular $http.get() method\n\t __DataStore.fetch('cart.update.cart.string')\n\t \t\t.success(function(responseData) {\n\n\t\t\t\tappServices.processResponse(responseData, null,\n function(reactionCode) {\n\n\t\t \tscope.cart_string \t = responseData.data.cartString;\n\t\t \tscope.loadPage \t \t = responseData.reaction;\n\t\t \tscope.loadCartStatus = true;\n\t\t \tif (scope.status === true) {\n\n\t\t\t\t $('.shopping-cart-btn').effect(\n\t\t\t\t \"highlight\", \n\t\t\t\t '#FFF',\n\t\t\t\t 5000\n\t\t\t\t );\n\t\t\t \t}\n }\n ); \n\t \n \t });\n\n\t };\n\t scope.getCartString();\n\n /**\n * Check if user logged in\n *\n * @return boolean \n *---------------------------------------------------------------- */\n \n scope.isLoggedIn = function() {\n return scope.auth_info.authorized; // is looged in\n };\n\n /**\n * Check if user logged in\n *\n * @return boolean \n *---------------------------------------------------------------- */\n \n scope.isAdmin = function() {\n return scope.isLoggedIn() && scope.auth_info.designation === 1; //check if is admin\n };\n\n /**\n * Get the logged in user full name\n *\n * @return string \n *---------------------------------------------------------------- */\n \n scope.getUserFullName = function() {\n\n if (scope.isLoggedIn()) {\n return scope.auth_info.profile.first_name+' '+scope.auth_info.profile.last_name;\n }\n\n };\n \n }", "function WorkoutController(workout, users, bodyweight, rep, cardio, clientProgress, $scope, $rootScope, $state) {\n\n\t\t// Require JWT for API call by authorization\t\t\n\t\tif ($rootScope.authenticated) {\n\n\t\t\t//console.log(\"rootScope\");\n\t\t\t//console.log($rootScope);\n\t\t\t//console.log($rootScope.currentUser.id);\n\t\t\t//console.log(\"state\")\n\t\t\t//console.log($state);\n\n\t\t\tvar vm = this;\n\n\t\t\tvm.exercises = [];\n\n\t\t\tvm.subscribers = [];\n\n\t\t\tvm.exerciseBodyweight = [];\n\n\t\t\tvm.reps = [];\n\n\t\t\tvm.exerciseCardio = [];\n\n\t\t\t// Arrays for building workout program\n\t\t\t// Select exercises for workout program as an array of JSON objects\n\t\t\tvm.select = [];\n\n\t\t\tvm.workoutPlan = [];\n\n\t\t\tvm.workObject = [];\n\n\t\t\tvm.calendar = [ {\"day\":\"Monday\"},\n\t\t\t\t\t\t\t{\"day\":\"Tuesday\"},\n\t\t\t\t\t\t\t{\"day\":\"Wednesday\"},\n\t\t\t\t\t\t\t{\"day\":\"Thursday\"},\n\t\t\t\t\t\t\t{\"day\":\"Friday\"},\n\t\t\t\t\t\t\t{\"day\":\"Saturday\"},\n\t\t\t\t\t\t\t{\"day\":\"Sunday\"} ];\n\n\t\t\tvar clientID = $rootScope.currentUser.id;\n\n\t\t\tvm.client = [];\n\n\t\t\tvm.clientProgram = [];\n\n\t\t\t//callstack for JSON arrays from API as $resoure objects\n\t\t\tgetExercises();\n\n\t\t\tgetUsers();\n\n\t\t\tgetBodyweight();\n\n\t\t\tgetCardio();\n\n\t\t\tgetReps();\n\n\t\t\tgetWorkouts();\n\n\t\t\tgetClientWorkout();\t\t\n\t\t\t\n\t\t\t\n\t\t\t//return JSON object from exercise API, array is result.data\n\t\t\tfunction getExercises() {\n\t\t\t\tworkout.getExercises().then(function(result) {\n\t\t\t\t\t//$resource object returned to controller \n\t\t\t\t\tvm.exercises = result;\n\t\t\t\t\tconsole.log(vm.exercises);\n\t\t\t\t\t}, function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tvm.deleteExercise = function(factory, id) {\n\n\t\t\t\tif(factory == 'workout') {\n\t\t\t\t\tworkout.deleteExercise(id).then(function(success) {\n\t\t\t\t\t\tgetExercises();\n\t\t\t\t\t\tconsole.log(success)\n\t\t\t\t\t}, function(error) {\n\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t});\n\t\t\t\t} else if(factory == 'bodyweight') {\n\t\t\t\t\tbodyweight.deleteExercise(id).then(function(success) {\n\t\t\t\t\t\tgetBodyweight();\n\t\t\t\t\t\tconsole.log(success);\n\t\t\t\t\t}, function(error) {\n\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t});\n\t\t\t\t} else if(factory == 'cardio') {\n\t\t\t\t\tcardio.deleteExercise(id).then(function(success) {\n\t\t\t\t\t\tgetCardio();\n\t\t\t\t\t\tconsole.log(success);\n\t\t\t\t\t}, function(error) {\n\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\trep.deleteExercise(id).then(function(success) {\n\t\t\t\t\t\tgetReps();\n\t\t\t\t\t\tconsole.log(success);\n\t\t\t\t\t}, function(errror) {\n\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\n\t\t\tvm.addExercise = function(factory) {\n\n\t\t\t\tif(factory == 'workout') {\n\t\t\t\t\tworkout.addExercise({\n\t\t\t\t\t\t\"body\":vm.addBody,\n\t\t\t\t\t\t\"exercise\":vm.newExercise\n\t\t\t\t\t}).then(function(success) {\n\t\t\t\t\t\tgetExercises();\n\t\t\t\t\t}, function(error) {\n\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t});\n\n\t\t\t\t}else if(factory == 'bodyweight') {\n\t\t\t\t\t\tbodyweight.addExercise({\n\t\t\t\t\t\t\t\"body\":vm.addBody,\n\t\t\t\t\t\t\t\"exercise\":vm.newExercise\n\t\t\t\t\t\t}).then(function(success) {\n\t\t\t\t\t\t\tgetBodyweight(); \n\t\t\t\t\t}, function(error) {\n\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t});\n\n\t\t\t\t}else if(factory == 'cardio') {\n\t\t\t\t\t\tcardio.addExercise({\n\t\t\t\t\t\t\t\"type\":vm.addType,\n\t\t\t\t\t\t\t\"exercise\":vm.newExercise\n\t\t\t\t\t\t}).then(function(success) {\n\t\t\t\t\t\t\tgetCardio();\n\t\t\t\t\t}, function(error) {\n\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t});\n\t\t\t\t}else {\n\t\t\t\t\t\trep.addExercise({\n\t\t\t\t\t\t\t\"range\":vm.addRep,\n\t\t\t\t\t\t\t\"time_frame\":vm.addTime,\n\t\t\t\t\t\t\t\"rest_time\":vm.addRest\n\t\t\t\t\t\t}).then(function(success) {\n\t\t\t\t\t\t\tgetReps();\n\t\t\t\t\t}, function(error) {\n\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} \n\n\t\t\t//update $resource object and send to API\n\t\t\t/// used for all Controller updates\n\t\t\tvm.update = function(factory, data) {\n\t\t\t\tif(factory == 'reps') {\n\t\t\t\t\trep.update({\n\t\t\t\t\t\t\"id\":data.id,\n\t\t\t\t\t\t\"range\":data.updateBody,\n\t\t\t\t\t\t\"time_frame\":data.updateExercise,\n\t\t\t\t\t\t\"rest_time\":data.updateRep\n\t\t\t\t\t}).then(function(success){\n\t\t\t\t\t\tconsole.log(success);\n\t\t\t\t\t\tgetReps();\n\t\t\t\t\t}, function(error) {\n\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t});\n\t\t\t\t}else if(factory == 'user') {\n\t\t\t\t\tvar user = {\n\t\t\t\t\t\t\"id\":data.id,\n\t\t\t\t\t\t\"name\":data.name,\n\t\t\t\t\t\t\"email\":data.email,\n\t\t\t\t\t\t\"role\":data.role\n\t\t\t\t\t}\n\t\t\t\t\tusers.update(user).then(function(success) {\n\t\t\t\t\t\tconsole.log(success);\n\t\t\t\t\t\tgetUsers();\n\t\t\t\t\t}, function(error) {\n\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t});\n\t\t\t\t}else if(factory == 'workout') {\n\t\t\t\t\tworkout.update({\n\t\t\t\t\t\t\"id\":data.id,\n\t\t\t\t\t\t\"body\":data.updateBody,\n\t\t\t\t\t\t\"exercise\":data.updateExercise\n\t\t\t\t\t}).then(function(success){\n\t\t\t\t\t\tconsole.log(success);\n\t\t\t\t\t\tgetExercises();\n\t\t\t\t\t}, function(error) {\n\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t});\n\t\t\t\t}else if (factory == 'bodyweight') {\n\t\t\t\t\tbodyweight.update({\n\t\t\t\t\t\t\"id\":data.id,\n\t\t\t\t\t\t\"body\":data.updateBody,\n\t\t\t\t\t\t\"exercise\":data.updateExercise\n\t\t\t\t\t}).then(function(success) {\n\t\t\t\t\t\tconsole.log(success);\n\t\t\t\t\t\tgetBodyweight();\n\t\t\t\t\t}, function(error) {\n\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t});\n\t\t\t\t}else {\n\t\t\t\t\tcardio.update({\n\t\t\t\t\t\t\"id\":data.id,\n\t\t\t\t\t\t\"type\":data.updateBody,\n\t\t\t\t\t\t\"exercise\":data.updateExercise\n\t\t\t\t\t}).then(function(success) {\n\t\t\t\t\t\tconsole.log(success);\n\t\t\t\t\t\tgetCardio();\n\t\t\t\t\t}, function(error) {\n\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//return JSON object from user API and convert to an array\n\t\t\tfunction getUsers() {\n\t\t\t\tusers.getUser().then(function(result) {\n\t\t\t\t\tvm.subscribers = result;\n\t\t\t\t\tconsole.log(vm.subscribers);\n\t\t\t\t}, function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t//log New User\n\t\t\tvm.logNewUser = function() {\n\n\t\t\t\tusers.saveUser({\n\t\t\t\t\t\"name\":vm.full_name,\n\t\t\t\t\t\"email\":vm.email,\n\t\t\t\t\t\"password\":vm.password,\n\t\t\t\t\t\"subscriber\": 1\n\t\t\t\t}).then(function(success) {\n\t\t\t\t\t//refresh user list\n\t\t\t\t\tgetUsers();\n\t\t\t\t\tconsole.log(success);\n\t\t\t\t}, function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\n\t\t\t\tgetUsers();\n\n\t\t\t\t//Clear input fields\n\t\t\t\tvm.full_name = \"\";\n\t\t\t\tvm.email = \"\";\n\t\t\t\tvm.password = \"\";\n\t\t\t}\n\n\t\t\t//delete user\n\t\t\tvm.deleteUser = function(subscribers) {\n\n\t\t\t\tvar id = subscribers.id;\n\t\t\t\tusers.deleteUser(id).then(function(success) {\n\t\t\t\t\tgetUsers();\n\t\t\t\t\tconsole.log(success);\n\t\t\t\t}, function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tvm.selectExercise = function(data, item, date) {\n\n\t\t\t\tif(item == false) {\n\t\t\t\t\talert('Select Reps Before Adding to Program');\n\t\t\t\t}\n\t\t\t\t//data is an object, not any array for the array prototype\n\t\t\t\t//data structure is an array of $resource objects\n\n\t\t\t\t//save objects to array as $resource objects \n\t\t\t\t//selected from ng-click\n\t\t\t\tvar mergedObject = angular.extend(data, item, date);\n\n\t\t\t\t// push is an array operation\n\t\t\t\tvm.select.push(mergedObject);\n\n\t\t\t\t//clear selected item on next select\n\t\t\t\t\n\t\t\t\t//console.log(\"vm.select\");\n\t\t\t\t//console.log(vm.select);\n\t\t\t}\n\n\n\t\t\t//log New Workout\n\t\t\t// add function to save to a specific user\n\t\t\tvm.logWorkout = function() {\n\t\t\t\t// convert array of objects to JSON string\n\t\t\t\tvar workoutJSONstring = JSON.stringify(vm.select);\n\t\t\t\t//console.log(\"JSON\");\n\t\t\t\t//console.log(workoutJSONstring);\n\t\t\t\tworkout.saveWorkout({\n\t\t\t\t\t\"workout\":workoutJSONstring,\n\t\t\t\t\t\"name\":vm.programName,\n\t\t\t\t\t\"goal\":vm.workoutType,\n\t\t\t\t\t\"weeks\":vm.programVariation,\n\t\t\t\t\t\"frequency\":vm.programLength\n\t\t\t\t}).then(function(success) {\n\t\t\t\t\tconsole.log(success);\n\t\t\t\t}, function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\n\t\t\t\tgetWorkouts();\n\t\t\t\t// clear workout data after POST to API\n\t\t\t\tvm.select = \"\";\n\t\t\t\tvm.programName = \"\";\n\t\t\t\tvm.workoutType = \"\";\n\t\t\t\tvm.programVariation = \"\";\n\t\t\t\tvm.programLength = \"\";\n\t\t\t}\n\n\t\t\t// update user with workout and send to API\n\t\t\tvm.assignWorkout = function(subscriber) {\n\t\t\t\tvar workoutProgram = vm.assignProgram.id;\n\t\t\t\tvar client = subscriber.id;\n\t\t\t\tusers.assignWorkout({\n\t\t\t\t\t\"id\":client,\n\t\t\t\t\t\"user_workout\":workoutProgram\n\t\t\t\t}).then(function(success) {\n\t\t\t\t\tconsole.log(success);\n\t\t\t\t}, function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// return workout plans from API\n\t\t\tfunction getWorkouts() {\n\t\t\t\tworkout.getWorkouts().then(function(result) {\n\t\t\t\t\t// returned as $resource with workout property as a string\n\t\t\t\t\tvm.workoutPlan = result.data;\n\t\t\t\t\t// list of JSON parsed workouts\n\t\t\t\t\tvm.workObject = vm.workoutPlan.listWorkouts();\n\n\t\t\t\t\t//console.log(\"vm.workoutPlan\");\n\t\t\t\t\t//console.log(vm.workoutPlan);\n\t\t\t\t\t//console.log(\"vm.workObject\");\n\t\t\t\t\t//console.log(vm.workObject);\n\n\t\t\t\t}, function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tfunction getClientWorkout() {\n\t\t\t\tusers.getClient(clientID).then(function(result) {\n\t\t\t\t\tconsole.log(result);\n\t\t\t\t\tvm.client = result.data;\n\n\t\t\t\t\t//foreign key on the client side\n\t\t\t\t\tvar workout = result.data.user_workout;\n\t\t\t\t\tconsole.log(\"workout\");\n\t\t\t\t\tconsole.log(workout);\n\n\t\t\t\t\t//call Foreign key on frontend then backend (optimize)\n\t\t\t\t\t// setup getWorkouts() with null parameter for admin or \n\t\t\t\t\t// user without program\n\n\t\t\t\t\t//call if result.data.user_workout is not undefined\n\t\t\t\t\tgetWorkout(workout);\n\t\t\t\t}, function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// save client progress and send to API\n\t\t\tvm.clientProgress = function(exercises) {\n\t\t\t\n\t\t\t\t\tvar i;\n\t\t\t\t\tvar tmpProgress = [];\n\t\t\t\t\tvar output = [];\n\t\t\t\t\tvar data = vm.progress;\n\n\t\t\t\t\t// Time function for progress save\n\t\t\t\t\tvm.time = moment().format('LL');\n\t\t\t\t\t//console.log(\"data\");\n\t\t\t\t\t//console.log(data);\n\n\t\t\t\t\tangular.forEach(exercises, function(result) {\n\t\t\t\t\t\ttmpProgress.push(result.exercise);\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t// Check for exercise workout array key to correspond\n\t\t\t\t\t// with object property key for specific workout\n\t\t\t\t\t// Save to new Array of objects\n\t\t\t\t\tangular.forEach(tmpProgress, function(result, key) {\n\t\t\t\t\t\tangular.forEach(data, function(object, property) {\n\t\t\t\t\t\t\tif(key == property) {\n\t\t\t\t\t\t\t\toutput.push({exercise:result, weight:object});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\n\t\t\t\t\t\n\t\t\t\t\t//convert vm.progressExercise to array\n\t\t\t\t\tconsole.log(\"output array\");\n\t\t\t\t\tconsole.log(output);\n\n\t\t\t\t\tvar outputJSON = JSON.stringify(output);\n\n\t\t\t\t\t//console.log(tmpProgress);\n\t\t\t\t\t//console.log(\"tmpProgress with weight\");\n\t\t\t\t\t//console.log(tmpProgress);\n\t\t\t\tclientProgress.saveProgress({\n\t\t\t\t\t\"date\":vm.time,\n\t\t\t\t\t\"client_id\":$rootScope.currentUser.id,\n\t\t\t\t\t\"workout_progress\":outputJSON\n\t\t\t\t}).then(function(success) {\n\t\t\t\t\tconsole.log(success);\n\t\t\t\t}, function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t}); \n\n\t\t\t\t//clear input fields\n\t\t\t\tvm.progress = '';\n\t\t\t} \n\n\t\t\t// called from getClientWorkout foreign key to API\n\t\t\tfunction getWorkout(id) {\n\t\t\t\tworkout.clientWorkout(id).then(function(result) {\n\t\t\t\t\tvm.clientProgram = result.data;\n\t\t\t\t\tconsole.log(vm.clientProgram);\n\t\t\t\t\tvar JSONstring = JSON.parse(result.data.workout);\n\t\t\t\t\tconsole.log('JSON string');\n\t\t\t\t\tconsole.log(JSONstring);\n\t\t\t\t\tvm.clientProgram.program = JSONstring;\n\t\t\t\t\tconsole.log(vm.clientProgram);\n\t\t\t\t}, function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t//return JSON object from Bodyweight API and convert to array\n\t\t\tfunction getBodyweight() {\n\t\t\t\tbodyweight.getBodyweight().then(function(result) {\n\t\t\t\t\tvm.exerciseBodyweight = result;\n\t\t\t\t\tconsole.log(vm.exerciseBodyweight);\n\t\t\t\t}, function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t//return JSON object from Cardios API and convert to array\n\t\t\tfunction getCardio() {\n\t\t\t\tcardio.getCardio().then(function(result) {\n\t\t\t\t\tvm.exerciseCardio = result;\n\t\t\t\t\tconsole.log(vm.exerciseCardio);\n\t\t\t\t}, function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t//return JSON object from Reps API using async promise\n\t\t\tfunction getReps() {\n\t\t\t\trep.getReps().then(function(result) {\n\t\t\t\t\tvm.reps = result;\n\t\t\t\t\tconsole.log(vm.reps);\n\t\t\t\t}, function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\t// Prevent $resource call without JWT authentication \n\t\telse {\n\t\t\tconsole.log('authentication error');\n\t\t\t}\n\t\t}", "function createAccountController($scope, $location, SMAAlertFactory, ProjectConstants, DataService) {\n\n $scope.AppC.ShowHeader = false;\n $scope.AppC.ShowFooter = false;\n $scope.AppC.ActivePageName = \"\";\n\n //var vid = document.getElementsByClassName(\"bgvid\")[0];\n //vid.muted = true;\n\n /*jshint validthis:true */\n var createA = this;\n\n //createA.UserName = \"[email protected]\";\n //createA.Password = \"Password1\";\n //createA.Name = \"FirstName MI LastName\";\n //createA.SchoolCorporation = \"Adams Central\";\n //createA.County = \"Adams\";\n //createA.State = \"Indiana\";\n\n createA.UserName = \"\";\n createA.Password = \"\";\n createA.Name = \"\";\n createA.SchoolCorporation = \"\";\n createA.County = \"\";\n createA.State = \"AL\";\n createA.PhoneNumber = \"\";//M0027\n\n createA.CheckPassword = checkPassword;\n createA.PasswordValidation = function () { };\n createA.PasswordValidation.ShowMessages = false;\n createA.PasswordValidation.ContainsUppercase = false;\n createA.PasswordValidation.ContainsLowercase = false;\n createA.PasswordValidation.ContainsNumber = false;\n createA.PasswordValidation.ContainsSymbol = false;\n createA.PasswordValidation.ContainsLength = false;\n createA.PasswordValidation.ContainsWhitespace = false;\n\n //createA.ShowData = showData;\n createA.CreateAccount = checkValidation;\n\n createA.userClickedButton = null;\n\n return createA;\n\n function checkValidation() {\n var phonenumberpattern = /\\(?([0-9]{3})\\)?([ .-]?)([0-9]{3})\\2([0-9]{4})/;\n if (ProjectConstants.App.IsDownForMaintenance === true) { // quick check to see if the app is offline\n SMAAlertFactory.CreateInfoAlert(\"Oops!\", \"iAspire is currently down for maintenance.\\n\" + \"Please try again later.\");\n } else {\n if (!createA.UserName || createA.UserName === \"\") {\n SMAAlertFactory.CreateInfoAlert(\"Error\", \"Invalid email\");\n } else if (!createA.Password || createA.Password === \"\") {\n SMAAlertFactory.CreateInfoAlert(\"Error\", \"Invalid Password.\\nMinimum requirements:\\nlength 8 - 12 characters\\n 1 small character\\n1 capital character\\n1 number\");\n } else if (!createA.Name || createA.Name === \"\") {\n SMAAlertFactory.CreateInfoAlert(\"Error\", \"Please enter a name\");\n } else if (!createA.SchoolCorporation || createA.SchoolCorporation === \"\") {\n SMAAlertFactory.CreateInfoAlert(\"Error\", \"Please enter a school corporation/Organization\");\n }\n //else if (createA.PhoneNumber != \"\" && phonenumberpattern.test(createA.PhoneNumber) == false) {\n // SMAAlertFactory.CreateInfoAlert(\"Error\", \"Please enter a valid phone number\");\n //}\n //else if (!createA.County || createA.County === \"\") {\n // SMAAlertFactory.CreateInfoAlert(\"Error\", \"Please Enter a county\");\n //}\n else if (!createA.State || createA.State === \"\") {\n SMAAlertFactory.CreateInfoAlert(\"Error\", \"Please Enter a state\");\n } else {\n createA.userClickedButton = true;\n //var obj = {\n // UserName: createA.UserName,\n // Password: createA.Password,\n // Name: createA.Name,\n // SchoolCorporation: createA.SchoolCorporation,\n // County: createA.County,\n // State: createA.State,\n //}\n var obj = {\n UserName: createA.UserName,\n Password: createA.Password,\n Name: createA.Name,\n SchoolCorporation: createA.SchoolCorporation,\n State: '',//M0027\n PhoneNumber: createA.PhoneNumber \n };\n DataService.createAccount(obj)\n .success(function (data, status, headers, config) {\n $scope.AppC.userLogin = createA.UserName;\n $scope.AppC.userPassword = createA.Password;\n window.location.hash = \"#/login\";\n })\n .error(function (data, status, headers, config) {\n console.error(data);\n if (status === 409) {\n SMAAlertFactory.CreateInfoAlert(\"Oops!\", \"Email is already is use.\");\n } else {\n SMAAlertFactory.CreateInfoAlert(\"Oops!\", \"Something has gone wrong.\\n\" + \"Please try again later.\");\n }\n createA.userClickedButton = false;\n });\n }\n }\n\n }\n\n function checkPassword(event) {\n\n //var containsUppercase = /(?=.*[A-Z]).*$/;\n //var containsLowercase = /(?=.*[a-z]).*$/;\n //var containsNumber = /(?=.*[0-9]).*$/;\n //var containsSymbol = /(?=.*[!@#$%^*()_+}{\":;'?/<.>,]).*$/;\n //var containsLength = /(^.{8,20}$)/;\n var containsLength = /(?=^.{6,}).*$/;\n var containsWhitespace = /(?=.*[\\s]).*$/;\n\n if (createA.Password) {\n // check for an uppercase letter\n //if (containsUppercase.test(createA.Password) === true) {\n // createA.PasswordValidation.ContainsUppercase = true;\n //} else {\n // createA.PasswordValidation.ContainsUppercase = false;\n //}\n //// check for a lowercase letter\n //if (containsLowercase.test(createA.Password) === true) {\n // createA.PasswordValidation.ContainsLowercase = true;\n //} else {\n // createA.PasswordValidation.ContainsLowercase = false;\n //}\n //// check for a number\n //if (containsNumber.test(createA.Password) === true) {\n // createA.PasswordValidation.ContainsNumber = true;\n //} else {\n // createA.PasswordValidation.ContainsNumber = false;\n //}\n //// check for a symbol\n //if (containsSymbol.test(createA.Password) === true) {\n // createA.PasswordValidation.ContainsSymbol = true;\n //} else {\n // createA.PasswordValidation.ContainsSymbol = false;\n //}\n // check for length\n if (containsLength.test(createA.Password) === true) {\n createA.PasswordValidation.ContainsLength = true;\n } else {\n createA.PasswordValidation.ContainsLength = false;\n }\n // check for whitespace\n if (containsWhitespace.test(createA.Password) === true) {\n createA.PasswordValidation.ContainsWhitespace = true;\n } else {\n createA.PasswordValidation.ContainsWhitespace = false;\n }\n // check all\n //if (createA.PasswordValidation.ContainsUppercase === true &&\n // createA.PasswordValidation.ContainsLowercase === true &&\n // createA.PasswordValidation.ContainsNumber === true &&\n // createA.PasswordValidation.ContainsSymbol === true &&\n // createA.PasswordValidation.ContainsLength === true &&\n // createA.PasswordValidation.ContainsWhitespace === false) {\n // setTimeout(function () {\n // createA.PasswordValidation.ShowMessages = false;\n // $scope.$apply();\n // }, 2000);\n //} else {\n // createA.PasswordValidation.ShowMessages = true;\n //}\n if (createA.PasswordValidation.ContainsLength === true &&\n createA.PasswordValidation.ContainsWhitespace === false) {\n setTimeout(function () {\n // double check\n if (createA.PasswordValidation.ContainsLength === true &&\n createA.PasswordValidation.ContainsWhitespace === false) {\n createA.PasswordValidation.ShowMessages = false;\n $scope.$apply();\n }\n }, 2000);\n } else {\n createA.PasswordValidation.ShowMessages = true;\n }\n } else {\n createA.PasswordValidation.ShowMessages = false;\n }\n }\n\n //function showData() {\n // console.log(createA.UserName);\n // if (createA.UserName && createA.UserName.$valid) {\n // console.log(createA.UserName.$valid);\n // }\n // if (createA.UserName && createA.UserName.$error) {\n // console.log(createA.UserName.$error);\n // }\n // console.log(createA.Password);\n // if (createA.Password &&createA.Password.$valid) {\n // console.log(createA.Password.$valid);\n // }\n // if (createA.Password &&createA.Password.$error) {\n // console.log(createA.Password.$error);\n // }\n // console.log(createA);\n //}\n }", "function OnRun($rootScope, $location, AppSettings, HelloService, AuthService, MailService, $http, SweetAlert) {\n var root = {};\n root.hello = HelloService;\n \n /**\n * UI related root variables\n *\n */\n root.globalSearchTerm = '';\n root.topNavItems = [\n {\n 'title': 'Home',\n 'link' : '/',\n 'icon' : 'fa fa-home'\n },\n {\n 'title': 'Wall',\n 'link' : '/wall',\n 'icon' : 'fa fa-list'\n },\n {\n 'title': 'Report',\n 'link' : '/report',\n 'icon' : 'fa fa-bar-chart'\n } \n ];\n\n root.fullscreenDisabled = true;\n root.sidebarEnabled = false;\n\n $rootScope.$on('cfpLoadingBar:started', function() {\n angular.element('#loklak-nav-logo').hide();\n });\n\n $rootScope.$on('cfpLoadingBar:completed', function() {\n angular.element('#loklak-nav-logo').show();\n });\n\n\n // check if authenticated\n $rootScope.$on(\"$stateChangeStart\", function(event, toState, toParams, fromState, fromParams){\n if (toState.authenticate && !AuthService.isLoggedIn()){\n // User isn’t authenticated\n $state.transitionTo(\"/\");\n event.preventDefault(); \n }\n }\n );\n\n // change page title based on state\n $rootScope.$on('$stateChangeSuccess', function(event, toState) {\n var pageTitle = 'Loklak ';\n if ( toState.title ) {\n pageTitle += toState.title;\n $rootScope.root.currentView = toState.title;\n }\n $rootScope.root.pageTitle = pageTitle;\n });\n\n $rootScope.root = root;\n $rootScope.root.loginForm = true;\n\n $http.get('/api/currentuser').success(function(data){\n if(data._id){\n $rootScope.root.currentUser = data;\n $rootScope.root.isLoggedIn = true;\n } else {\n $rootScope.root.currentUser = {};\n $rootScope.root.isLoggedIn = false;\n }\n });\n\n $rootScope.root.user = {\n email : \"\",\n password : \"\"\n };\n \n $rootScope.root.login = function () {\n $http.post('/api/login', {\n email: $rootScope.root.user.email,\n password: $rootScope.root.user.password\n }).success(function(data) {\n console.log(data);\n $rootScope.root.isLoggedIn = true;\n $rootScope.root.currentUser = data;\n $location.path('/profile');\n }).error(function() {\n SweetAlert.alert(\"Please try again\", {title: \"Error Logging In!\"});\n });\n\n };\n\n $rootScope.root.register = function(){\n $http.post('/api/register', {\n email: $rootScope.root.user.email,\n password: $rootScope.root.user.password\n }).success(function(data) {\n if(!data.message){\n $rootScope.root.isLoggedIn = true;\n $rootScope.root.currentUser = data;\n SweetAlert.swal(\"Good job!\", \"Registered\", \"success\");\n } else {\n $rootScope.root.isLoggedIn = false;\n $rootScope.root.currentUser = null;\n }\n }).error(function() {\n SweetAlert.alert(\"Please try again\", {title: \"Error Signing Up!\"});\n });\n\n };\n\n $rootScope.root.onLogout = function () {\n\n $http.get('/api/logout')\n .success(function() {\n $location.path('/');\n $rootScope.root.isLoggedIn = false;\n $rootScope.root.currentUser = {};\n })\n .error(function() {\n SweetAlert.alert(\"Please try again\", {title: \"Logout Failed!\"});\n });\n };\n\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 }", "onLoggedIn() {\r\n this.controller = new MainController(this.login.pryvUserConnection, \"event-view\", \"category-events\");\r\n this.controller.init();\r\n }", "function displayMainPage() {\n const userNameInput = getUserInputID()\n if (!userNameInput) {\n _domUpdates_js__WEBPACK_IMPORTED_MODULE_4__.default.renderLoginFailedMsg()\n } else {\n getFetchedData(userNameInput)\n getTrips(userNameInput, tripsData, date)\n verifyLoginInput(userNameInput)\n }\n}", "function initController(){\n\n vm.userData = ProfileCourseService.GetProfileData();\n\n console.log(vm.userData);\n\n\n if (vm.userData.TipoRepositorioArchivos == \"0\"){\n\n vm.userData.TipoRepositorioArchivos = \"Google Drive\"\n }\n if (vm.userData.TipoRepositorioArchivos == \"1\"){\n\n vm.userData.TipoRepositorioArchivos = \"Dropbox\"\n }\n\n vm.courseAverageWidth = {'width': vm.userData.PromedioCursos+'%'}; \n vm.projectAverageWidth = {'width': vm.userData.PromedioProyectos+'%'}; \n\n vm.photo = \"data:image/jpg;base64,\" + $localStorage.Foto;\n\n vm.toggleEnable;\n if (vm.userData.Active == \"0\"){\n vm.toggleEnable = false;\n }\n if(vm.userData.Active == \"1\"){\n vm.toggleEnable = true;\n }\n loadStats();\n }", "function MainController(ConfigData, Utils, keymap, focusController, HomePage, $scope, ContextStack, vlayers, fstates){\n\t\tvar TAG = \"Controller - MainController\",\n\t\t\tisSmartTVMode = ConfigData.isSmartTVMode(),\n\t\t\t_THIS = this;\n\n var homeData = new HomePage();\n\n //Default layer show splash screen\n $scope.currentLayer = vlayers.LOADING;\n $scope.title = \"Home Page\";\n $scope.vlayers = vlayers;\n $scope.liveEvents = [];\n\n //Message truyen vao alert\n\t\t$scope.alertMessage = \"\";\n $scope.confirmOK = function () {\n\t\t\t//Dummy function\n };\n $scope.confirmCancel = function () {\n\t\t\t//DummyFunction\n };\n $scope.isActiveLayer = function(layer){\n \treturn (layer == $scope.currentLayer);\n\t\t};\n\n\t\t//set application's global Main variable's controller to this controller\n\t\tMain.mainController = _THIS;\n ContextStack.setMainCtl(_THIS);\n\n /**\n\t\t * Function thuc hien event goi tu Main.js\n\t\t * - Khi onload\n\t\t * - Khi unload\n */\n\t\tthis.onApplicationOnLoadComplete = function(){\n /**\n * Note: Muon set focus default thi can fai delay 1 khoang thoi gian de component focusable co the compile\n */\n Utils.log(\"***onApplicationOnLoadComplete()***\", TAG);\n Utils.dispatchCallbackUsingAngularTimeout(initHomPage,100);\n\t\t};\n\n\t\tthis.onApplicationUnload = function(){\n\t\t\tUtils.log(\"***onApplicationUnload()***\", TAG);\n\t\t};\n\n\t\tthis.exitApp = function () {\n Utils.log(\"***onApplication Exit***\", TAG);\n if(tizenApp != null){\n tizenApp.getCurrentApplication().exit();\n }\n };\n\n\t\tthis.onApplicationSuspend = function () {\n Utils.log(\"***onApplication Suspend***\", TAG);\n webapis.avplay.suspend();\n };\n\n\t\tthis.onApplicationRestore = function () {\n Utils.log(\"***onApplication Restore***\", TAG);\n webapis.avplay.restore();\n };\n\t\t//========================================================================\n\n /**\n\t\t * Cac function nay se dc service ContextStack goi.\n\t\t * Thuong cac component ko the goi truc tiep vao controller, nen se goi qua service ContextStack het\n */\n this.setLayer = function (layer) {\n Utils.log(\"Change layer to: \" + layer, TAG);\n $scope.currentLayer = layer;\n };\n\n this.showLoading = function () {\n $scope.currentLayer = vlayers.LOADING;\n };\n\n this.showAlert = function (message) {\n $scope.alertMessage = message;\n $scope.currentLayer = vlayers.DIALOG_ALERT;\n };\n\n this.showConfirm = function (message, confirmOK, confirmCancel) {\n $scope.alertMessage = message;\n $scope.confirmOK = confirmOK;\n $scope.confirmCancel = confirmCancel;\n $scope.currentLayer = vlayers.DIALOG_CONFIRM;\n };\n //====================================================================================================\n\n this.showMenu = function () {\n ContextStack.showConfirm(\"Test confirm\",\n function () {\n Utils.log(\"User confirm ok\", TAG);\n })\n };\n\n function initHomPage() {\n homeData.loadData(function (res) {\n if(homeData.liveEvents && homeData.liveEvents.events.length > 0){\n angular.copy(homeData.liveEvents.events,$scope.liveEvents);\n }\n console.log($scope.liveEvents);\n ContextStack.routeState(null, fstates.HOME);\n }, function (res) {\n Utils.log(\"fail\");\n });\n }\n\n /**\n\t\t * Process pressed key\n */\n var timeLastPressed = Date.now();\n var prevKey = 0;\n function beforeHandleKey(context) {\n if(prevKey == context.event.keyCode && Utils.holdKey(timeLastPressed)){\n Utils.log(\"HoldKey \" + prevKey, TAG);\n return false;\n }\n prevKey = context.event.keyCode;\n timeLastPressed = Date.now();\n\n Utils.log(\"Key: \" + context.event.keyCode, TAG);\n Utils.log(\"Current layer: \" + $scope.currentLayer, TAG);\n //Process back button\n if(context.event.keyCode == keymap.RETURN || context.event.keyCode == keymap.ESC){\n if($scope.currentLayer == vlayers.LOADING || $scope.currentLayer == vlayers.DIALOG_CONFIRM || $scope.currentLayer == vlayers.DIALOG_ALERT){\n ContextStack.showFocusCurrentContext();\n }else {\n ContextStack.popState();\n }\n }\n return true;\n }\n\n focusController.addBeforeKeydownHandler(beforeHandleKey);\n }", "function IndexMain ($scope,StaticResource,CompanyInfo,JobData) {\r\n $scope.ResourceURLs = StaticResource.getResourceURLs('index_page');\r\n\r\n CompanyInfo.TopCompany(function(result){\r\n $scope.TOPcompanys = result.data;\r\n if(result.data != null){\r\n for(var i = 0 ; i < result.data.length; i++){\r\n $scope.TOPcompanys[i].href = \"#/Cpage/\" + $scope.TOPcompanys[i].cid;\r\n }\r\n }\r\n });\r\n\r\n JobData.TopJob(function(result){\r\n $scope.TopJobs = result.data;\r\n });\r\n }", "function main() {\n getAllDancers()\n getSingleDancer(1).then(renderDancer)\n likeUnlike()\n feedbackForm()\n}", "function PendingMemberSignUpController($http, $rootScope, siteInfo, $timeout, appCacheService) {\n this.$http = $http;\n this.$rootScope = $rootScope;\n this.siteInfo = siteInfo;\n this.$timeout = $timeout;\n this.appCacheService = appCacheService;\n this.isLoading = false;\n this.signUpInfo = new MemberSignUpInfo();\n this.showInputForm = true;\n this.showSchoolField = false;\n }", "function MainController(\n $log\n ) {\n var main = this;\n\n /**\n * A function for Jessica to make a change to.\n */\n function jessica() {\n $log.debug(\"TODO\");\n }\n\n /**\n * A function for KP to make a change to.\n */\n function kp() {\n $log.debug(\"TODO\");\n }\n\n /**\n * A function for John to make a change to.\n */\n function john() {\n $log.debug(\"TODO\");\n }\n\n /**\n * This function only exists to prevent everyone from modifying the same area in code.\n *\n * TODO - remove this once everyone has submitted a code change\n */\n function training() {\n jessica();\n kp();\n john();\n }\n\n $log.debug(\"Main Controller loaded\", main);\n\n training();\n }", "function indexPage() {\n logIn();\n signUp();\n signInAuth();\n signUpAuth();\n runDemo();\n}", "function DemandController () {\n\t\t\t// user submits zip code\n\t\t\t$(\"form#zip-search-demand\").submit(this.searchZip.bind(this));\n\t\t\t// user chooses targets\n\t\t\t// user removes targets\n\t\t\t// user sends message\n\t\t}", "function index(req, res, next) {\n\t// parameters for res.render(par1, par2)\n\t// par1 : a view in the views folder\n\t// par2 : data to be used when rendering the view\n // console.log(ALOmodel);\n // console.log(autopop);\n res.render(\n \t'program',\n \t{ title: 'Add Program',\n program: programModel,\n accreditor: accreditorModel,\n department: departmentModel,\n classes: autopop,\n ALO: ALOmodel,\n }\n );\n // console.log(programModel);\n}", "function initController() {\r\n loadProjects();\r\n }", "function main(){\n\t\t//check ob die url/seite die richtige ist\n//\t\tif(checkRightLocation()) {\n\n\t\tcleanPage();\n\t\taddFavoriteTitle();\n\t\taddEmptyTable();\n\t\taddHeader();\n\t\tvar favoritesCall = Utils.getFavorites(addFavorites);\t\t\t\n\t\t\t\t\t\t\n\t//\t} else {\n\t//\t\talert(wrongPageErrorMessage);\n\t//\t}\n\t}", "function show() {\n\tapp.getView().render('content/folder/customerserviceaboutus');\n}", "function initController() {\n UserService.GetAll().then(function (user) {\n $scope.allUsers = user;\n $scope.userLength = Object.size(user);\n }).finally(function() {\n\t\t\t\t$scope.loading = false;\n\t\t\t});\n }", "function mainController() {\n\n var msgUser = $('#message-user').val();\n $('#messages').append(\"<li class='message-user'>\"+ msgUser +\"</li>\");\n\n switch(session){\n case 'main':\n answerQuestion(msgUser);\n break;\n case 'search':\n searchProduct(msgUser);\n break;\n case 'ship':\n shipOrEnd(msgUser);\n break;\n case 'end':\n end(msgUser);\n break;\n }\n}", "function Controller() { }", "function ViewController() {}", "function go() {\n logAllActions()\n trackAllActions()\n updateTitle()\n setReducer(reducer)\n dispatch({\n type: 'SET_CURRENT_USER_ID',\n currentUserID: cookie.get('currentUserID'),\n })\n route(window.location.pathname + window.location.search)\n init({\n view: indexView,\n el: document.body\n })\n}", "function AccountsPresentationController() {\n kony.mvc.Presentation.BasePresenter.call(this);\n }", "function index(req, res) {\n Profile.find({})\n .then(profiles => {\n res.render('profiles/index', {\n title: \"All Users\",\n profiles,\n })\n })\n .catch((err) => {\n console.log(err)\n res.redirect(\"/\")\n })\n}", "function homeController()\r\n {\r\n var self = this;\r\n }", "function filingPersonalInfoCtrl($scope, $state, fintaxFilingService, convertDigitsIntoWords, toaster) {\n $scope.formEditable = true;\n $scope.init = function () {\n fintaxFilingService.getInfo().then(function (response) {\n if (response != null) {\n if (!IsAdmin())formStatus(response.state);\n }\n }, function () {\n console.log(reason);\n });\n fintaxFilingService.getPersonalInfo().then(function (response) {\n if(response != null){\n $scope.personalInfoFormData = response;\n } else {\n $scope.personalInfoFormData = {};\n }\n }, function(reason){\n console.log(reason);\n });\n };\n $scope.submitPersonalInfo = function () {\n fintaxFilingService.setPersonalInfo($scope.personalInfoFormData);//should be via promise\n toaster.success({body: \"Personal Information saved\"});\n };\n function formStatus(state) {\n if(state == 'infoProvided'){\n $scope.formEditable = false;\n }\n if (!$scope.formEditable) {\n $(\"#filingPersonalInfo :input\").attr(\"disabled\", true);\n $(\"#filingPersonalInfo :submit\").attr(\"disabled\", true);\n }\n }\n}", "function Controller(){} //Extends Class (at bottom of page).", "function ViewCompaniesCtrl($rootScope,$scope,CompanyFactory,SettingFactory,LanguageFactory){\n $scope.init=function(){\n $rootScope.MenuActive={};\n $rootScope.MenuActive.Page='partials/user/view/view_companies.html';\n $rootScope.MenuActive.Controller='ViewCompaniesCtrl';\n $rootScope.MenuActive.CompaniesView='active';\n $rootScope.Page.Menu.BrandTitle=$rootScope.Page.Company.Title;\n SettingFactory.GetSettings();\n $scope.GetCompanies();\n $scope.GetCompanyCityList();\n\n\n };\n $scope.GetCompanies=function(){\n CompanyFactory.GetCompanies().success(function(data){\n $scope.companies=data.children;\n });\n };\n $scope.GetCompanyCityList=function(){\n CompanyFactory.GetCompanyCityList().success(function(data){\n $scope.companyCityList=data.children;\n });\n };\n\n $scope.init();\n}", "function HomeController($scope, $http, $location, userService, $routeParams) {\n $scope.search = function(){\n $scope.matchingEmployees = userService.search($scope.query).\n then(function(results){\n $scope.matchingEmployees = results.data.hits.hits;\n })\n };\n\n $scope.all = function(){\n $scope.query = null;\n $scope.matchingEmployees = userService.all().\n then(function(results){\n $scope.matchingEmployees = results.data.hits.hits;\n })\n };\n\n $scope.openEmployee = function(name){\n $location.path(\"/profile/\"+$scope.query+\"/\"+name);\n }\n\n // $scope.query = \"beans\";\n\n if($routeParams.query !== undefined) {\n $scope.query = $routeParams.query;\n $scope.matchingEmployees = userService.search($scope.query).\n then(function(results){\n $scope.matchingEmployees = results.data.hits.hits;\n })\n }\n }", "function mainController(){\n var mainThis = this;\n mainThis.titleLink = \"RU Stuck\"\n mainThis.profileLink = \"Profile\"\n mainThis.questionLink = \"I'm Stuck\"\n mainThis.expertLink = \"I'll Help\"\n}", "function Controller() {\n\n }", "function SProfileController($routeParams, $location, UserService, $rootScope) {\n var vm = this;\n vm.updateUser = updateUser;\n vm.deleteUser = deleteUser;\n vm.userId = $rootScope.currentUser._id;\n vm.logout = logout;\n var userId = $rootScope.currentUser._id;\n /*it is good practice to declare initialization ina function. say init*/\n function init(){\n UserService\n .findUserById(userId)\n .then(function (response) {\n vm.user = response.data;\n });\n }\n init();\n // Author: Sesha Sai Srivatsav\n function logout() {\n UserService\n .logout()\n .then(\n function (response) {\n $location.url(\"/login\");\n },\n function () {\n $location.url(\"/login\");\n }\n );\n }\n // Author: Sesha Sai Srivatsav\n function deleteUser() {\n UserService\n .deleteUser(userId)\n .then(function (response) {\n var result= response.data;\n if(result){\n $location.url(\"/login\");\n }else{\n vm.error = \"can't delete you.\"\n }\n });\n }\n // Author: Sesha Sai Srivatsav\n function updateUser(user){\n UserService\n .updateUser(userId, user)\n .then(function (res) {\n var updatedUser = res.data;\n if (updatedUser){\n vm.success=\"successfully updated!\";\n }else{\n vm.error = \"Some thing doesn't seem right here\";\n }\n });\n }\n\n\n\n }", "async function profilePage() {\n if (getPath() === 'profile.html') {\n const params = new URLSearchParams(document.location.search.substring(1));\n let overview;\n if (params.has('user')) {\n // Hide edit button\n document.querySelector('a.edit').classList.add('hide');\n\n // Fetch user profile\n const id = params.get('user');\n const [user] = await UserAPI.fetchUser(id);\n // Fetch user records\n const baseUrl = RecordAPI.uri;\n const url = `${baseUrl}/records?user=${id}`;\n const records = await RecordAPI.fetchRecords(url);\n overview = generateOverview(records);\n renderProfile(user, overview);\n } else {\n const { user } = auth();\n overview = getOverview();\n renderProfile(user, overview);\n }\n }\n}", "function App() {\n this.express = express();\n this.middleware();\n this.routes();\n this.profiles = new Array();\n this.profiles.push(new IProfile_1.IProfile(1, 'wes', 31, '[email protected]'));\n this.profiles.push(new IProfile_1.IProfile(2, 'Troy', 21, '[email protected]'));\n }", "function App() {\n this.googlePassportObj = new GooglePassport_1[\"default\"]();\n this.expressApp = express();\n this.middleware();\n this.routes();\n this.idGenerator = 100;\n this.Postcards = new PostcardModel_1.PostcardModel();\n this.Collections = new CollectionModel_1.CollectionModel();\n }", "function ApprovalsReqModule_PresentationController() {\n kony.mvc.Presentation.BasePresenter.call(this);\n this.initializePresentationController();\n }", "function HomeCtrl() {\n\n\n\n }", "function app(){\n \"use strict\";\n\n // load some scripts (uses promises :D)\n loader.load(\n\n // Styles\n {url: \"./bower_components/normalize.css/normalize.css\"},\n {url: \"./bower_components/typeplate-starter-kit/css/typeplate.css\"},\n {url: \"./dist/style.css\"},\n {url: \"./dist/foundation-icons/foundation-icons.css\"},\n // {url: '//fonts.googleapis.com/css?family=Poiret+One'},\n\n // Dependencies\n {url: \"./bower_components/jquery/dist/jquery.min.js\"},\n {url: \"./bower_components/lodash/dist/lodash.min.js\"},\n {url: \"./bower_components/backbone/backbone.js\"},\n {url: \"./bower_components/backbonefire/dist/backbonefire.js\"},\n {url: \"./bower_components/firebase/firebase.js\"},\n\n // Models\n {url: \"./js/models/jobListing.js\"},\n // {url: \"./js/models/user.js\"},\n\n // Collections\n {url: \"./js/collections/joblistings.js\"},\n // {url: \"./js/collections/users.js\"},\n\n // Routers\n {url: \"./js/routers/jobboardRouter.js\"},\n\n // Views\n {url: \"./js/views/appview.js\"},\n {url: \"./js/views/joblistingsView.js\"},\n {url: \"./js/views/joblistingView.js\"},\n {url: \"./js/views/joblistingexpandedView.js\"},\n {url: \"./js/views/jobpostformView.js\"},\n {url: \"./js/views/registrationformView.js\"},\n {url: \"./js/views/profileView.js\"},\n\n // Templates\n {url: \"./templates/jobPostForm.html\"},\n // {url: \"\"},\n\n // Utilities\n {url: \"//checkout.stripe.com/checkout.js\"},\n {url: \"./js/stripeCheckout.js\"},\n {url: \"./js/utilities/Auth.js\"},\n\n // foundation js\n {url: \"./bower_components/foundation/js/foundation.js\"},\n {url: \"./bower_components/foundation/js/foundation/foundation.offcanvas.js\"}\n // {url: \"./css/foundation-icons.css\"}\n ).then(function(){\n\n _.templateSettings.interpolate = /{([\\s\\S]+?)}/g;\n document.body.style.opacity = 1;\n $(document).foundation();\n var router = new app.JobBoardRouter();\n\n // login/logout stuff\n \n \n });\n\n}", "function ProfileHandler(db) {\n \"use strict\";\n\n const profile = new ProfileDAO(db);\n\n this.displayProfile = (req, res, next) => {\n const userId = req.session.userId;\n\n profile.getByUserId(parseInt(userId), (err, doc) => {\n if (err) return next(err);\n doc.userId = userId;\n\n return res.render(\"profile\", doc);\n });\n };\n\n this.handleProfileUpdate = (req, res, next) => {\n\n const firstName = req.body.firstName;\n const lastName = req.body.lastName;\n const ssn = req.body.ssn;\n const dob = req.body.dob;\n const address = req.body.address;\n const bankAcc = req.body.bankAcc;\n const bankRouting = req.body.bankRouting;\n const errorMsgSuffix = ' does not comply with requirements for format specified. Please try again.';\n\n const namesRegexPattern = /^[a-zA-ZàáâäãåąčćęèéêëėįìíîïłńòóôöõøùúûüųūÿýżźñçčšžÀÁÂÄÃÅĄĆČĖĘÈÉÊËÌÍÎÏĮŁŃÒÓÔÖÕØÙÚÛÜŲŪŸÝŻŹÑßÇŒÆČŠŽ∂ð ,.'-]+$/u;\n // Allow only valid names (international ok)\n // if the regex test fails we do not allow saving\n // This will further help to prevent scripting attacks via not allowing chars like '<' where they shouldn't be.\n if (namesRegexPattern.test(firstName) !== true || namesRegexPattern.test(lastName) !== true) {\n return res.render(\"profile\", {updateError: `Name${errorMsgSuffix}`})\n }\n\n // Fix for Section: ReDoS attack\n // The following regexPattern that is used to validate the bankRouting number is insecure and vulnerable to\n // catastrophic backtracking which means that specific type of input may cause it to consume all CPU resources\n // with an exponential time until it completes\n // --\n // The Fix: Instead of using greedy quantifiers the same regex will work if we omit the second quantifier +\n // const bankRouteRegexPattern = /([0-9]+)\\#/;\n const bankRouteRegexPattern = /([0-9]+)+\\#/;\n // Allow only numbers with a suffix of the letter #, for example: 'XXXXXX#'\n // if the regex test fails we do not allow saving\n if (bankRouteRegexPattern.test(bankRouting) !== true) {\n return res.render(\"profile\", {updateError: `Bank Routing number${errorMsgSuffix}`})\n }\n\n const userId = req.session.userId;\n\n profile.updateUser(\n parseInt(userId),\n firstName,\n lastName,\n ssn,\n dob,\n address,\n bankAcc,\n bankRouting,\n (err, user) => {\n\n if (err) return next(err);\n\n // WARN: Applying any sting specific methods here w/o checking type of inputs could lead to DoS by HPP\n //firstName = firstName.trim();\n user.updateSuccess = true;\n user.userId = userId;\n\n return res.render(\"profile\", user);\n }\n );\n\n };\n\n}", "function home(){\n\tapp.getView().render('vipinsider/insider_home.isml');\n}", "function mainCtrl($scope, $rootScope, $log, $location, $window, $timeout, toastr, UsersResourceService, AppService) {\n $scope.subView = 'patchNotes';\n // Subview shift Fn\n $scope.subViewShift = function (view) {\n switch (view) {\n case \"svrAnnouncements\" :\n $scope.subView = view;\n break;\n case \"patchNotes\" :\n $scope.subView = view;\n break;\n case \"patches\" :\n $scope.subView = view;\n break;\n }\n };\n }", "function MainController($scope, $http, IncomingSv) {\n\n\tvar memberdata = IncomingSv.GetMemberList($scope);\n\tvar spritesheet = IncomingSv.SpriteSheet($scope);\n\t\n\t$scope.dirctmessage = './partials/DirectMessages.html'\n\t$scope.video = './partials/Video.html'\n\t$scope.roommessage = './partials/RoomMessages.html'\n\n\t$scope.signin = function() {\n\t\talert(\"signin\");\n/*\t\t$( \"#sign-in-form\" ).dialog({\n\t\t autoOpen: false,\n\t\t height: 300,\n\t\t width: 350,\n\t\t modal: true,\n\t\t buttons: {\n\t\t\t\"Sign In\": function() {\n\t \n\t\t\t $( this ).dialog( \"close\" );\n\t \n\t\t\t},\n\t\t\t\"Not registered?\": function() {\n\n\t\t\t $( this ).dialog( \"close\" );\n\t\t\t}\n\t\t },\n\t\t close: function() {\n\t\t \n\t\t }\n\t\t});\n\n\t\t$( \"#sign-in-form\" ).dialog( \"open\" );\t\t*/\n\t};\n\t\n/*\t$scope.addContact = function() {\n\t\tthis.contacts.push({type:'email', value:'[email protected]'});\n\t};\n\t \n\t$scope.removeContact = function(contactToRemove) {\n\t\tvar index = this.contacts.indexOf(contactToRemove);\n\t\tthis.contacts.splice(index, 1);\n\t};\n\t \n\t$scope.clearContact = function(contact) {\n\t\tcontact.type = 'phone';\n\t\tcontact.value = '';\n\t};*/\n}", "function App() {\n this.db = new DatabaseConnection_1.DatabaseConnection();\n this.express = express();\n this.middleware();\n this.routes();\n this.setViews();\n var classifier = new ReleaseClassifier_1.ReleaseClassifier();\n var commitClassifier = new CommitClassifier_1.CommitClassifier();\n //classifier.readReleases();\n //commitClassifier.readCommits();\n }", "function staffingForm() {\n this.initialize = function() {\n var callbackFunction = $.Callbacks('once');\n callbackFunction.add(this.successUserProfile.bind(this));\n var errorCallbackFunction = $.Callbacks('once');\n errorCallbackFunction.add(this.serviceErrorHandler.bind(this));\n RSASERVICES.getUserProfile(\"\", callbackFunction, errorCallbackFunction,\n false, true, \"\");\n var currentLocation = window.location.href;\n //Click on staffing request link redirects to staffing forms page\n $(\"#staffingReqLink\").on(\n \"click\",\n function() {\n window.location.href = currentLocation.split(\n \"StaffingForms/StaffingFormsMain.html\").join(\n \"RetailStaffing/RetailStaffingRequest.html\");\n });\n //Click on interviewAvailability link redirects to interviewAvailability page\n $(\"#interviewAvailabilityLink\").on(\n \"click\",\n function() {\n window.location.href = currentLocation.split(\n \"StaffingForms/StaffingFormsMain.html\").join(\n \"StaffingForms/InterviewAvailability.html\");\n });\n //Click on interviewAvailability link redirects to interviewAvailability page\n $(\"#interviewSummaryLink\").on(\n \"click\",\n function() {\n window.location.href = currentLocation.split(\n \"StaffingForms/StaffingFormsMain.html\").join(\n \"RetailStaffing/InterviewResults.html\");\n });\n };\n /*\n * Method has the service handler\n * if service fails it will throw popup\n * for the message provided\n */\n this.serviceErrorHandler = function() {\n this\n .showModalPopUp(\"Unable to get your user profile information. Please try again later.\");\n };\n /*\n * Method has the functions can used to\n * show,block and drag the popup\n */\n this.showModalPopUp = function(msg) {\n $(\"#warningpopup\").modal({\n backdrop : 'static',\n keyboard : false\n });\n $(\"#warningpopup\").modal(\"show\");\n $(\"#warningpopup\").on('shown.bs.modal', function() {\n $(\"#warningpopup #warningOkbutton\").focus();\n });\n $(\"#warningpopup\").draggable({\n handle : \".modal-header\"\n });\n $(\"#warningpopup .sureMsg\").html(msg);\n $(\"#warningpopup #warningOkbutton\").attr(\"data-dismiss\", \"modal\");\n $(\"#warningpopup #warningCancelbutton\").hide();\n };\n /*\n * Method has the success response for\n * user profile service\n */\n this.successUserProfile = function(response) {\n $.unblockUI();\n CONSTANTS.userProfile = {};\n CONSTANTS.userProfileDetailsInform = {};\n //validate the condition in which the error code is equal to 0\n if (response && response.UserProfileResponseDTO\n && response.UserProfileResponseDTO.ErrorCd === 0) {\n CONSTANTS.userProfileDetailsInform = response;\n CONSTANTS.userProfile.userId = response.UserProfileResponseDTO.userId;\n $('.navbar-right .WelcomeText').text(\n \"Welcome \" + response.UserProfileResponseDTO.firstName\n + \" \" + response.UserProfileResponseDTO.lastName);\n $('.navbar-right .Storenumber').text(\n \"Store# \" + response.UserProfileResponseDTO.strNbr + \"\");\n } else {\n this\n .showModalPopUp(\"Unable to get your user profile information. Please try again later.\");\n }\n };\n}", "function create_new_member_controller () {\n controller = controller('new_member_modal_controller', {\n $scope: ctrl_scope,\n $uibModalInstance: {\n close: function () {\n modal_state = 'close';\n },\n dismiss: function () {\n modal_state = 'dismiss';\n }\n },\n organization: {organization_id: 1}\n });\n }", "function HomeController( userService, $mdSidenav, $mdBottomSheet, $timeout, $log ) {\n\n }", "function main() {\n\t\t\thtmlModule = new htmlUtil(); // View creation / HTML logic\n\t\t\tarrModule = new arrMethods(); // Array Method shortcuts\n\t\t\tmsg = htmlModule.msg; // Logging\n\t\t\tmsg.set(\"Starting Module\");\n\n\t\t\t// Setup Form.\n\t\t\ttempForm();\n\t\t}", "function ApplicationInitiationController(fileTarget, counterStartPoint, counterPlus, counterStopConditionValue, givenSpeed, nextDestination){ \n \n // Interval loop counter\n var counter = counterStartPoint;\n \n // Creating deafult activity indicator\n var loadingIndicator = creatingActivityIndicator();\n landingWindow.add(loadingIndicator);\n \n // Setting interval for timing the landing root window\n var timer = setInterval(function(){\n \n counter+=counterPlus;\n \n // Condition to stop the interval and executes the rest of the source code...\n if (counter == counterStopConditionValue) {\n clearInterval(timer);\n landingWindow.remove(loadingIndicator);\n loadingIndicator = null;\n \n // Creating the Tab Group for app navigation\"\"\n var mainTabController = Ti.UI.createTabGroup({});\n mainTabController.opacity = 0.0;\n \n // Creating a initial root window and the \"ADD\" button. This root window is for displaying the initial table view...\n var homeWindow = creatingWindow(null, \"#fff\", null, null, null, \"#fff\", fileTarget);\n var buttonADD = creatingButton( Titanium.UI.iPhone.SystemButton.ADD, null, null, null, null, null, null, null, null, null);\n \n homeWindow.setRightNavButton(buttonADD);\n //homeWindow.tabBarHidden = true;\n \n // Calling the \"TableViewController\" function for displaying and setting the whole table\n var testtable = TableViewController(homeWindow);\n homeWindow.add(testtable);\n \n // Creating a single tab to hold the root window\n var homeTab = creatingTab(homeWindow, Titanium.UI.iPhone.SystemIcon.FAVORITES, \"Password Manager\");\n mainTabController.addTab(homeTab);\n \n // Creating animation for mainTabController's transition\n creatinCurveAnimation(mainTabController, Ti.UI.ANIMATION_CURVE_EASE_IN_OUT, 1, 1000);\n \n // Adding event listener to the ADD button...\n buttonADD.addEventListener(\"click\", function(){\n \n // Creating a root window, a navigation window, 3 labels and a input field for each labels. This input fields has a null value and a hint text\n var addWindow = creatingWindow(\"Save Your Password\", \"#cecece\", null, null, null, \"#fff\", fileTarget);\n var detailNavigation = creatingNavWindow(addWindow);\n \n var itemLable1 = creatingLabel(\"Account Type:\", \"#333\", null, 14, \"arial\", Ti.UI.SIZE, 40, 40, 10, null, null);\n var accountNameTextField = creatingTextField(Ti.UI.INPUT_BORDERSTYLE_ROUNDED, true, 4, \"Website URL\", false, \"#333\", 200, 40, 40, null, 10, null);\n \n var itemLable2 = creatingLabel(\"Login email:\", \"#333\", null, 14, \"arial\", Ti.UI.SIZE, 40, accountNameTextField.top + accountNameTextField.height + 40, 10, null, null);\n var emailTextField = creatingTextField(Ti.UI.INPUT_BORDERSTYLE_ROUNDED, true, 4, \"Login email\", false, \"#333\", 200, 40, accountNameTextField.top + accountNameTextField.height + 40, null, 10, null); \n \n var itemLable3 = creatingLabel(\"Password:\", \"#333\", null, 14, \"arial\", Ti.UI.SIZE, 40, emailTextField.top + emailTextField.height + 40, 10, null, null);\n var passwordTextField = creatingTextField(Ti.UI.INPUT_BORDERSTYLE_ROUNDED, true, 9, \"Login password\", true, \"#333\", 200, 40, emailTextField.top + emailTextField.height + 40, null, 10, null);\n \n addWindow.add(itemLable1, itemLable2, itemLable3);\n addWindow.add(accountNameTextField, emailTextField, passwordTextField);\n \n // Calling the \"ModalWindowController\" function and passes multiple objects attributes including custom functions for to be use in the \"ModalWindowController\"... \n ModalWindowController(addWindow, detailNavigation, Titanium.UI.iPhone.SystemButton.CANCEL, function(){},\n Titanium.UI.iPhone.SystemButton.SAVE, function(){\n var Qcreate = require(\"CRUD/QueryCREATEandUPDATE\");\n Qcreate.databaseCreateAndUpdate(\"INSERT INTO accounts (name, email, passwords) VALUES (?, ?, ?)\", accountNameTextField.getValue(), emailTextField.getValue(), passwordTextField.getValue(), detailNavigation);\n \n }, function(){});\n \n });\n \n // Openign the mainTabController\n mainTabController.open();\n \n };\n }, givenSpeed);\n}", "function HomeController(runtimerFactory) { //change $http to runtimerFactory when you complete that, used to be $http\n var vm = this;\n\n \n \n\n vm.runs = [];\n\n \n\n \n\n vm.addRun = addRun;\n vm.deleteRun=deleteRun;\n vm.editRun=editRun;\n\n vm.runPacer= function() {\n vm.runPace= (((vm.newHours*60*60)+(vm.newMinutes*60)+(vm.newSeconds))/vm.newDistance)/60\n }\n //not sure where to put this function ..if not working maybe try it under the activate\n\n\n activate();\n\n\n\n\n //////////////////////\n\n \n \n function activate() {\n runtimerFactory\n .getAll()\n .then(function(response){\n vm.runs=response.data;\n });\n }\n\n function addRun() {\n if (vm.newWorkout) {\n runFactory\n .create({\n name: vm.newRun,\n distance: vm.newDistance,\n vm.runPacer();\n workout: vm.newWorkout\n })\n .then(function(response) {\n vm.runs.push(response.data);\n });\n } else {\n alert('please choose a workout type.');\n }\n }\n\n function editRun(run){\n runFactory\n .update(run.runId, run)\n .then(function(response){\n\n })\n }\n\n function deleteRun(run) {\n runFactory\n .remove(run.runId)\n .then(function(response) {\n var index =vm.runs.indexOf(run);\n vm.runs.splice(index,1);\n })\n }\n }", "index(request, response) {\n const loggedInUser = accounts.getCurrentUser(request); \n logger.info('about rendering');\n if (loggedInUser) {\n \n const viewData = {\n title: 'About the Horselist App',\n developers: developerStore.getAllDevelopers(),\n fullname: loggedInUser.firstName + ' ' + loggedInUser.lastName,\n picture: loggedInUser.picture,\n messages: messageStore.getAllMessages(),\n };\n response.render('about', viewData);\n }\n else response.redirect('/'); \n }", "function Controller() {\n \n }", "function Controller() {\n \n }", "function index(req, res,){\n\n Profile.find({}) \n \n .then(profiles => {\n \n res.render('profiles/index',{\n\n title:\"not-reddit profiles\",\n\n profiles,\n\n }) \n })\n}", "function controller_by_user(){\n\t\ttry {\n\t\t\t\n//debug: all data\n//console.log(data_lotes_venders);\n$ionicConfig.backButton.text(\"\");\n\t\t\t\n\t\t} catch(e){\n\t\t\tconsole.log(\"%cerror: %cPage: `lotes_vender` and field: `Custom Controller`\",\"color:blue;font-size:18px\",\"color:red;font-size:18px\");\n\t\t\tconsole.dir(e);\n\t\t}\n\t}", "function initHome() {\n\tgetCurrentUser();\n\tinitializeStudentInfo();\n\tloadCourses(buildCourseContent);\n\tprogressBarFunc();\n\tw3_open(); \n}", "function GetUser() {\n showUsers(dataUsers[currentPage]);\n}", "function ZmProfileUserCtrl(zmUserService) {\n\t\tvar vm = this;\n var vm.viewMode = true;\n\t\tvar about = {};\n //Method\n\t\tvm.deleteUser = deleteUser;\n\t\tvm.addUser = addUser;\n\n\t\tzmUserService.readListOfUser(function(data){\n\t\t\tvm.contacts = data;\n\t\t});\n\n\t/**\n * @name deleteUser\n * @param index,id\n * @description Delete user from list\n * @return success or failure of deleted user\n */\n function deleteUser(index,id){\n zmUserService.deleteUser(id,function(data){\n if(data.status==true){\n angular.forEach(contacts, function(value, key) {\n if(value['userid']==id){\n contacts.splice(i,1);\n }\n })\n }\n });\n }\n \n /**\n * @name addUser\n * @param addUserData // this is an object of user data\n * @description Add user in list\n * @return new added user data\n */\n function addUser(addUserData){\n zmUserService.addUser(addUserData,function(data){\n vm.contacts = data;\n });\n }\n\n /**\n * @name readUser\n * @param id\n * @description read user detail\n * @return user details\n */\n function readUser(id){\n viewMode = false;\n zmUserService.readUser(id,function(data){\n vm.about.contact = data ;\n });\n }\n\n\t}", "function run($rootScope, $state, authService, companyService, userService, $firebaseAuth, genService, modelsService, accessService, backofficeService) {\n\n $rootScope.backoffice_url = backoffice_url;\n\n \t\t FastClick.attach(document.body);\n\n // Getting Init Information\n //$rootScope.authenticating = false;\n\n \t\t// Make auth Service Available from RootScope\n \t\t$rootScope.authService = authService;\n\n \t\t// Make General Service Available from RootScope\n \t\t$rootScope.genService = genService;\n\n \t\t // Watch for StateChanges\n\t \t$rootScope.$on('$stateChangeSuccess', function (event, toState, toParams, fromState) {\n\n // On Logout, keep checking status of login\n $rootScope.authService.getCurrentUser(function(firebaseUser){\n \t if(!firebaseUser){\n $rootScope.currentUser = undefined;\n }\n \t });\n\n\n if(toState.data && toState.data.vars.securityLevel && $rootScope.user){\n if(toState.data.vars.securityLevel > $rootScope.user.rights){\n backofficeService.logpost('Employee attempted to access ristricted area: '+toState.name ,$rootScope.user.email,'security','info',()=>{},()=>{});\n $state.go(fromState.name);\n }\n }\n\n\t var loginRequired = toState.data.vars.loginRequired;\n\n $rootScope.currentState = toState.name;\n $rootScope.currentStateTitle = toState.data.vars.title;\n\n\t console.log('Current State:',toState.name);\n console.log('Current Admin:', $rootScope.currentUser);\n\n \tif (loginRequired && typeof $rootScope.currentUser === 'undefined') {\n $rootScope.authenticating = true;\n console.log('.');\n $firebaseAuth().$waitForSignIn().then(function(status){\n console.log('Auth Resolved');\n \t\t\tif(!status){\n \t\t\t\t$state.go('login');\n $rootScope.authenticating = false;\n \t\t\t}\n \t\t\telse{\n $rootScope.currentUser = status.uid;\n getInitialInformation(status.uid, function(){\n $rootScope.authenticating = false;\n accessService.setAccessRights($rootScope.user.rights);\n console.log('Current Admin:', $rootScope.currentUser);\n $state.go(toState.name);\n $rootScope.$apply();\n }, function(error){\n console.error(error);\n $state.go('login');\n authService.logout(function(){}, function(){});\n $rootScope.authenticating = false;\n }, userService, companyService, modelsService, $rootScope);\n \t\t\t}\n \t\t});\n }\n\n });\n\n // Make a green header bar above everything #563\n var url = window.location.href;\n $rootScope.developmentEnvironment = !/^https?:\\/\\/internal.liimex.com/.test(url) &&\n !/^https?:\\/\\/backoffice-production.herokuapp.com/.test(url);\n }", "function viewFullProfile() {\n history.push('/supported-employees/'+employee.id)\n }", "function RenderIndexPage(reqObject, resObject, loginStatus) {\n var rows = business.GetTopBookshelves(4, 1);\n for (var i = 0; i < rows.length; i++) {\n //\n // rows[i].ten_user = business.GetUsernameByIDBookshelf(rows[i].id);\n rows[i].ten_user = business.GetAccountInfo(rows[i].id).ten_user;\n rows[i].avatar_user = business.GetAccountInfo(rows[i].id).avatar;\n }\n\n\n var vm = {\n viewbook: rows,\n isLogged: loginStatus,\n }\n\n // Render view khi da login\n if (loginStatus) {\n vm.username = business.GetAccountInfo(reqObject.session.userid).ten_user;\n vm.id_user = reqObject.session.userid;\n }\n\n \n resObject.render('home/index', vm);\n //resObject.send('OK');\n}", "function MainCtrl(UserService) {\n\n // Capture the 'this' context of the controller using vm, standing for ViewModel.\n // Use it to avoid having to call bind and unnecessary scoping issues.\n var vm = this;\n\n vm.someObject = 'Some value';\n\n vm.users = [];\n vm.getUsers = function() {\n \n // Business logic being delegated to a service.\n // Controllers should act as a ViewModel and control the data flowing between the Model and\n // the View presentation layer. Business logic in Controllers makes testing Services impossible.\n UserService.getUsers()\n .then(function(response) {\n vm.users = response;\n });\n }\n\n // Check the 'app.js' config function to see where this is used and an explanation.\n vm.resolve = {\n doSomething: function() {\n return UserService.doSomething();\n } \n }\n }", "function JobApiController() {\n\t}", "function MainCtrlCtor(UserService)\n {\n this.UserService = UserService\n //this.$route = $route;\n this.user = \"Customer\"\n this.type = \"\";//company,customer,coupon\n this.page = \"\"//update,signin\n this.status = \"\";\n this.pool = {objects:[],names:[]};\n \n }", "function goToChangeManagerHome() {\n $('#main').show();\n $('#navbuttons').hide();\n $('#requestdetails').hide();\n\n // $('#btnFilter').hide();\n // $('#btnResetFilter').hide();\n // $('.nav-tabs a[href=\"#myAssign\"]').tab('show');\n\n\n //refresh the grids\n showChangeRecords();\n showChangeRequests();\n showMyChangeRecords();\n showMyChangeRequests();\n getMyChangeTasks();\n getAllChangeTasks();\n}", "function user(){\r\n uProfile(req, res);\r\n }", "function App() {\n var mouse = DreamsArk.module('Mouse');\n //\n // /**\n // * start Loading the basic scene\n // */\n DreamsArk.load();\n //\n // mouse.click('#start', function () {\n //\n // start();\n //\n // return true;\n //\n // });\n //\n // mouse.click('.skipper', function () {\n //\n // query('form').submit();\n //\n // return true;\n //\n // });\n //\n // mouse.click('#skip', function () {\n //\n // query('form').submit();\n //\n // return true;\n //\n // });\n //\n // mouse.click('.reseter', function () {\n //\n // location.reload();\n //\n // return true;\n //\n // });\n }", "function adminDashboardCtrl(UserService, $scope, Idle, MESSAGES, $uibModal, $timeout, $state, Common) {\n\n var vm = this;\n\n console.log('im getting in the dashboards');\n }", "function profileController($scope, profileService, $routeParams, $location){\n var vm = this; \n vm.param1 = $routeParams.id;\n\n vm.showUser = function(){\n profileService.showUser(vm.param1).then(function(data){\n console.log(data);\n vm.user = data.data;\n })\n }\n\n vm.updateUser = function(){\n profileService.updateUser(vm.param1).then(function(data){\n console.log(data);\n vm.user = data.data;\n })\n }\n\n vm.openEdit = function(path){\n $location.path('/users/edit/' + vm.param1);\n }\n \n vm.deleteUser = function(){\n profileService.deleteUser(vm.param1).then(function(data){\n console.log(data);\n vm.user = data.data;\n });\n }\n vm.showUser();\n vm.seeMatches = function(path){\n $location.path('/users/matches');\n }\n vm.qnaireAgain = function(path){\n $location.path('/questions');\n }\n}", "function HomeCtrl () {\n const app = this;\n app.stats = {};\n app.nodeDiscovery = false;\n app.message = '';\n\n }", "function PageController($scope, $location, $http, applicationState, Choko) {\n if (!$scope.page.type || $scope.page.type === 'default') {\n $scope.items = $scope.page.items || {};\n $scope.title = $scope.page.title;\n }\n else {\n // Set view to the panel itself and call ViewController.\n $scope.view = $scope.page;\n ViewController($scope, $location, $http, applicationState, Choko);\n }\n}", "async function Profile(evt) {\n evt.preventDefault();\n if (localStorage.userId !== undefined) {\n hidePageComponents();\n $profileInfo.show();\n $userProfile.show();\n $links.show();\n $logoutBtn.show();\n $userBtn.show();\n\n if (localStorage.favTeamId == \"None\") {\n $favTeam.text(\"You have not selected a favorite team\");\n } else {\n $favTeam.text(\n `Your currently selected favorite team is the ${localStorage.favTeamName}`\n );\n }\n } else {\n $welcome.show();\n $loginBtn.show();\n $signupBtn.show();\n }\n}", "function controller_by_user(){\r\n\t\ttry {\r\n\t\t\t\r\n//debug: all data\r\n//console.log(data_sections);\r\n$ionicConfig.backButton.text(\"\");\r\n\t\t\t\r\n\t\t} catch(e){\r\n\t\t\tconsole.log(\"%cerror: %cPage: `sections` and field: `Custom Controller`\",\"color:blue;font-size:18px\",\"color:red;font-size:18px\");\r\n\t\t\tconsole.dir(e);\r\n\t\t}\r\n\t}", "function MainController() {\n\tvar vm = this;\n\n\tvm.hello = 'world';\n\n\tvm.categories = [\n\t\t{\"id\": 0, \"name\": \"Development\"},\n\t\t{\"id\": 1, \"name\": \"Design\"},\n\t\t{\"id\": 2, \"name\": \"Exercise\"},\n\t\t{\"id\": 3, \"name\": \"Humor\"},\n\t];\n\n\tvm.bookmarks = [\n\t\t{\"id\": 0, \"title\": \"AngularJS\", \"url\": \"http://angularjs.org\", \"category\": \"Development\"},\n\t\t{\"id\": 1, \"title\": \"A List Apart\", \"url\": \"http://alistapart.com\", \"category\": \"Design\"},\n\t\t{\"id\": 2, \"title\": \"9 Gag\", \"url\": \"http://9gag.com\", \"category\": \"Humor\"},\n\t];\n\n\tvar currentCategory = null;\n\n\tfunction setCurrentCategory(category) {\n\t\tcurrentCategory = category;\n\t}\n\n\tfunction getCurrentCategory() {\n\t\treturn currentCategory;\n\t}\n\n\tfunction isCurrentCategory(category) {\n\t\treturn currentCategory == category;\n\t}\n\n\tvm.setCurrentCategory = setCurrentCategory;\n\tvm.getCurrentCategory = getCurrentCategory;\n\tvm.isCurrentCategory = isCurrentCategory;\n}", "function settingController($scope, $state, $window, commonApi, constants, localize) {\n // Init data when initialize welcome screen\n function initialize() {\n }\n\n //initialize welcome screen\n initialize();\n }", "function MainController(){\n var vm = this;\n vm.year = new Date().getFullYear();\n }", "function runApp() {\n showCurrentGames();\n searchCountryMatches();\n selectSearchedTeam();\n listOfWorldCupTeams();\n}" ]
[ "0.5955003", "0.5948213", "0.59005713", "0.58052117", "0.579127", "0.57029706", "0.56436056", "0.5578276", "0.55665636", "0.5540938", "0.5484071", "0.5446754", "0.53985465", "0.53375816", "0.5337507", "0.5332887", "0.53163147", "0.5307199", "0.53036565", "0.53007305", "0.52918017", "0.5287953", "0.5279433", "0.52602005", "0.52593136", "0.52142173", "0.5211991", "0.5186645", "0.51713884", "0.5171198", "0.51690936", "0.5161792", "0.5159452", "0.5155922", "0.51535", "0.515207", "0.5146953", "0.51469123", "0.51381785", "0.513696", "0.5120769", "0.511935", "0.5108088", "0.51060236", "0.51018494", "0.5099097", "0.5089886", "0.50881344", "0.50785595", "0.50785434", "0.50732607", "0.505374", "0.50513935", "0.50496125", "0.5048614", "0.504509", "0.50325227", "0.50242716", "0.5021969", "0.501653", "0.5015543", "0.50133187", "0.50119394", "0.5006627", "0.50014853", "0.49993706", "0.4993044", "0.49903584", "0.49828517", "0.4979855", "0.497532", "0.49736047", "0.4956789", "0.4955546", "0.49500662", "0.49500662", "0.49497038", "0.4946114", "0.49457514", "0.49435827", "0.4935793", "0.49313983", "0.49277085", "0.49274263", "0.4924505", "0.49200094", "0.49173936", "0.49064997", "0.4906271", "0.49025553", "0.49007267", "0.48966515", "0.48905054", "0.48885235", "0.4884051", "0.4881819", "0.48792067", "0.4874156", "0.48705167", "0.48649922" ]
0.4870267
99
Initial execution function on page load.
function activate() { return StaffService.getAllStaffMembers().then(function (data) { vm.staffMembers = data; vm.selectedMember = data[0]; loggerFactory.info('Staff Members: ', data); }, function (err) { loggerFactory.error('Get Staff Members: ', err); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n // THIS IS THE CODE THAT WILL BE EXECUTED ONCE THE WEBPAGE LOADS\n }", "function init() {\n\t\t$(document).on('pageBeforeInit', function (e) {\n\t\t\tvar page = e.detail.page;\n\t\t\tload(page.name, page.query);\n\t\t});\n }", "function alwaysRunOnload () {\n\t\n\t}", "function alwaysRunOnload () {\n\t\t// Placeholder/Future use.\n\t}", "function pageLoad(){\n\t\tconsole.log(\"init hello\");\n\t\tgetDates()\n\t}", "function init() {\n if ($('.scheduled-page').length > 0) {\n setPageUrl();\n bindEvents();\n renderSwitcher();\n renderActions();\n switchPage(scheduled.currentView);\n }\n }", "function init()\n {\n $(document).on(\"loaded:everything\", runAll);\n }", "function startatLoad(){\r\n\tloadNavbar(function(){\r\n\t\tgetPT1000XMLData(function(){\r\n\t\t\tshowPT1000values();\r\n\t\t});\r\n\t});\r\n}", "function startatLoad(){\r\n\tloadNavbar(function(){\r\n\t\tsetSelectMenuesValues(function(){\r\n\t\t\t\tgetXMLData(function(){\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t});\r\n}", "function mainLoaded() {\n if (typeof(executeOnContentLoad) == \"function\") {\n if (contentLoadDestination && location.hash != contentLoadDestination) return;//wait til we are on the correct page\n var fn = executeOnContentLoad;\n executeOnContentLoad = null;\n contentLoadDestination = null;\n fn();\n }\n }", "function initPageLoadCall() {\n if(options.page_paths != {} && options.call_page_tags) {\n var page = options.page_paths[path()];\n if(page !== undefined) {\n fireTag(\"view\", {\n \"page_type\": \"marketing\",\n \"page_name\": page\n });\n }\n }\n }", "function onPageLoad() {\n\tif (loginDataReady) {\n\t\tupdateBootStatus(\"halt:org.webshell.shell:processLoginData:ready\");\n\t\tprocessLoginData();\n\t} else {\n\t\tupdateBootStatus(\"halt:org.webshell.shell:processLoginData:notready\");\n\t\tpageLoadedQuickSoProcessDataImmediately = true;\n\t}\n}", "function initPage(){\r\n\t\t//add head class\r\n\t\t$(\"#headEfficiencyLi\").addClass(\"active\");\r\n\t\t$(\"#leftNodeSelectLi\").addClass(\"active\");\r\n\t\t\r\n\t\ttoggleVinHint(true);\r\n\r\n\t\t//hide alert\r\n\t\t$(\"#messageAlert\").hide();\r\n\r\n\t\t$(\"#tableList tbody\").text(\"\");\r\n\t\t//set default queue time and get queue\r\n\t\t// $(\"#startTime\").val(window.byd.DateUtil.todayBeginTime);\r\n\t\t$(\"#startTime\").val(byd.DateUtil.firstDayOfTheMonth);\r\n\t\t$(\"#endTime\").val(byd.DateUtil.todayEndTime);\r\n\t\tajaxGetDoneList();\r\n\t\tajaxGetPrintList();\r\n\r\n\t\tresetPage();\r\n\t\tif($(\"#currentNode\").val() == \"subEngine\") {\r\n\t\t\t$(\"#formBarCode\").show();\r\n\t\t}\r\n\r\n\t}", "function initPage(){\r\n\t\t//add head class\r\n\t\t$(\"#headGeneralInformationLi\").addClass(\"active\");\r\n\t\tgetSeries();\r\n\t\t$(\"#divLeft,#divHead,#divFoot\").addClass(\"notPrintable\");\r\n\t\t$(\"#startTime\").val(window.byd.DateUtil.lastWorkDate());\r\n\r\n\t\tajaxQueryReplacementCost(\"monthly\");\r\n \tajaxQueryReplacementCost(\"yearly\");\r\n \tajaxQueryCostDistribute();\r\n\t\tresetAll();\r\n\t}", "function initPage() {\n $.get('/api/headlines?saved=false').done((data) => {\n articleContainer.empty();\n if (data && data.length > 0) {\n renderArticles(data);\n\n // Activate tooltips for the action buttons.\n $('[data-toggle=\"tooltip\"]').tooltip();\n } else {\n renderEmpty();\n }\n });\n }", "function initializePage() {\n handleGlobalEvent();\n handleSideBar();\n handleMessageBar();\n handleCollapsibleController();\n handleResetButton();\n handleDisabledSubmit();\n handleAjaxError();\n handleAjaxSetup();\n }", "function initPage() {\n $.get('/api/headlines?saved=true').done((data) => {\n articleContainer.empty();\n\n if (data && data.length > 0) {\n renderArticles(data);\n\n // Activate tooltips for the action buttons.\n $('[data-toggle=\"tooltip\"]').tooltip();\n } else {\n renderEmpty();\n }\n });\n }", "function page_loaded() {\n post_load_setup();\n}", "function initStartup(){\n initDate();\n $.when(loadHash()).done(loadPermaSearchParams());\n}", "function initialPages($) {\n\t\t$('.select2').select2();\n\t\tdisabledInput();\n\t\tentityHandler();\n\t\texpiryDateRange('#expiry');\n\t\textendEXpiryDatePicker('#extend_expiry');\n\t\tclickConfirmExtend();\n\t\tclickConfirmTerminate();\n\t\tclickConfirmChangeStatus();\n\t\tclickConfirmChangeGroup();\n\t\tclickConfirmChangePassword();\n\t\tclickConfirmResetPassword();\n\t\tclickModalCloseBtnDone();\n\t}", "function initPage() {\n\tset_hidden_elements();\n}", "function coreInitLoadPage() {\n if (typeof $(\"body\").attr(\"control\") !== \"undefined\")\n WEBUI.MAINPAGE = $(\"body\")[$(\"body\").attr(\"control\").split(\".\")[1]]();\n }", "function onStart() {\n // loads manifests, scouts, schedule, etc.\n loadImportantFiles();\n // goes to the home page\n switchPages(\"home\", undefined, undefined, 0);\n // determines a list of teams\n determineTeams();\n // uses list of teams to create \"Teams\" page\n insertTeams();\n // sorts \"Teams\" table once files are loaded\n window.setTimeout(sortTable, 200);\n // loads scouting data\n loadData();\n // sets up \"Team\" page for data to be inputted\n setupData();\n // \"Picklist\" page starts with one picklist\n createPicklist();\n // decides whether or not to display sensitive info\n displaySensitiveInfo();\n // hides the \"Team\" page carousel\n $(\"#myCarousel\").hide();\n // puts scouts on Scouts page\n populateScouts();\n // sets up the rankings table\n addRankingsToPage();\n}", "function startOnLoad() {\n}", "function startOnLoad() {\n}", "function initPage()\n\t{\n\t\tinitGlobalVars();\n\t\tinitDOM();\n\t\tinitEvents();\n\t}", "function initialise() {\n mainMenu();\n\n initialisePage();\n}", "function initializePage() {\n\tconsole.log(\"initializing\");\n}", "function pageBeforeInit(pageData) {\n\n } // end pageInit", "function initialize() {\n $.get(\"views/AdminHomePage.html\")\n .done(setup)\n .fail(error);\n }", "function page_init() {\r\n\talert('page init being called');\t\r\n}", "init() {\n // Action to execute on load of the app\n }", "function init() {\n $(document).on('pageBeforeInit', function (e) {\n var page = e.detail.page;\n\n if (page.name.startsWith(\"smart\")) return;\n\n if (localStorage.getItem('auth-token') == null)\n load('login');\n else\n load(page.name, page.query);\n });\n }", "function initialPages($) {\n\t\t$('.select2').select2();\n\t\tdatePicker('#expiry');\n\t\tfileInput('#avatar');\n\t\tselectRole();\n\t\tselectEntity();\n\t\tformSubmit();\n\t\t\n\t}", "onload() {\n this.init();\n }", "function initPage(){\r\n\t\t//add head class\r\n\t\t$(\"#headAssemblyLi\").addClass(\"active\");\r\n\t\t$(\"#leftCarQueryLi\").addClass(\"active\");\r\n\t\tgetSeries();\r\n\t\tfillLineSelect();\r\n\t\t$(\"#carTag\").hide();\r\n\t\t$(\"#resultTable\").hide();\r\n\t\t$(\"#tabTestLine\").hide();\r\n\t}", "function init() { \n SP.SOD.notifyScriptLoadedAndExecuteWaitingJobs('domTools.js');\n }", "function initOnDomReady() {}", "function initializePage() {\n\tconsole.log(\"initializePage\");\n\tclearInputs();\n\ttoggleInterest();\n}", "function init() {\n //called when document is fully loaded; your \"main method\"\n}", "function init(){\n console.debug('Document Load and Ready');\n console.trace('init');\n initGallery();\n \n pintarLista( );\n pintarNoticias();\n limpiarSelectores();\n resetBotones();\n \n}", "function init(){\n loadOrders();\n verifyPermission(); \n loadProducts();\n setfilter(); \n}", "function init() {\n autoScroll();\n countDown();\n fetchWeather();\n fetchDestinations();\n formValidation();\n }", "function onPageInit(e){\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}", "function qodeOnWindowLoad() {\n\t qodeInitNewsShortcodesPagination().init();\n }", "function init() {\n\tconst params = getUrlParameters() // valuable information is encoded in the URL\n\tconst dataPromise = loadData(params) // start loading the data\n\tconst callback = () => app(params, dataPromise)\n\n\t// set error handlers\n\twindow.addEventListener(\"error\", errorHandler)\n\twindow.addEventListener(\"unhandledrejection\", errorHandler)\n\n\tif (document.readyState !== \"loading\")\n\t\tdocument.addEventListener(\"DOMContentLoaded\", callback)\n\telse\n\t\tcallback()\n}", "function onPageLoad() {\n $('button[data-button-cerca]').click(ricercaConciliazione.bind(undefined, false));\n $(\"#buttonNuovaConciliazione\").click(apriCollapseNuovaConciliazione);\n $('#inserimento_buttonSalva').click(gestisciConciliazione.bind(undefined, 'inserimento', 'gestioneConciliazionePerTitolo_inserisci.do'));\n $('#aggiornamento_buttonSalva').click(gestisciConciliazione.bind(undefined, 'aggiornamento', 'gestioneConciliazionePerTitolo_aggiornamento.do'));\n\n definisciRadioEntrataSpesa();\n definisciCaricamentoSelectViaAjax();\n definisciPulsantiAnnullamento();\n definisciRicercaGuidataConto();\n\n $(document).on('contoCaricato', gestioneContoCaricato);\n }", "function initializePage(){\n console.log(\"Initializing page... \");\n //do stuff.\n console.log(\"Done.\\n\");\n}", "function onInit() {}", "function init() {\n\t\t\tresetData();\n resetClipboardMI();\n resetClipboardEC();\n resetClipboardDC();\n\t\t\trefreshTotalCount();\n\t\t\tloadVocabs();\n for(var i=0;i<5; i++) { addMutationInvolvesRow(); }\n for(var i=0;i<5; i++) { addExpressesComponentsRow(); }\n for(var i=0;i<5; i++) { addDriverComponentsRow(); }\n if (document.location.search.length > 0) {\n searchByAlleleKeys();\n }\n\t\t}", "function init() {\n if ($('.detail-page').length > 0) {\n renderLoader();\n setArticleParams();\n getArticle();\n bindEvents();\n }\n }", "function preRunFunc() {\n\t\tonglets_ui.tabs();\n\t\tgetOngletsChannels();\n\t\tonInputFocus();\n\t\tonInputFocusOut();\n\t\tformSubmit();\n\t\tputButtonsEvents();\n\t}", "function pageInitalize(){\n\n articleContainer.empty();//Empties article container.//\n $.get(\"/api/headlines?saved=false\").then(function(data){//Runs AJAX request for unsaved\n if (data && data.length) {//Renders found headlines to the page.//\n renderArticles(data);\n }else{\n renderEmpty();//Renders no articles message.//\n }\n });\n }", "function initLoad()\n{\n console.log('page load');\n myGame.buildBoard();\n myGame.nextMove();\n myGame.reset();\n}", "function init() {\n console.log(\"Document Ready\");\n\n createPets();\n totalNumPets();\n totalPrice();\n petsByType();\n displayPets();\n displayOfficeInfo();\n}", "onPageReady () {}", "function onPageInit(e){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t}", "function initialPages($) {\n\t\t$('.select2').select2();\n\t\tdatePicker('#date_range');\n\t\tonChangeLoanTypeHandler();\n\t\tdateRangeHandler();\n\t}", "function init() {\n\t\t\tresetData();\n\t\t\trefreshTotalCount();\n\t\t\tloadVocabs();\n\t\t}", "function init() {\n loadTheme();\n loadBorderRadius();\n loadBookmarksBar();\n loadStartPage();\n loadHomePage();\n loadSearchEngine();\n loadCache();\n loadWelcome();\n}", "function init () {\r\n\t\tconsole.log('all is loaded.');\r\n\t}", "onInit() {}", "function onLoaded()\n\t{\n\t\twindow.initExhibitorsList();\n\t\twindow.initFloorPlans();\n\t\twindow.initConciege();\n\t\twindow.initAmenities();\n\t\twindow.initVisas();\n\t}", "function initPage() {\n\n initHeader();\n\n initForm();\n\n initDatalist();\n}", "function pageReady() {\n legacySupport();\n initSliders();\n }", "function initializePage() {\r\n requestPageData(COMIC.slug, getComicAndPageFromActiveUrl().pageSlug, function (response) {\r\n navigateToPage(response.slug, false);\r\n });\r\n }", "function init() {\n lastTime = Date.now();\n main();\n }", "function init() {\n lastTime = Date.now();\n main();\n }", "function init() {\n\t\tloadPosts();\n\t\tloadPages();\n\t\tloadCategories();\n\t\tloadTags();\n\t}", "function onload() {\n\tsendRequest(\"/Tools/portal/sendSignalToShellWhenPageLoad\");\n}", "function init(){\n console.log(\"Page loaded and DOM is ready\");\n}", "function initPage () {\n // Applying styles to all buttons\n var formButtons = $('div#cvss-calculator-form input[type=\"button\"]');\n angular.forEach(formButtons, function(button) {\n button.className = 'btn btn-default';\n });\n\n // !!!!!!!!!!!!!!!!!!!!!!!!\n // !!!!!!!! CALL function to initialize plots and check for existence of\n // !!!!!!!! hidden fields which WILL affect the page display.\n // Note: we only want the PlotService initialized once because it is\n // used by both versions.\n PlotService.plotMethods.init('V3'); // initialize plots and tool tips\n hiddenCheck();\n // Complete\n vm.initComplete = true;\n }", "function ajax_Load() {\n //$(\".consoleLogOutput\").append('<div class=\"consoleLog_helm\">ajax_Load() event starting.</div>');\n \n if (helm.alreadyInitialized && helm.RefreshHelmDataAfterUpdatePanelPostBack) {\n helm.jQueryBindEvents();\n helm.Initialize(true); //true -> because this is after ajax request\n } else {\n //reset the refresh overrides\n helm.alreadyInitialized = true;\n helm.RefreshHelmDataAfterUpdatePanelPostBack = true;\n }\n \n }", "function onPageInit(e){\t\t\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}", "function onPageInit(e){\t\t\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}", "function firstCall()\r\n{\r\n loadUSNavy();\r\n}", "function eltdfOnWindowLoad() {\n\t eltdfWooCommerceStickySidebar().init();\n\t eltdfInitButtonLoading();\n eltdfInitProductListMasonryShortcode();\n }", "function pageOnLoad(){\n render(datasetInit);\n render(convertedDataSet1992);\n }", "function init() {\n fetchDetails();\n setEvents();\n }", "function pageLoad(){\n $jQ('body').zIndex(); // jQuery UI Check\n window.onbeforeunload=function(){return '';}; // Hack to prevent any page.reload\n startCSSInfo();\n hackUserAgent();\n hackRemoveAnimations();\n hackDisableSubmit();\n hackActions();\n setNumScripts();\n setTimeStatus();\n setSystemColors();\n setVisibility();\n setUserActions();\n setAllVisibleElementsInfo();\n hackFrameScroll();\n}", "function onPageInit(e){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}", "function oninitialized() {\n\t // focus once ready\n\t this.once(this.options.mode + ' ready', bind(this.focusInput, this));\n\t\n\t // resolve view\n\t if ('signin' === this.options.mode) {\n\t // if user in AD ip range\n\t if (this.$ssoData && this.$ssoData.connection) {\n\t return this._kerberosPanel(this.options, callback);\n\t }\n\t\n\t // if user logged in show logged in experience\n\t if (this.options._shouldShowLastLogin()) {\n\t return this._loggedinPanel(this.options, callback);\n\t }\n\t\n\t // otherwise, just show signin\n\t this._signinPanel();\n\t }\n\t\n\t if ('signup' === this.options.mode) {\n\t this._signupPanel();\n\t }\n\t\n\t if ('reset' === this.options.mode) {\n\t this._resetPanel(this.options, callback);\n\t }\n\t\n\t }", "function _init() {\r\n // set page <title>\r\n Metadata.set(home.title);\r\n\r\n // activate controller\r\n _activate();\r\n }", "function initializePage() {\n //Event Listeners\n handleQuizStart();\n handleAnswerSubmitted();\n handleNextQuestion();\n handleRestartQuiz();\n\n //Render Function\n render(); \n}", "async function initializePage() {\r\n // Bind the tab functionality\r\n initializeTabs();\r\n\r\n // Load the page data\r\n const response = await requestPageData(getComicAndPageFromActiveUrl().pageSlug);\r\n await navigateToPage(response.slug, false);\r\n\r\n await preloadRandomComics();\r\n }", "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "function _init(){\n tools_service.showPreloader($scope, 'show');\n initMap([], 3, false);\n _getTripTagsContent(function(){\n recoverTraveler(function () {\n _editQuery();\n //_recoverQUERY(_initLoadQueryString());\n })\n });\n }", "function on_page_load() {\n // Initialize On-scroll Animations\n AOS.init({\n anchorPlacement: 'top-left',\n duration: 600,\n easing: \"ease-in-out\",\n once: true,\n mirror: false,\n disable: 'mobile'\n });\n }", "function onPageLoad() {\r\n\t// although jQuery already has an on page load, \r\n\t// this function was added for sake of organization.\r\n\tvar trigger = \"load\";\r\n}", "init() {\n if (document.body) {\n const { body } = document;\n const controller = body.getAttribute('data-controller');\n const action = body.getAttribute('data-action');\n\n if (controller) {\n this.execAction(controller, 'init');\n this.execAction(controller, action);\n }\n }\n }", "function pageReady() {\n svg4everybody();\n initScrollMonitor();\n initModals();\n }", "async function initializePage() {\n loadProjectsContainer();\n loadCalisthenicsContainer();\n loadCommentsContainer();\n}", "function initialisePage(){\n\t\t\tcurrent_tab = \"about\";\n\t\t\tgenerateNav(register_navevents);\n\t\t\tgenerateFramework(current_tab, generatePage);\n\t\t\t// Enable button again\n\t\t\tbuttonOff();\n\t\t}", "function init() {\n console.debug(\"Document Load and Ready\");\n\n listener();\n initGallery();\n cargarAlumnos();\n\n // mejor al mostrar la modal\n // cargarCursos();\n}", "function pageLoad() {\n setControlValues();\n processHashInstruction();\n\n if (Common.isIE) Common.fixToMaxItemWidth('settings-header', 16, false);\n\n document.getElementById('theme').addEventListener('change', themeSelectChange);\n document.getElementById('defaults').addEventListener('click', defaultsClick);\n document.getElementById('save').addEventListener('click', saveClick);\n document.getElementById('cancel').addEventListener('click', cancelClick);\n\n document.getElementById('offline').style\n .display = (navigator.onLine ? 'none' : 'block');\n window.addEventListener('offline', appOffline);\n window.addEventListener('online', appOnline);\n}", "function init() {\n pageID = 1;\n page01 = document.getElementById(\"page01\");\n page02 = document.getElementById(\"page02\");\n page03 = document.getElementById(\"page03\");\n pageTracker();\n}", "function init() {\n //UH HUH, THIS MY SHIT!\n }", "function init()\r\n {\r\n _updateTerminoPago();\r\n }", "function preLoad() {\n // load something and continue on only when finished\n}", "function init() {\n initializeVariables();\n initializeHtmlElements();\n}", "function initial_startup(){\n\t\t$.ajax({\n\t\t\tmethod: 'post',\n\t\t\tdata: {search: ''},\n\t\t\turl: 'applications/admin/delete_activity_list.php',\n\t\t\tsuccess: function(data){\n\t\t\t\tactivity_list.html(data);\n\t\t\t},\n\t\t\terror: onError\n\t\t});\n\t}" ]
[ "0.7887568", "0.7398014", "0.737307", "0.72839206", "0.7278023", "0.7210524", "0.72056454", "0.7181718", "0.6919903", "0.69168234", "0.6903555", "0.6847969", "0.6831464", "0.68242145", "0.68108845", "0.6780811", "0.6777718", "0.67721826", "0.67433655", "0.67056125", "0.6685064", "0.666905", "0.66609126", "0.66604036", "0.66604036", "0.6642219", "0.66337866", "0.6621999", "0.6615435", "0.6580779", "0.65774834", "0.6576169", "0.6567006", "0.6560377", "0.6552509", "0.65491533", "0.65367264", "0.6534699", "0.6531707", "0.6520578", "0.6513636", "0.6506353", "0.6492367", "0.6485063", "0.6474087", "0.6472121", "0.64719164", "0.6466091", "0.646215", "0.6461093", "0.6457414", "0.64571846", "0.6457121", "0.6445745", "0.6443774", "0.643978", "0.6439383", "0.64350045", "0.6429833", "0.6428357", "0.64268625", "0.6416974", "0.64118963", "0.6411034", "0.640487", "0.64032614", "0.6400687", "0.6400687", "0.6398969", "0.6385877", "0.6382042", "0.6382032", "0.63809174", "0.63808334", "0.63808334", "0.6366506", "0.6365523", "0.6361756", "0.63585514", "0.6355597", "0.63513535", "0.6344143", "0.63375163", "0.633557", "0.63297683", "0.63194305", "0.63156396", "0.63153565", "0.6314", "0.6308741", "0.63070464", "0.63063395", "0.630064", "0.6299661", "0.629839", "0.6298383", "0.62951076", "0.6293835", "0.62935656", "0.6292651", "0.62849283" ]
0.0
-1
Select the current staff member.
function selectStaffMember(member, index) { vm.isSelected = false; vm.selectedMemberIndex = index; vm.selectedMember = angular.isDefined(member) ? member : vm.staffMembers[0]; if (!$mdSidenav('left').isLockedOpen()) { $mdSidenav('left').close(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fnselectMember(){\r\n\tastrMemberName=fngetElementsByClass('btn_assign_unassign',document,'div'); \r\n\tfnteamStatus();\r\n}", "function select ( menuId ) {\r\n // self.selected = angular.isNumber(menuId) ? $scope.users[user] : user;\r\n self.toggleList();\r\n }", "function activate() {\n return StaffService.getAllStaffMembers().then(function (data) {\n vm.staffMembers = data;\n vm.selectedMember = data[0];\n loggerFactory.info('Staff Members: ', data);\n }, function (err) {\n loggerFactory.error('Get Staff Members: ', err);\n });\n }", "function selectUser(user) {\n\t vm.currentUser = user;\n\t\t}", "function getMemberIndex(index){\n selectedMemberIndex = index;\n\n}", "function selectUser() {\n var userSel = document.getElementById(\"user-sel\");\n if (userSel.value == \"null\") {\n searchMemberKey = null;\n } else {\n searchMemberKey = userSel.value\n }\n\n checkGroupsSidebar(true);\n getAllGroups();\n}", "function selectUserFromCollaboratorList(email) {\n var parentUl = $('#panel-collaborators').children('ul');\n var users = parentUl.children('li');\n var user = users.get(0);\n\n // Set user to select..\n for(var i = 0; i < users.length; i++) {\n user = users.get(i);\n if(user.id == email) {\n user.setAttribute(\"style\", \"background-color: #c3c3c3; cursor: pointer;\");\n selectedCollaboratorIndex = i;\n selectedCollaboratorEmail = email;\n }\n else {\n user.setAttribute(\"style\", \"cursor: pointer;\");\n }\n }\n}", "function markUserSelected(){\n\tif(document.getElementById('selectUser').value==0){\n\t\talert(\"please select a user\");\n\t}else{\n\t\tCURRENT_USER_=document.getElementById('selectUser').value;\n\t\t//\n\t\tdocument.getElementById('projectBioContainer').style.display='block';\n\t}\n}", "function multiselectModalEditStaffList() {\n\tmultiselectModal(\"editStaffList\", $('#FFSEditStaffList_AvailableAndAssignedStaffSVIDs > option').length, 'Select Assigned Staff', $(window).height() - (240));\n}", "select(id) { this._updateActiveId(id, false); }", "function selectUser ( user ) {\n self.selected = angular.isNumber(user) ? $scope.users[user] : user;\n }", "function selectUser ( user ) {\n self.selected = angular.isNumber(user) ? $scope.users[user] : user;\n self.toggleList();\n self.loadDataFromFirebase();\n // console.log(self.selected);\n }", "selectCurrent()\n {\n this.select(this.currentSelectedIndex);\n }", "approveMember() {\n MemberActions.approveUser(this.props.memberID);\n this.props.unselect();\n }", "function select_meal_in_meal_list(meal_id) {\n // Only do this if not in edit mode\n if (!is_edit_mode) {\n // Chage the current meal to the newly selected/clicked meal\n set_current_meal(meal_id);\n\n current_meal.is_calendar_meal = false;\n\n // Populate the meal editor with the current meal\n populate_meal_editor(current_meal);\n\n // Set that you're selecting a meal from the meal list\n is_selected_meal_from_meal_list = true;\n\n // Highlight the selected/clicked meal\n highlight_current_meal(meal_id, true);\n }\n}", "onStaffSelect(event){\n let staffId = { key: \"staffMemberId\", value: event.target.value == '' ? -1 : event.target.value };\n this.onCheckoutEditorChange(staffId);\n }", "select() { this.selected = true; }", "function SP_SelectOriginatorLaunched()\n{\n \tvar oListOriginator = document.getElementById(\"mastercontrol.task.originator\"); \n\tvar sCurrentUser = document.getElementById(\"mastercontrol.form.currentuser\").value.toLowerCase();\n\tvar i;\n\tvar sItemValue = \"\";\n\tfor (i=0; i<oListOriginator.length;i++)\n\t{\n\t\tsItemValue = oListOriginator[i].value;\n\t\tif (sItemValue.toLowerCase() === sCurrentUser)\n\t\t{\n oListOriginator.selectedIndex = i;\n\t\t\t break; \n }\n\t} \n}", "function onCreateNewStaffClick() {\n $('#modal-register-staff').modal('show');\n }", "function select_member(){\n var div = document.querySelector(\"div#selected_members\");\n var swap = document.querySelector(\"div#selected_members .swapable\");\n var new_div = this.cloneNode(true);\n new_div.querySelector(\"input\").checked = true;\n var new_div_name = JSON.parse(new_div.querySelector(\"p.data\").innerText)[\"name\"];\n if(!compile_div_names().includes(new_div_name)){\n new_div.classList.add(\"selected\");\n if(div.childElementCount < 3){\n div.appendChild(new_div);\n new_div.click();\n } else {\n div.replaceChild(new_div, swap);\n swapable_member();\n new_div.click();\n };\n };\n}", "function SelectMember(Member) {\n $(\"#txtMemberId\").val($(Member).parent().parent().find(\".MemberId\").text());\n $(\"#txtFirstName\").val($(Member).parent().parent().find(\".FirstName\").text());\n $(\"#txtLastName\").val($(Member).parent().parent().find(\".LastName\").text());\n $(\"#txtMobileNo\").val($(Member).parent().parent().find(\".MobileNumber\").text());\n ClosingPopup(\"#modal-membersearch\");\n}", "function selectUser(event) {\n var editBtn = $(event.target);\n editIndex = editBtn.attr(\"id\").split('-')[1];\n selectedUserId = users[editIndex]._id;\n try {\n userService.findUserById(selectedUserId)\n .then(function (userInfo) {\n console.log(\"userInfo from findUserById\", userInfo);\n $usernameFld.val(userInfo.username);\n $passwordFld.val(userInfo.password);\n $firstNameFld.val(userInfo.firstName);\n $lastNameFld.val(userInfo.lastName);\n $roleFld.val(userInfo.role);\n selectedUser = userInfo;\n });\n }\n catch (err) {\n console.log(err.name + \": \" + err.message);\n }\n }", "async setCurrentUser() {\n const response = await this.client.get('currentUser')\n this.currentUser = response.currentUser\n }", "function selecionarEmpleadoStaff(id){\n\tvar url =$('.staff_empleado_url').attr('id');\n\turl = url+'?empleadoStaff='+id;\n\n\t$.post(url, function( data ) {\n\t\tdata.forEach( function(valor, indice, array) {\n\t\t\t$('#staff_empleado').val(valor.empleado_codigo).trigger('change');\n\t\t\t$('#staff_tarea').val(valor.tarea_codigo).trigger('change');\n\t\t\t$('#estado_staff_empleado').val(valor.activo).trigger('change');\n\t\t\t$('#id_staff').val(id);\n\n\n\t\t});\n\t});\n}", "function createIsStaffSelector(resourceSelector) {\n return createSelector(\n createUserUnitRoleSelector(resourceSelector),\n uiUnitRole => getIsUnitStaff(uiUnitRole),\n );\n}", "function reportSetSelectedStaffMemberName(reportName) {\n\t$(\".reportCurrentStaffMemberName\").each(function () {\n\t\tif (reportName == \"FUNDINGHISTORY\") {\n\t\t\t$(this).text(\"ALL\");\n\t\t} else {\n\t\t\t$(this).text($(\"#AssignedStaffList option:selected\").text());\n\t\t}\n\t});\n}", "function selectUser(index) {\n vm.user = vm.users[index];\n }", "select () {\n this.selected = true;\n }", "function SelectMember(Member) {\n $(\"#TransferMemberId\").val($(Member).parent().parent().find(\".MemberId\").text());\n $(\"#TransferMemberName\").val($(Member).parent().parent().find(\".FirstName\").text() + \" \" + $(Member).parent().parent().find(\".LastName\").text());\n $(\"#modal-membersearch\").modal(\"hide\");\n}", "function activate() {\n teamMember.member.lead = (teamMember.member.name === 'Jett');\n }", "function memberJoinedProject(data) {\n s.membersEditBody.html(data.membersEditPartial);\n s.membersBody.html(data.membersBodyPartial);\n $('.modal-form__member-select').append($('<option>', {\n value: data.memberId,\n text: data.memberUsername\n }));\n\n $(\".members-edit__list\").select2();\n }", "onSelectActor(item) {\n this.selectedActor = item;\n }", "function selectUser(e, ui) {\n\tvar id = ui.item.id,\n\tname = ui.item.value;\n\tif (id) {\n\t\tsearchUsers(id, name);\n\t}\n}", "function selectLog(uid) {\n UserRecords.focusID(uid);\n }", "function chooseUser(name) {\n\tconsole.log(\"chooseUser(): \" + name);\n\t\n\t// clear selection\n\tfor (key in participants) {\n\t\tif (participants[key].selected === true) {\n\t\t\tparticipants[key].setSelected(false);\n\t\t}\t\t\n\t}\n\t// set user with name selected\n\tparticipants[name].setSelected(true);\n\n\tnextVideo.setUserName(name);\n}", "function selectSingleTeamFull(value){\n\tclearCurrentTeamSelections();\n\t//just does the ui\n\tselectTeam(value);\n\t//just does the current selections\n\taddTeamToCurrentSelection(value);\n\tvar currentTeams = getCurrentTeamSelections();\n\tsetSelectedTeams(currentTeams);\n}", "function rolesTest(toSelect) {\n cy.get('[name=\"role\"]').select(toSelect)\n }", "select() {\n this._stepper.selected = this;\n }", "function toggleSelection() {\n\t\t//we want uodate our UI to look like we are making a selection\n\t\t//debugger;\n\t\t//toggle a css class to the element with JavaScript\n\t\tthis.classList.toggle(\"selected\");\n\t\tconsole.log(this.id);\n\t}", "function newMember() {\n\tinquirer\n\t\t.prompt([\n\t\t\t{\n\t\t\t\tname: 'empType',\n\t\t\t\ttype: 'list',\n\t\t\t\tmessage: 'Please select member role:',\n\t\t\t\tchoices: ['Engineer', 'Intern', '-- Finish Team --'],\n\t\t\t},\n\t\t])\n\t\t.then((res, err) => {\n\t\t\tif (err) console.error(err);\n\t\t\tswitch (res.empType) {\n\t\t\t\tcase 'Engineer':\n\t\t\t\t\taddEngineer();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Intern':\n\t\t\t\t\taddIntern();\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-- Finish Team --':\n\t\t\t\t\trenderTeam();\n\t\t\t}\n\t\t});\n}", "function openOneUserAccess() {\n\tif (currentGroup != null && currentGroup.userAccesses.length == 1) {\n\t\tvar userAccess = currentGroup.userAccesses[0];\n\t\tpopulateUserAccessForm(userAccess);\n\t} else {\n\t\thide(\"newUser\");\n\t}\n}", "assignedTo() {\n $.get('/admin/v1/api/members?selected='+$('#selected-member').val(), function (data) {\n $('[data-assigned-to],[data-members]').html(data)\n $('[data-assigned-to],[data-members]').chosen(\"destroy\").chosen()\n })\n }", "function toggleSelection() {\r\n // we want to update our UI to make it look like\r\n //we're making a selection\r\n //debugger;\r\n // toggle CSS class to the element with JavaScript\r\n this.classList.toggle(\"selected\");\r\n console.log(this.id);\r\n }", "function selectUserOverlay(uuid) {\n if (selectedUserUUID) {\n // deselect the old selected user\n deselectUserOverlay(selectedUserUUID);\n }\n userStore[uuid].isSelected = true;\n Overlays.editOverlay(userStore[uuid].overlayID, { color: OVERLAY_SELECTED_COLOR });\n selectedUserUUID = uuid;\n }", "function profileSelect(usr)\n{\n var cur = getActiveDocument();\n if(usr==\"Mike\")\n getDocument('backend/templates/loginPage.xml');\n else\n {\n getDocument('backend/templates/home.xml');\n navigationDocument.removeDocument(cur);\n }\n}", "function applyCurrentStaff(){\n currentN = document.getElementById(\"staff\").value;\n document.getElementById(\"input\").innerHTML = staffDataChangeForm();\n}", "function selectUser(user) {\n self.selected = angular.isNumber(user) ? $scope.users[user] : user;\n self.toggleList();\n\n appContextService.setselectedService(self.selected);\n\n $location.path(user.url);\n\n }", "function selectCf(){\n var panel = View.getControl('', 'sched_wr_cf_cf_form');\n //KB3037631\t- filter the supervisor work team id to keep consistent with on-demand\n\tvar wrId = panel.getFieldValue(\"wrcf.wr_id\");\n\tvar sql = \"(date_contract_exp IS NULL OR date_contract_exp > ${sql.currentDate}) AND assign_work = 1 AND status = 'A' \" +\n\t\t\t\"AND work_team_id IN (SELECT work_team_id FROM wr WHERE wr_id = \"+wrId+\n\t\t\t\t\" UNION SELECT work_team_id FROM cf WHERE email = \" +\n\t\t\t\t\t\"(SELECT email FROM em WHERE em_id = \" +\n\t\t\t\t\t\t\"(SELECT supervisor FROM wr WHERE wr_id = \"+wrId+\")))\";\n if ($('wrcf.scheduled_from_tr_id').value != '') {\n sql += \" AND tr_id ='\" + $('wrcf.scheduled_from_tr_id').value + \"'\";\n }\n View.selectValue(\"sched_wr_cf_cf_form\", getMessage('craftsperson'), [\"wrcf.cf_id\"], \"cf\", [\"cf.cf_id\"], [\"cf.cf_id\", \"cf.name\", \"cf.tr_id\", \"cf.work_team_id\"], sql);\n}", "function StaffController(StaffService, loggerFactory, $mdSidenav, $mdToast, $window) {\n var vm = this;\n vm.staffMembers = [];\n vm.appointment = {};\n vm.selectedMember = null;\n vm.isFabOpen = false;\n vm.isSelected = false;\n vm.selectedMemberIndex = 0;\n vm.selectStaffMember = selectStaffMember;\n vm.toggleMemberList = toggleMemberList;\n vm.toggleSelection = toggleSelection;\n vm.openSideMenu = openSideMenu;\n vm.navigateTo = navigateTo;\n vm.desiredDate = new Date();\n vm.currentTime = new Date().getTime();\n\n activate();\n\n /**\n * Initial execution function on page load.\n */\n function activate() {\n return StaffService.getAllStaffMembers().then(function (data) {\n vm.staffMembers = data;\n vm.selectedMember = data[0];\n loggerFactory.info('Staff Members: ', data);\n }, function (err) {\n loggerFactory.error('Get Staff Members: ', err);\n });\n }\n\n /**\n * Select the current staff member.\n * @param memberId\n */\n function selectStaffMember(member, index) {\n vm.isSelected = false;\n vm.selectedMemberIndex = index;\n vm.selectedMember = angular.isDefined(member) ? member : vm.staffMembers[0];\n if (!$mdSidenav('left').isLockedOpen()) {\n $mdSidenav('left').close();\n }\n }\n\n /**\n * Hide or Show the 'left' SideNav when small screen.\n */\n function toggleMemberList() {\n $mdSidenav('left').toggle();\n }\n\n function toggleSelection() {\n vm.isSelected = !vm.isSelected;\n if(vm.isSelected){\n showFavoriteToast();\n }\n }\n\n /**\n * Open the side menu when small screen.\n */\n function openSideMenu($mdMenu, event) {\n $mdMenu.open(event);\n }\n\n /**\n * Open favorite selected tooltip.\n */\n function showFavoriteToast() {\n $mdToast.show({\n hideDelay: 3000,\n position: 'top right',\n controller: 'ToastController',\n controllerAs: 'toast',\n templateUrl: 'fav_toast_template.html',\n bindToController: true\n });\n }\n\n /**\n * Go to requested URL..\n * @param url\n */\n function navigateTo(url){\n $window.open(url, '_blank');\n }\n }", "getSelectedUser(id) {\n this.props.dispatch({ type: 'FETCH_SELECTED_USER', payload: id });\n this.setState({display:true})\n }", "function addExistingMember(self) {\n show2ListsMembersContainer(self);\n if (!self.list1) {\n getAllTeamMembers(self);\n } \n }", "_getSelectedUser()\n {\n return $('#region-main_projectusers_users select').find(\":selected\").text().trim();\n }", "function SP_UserAssignment(sourceRole, stepUsers, replace)\n{\n\tvar sourceRole = $(document.getElementById(sourceRole));\n\tvar stepUsers = $(document.getElementById(stepUsers));\n\n\tif (replace) {\n\t\tstepUsers.find('option').prop('selected',false);\n\t}\n\tsourceRole.find('option:selected').each(function() {\n\t\topt = $(this);\n\t\tvar fulltext = opt.text();\n\t\tvar userid = opt.text().substring(fulltext.lastIndexOf('(')+1, fulltext.lastIndexOf(')'));\n\t\tstepUsers.find('option[value*=\"'+userid+'\"]').prop('selected',true);\n\t});\n}", "optionClickedStaff(optionsList) {\r\n this.getGroupStaff(optionsList);\r\n}", "function viewtheirstuff(userselected) { \n viewwhichuser(userselected);\n backtotop();\n }", "function selectThis(selected) {\n if(!selected || isNaN(selected)) { selected = 1; return; }\n\n let selEl = document.querySelector('.paste[data-selected=true]');\n let elToChange = document.querySelector(`#opt_${selected}`);\n\n if(!selEl || !elToChange) return;\n\n selEl.dataset.selected = false;\n elToChange.parentNode.dataset.selected = true;\n scrollIntoView(elToChange.parentNode)\n}", "function newMemberChoice() {\n inquirer.prompt(nextMember).then(answer => {\n if (answer.newMember !== 'No more team members to add') {\n newMemberQuestions(answer.newMember)\n } else {\n fs.writeFile(outputPath,render(teamMembers),err => {\n if (err) throw err;\n console.log('I present to you: the Dream Team');\n });\n }\n })\n}", "selectRandom() {\n const index = Math.floor(Math.random() * 6) + 1;\n const { id } = self.data[index];\n self.selectClub(id);\n }", "function setSimpleSelection(doc, anchor, head, options) {\n\t\t setSelection(doc, simpleSelection(anchor, head), options);\n\t\t }", "function setSimpleSelection(doc, anchor, head, options) {\n\t\t setSelection(doc, simpleSelection(anchor, head), options);\n\t\t }", "function select () {\r\n\t\t\t\tthis.tool.select();\r\n\t\t\t}", "function onLoginSubmit() {\n var select = document.getElementById(\"currentUsersList\");\n var userId = select.options[select.selectedIndex].value;\n var role = select.options[select.selectedIndex].innerHTML;\n \n logIn(userId,role);\n }", "function selectUser(user) {\n $rootScope.$emit(\"changeUser\", user);\n }", "function activateSubmittedByDropdown()\n{\n\t// get the member id from the member name field\n\tvar memberId = document.getElementById(\"member_name\").value;\n\t// send member id as get request to list_admin function in LettersController\n\t$.ajax({\n\t\turl: 'list_admin',\n\t\ttype: 'GET',\n\t\tdata: {\n\t\t\tmember_id : memberId\n\t\t},\n\t\terror: function(){\n\t\t\talert('Did not work');\n\t\t},\n\t\tsuccess: function(data){\n\t\t\t// populate submitter name menu with result\n\t\t\t$(\"#submitter_name\").html(data);\n\t\t}\n\t});\n}", "selectOption() {\n switch ( this.index ) {\n case 0:\n this.scene.start( 'GameScene' );\n break;\n }\n }", "async setCurrentUser() {\n const currentUser = await firebase.auth().currentUser;\n this.setState({currentUser: currentUser});\n }", "function setSimpleSelection(doc, anchor, head, options) {\n\t setSelection(doc, simpleSelection(anchor, head), options);\n\t }", "function setSimpleSelection(doc, anchor, head, options) {\n\t setSelection(doc, simpleSelection(anchor, head), options);\n\t }", "function setSimpleSelection(doc, anchor, head, options) {\n\t setSelection(doc, simpleSelection(anchor, head), options);\n\t }", "function refreshSelect() {\n if(selectedIndex == -1) {\n return;\n }\n\n if(selectFlag == \"ONE\") {\n selectUserFromList(userSelected.username, userSelected.contact_id, userSelected.id, \"CONTACT\");\n }\n else {\n selectGrpFromList(grpSelected.grpID, grpSelected.grpName);\n }\n}", "select() {\n this.battle.commander.current.action = new Action(this.model, this.character);\n this.battle.commander.current.select(new TargetsCommandsPanel(this.model, this.character));\n }", "function getMember(next) {\n setTimeout(() => {\n next('Member 1')\n }, 1500)\n}", "function toChangeStaffData(){\n if(staffs.length > 0){\n currentN = staffs[0].n;\n }\n document.getElementById(\"input\").innerHTML = staffDataChangeForm();\n}", "function handleFormSubmit(event) {\n event.preventDefault();\n var SelUser = memberSelect.val();\n\n //function for showing reports of selected member\n\n\n // end function for showing reports of selected member\n\n console.log(\"Which user was selected? \", SelUser);\n return SelUser\n}", "function selectStudent(studentName) {\n\tconst student = findStudentElement(studentName.trim());\n\tstudent.click();\n\tsetTimeout(() => {\n\t\tArray.from(document.querySelectorAll('.pure-button.pure-button-primary')).filter(button => button.textContent == 'Show Files')[0].click();\n\t}, 1000);\n}", "function findCurrentUser() {\n return \"stefan\"\n }", "function anotherMember() {\n inquirer\n .prompt([\n {\n type: 'list',\n message: 'Would you like to add another team member?',\n choices: ['Manager', 'Engineer', 'Intern', 'None'],\n name: 'type',\n },\n ])\n .then((response) => {\n switch (response.type) {\n case 'Manager':\n managerQs();\n break;\n case 'Engineer':\n engineerQs();\n break;\n case 'Intern':\n internQs();\n break;\n default:\n generateHTML();\n break;\n }\n });\n}", "function setSimpleSelection(doc, anchor, head, options) {\r\n setSelection(doc, simpleSelection(anchor, head), options);\r\n}", "selectPerfil(profile) {\n // Agrega el id del perfil a la transición\n this.transitionTo('perfil', profile.get('id'));\n }", "function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options)\n}", "function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options)\n}", "function findUserByStaffId(staffId){\n\tvar findUser = null;\n\t$.each(users, function(index, user){\n\t\tif(staffId == user.staffId){\n\t\t\tfindUser = user; \n\t\t}\n\t});\n\treturn findUser;\n}", "function assignMember(e){\n if(e.target.className==\"AssignMembers\"){\n \n var newMember= document.createElement('div');\n \n var selectedOptionIndexValue = document.getElementById(\"boxAssignMembersContent21\")[selectedMemberIndex].value;\n var textNode= document.createTextNode(selectedOptionIndexValue);\n newMember.appendChild(textNode);\n newMember.className=\"newMember\";\n \n e.target.parentElement.appendChild(newMember); \n } \n}", "async select(selectedCursor) {\n this.applySelectedCursorStyling(selectedCursor);\n await this.userRepository.setSelectedCursor(sessionManager.get(\"userId\"), selectedCursor);\n }", "function renderMemberList(data) {\n if (!data.length) {\n window.location.href = \"/members\";\n }\n $(\".hidden\").removeClass(\"hidden\");\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createMemberRow(data[i]));\n }\n memberSelect.empty();\n console.log(rowsToAdd);\n console.log(memberSelect);\n memberSelect.append(rowsToAdd);\n memberSelect.val(userId);\n console.log(\"I selected \", memberSelect, \"!!!\")\n }", "function selectID(belly) {\r\n return belly.id == userSelection;\r\n }", "function setSimpleSelection(doc, anchor, head, options) {\r\n setSelection(doc, simpleSelection(anchor, head), options);\r\n }", "function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }", "function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }", "function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }", "function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }", "function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }", "function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }", "function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }", "function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }", "function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }", "function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }", "function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }", "function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }", "function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }" ]
[ "0.6085138", "0.60093236", "0.5921727", "0.5857276", "0.5638627", "0.5568501", "0.551495", "0.5491164", "0.54646754", "0.5442988", "0.5425162", "0.54168624", "0.5379206", "0.53753644", "0.5370801", "0.53613", "0.5348411", "0.5306193", "0.52819854", "0.523915", "0.5230852", "0.52296746", "0.5226338", "0.52184504", "0.52173555", "0.5212509", "0.51776785", "0.51663303", "0.51555336", "0.5146705", "0.5126823", "0.5124831", "0.5124372", "0.5123755", "0.512353", "0.5119942", "0.5110071", "0.5105359", "0.50916815", "0.5074599", "0.50662535", "0.5065024", "0.5054629", "0.5050029", "0.5033746", "0.50331265", "0.50179166", "0.50125945", "0.50013787", "0.49969932", "0.49955276", "0.49785528", "0.495574", "0.49327648", "0.49299505", "0.49282244", "0.49192226", "0.49146134", "0.49039108", "0.49039108", "0.49018648", "0.48991874", "0.48946446", "0.48935032", "0.48922005", "0.4888238", "0.4883201", "0.4883201", "0.4883201", "0.48828486", "0.48690298", "0.4861417", "0.48582602", "0.48497882", "0.48439935", "0.48389354", "0.48387378", "0.48360005", "0.48359707", "0.48293966", "0.48293966", "0.48269233", "0.48250896", "0.48166975", "0.4811263", "0.48086923", "0.48019227", "0.4797858", "0.4797858", "0.4797858", "0.4797858", "0.4797858", "0.4797858", "0.4797858", "0.4797858", "0.4797858", "0.4797858", "0.4797858", "0.4797858", "0.4797858" ]
0.71720594
0
Hide or Show the 'left' SideNav when small screen.
function toggleMemberList() { $mdSidenav('left').toggle(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showNav()\n\t{\n\t\tmobileNav = !mobileNav;\n\t\tif(mobileNav)\n\t\t{\n\t\t\t$(\"#side_nav\").addClass('show-nav');\n\t\t\t$('html,body').css('overflow','hidden');\n\t\t} else {\n\t\t\t$('#side_nav').removeClass('show-nav');\n\t\t\t$('html,body').css('overflow','auto');\n\t\t}\n\t}", "function hideMenuOnBigScreen() {\n if (window.innerWidth > 555) {\n closeSideNav();\n }\n}", "function openNav() {\n\t\tif (window.outerWidth ==768){\n\t\t\tdocument.getElementById(\"mySidenav\").style.width = \"220px\";\n\t\t\tdocument.getElementById(\"main\").style.marginLeft = \"210px\";\n\t\t}\n\t\telse if (window.outerWidth >480){\n\t\t\tdocument.getElementById(\"mySidenav\").style.width = \"250px\";\n\t\t\tdocument.getElementById(\"main\").style.marginLeft = \"250px\";\n\t\t}\n else{\n\t\t document.getElementById(\"mySidenav\").style.width = \"100%\";\n\t\t\tdocument.getElementById(\"main\").style.marginLeft = \"100%\";\n\t\t}\n \n\t}", "function showOnLeftSubMenu() {\r\n\t\t\t\r\n\t\t\t// Show on left class for minimal styling.\r\n\t\t\t$('#header-outer .sf-menu > li:not(.megamenu) > ul > li > ul').each(function () {\r\n\t\t\t\t\r\n\t\t\t\t$(this).removeClass('on-left-side');\r\n\t\t\t\t\r\n\t\t\t\tif ($(this).offset().left + $(this).outerWidth() > $window.width()) {\r\n\t\t\t\t\t$(this).addClass('on-left-side');\r\n\t\t\t\t\t$(this).find('ul').addClass('on-left-side');\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$(this).removeClass('on-left-side');\r\n\t\t\t\t\t$(this).find('ul').removeClass('on-left-side');\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t}", "function toggleMenuList() {\n $mdSidenav('left').toggle();\n }", "function toggleNewsList() {\n $mdSidenav('left').toggle();\n }", "function toggleMenuList() {\n $mdSidenav('left').toggle();\n }", "function toggleMenusList() {\n $mdSidenav('left').toggle();\n }", "function showNavWeb() {\n if (window.innerWidth > 768) {\n showButton.parentElement.className = 'hamburger-button hide';\n menuContent.className = 'modal-navigation-mobile hide';\n menuNavWeb.className = 'nav-link-container flex row';\n } else {\n showButton.parentElement.className = 'hamburger-button flex row';\n menuContent.className = 'modal-navigation-mobile hide';\n menuNavWeb.className = 'nav-link-container hide';\n }\n}", "function showNavMenuDesktop() {\n\tif (getBrowserWidth() >= 992) {\n\t\tshowElement(navMenu, \"none\");\n\t} else if (getBrowserWidth() < 992) {\n\t\thideElement(navMenu, \"translateX(100%)\");\n\t}\n}", "function toggleSideNav() {\n if ($('.nav-links-li').is(':hidden')) {\n $('.nav-links-li').removeClass('hide');\n $('.nav-links-li').addClass('show');\n } else {\n $('.nav-links-li').removeClass('show');\n $('.nav-links-li').addClass('hide');\n }\n}", "function openNav()\n{\n let sideBar = document.querySelector(\".side-nav\");\n sideBar.style.visibility = \"visible\";\n sideBar.style.width = \"100%\";\n}", "function openNav(){\n\tif (detectMobile() == true) {\n\tdocument.getElementById(\"mySidenav\").style.width = \"100%\";\n\t} else {\n\tdocument.getElementById(\"mySidenav\").style.width = \"40%\";\n\t}\n\n}", "function showSideMenu() {\n if (sideMenuToggle == 0) {\n $(\"#mainpane\").animate({\n left: \"300\"\n }, 500);\n sideMenuToggle = 1;\n }\n else {$(\"#mainpane\").animate({\n left: \"0\"\n }, 500);\n sideMenuToggle = 0;\n }\n}", "function openNav() {\n closeRightNav();\n document.getElementById(\"mySidenav\").style.width = \"550px\";\n document.getElementById(\"mySidenav\").style.left = \"0\";\n}", "function hideSidebar() {\n if (window.innerWidth <= smValue) {\n sidebar.classList.add(hideClass);\n } else {\n sidebar.classList.remove(hideClass);\n }\n}", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"500px\";\n document.getElementById(\"sideOverlay\").style.display = \"block\";\n }", "function openNav() {\n $('#nav-list li').removeClass('treelisthidden');\n storage.setItem(treesettings, '1');\n $('#sideNavigation').css('display', 'block');\n\n $('#sideNavigation').css('width', '300px');\n $('body.support_kb').find('.cover').css('display', 'none');\n $('body.support_kb').find('#sidefoot').css({\n 'width': '300px',\n 'margin-left': ''\n });\n $('#sidefoot').css('display', 'block');\n $('.footer-inner').css('padding-left', '300px');\n $('body').find('main').css('width', 'calc(100% - 100px)');\n $('body.support_kb').find('#sideNavigation').css('margin-left', '0');\n $('body').find('main').css('width', 'calc(100% - 350px)');\n\n (function() {\n try {\n $('#sideNavigation').resizable(\"enable\");\n } catch (err) {\n setTimeout(arguments.callee, 200)\n }\n })();\n\n $('#side-toggle').attr('class', 'fa fa-angle-double-left');\n\n }", "function toggleList() {\n $log.info(' NavbarController $mdSidenav=');\n $mdSidenav('left').toggle();\n }", "function showNav() {\n $('.mobile-nav-button').removeClass('active');\n $('.mobile-search-button').removeClass('active');\n //if (($(window).width() >= MIN_NON_TABLET_SIZE && !Modernizr.ipad) || ($(window).width()<MIN_NON_TABLET_SIZE && $('header.ot, header.campaign').length==0)) {\n //if ($(window).width() > MIN_NON_TABLET_SIZE && !Modernizr.ipad) {\n if ($(window).width() > MIN_NON_MOBILE_SIZE) {\n $('.main-header-nav').show().css({'height':'', 'right':''});\n }\n else {\n $('.main-header-nav').hide().find('.active').removeClass('active');\n $('.main-header-nav > ul').css('left', '0px');\n }\n showDisplayName();\n}", "function displaySidebar(){\n var w = document.documentElement.clientWidth;\n\n var toggleButton = document.getElementById(\"openNav\");\n var main = document.getElementById(\"main\");\n var sidebar = document.getElementById(\"mySidebar\");\n var navbar = document.getElementById(\"navbar\");\n\n if(w >= 993) {\n\n main.style.marginLeft = \"300px\";\n sidebar.style.width = \"300px\";\n sidebar.style.display = \"block\";\n navbar.classList.add('w3-hide-large');\n }\n \n}", "function toggleSideMenu() {\n\t$( \".side-menu\" ).animate( {'width': 'toggle'});\n\tif ($('.side-menu').width()>1) {\n\t\t$( \".main-content\" ).animate( {'margin-left': '0'});\n\t}\n\telse {\n\t\t$( \".main-content\" ).animate( {'margin-left': '200px'});\n\t}\n}", "function ybSideNavVisibility(status) {\n const navSidebar = document.querySelector('aside.td-sidebar');\n\n let preWidth = 300;\n if (status === 'hide') {\n let leftMenuWidth = navSidebar.style.width;\n if (leftMenuWidth < 300) {\n leftMenuWidth = 300;\n } else if (leftMenuWidth > 500) {\n leftMenuWidth = 300;\n }\n\n navSidebar.setAttribute('data-pwidth', leftMenuWidth);\n jQuery('.left-sidebar-wrap-inner').animate({\n opacity: '0',\n });\n jQuery('aside.td-sidebar').animate({\n minWidth: '0px',\n width: '60px',\n maxWidth: '60px',\n });\n } else {\n if (ybGetCookie('leftMenuWidth')) {\n preWidth = ybGetCookie('leftMenuWidth');\n }\n\n if (navSidebar.getAttribute('data-pwidth')) {\n preWidth = navSidebar.getAttribute('data-pwidth');\n }\n\n if (preWidth < 300) {\n preWidth = 300;\n } else if (preWidth > 500) {\n preWidth = 300;\n }\n\n jQuery('.left-sidebar-wrap-inner').animate({\n opacity: '1',\n });\n\n jQuery('aside.td-sidebar').animate({\n width: preWidth,\n maxWidth: preWidth,\n });\n }\n }", "function show_menu_bars(){\n if(window.innerWidth <= 1000){\n setAct(true)\n setNavs(false)\n }\n else{\n setAct(false)\n setNavs(true)\n }\n }", "function navController(){\n if ( document.getElementById(\"mySidenav\").style.width == \"0px\" ){\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"content-wrapper\").style.marginLeft = \"250px\";\n }\n else {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"content-wrapper\").style.marginLeft = \"0px\";\n }\n }", "function switchSideMenu() {\n\n var sideMenu = document.querySelector(\".side-menu\");\n\n if (sideMenu.style.display == \"block\") {\n\n sideMenu.style.display = \"none\";\n\n } else {\n\n sideMenu.style.display = \"block\";\n }\n}", "function toggleMenu()\n{\n\t// Get the left panel\n\tvar menu = document.getElementById(\"mobile-menu\");\n\t\n\t// If the panel is visible (displayed), remove it\n\tif(menu.style.display == \"block\")\n\t{\n\t\tmenu.style.display = \"none\";\n\t}\n\t\n\t// If the panel is not displayed, display it\n\telse\n\t{\n\t\tmenu.style.display = \"block\";\n\t\tmenu.style.width = \"100%\";\n\t\t\n\t\tdocument.body.scrollTop = document.documentElement.scrollTop = 0;\n\t}\n}", "function showNav() {\n let navWidth = getNavWidth()[0]; //Get the sideNav Width\n document.getElementById(\"sideNav\").style.left = \"0px\"; //Set the sideNav left style property to 0 - this will transition the sideNav from it's offset position onto the window\n document.getElementById(\"sideNavDocOverlay\").style.zIndex = \"999\"; //Set the sideNavDocOverlay zIndex to 999. This will ensure that it appears over all content except the sideNav\n document.getElementById(\"sideNavDocOverlay\").style.backgroundColor = \"rgba(0,0,0,0.7)\"; //Set the sideNavDocOverlay backgroundColor style property to 70% translucent black (from 100% default)\n document.getElementById(\"sideNavDocOverlay\").style.left = navWidth; //Set the sideNavDocOverlay left style property to match the navWidth. This will transition the overlay from the left in line with the sideNav transition\n}", "function hideNav() {\n let navOffset = getNavWidth()[1]; //Get the sideNav Width\n document.getElementById(\"sideNav\").style.left = navOffset; //Set the sideNav left style property to negative width - this will transition the sideNav fully off of the left side of the window\n document.getElementById(\"sideNavDocOverlay\").style.zIndex = \"-1000\"; //Set the sideNavDocOverlay zIndex to -1000, ensuring that it drops behind all other content\n document.getElementById(\"sideNavDocOverlay\").style.backgroundColor = \"rgba(0,0,0,0.0)\"; //Set the sideNavDocOverlay backgroundColor style property to the default of 100% translucent\n document.getElementById(\"sideNavDocOverlay\").style.left = \"0px\"; //Set the sideNavDocOverlay left style property to 0. This will transition the overlay across the window in line with the sideNav transition\n}", "function toggleSideNav( name ) {\n $mdSidenav(name).toggle();\n }", "function showLeftFunction() {\n if(hasClass(menuLeft, \"mob-menu-open\")) {\n menuLeft.className = \"mob-menu\";\n } else {\n menuLeft.className += \" mob-menu-open\";\n }\n}", "function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"250px\";\n if (screen.width<=630) {\n document.getElementById(\"mySidebar\").style.width = \"100%\";\n document.getElementById(\"mySidebar\").style.Left = \"0px\";\n\n }\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n\n}", "function toggleSideNav() {\n if ($( '.nav-links-li' ).is( ':hidden' )){\n $('.nav-links-li').removeClass('hide');\n $('.nav-links-li').addClass('show');\n } else {\n $('.nav-links-li').removeClass('show');\n $('.nav-links-li').addClass('hide');\n }\n}", "function hideSideBar() {\n if (isMenuOpen) {\n setSideBarClass('hide');\n setMainScreenClass('col-sm-12');\n setArrowSide(openLogo);\n setIsMenuOpen(false);\n setMainScreenArrowClass('img-fluid arrow-img')\n } else {\n setSideBarClass('col-sm-2 sidebar-col');\n setMainScreenClass('col-sm-10');\n setArrowSide(closeLogo);\n setIsMenuOpen(true);\n setMainScreenArrowClass('hide')\n }\n\n }", "function sideMenuShow() {\n if (sideMenu.className == \"closed\") {\n sideMenu.classList.toggle(\"closed\");\n localStorage.setItem(\"state\", \"open\");\n } else {\n sideMenu.classList.toggle(\"closed\");\n localStorage.setItem(\"state\", \"closed\");\n }\n}", "function togglePiecesList() {\n $mdSidenav('left').toggle();\n }", "function toggleMenuLinks () {\n\t\tif (sitenavMinWidth < $(window).width()) {\n\t\t\t$(\"body\").removeClass(\"ibm-sitenav-menu-hide\");\n\t\t}\n\t\telse {\n\t\t\t$(\"body\").addClass(\"ibm-sitenav-menu-hide\");\n\t\t}\n\t}", "displaySideNav(){\n if(this.state.showSideNav){\n console.log('side nav show')\n this.state.showSideNav();\n }\n }", "function toggleAccountsList () {\n if ($mdMedia('md') || $mdMedia('sm')) $mdSidenav('left').toggle()\n }", "function toggleProjectList() {\n $mdSidenav('left').toggle();\n }", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n $(\"#OpenSidebar\").css('visibility', 'visible').hide().show(500);\n //document.getElementById('page1-text').style.marginLeft=\"10%\";\n}", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"500px\";\n document.getElementById(\"sideOverlay\").style.display = \"block\";\n}", "function toggleNav() {\n $('#show-menu').toggleClass(\"is-active\");\n if ($('#site').css('margin-left') == '-300px') {\n $('#site').css('margin-left', '0');\n } else {\n $('#site').css('margin-left', '-300px');\n }\n}", "function showHamburgerNav () {\n let hamburger = document.getElementById(\"hamburgerNav\");\n //let desktopNav = document.getElementById(\"desktop_nav\");\n if (window.innerWidth <= 375) {\n hamburger.display === \"block\";\n } else {\n hamburger.display === \"none\";\n }\n}", "function openNav() {\n var windowWidth = $(window).width();\n console.log(windowWidth);\n if (windowWidth < 1000) {\n document.getElementById(\"mySidenav\").style.width = \"100%\";\n } else {\n document.getElementById(\"mySidenav\").style.width = \"500px\";\n document.getElementById(\"main\").style.paddingLeft = \"500px\";\n }\n}", "function showMallNav() {\n mallNav.classList.remove('mallnav--hidden');\n }", "function navToggle() {\n var width = document.body.clientWidth;\n if (width <= 840) {\n $(\".nav\").toggle('slide',{direction:'right'},300);\n $('#nav-toggle').toggleClass('active'); \n }\n }", "showMobilemenu() {\n document.getElementById('main-wrapper').classList.toggle('show-sidebar');\n }", "function toggleSidebar() {\n // Note: The remove and add classes are important to make sure this works when you change from small to large\n // screen and vice versa after clicking the sidebar.\n if ($(window).width() < 1024) {\n // Mobile view\n $sidebar\n .removeClass(sidebarClosedState)\n .addClass('lg:sp-w-72')\n .toggleClass('sp-w-72 sm:sp-w-72 sm:sp-w-8 ' + sidebarOpenState);\n\n $sidebar.find('.sp-toggle-sidebar')\n .addClass('lg:sp-ml-72')\n .toggleClass('sp-ml-72 sm:sp-ml-72 sm:sp-ml-8');\n } else {\n // Desktop view\n $sidebar\n .removeClass('sp-w-72 sm:sp-w-72 ' + sidebarOpenState)\n .toggleClass('lg:sp-w-72 ' + sidebarClosedState);\n\n $sidebar.find('.sp-toggle-sidebar')\n .removeClass('sp-ml-72 sm:sp-ml-72')\n .toggleClass('lg:sp-ml-72');\n }\n }", "function openNav() {\r\n if (isDrawerEnable) {\r\n closeNav();\r\n isDrawerEnable = false;\r\n return;\r\n }\r\n document.getElementById(\"mySidenav\").style.width = \"250px\";\r\n isDrawerEnable = true;\r\n}", "function hideNav() {\n\tif ($(window).width() <= 800){\n \t toggleNavElements();\n removeNavDropdownLinks();\n }\n}", "function showMediaInfoSidebar() {\n $rightSideBar.removeClass('d-none');\n }", "function showMallNav() {\n classie.remove(mallNav, 'mallnav--hidden');\n }", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n hideDivs();\n}", "toggleSidebarMobile() {\n Ember.$('.ui.sidebar.main.menu').sidebar('toggle');\n\n if (Ember.$('.inverted.vertical.main.menu').hasClass('visible')) {\n Ember.$('.sidebar.icon.text-menu-show').removeClass('hidden');\n Ember.$('.sidebar.icon.text-menu-hide').addClass('hidden');\n Ember.$('.bgw-opacity').addClass('hidden');\n } else {\n Ember.$('.sidebar.icon.text-menu-show').addClass('hidden');\n Ember.$('.sidebar.icon.text-menu-hide').removeClass('hidden');\n Ember.$('.bgw-opacity').removeClass('hidden');\n }\n }", "showMobilemenu() {\n document.getElementById(\"main-wrapper\").classList.toggle(\"show-sidebar\");\n }", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n $(\"#allProd\").show();\n $(\"#signupdiv\").hide();\n $(\"#logindiv\").hide();\n $(\"#gestionFilmDiv\").hide();\n\n}", "static openNav() {\n ElementHandler.setElementCSSById('sidebarMenu', 'width', \"250px\");\n ElementHandler.setElementCSSById('openSidebar', 'width', \"250px\");\n ElementHandler.hideElementById('openSidebar');\n }", "function hideOrShowMenus(){\n\tresizeSidebar(\"menu\");\n}", "function toggleNav(size){\n\tdocument.getElementById(\"settingsNav\").style.width = size;\n\ttransport.settings.sidenavElementState = size;\n\t// We need to update the network traffic whenever the nav is re-opened\n\tif(size){\n\t\ttransport.settings.setNetTraffic(transport.parceler.recieveData, true);\n\t\ttransport.settings.setNetTraffic(transport.parceler.transmitData, false);\n\t}\n\tvar element = document.getElementById(\"gear\").style;\n\telement.visibility = element.visibility === \"hidden\" ? \"visible\" : \"hidden\";\n}", "function toggleLeft() {\n\tcontainer = calcContainer();\n\tcenter = calcCenter();\n\tleft = calcLeft();\n\tright = calcRight();\n\n\t$('#left').toggle(); // Toggle show/hide\n\tleftShow = !leftShow; // Toggle the boolean.\n\n\tmaximizeVideoPlayerResolution();\n\n\tif (leftShow && rightShow) {\n\t\tapplyResolutions();\n\t}\n}", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n\n sideopen.style.marginLeft = \"250px\"; \n sideclose.style.visibility = \"visible\";\n sideclose.style.marginLeft = \"250px\";\n sideclose.style.zIndex = \"15\";\n sideopen.style.visibility = \"hidden\";\n \n}", "function closeLeftSideBar(){\n notifyScreenreader(\"closed user settings\");\n removeSideBar(\"#leftSidebar\", \"#leftSidebarCollapse\");\n}", "function menuToggle() {\n if (window.innerWidth < 768) {\n $(\".dropdown\").slideToggle(\"400\");\n }\n }", "function mobileSidebar() {\n\t\tif(jQuery('.product-view .sidebar-left').length){\n\t\t\tsidebar = jQuery('.product-view .sidebar-left');\n\t\t\tcontent = jQuery('.product-view .product-essential');\n\t\t\tsetTimeout(function(){\n\t\t\t\tif(jQuery(document.body).width() < 767) {\n\t\t\t\t\tcontent.parent().css('padding-bottom', sidebar.outerHeight(true));\n\t\t\t\t\tsidebar.css({\n\t\t\t\t\t\t'top' : content.outerHeight(),\n\t\t\t\t\t\t'width' : content.width()\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tcontent.parent().attr('style', '');\n\t\t\t\t\tsidebar.attr('style', '');\n\t\t\t\t}\n\t\t\t}, 1000);\n\t\t} \n\t}", "function togglePagesMenu() {\n var pending = $mdBottomSheet.hide() || $q.when(true);\n \n pending.then(function(){\n $mdSidenav('left').toggle();\n });\n }", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"200px\";\n document.getElementById(\"myContent\").style.opacity = 0.85;\n document.getElementById(\"footer\").style.display = \"none\";\n}", "function showMenuBtn(){\n\t\tif($(window).width()<1199.98){\n\t\t\t$(\".open_menu\").addClass(\"d-block\");\n\t\t\t$(\"header nav\").addClass(\"d-none\");\n\t\t\t$(\".navigation_mobile\").removeClass(\"opened\");\n\t\t}else{\n\t\t\t$(\".open_menu\").removeClass(\"d-block\");\n\t\t\t$(\"header nav\").removeClass(\"d-none\");\n\t\t\t$(\".navigation_mobile\").removeClass(\"opened\");\n\t\t}\n\t}", "function showMenuBtn(){\n\t\tif($(window).width()<1199.98){\n\t\t\t$(\".open_menu\").addClass(\"d-block\");\n\t\t\t$(\"header nav\").addClass(\"d-none\");\n\t\t\t$(\".navigation_mobile\").removeClass(\"opened\");\n\t\t}else{\n\t\t\t$(\".open_menu\").removeClass(\"d-block\");\n\t\t\t$(\"header nav\").removeClass(\"d-none\");\n\t\t\t$(\".navigation_mobile\").removeClass(\"opened\");\n\t\t}\n\t}", "function _toggleSideNav(navID) {\n $mdSidenav(navID)\n .toggle();\n }", "function sidemenuToggle() {\n if(isSideMenuOpen) {\n sidemenuClose();\n } else {\n sidemenuOpen();\n }\n}", "function sidemenuToggle() {\n if(isSideMenuOpen) {\n sidemenuClose();\n } else {\n sidemenuOpen();\n }\n}", "function handleSmallScreens() {\n document.querySelector('.navbar-toggler')\n .addEventListener('click', () => {\n let navbarMenu = document.querySelector('.navbar-menu')\n\n if (navbarMenu.style.display === 'flex') {\n navbarMenu.style.display = 'none'\n return\n }\n\n navbarMenu.style.display = 'flex'\n })\n}", "function handleSmallScreens() {\n document.querySelector('.navbar-toggler')\n .addEventListener('click', () => {\n let navbarMenu = document.querySelector('.navbar-menu')\n\n if (navbarMenu.style.display === 'flex') {\n navbarMenu.style.display = 'none'\n return\n }\n\n navbarMenu.style.display = 'flex'\n })\n}", "function toggleSideBar() {\n id(\"tab\").classList.toggle(\"hidden\");\n id(\"options\").classList.toggle(\"move\");\n }", "function handleSmallScreens() {\r\n document.querySelector('.navbar-toggler')\r\n .addEventListener('click', () => {\r\n let navbarMenu = document.querySelector('.navbar-menu')\r\n\r\n if (navbarMenu.style.display === 'flex') {\r\n navbarMenu.style.display = 'none'\r\n return\r\n }\r\n\r\n navbarMenu.style.display = 'flex'\r\n })\r\n}", "function openSideBar() {\n if(mobileWidthCheck > 375) {\n console.log('largerScreen');\n document.getElementById('tableOfContents').style.width = \"350px\";\n }\n else if (mobileWidthCheck <= 375) {\n console.log('smallerScreen');\n document.getElementById('tableOfContents').style.width = \"200px\";\n }\n }", "function toggleSideNav(){\n var cn = document.getElementById(\"mySidenav\");\n //test for existance\n if( cn.classList.contains(\"collapsed\") ) {\n cn.style.width = \"350px\";\n document.getElementsByClassName('sidenav')[0].classList.toggle('collapsed');\n } else {\n cn.style.width = \"0\";\n document.getElementsByClassName('sidenav')[0].classList.toggle('collapsed');\n }\n }", "function showLeft() {\n\n document.querySelector('.frame').classList.remove('right');\n document.querySelector('.frame').classList.add('left');\n }", "function sidenavOpen () {\n sidenavBar.style.transform = 'translateX(0%)'\n sidenavStatus = true\n}", "function openNav_responsive() {\n options.jq.contentWell.css({\n position : 'absolute',\n top : 0,\n left : 0,\n height : '100%',\n overflow : 'hidden'\n });\n options.jq.navContainer.animate({marginLeft: 0}, animConfig());\n options.jq.contentWell.animate({left: '100%'}, animConfig(function () {\n options.jq.contentWell.hide();\n }));\n setNavState(1);\n }", "toggleMenuInMobile () {\n try {\n const windowWidth = window.innerWidth\n if (windowWidth > MENU_HIDE_WIDTH) return\n const toggleEle = document.getElementsByClassName('sidebar-toggle')\n toggleEle[0].click()\n } catch (error) {}\n }", "function menuOpenClicked() {\n document.getElementById('leftSideBar').style.left = \"0\";\n document.getElementById('emptyPage').style.left = \"0\";\n }", "function openNav() {\ndocument.getElementById(\"sidenav\").style.left = \"0\";\n}", "function show_responsive_menu() {\n var menuEl = $('#main-navigation ul');\n if (window.innerWidth <= 767) { // mobile \n if (visibleMobileMenu) {\n menuEl.show().css('opacity', 1);\n } else {\n menuEl.hide();\n }\n } else { // desktop\n menuEl.show().css('opacity', 1);\n }\n }", "function hideSidebar()\n{\n if(window.innerWidth <= 991)\n {\n $('body').removeClass('sidebar-open');\n $('body').addClass('sidebar-collapse');\n }\n}", "function openNav() {\r\n side_nav.style.width = \"250px\";\r\n side_nav_shader.style.display = \"block\";\r\n}", "function openSide() {\n sideMenu.style.height = \"100vh\";\n sideMenu.style.width = \"75%\";\n sideLinks.style.display = \"flex\";\n application.style.display = \"flex\";\n toggler.style.display = \"none\";\n overlayed.style.display = \"block\";\n}", "function toggleUsersList() {\n $mdSidenav('left').toggle();\n }", "function toggleUsersList() {\n $mdSidenav('left').toggle();\n }", "function toggleUsersList() {\n $mdSidenav('left').toggle();\n }", "function openNav() {\n $('#mySidenav').fadeIn();\n $('#main').css('margin-left', '-250px');\n $('#main').css('margin-right', '250px');\n $('#mySidenav').css('margin-left', '-250px');\n $('#mySidenav').css('margin-right', '250px');\n}", "toggleNav() {\n if ($(\"#offcanvas-menu-react\").hasClass(\"navslide-show\")) {\n $(\"#offcanvas-menu-react\").removeClass(\"navslide-show\").addClass(\"navslide-hide\")\n $(\".navbar\").removeClass(\"navslide-show\").addClass(\"navslide-hide\")\n $(\".nav-canvas\").removeClass(\"navslide-show\").addClass(\"navslide-hide\")\n }\n else {\n $(\".nav-canvas\").css(\"position\", \"relative\")\n $(\"#offcanvas-menu-react\").removeClass(\"navslide-hide\").addClass(\"navslide-show\")\n $(\".navbar\").removeClass(\"navslide-hide\").addClass(\"navslide-show\")\n $(\".nav-canvas\").removeClass(\"navslide-hide\").addClass(\"navslide-show\")\n }\n }", "showMenu() {\n this.$('jira-sidebar__menu').removeClass('jira-hidden');\n this.animate('in', width.sidebarSmall);\n }", "function openNav() {\r\n\t\tdocument.getElementById(\"mySidenav\").style.width = \"100%\";\r\n\t}", "function openSideBar(){\n document.getElementById(\"left-nav\").style.width=\"80px\";\n document.getElementById(\"main\").style.marginLeft=\"80px\";\n\n}", "function YATAToggleSideBar(left, show) {\n var item = \"YATAIconNav\";\n var side = (left) ? \"-left\" : \"-right\";\n var div = (left) ? \"YATALeftSide\" : \"YATARightSide\";\n \n divBase = item + side;\n if (show) {\n document.getElementById(divBase + \"-on\").style.display = \"none\";\n document.getElementById(divBase + \"-off\").style.display = \"inline-block\"; \n }\n else {\n document.getElementById(divBase + \"-on\").style.display = \"inline-block\"; \n document.getElementById(divBase + \"-off\").style.display = \"none\"; \n }\n var element = document.getElementById(div);\n element.classList.toggle(\"shinyjs-hide\");\n element.classList.toggle(\"shinyjs-show\");\n}", "function hideSideMenu() {\n $('.menu').addClass('hidden');\n }", "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"sideOverlay\").style.display = \"none\";\n }", "handleSideBarClick () {\n // Hide the navigation bar\n this.setState({showNavBar: false})\n // Show the side bar\n this.setState({showSideBar: true})\n }" ]
[ "0.72464377", "0.69647926", "0.69525725", "0.6914184", "0.68763477", "0.6858389", "0.6832779", "0.6817373", "0.674658", "0.6658307", "0.66300434", "0.6626138", "0.66064495", "0.6568991", "0.6566908", "0.655616", "0.654815", "0.65414965", "0.653671", "0.6535922", "0.65217125", "0.65135306", "0.64979506", "0.64902306", "0.64895695", "0.6456317", "0.6439132", "0.6435981", "0.64359295", "0.643191", "0.64251506", "0.6423948", "0.6422861", "0.6410352", "0.6402008", "0.6395293", "0.6390684", "0.6382824", "0.63796127", "0.6374409", "0.6368946", "0.63598776", "0.63587666", "0.6350188", "0.63467544", "0.63394254", "0.63381404", "0.63322437", "0.6330021", "0.6319504", "0.6306791", "0.6305025", "0.6301456", "0.6296132", "0.62925696", "0.6291921", "0.62868667", "0.62836266", "0.627929", "0.6254729", "0.62523675", "0.6248549", "0.62453055", "0.6243465", "0.6231679", "0.62293583", "0.621578", "0.6211769", "0.6211769", "0.6208847", "0.6204272", "0.6204272", "0.61997426", "0.61997426", "0.6195721", "0.61930954", "0.61887205", "0.6184033", "0.6167105", "0.61660045", "0.6159212", "0.61486405", "0.6146146", "0.61218977", "0.6118855", "0.6116636", "0.61071044", "0.6097032", "0.60929143", "0.60929143", "0.60929143", "0.6081576", "0.60789603", "0.60783535", "0.6077212", "0.60723287", "0.6060843", "0.6058345", "0.60580474", "0.6052136" ]
0.63271326
49
Open the side menu when small screen.
function openSideMenu($mdMenu, event) { $mdMenu.open(event); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggleMenuInMobile () {\n try {\n const windowWidth = window.innerWidth\n if (windowWidth > MENU_HIDE_WIDTH) return\n const toggleEle = document.getElementsByClassName('sidebar-toggle')\n toggleEle[0].click()\n } catch (error) {}\n }", "function OpenSideMenu() {\n if ($(\"body\").hasClass(\"mode-translation\")) {\n ToggleSideMenu(true);\n }\n}", "function menuForSmallScreen() {\n navMenuList.hide();\n\n hideMenuBtn.addClass(ClassName.NONE);\n showMenuBtn.removeClass(ClassName.NONE);\n\n function toggleSmallMenu() {\n navMenuList.fadeToggle();\n toggleButtons();\n }\n\n function toggleMenuEventHandler(event) {\n event.preventDefault();\n toggleSmallMenu();\n }\n\n hideMenuBtn.click(toggleMenuEventHandler);\n showMenuBtn.click(toggleMenuEventHandler);\n menuEl.click(function () {\n setTimeout(toggleSmallMenu, 600);\n });\n }", "function openSide() {\n sideMenu.style.height = \"100vh\";\n sideMenu.style.width = \"75%\";\n sideLinks.style.display = \"flex\";\n application.style.display = \"flex\";\n toggler.style.display = \"none\";\n overlayed.style.display = \"block\";\n}", "function hideMenuOnBigScreen() {\n if (window.innerWidth > 555) {\n closeSideNav();\n }\n}", "function sidemenuToggle() {\n if(isSideMenuOpen) {\n sidemenuClose();\n } else {\n sidemenuOpen();\n }\n}", "function sidemenuToggle() {\n if(isSideMenuOpen) {\n sidemenuClose();\n } else {\n sidemenuOpen();\n }\n}", "function showNavMenuDesktop() {\n\tif (getBrowserWidth() >= 992) {\n\t\tshowElement(navMenu, \"none\");\n\t} else if (getBrowserWidth() < 992) {\n\t\thideElement(navMenu, \"translateX(100%)\");\n\t}\n}", "showMobilemenu() {\n document.getElementById('main-wrapper').classList.toggle('show-sidebar');\n }", "showMenu() {\n this.$('jira-sidebar__menu').removeClass('jira-hidden');\n this.animate('in', width.sidebarSmall);\n }", "function openSideBar() {\n if(mobileWidthCheck > 375) {\n console.log('largerScreen');\n document.getElementById('tableOfContents').style.width = \"350px\";\n }\n else if (mobileWidthCheck <= 375) {\n console.log('smallerScreen');\n document.getElementById('tableOfContents').style.width = \"200px\";\n }\n }", "showMobilemenu() {\n document.getElementById(\"main-wrapper\").classList.toggle(\"show-sidebar\");\n }", "function showMenuBtn(){\n\t\tif($(window).width()<1199.98){\n\t\t\t$(\".open_menu\").addClass(\"d-block\");\n\t\t\t$(\"header nav\").addClass(\"d-none\");\n\t\t\t$(\".navigation_mobile\").removeClass(\"opened\");\n\t\t}else{\n\t\t\t$(\".open_menu\").removeClass(\"d-block\");\n\t\t\t$(\"header nav\").removeClass(\"d-none\");\n\t\t\t$(\".navigation_mobile\").removeClass(\"opened\");\n\t\t}\n\t}", "function showMenuBtn(){\n\t\tif($(window).width()<1199.98){\n\t\t\t$(\".open_menu\").addClass(\"d-block\");\n\t\t\t$(\"header nav\").addClass(\"d-none\");\n\t\t\t$(\".navigation_mobile\").removeClass(\"opened\");\n\t\t}else{\n\t\t\t$(\".open_menu\").removeClass(\"d-block\");\n\t\t\t$(\"header nav\").removeClass(\"d-none\");\n\t\t\t$(\".navigation_mobile\").removeClass(\"opened\");\n\t\t}\n\t}", "function handleSmallScreens() {\r\n document.querySelector('.navbar-toggler')\r\n .addEventListener('click', () => {\r\n let navbarMenu = document.querySelector('.navbar-menu')\r\n\r\n if (navbarMenu.style.display === 'flex') {\r\n navbarMenu.style.display = 'none'\r\n return\r\n }\r\n\r\n navbarMenu.style.display = 'flex'\r\n })\r\n}", "function openMobileMenu() {\n\t\tsetClick(!click);\n\t}", "function openNav() {\n\t\tif (window.outerWidth ==768){\n\t\t\tdocument.getElementById(\"mySidenav\").style.width = \"220px\";\n\t\t\tdocument.getElementById(\"main\").style.marginLeft = \"210px\";\n\t\t}\n\t\telse if (window.outerWidth >480){\n\t\t\tdocument.getElementById(\"mySidenav\").style.width = \"250px\";\n\t\t\tdocument.getElementById(\"main\").style.marginLeft = \"250px\";\n\t\t}\n else{\n\t\t document.getElementById(\"mySidenav\").style.width = \"100%\";\n\t\t\tdocument.getElementById(\"main\").style.marginLeft = \"100%\";\n\t\t}\n \n\t}", "function handleSmallScreens() {\n document.querySelector('.navbar-toggler')\n .addEventListener('click', () => {\n let navbarMenu = document.querySelector('.navbar-menu')\n\n if (navbarMenu.style.display === 'flex') {\n navbarMenu.style.display = 'none'\n return\n }\n\n navbarMenu.style.display = 'flex'\n })\n}", "function handleSmallScreens() {\n document.querySelector('.navbar-toggler')\n .addEventListener('click', () => {\n let navbarMenu = document.querySelector('.navbar-menu')\n\n if (navbarMenu.style.display === 'flex') {\n navbarMenu.style.display = 'none'\n return\n }\n\n navbarMenu.style.display = 'flex'\n })\n}", "function menuToggle() {\n if (window.innerWidth < 768) {\n $(\".dropdown\").slideToggle(\"400\");\n }\n }", "function openNav(){\n\tif (detectMobile() == true) {\n\tdocument.getElementById(\"mySidenav\").style.width = \"100%\";\n\t} else {\n\tdocument.getElementById(\"mySidenav\").style.width = \"40%\";\n\t}\n\n}", "static openNav() {\n ElementHandler.setElementCSSById('sidebarMenu', 'width', \"250px\");\n ElementHandler.setElementCSSById('openSidebar', 'width', \"250px\");\n ElementHandler.hideElementById('openSidebar');\n }", "function toggleMenuLinks () {\n\t\tif (sitenavMinWidth < $(window).width()) {\n\t\t\t$(\"body\").removeClass(\"ibm-sitenav-menu-hide\");\n\t\t}\n\t\telse {\n\t\t\t$(\"body\").addClass(\"ibm-sitenav-menu-hide\");\n\t\t}\n\t}", "function openMenu() {\n vm.showMenu=!vm.showMenu;\n }", "function openMobileMenu(){\n menuButton.classList.add(\"isOpen\");\n menuO.style.display=\"none\";\n menuX.style.display=\"block\";\n mobileMenu.style.display = \"block\";\n activateScrollMenu()\n }", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"500px\";\n document.getElementById(\"sideOverlay\").style.display = \"block\";\n }", "function show_responsive_menu() {\n var menuEl = $('#main-navigation ul');\n if (window.innerWidth <= 767) { // mobile \n if (visibleMobileMenu) {\n menuEl.show().css('opacity', 1);\n } else {\n menuEl.hide();\n }\n } else { // desktop\n menuEl.show().css('opacity', 1);\n }\n }", "function menuToggleClickHandler() {\n setSideMenuIsOpen(!sideMenuIsOpen);\n }", "function w3_open() {\n document.getElementById(\"mySidenav\").style.width = \"100%\";\n document.getElementById(\"mySidenav\").style.display = \"block\";\n}", "function openMenuRight() {\n document.getElementById(\"notificationbutton\").classList.add(\"hidden\");\n document.getElementById(\"sidebar\").style.opacity = 1;\n document.getElementById(\"sidemenu-right\").style.width = \"20vw\";\n document.getElementById(\"sidemenu-right\").style.opacity = 1;\n}", "function smMenu(){\n\t\t// Clears out other menu setting from last resize\n\t\t$('.menu-toggle a').off('click')\n\t\t$('.expand').removeClass('expand');\n\t\t$('.menu-toggle').remove();\n\t\t// Displays new menu\n\t\t$('.main-nav').before(\"<div class='menu-toggle'><a href='#'>menu<span class='indicator'> +</span></a></div>\");\n\t\t// Add expand class for toggle menu and adds + or - symbol depending on nav bar toggle state\n\t\t$('.menu-toggle a').click(function() {\n\t\t\t$('.main-nav').toggleClass('expand');\n\t\t\tvar newValue = $(this).find('span.indicator').text() == ' -' ? ' +' : ' -';\n\t\t\t$(this).find('span.indicator').text(newValue);\n\t\t});\n\t\t// Set window state\n\t\tvar windowState = 'small';\n\t}", "function openNav()\n{\n let sideBar = document.querySelector(\".side-nav\");\n sideBar.style.visibility = \"visible\";\n sideBar.style.width = \"100%\";\n}", "function openNav() {\n $('#nav-list li').removeClass('treelisthidden');\n storage.setItem(treesettings, '1');\n $('#sideNavigation').css('display', 'block');\n\n $('#sideNavigation').css('width', '300px');\n $('body.support_kb').find('.cover').css('display', 'none');\n $('body.support_kb').find('#sidefoot').css({\n 'width': '300px',\n 'margin-left': ''\n });\n $('#sidefoot').css('display', 'block');\n $('.footer-inner').css('padding-left', '300px');\n $('body').find('main').css('width', 'calc(100% - 100px)');\n $('body.support_kb').find('#sideNavigation').css('margin-left', '0');\n $('body').find('main').css('width', 'calc(100% - 350px)');\n\n (function() {\n try {\n $('#sideNavigation').resizable(\"enable\");\n } catch (err) {\n setTimeout(arguments.callee, 200)\n }\n })();\n\n $('#side-toggle').attr('class', 'fa fa-angle-double-left');\n\n }", "toggleSidebarMobile() {\n Ember.$('.ui.sidebar.main.menu').sidebar('toggle');\n\n if (Ember.$('.inverted.vertical.main.menu').hasClass('visible')) {\n Ember.$('.sidebar.icon.text-menu-show').removeClass('hidden');\n Ember.$('.sidebar.icon.text-menu-hide').addClass('hidden');\n Ember.$('.bgw-opacity').addClass('hidden');\n } else {\n Ember.$('.sidebar.icon.text-menu-show').addClass('hidden');\n Ember.$('.sidebar.icon.text-menu-hide').removeClass('hidden');\n Ember.$('.bgw-opacity').removeClass('hidden');\n }\n }", "function toggleMenu()\n{\n\t// Get the left panel\n\tvar menu = document.getElementById(\"mobile-menu\");\n\t\n\t// If the panel is visible (displayed), remove it\n\tif(menu.style.display == \"block\")\n\t{\n\t\tmenu.style.display = \"none\";\n\t}\n\t\n\t// If the panel is not displayed, display it\n\telse\n\t{\n\t\tmenu.style.display = \"block\";\n\t\tmenu.style.width = \"100%\";\n\t\t\n\t\tdocument.body.scrollTop = document.documentElement.scrollTop = 0;\n\t}\n}", "function openNav() {\n\tdocument.getElementById(\"mySidenav\").style.width = \"260px\";\n }", "function checkMenu() {\n\t\tif (window.innerWidth < min_width_menu && $rootScope.menu_opened) {\n\t\t\t$scope.toggleMenu();\n\t\t}\n\t}", "function switchSideMenu() {\n\n var sideMenu = document.querySelector(\".side-menu\");\n\n if (sideMenu.style.display == \"block\") {\n\n sideMenu.style.display = \"none\";\n\n } else {\n\n sideMenu.style.display = \"block\";\n }\n}", "function toggleMobileMenu() {\n let wrapper = $(\".m-menu-wrapper\");\n wrapper.toggleClass(\"active\");\n $(\"body\").toggleClass(\"locked\");\n }", "handleMouseDownOnMenu(e) {\n if (window.innerWidth <= 768) {\n this.toggleMenu();\n }\n e.stopPropagation();\n }", "function menuForLargeScreen() {\n navMenuList.show();\n\n timerObj = setTimeout(function () {\n menuPanel.addClass(ClassName.MENU_PANEL__COMPRESSED);\n hideMenuBtn.addClass(ClassName.NONE);\n showMenuBtn.removeClass(ClassName.NONE);\n }, 5000);\n\n function toggleMenuEventHandler(event) {\n event.preventDefault();\n toggleButtons();\n menuPanel.toggleClass(ClassName.MENU_PANEL__COMPRESSED);\n }\n\n hideMenuBtn.click(toggleMenuEventHandler);\n showMenuBtn.click(toggleMenuEventHandler);\n\n menuPanel.mouseenter(function () {\n clearTimeout(timerObj);\n menuPanel.removeClass(ClassName.MENU_PANEL__COMPRESSED);\n hideMenuBtn.removeClass(ClassName.NONE);\n showMenuBtn.addClass(ClassName.NONE);\n });\n menuPanel.mouseleave(function () {\n if (!menuPanel.hasClass(ClassName.MENU_PANEL__COMPRESSED)) {\n timerObj = setTimeout(function () {\n menuPanel.addClass(ClassName.MENU_PANEL__COMPRESSED);\n toggleButtons();\n }, 2000);\n }\n });\n }", "function onOpen() {\n SpreadsheetApp.getUi() // Or DocumentApp or SlidesApp or FormApp.\n .createMenu('Table Topics Sidebar')\n .addItem('Launch Sidebar', 'showSidebar')\n .addToUi();\n}", "function sideMenu(){\n\t// SHOW THE MENU WHEN THE USER HOVERS OVER TO THE RIGHT OF THE WINDOW\n\t$('.menu-hover').mouseenter(function(){\n\t\t$('.side-menu').toggle('slide', {direction: 'right'}, 300);\n\t\t});\n\t\t\n\t// HIDE THE MENU WHEN THE USER LEAVES THE SIDEBAR\n\t$('.side-menu').mouseleave(function(){\n\t\t$('.side-menu').toggle('slide', {direction: 'right'}, 300);\n\t\t});\n}", "function toggleSideMenu() {\n\t$( \".side-menu\" ).animate( {'width': 'toggle'});\n\tif ($('.side-menu').width()>1) {\n\t\t$( \".main-content\" ).animate( {'margin-left': '0'});\n\t}\n\telse {\n\t\t$( \".main-content\" ).animate( {'margin-left': '200px'});\n\t}\n}", "function toggleMenuList() {\n $mdSidenav('left').toggle();\n }", "function toggleHorizontalMobileMenu() {\n vm.bodyEl.toggleClass('ms-navigation-horizontal-mobile-menu-active');\n }", "function openNav_responsive() {\n options.jq.contentWell.css({\n position : 'absolute',\n top : 0,\n left : 0,\n height : '100%',\n overflow : 'hidden'\n });\n options.jq.navContainer.animate({marginLeft: 0}, animConfig());\n options.jq.contentWell.animate({left: '100%'}, animConfig(function () {\n options.jq.contentWell.hide();\n }));\n setNavState(1);\n }", "function toggleMenuList() {\n $mdSidenav('left').toggle();\n }", "function toggleHorizontalMobileMenu() {\n vm.bodyEl.toggleClass('ms-navigation-horizontal-mobile-menu-active');\n }", "function openNav() {\r\n\t\tdocument.getElementById(\"mySidenav\").style.width = \"100%\";\r\n\t}", "function openHeaderMenuOnMobile() {\n $('#nav-icon-menu').click(function(){\n $(this).toggleClass('open');\n $('body').toggleClass('navigation-opened');\n });\n}", "function responsive_menu() {\n if(is_tablet_and_down()) {\n $('.mobile-menu .lines-button').on('click', function() {\n $(this).toggleClass('active');\n $('.mobile-side-menu').toggleClass('open');\n $('.mobile-menu-push').toggleClass('mobile-menu-push-to-left');\n });\n } else {\n $('.mobile-menu .lines-button').off('click');\n $('.pill-container').off('click');\n $('.reaction-list li').off('click');\n }\n}", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"500px\";\n document.getElementById(\"sideOverlay\").style.display = \"block\";\n}", "function toggleMenu(el) {\n if(screen.width <= 768) {\n var listView = document.querySelector('.list-view');\n var menuContainer = document.querySelector('.menu-container');\n\n menuContainer.classList.toggle('change');\n if(window.getComputedStyle(listView).display === 'none') {\n listView.style.display = 'block';\n } else if(window.getComputedStyle(listView).display === 'block') {\n listView.style.display = 'none';\n }\n }\n}", "w3_open() {\n\t\tif (this.mySidenav.style.display === 'block') {\n\t\t\tthis.mySidenav.style.display = 'none';\n\t\t\tthis.overlayBg.style.display = \"none\";\n\t\t} else {\n\t\t\tthis.mySidenav.style.display = 'block';\n\t\t\tthis.overlayBg.style.display = \"block\";\n\t\t}\n\t}", "function showSideMenu() {\n if (sideMenuToggle == 0) {\n $(\"#mainpane\").animate({\n left: \"300\"\n }, 500);\n sideMenuToggle = 1;\n }\n else {$(\"#mainpane\").animate({\n left: \"0\"\n }, 500);\n sideMenuToggle = 0;\n }\n}", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n }", "function openSidepage() {\n\n\tvar move_by;\n\n\n\tif (window_width <= 768) {\n\t\tmove_by = window_width+'px';\n\t} else if (window_width <= 900) {\n\n\t\tmove_by = '500px';\n\n\t} else {\n\t\tmove_by = '700px';\n\t}\n\n\n\t$('#main').animate({\n\t\tright: move_by\n }, 400, 'easeOutBack');\n}", "function expandMenu() {\n var windowsize = $window.width();\n if (windowsize < hamburgerWidth) {\n // hamburger menu\n $(\".ked-navigation .sidebar\").css(\"height\", \"100vh\");\n $(\".sv-grid-ksgs12\").first().addClass('hamburger'); // So CSS can adjust padding rule accordingly\n pinIcon.hide(); // Don't support pinning when in hamburger menu yet.\n } else {\n // normal menu\n $(\".ked-navigation .sidebar\").css(\"width\", \"290px\");\n $(\".sv-grid-ksgs12\").first().removeClass('hamburger'); // So CSS can adjust padding rule accordingly\n }\n timeoutId = null;\n if (!pinned) pinIcon.css(\"opacity\", 0.5);\n $(\".ked-navigation .logo span\").css(\"opacity\", \"1\");\n $(\".ked-navigation .offcanvas-nav li a span\").css(\"opacity\", \"1\");\n $(\".ked-navigation .offcanvas-nav li a .state-indicator\").css(\"opacity\", \"1\");\n $(\".ked-navigation .search .search-field\").css(\"opacity\", \"1\");\n $(\".ked-navigation .offcanvas-nav li a span\").css(\"opacity\", \"1\");\n }", "function openSideNav() {\n var expandIcons = document.getElementsByClassName(\"more\");\n document.getElementById(\"sidenav\").style.left = 0;\n document.getElementById(\"screen-dim\").style.opacity = 1;\n document.getElementById(\"screen-dim\").style.visibility = \"visible\";\n for (var i = 0; i < expandIcons.length; i++) {\n expandIcons[i].style.transform = \"rotate(0deg)\";\n }\n}", "function toggleSidebar() {\n // Note: The remove and add classes are important to make sure this works when you change from small to large\n // screen and vice versa after clicking the sidebar.\n if ($(window).width() < 1024) {\n // Mobile view\n $sidebar\n .removeClass(sidebarClosedState)\n .addClass('lg:sp-w-72')\n .toggleClass('sp-w-72 sm:sp-w-72 sm:sp-w-8 ' + sidebarOpenState);\n\n $sidebar.find('.sp-toggle-sidebar')\n .addClass('lg:sp-ml-72')\n .toggleClass('sp-ml-72 sm:sp-ml-72 sm:sp-ml-8');\n } else {\n // Desktop view\n $sidebar\n .removeClass('sp-w-72 sm:sp-w-72 ' + sidebarOpenState)\n .toggleClass('lg:sp-w-72 ' + sidebarClosedState);\n\n $sidebar.find('.sp-toggle-sidebar')\n .removeClass('sp-ml-72 sm:sp-ml-72')\n .toggleClass('lg:sp-ml-72');\n }\n }", "function showOnLeftSubMenu() {\r\n\t\t\t\r\n\t\t\t// Show on left class for minimal styling.\r\n\t\t\t$('#header-outer .sf-menu > li:not(.megamenu) > ul > li > ul').each(function () {\r\n\t\t\t\t\r\n\t\t\t\t$(this).removeClass('on-left-side');\r\n\t\t\t\t\r\n\t\t\t\tif ($(this).offset().left + $(this).outerWidth() > $window.width()) {\r\n\t\t\t\t\t$(this).addClass('on-left-side');\r\n\t\t\t\t\t$(this).find('ul').addClass('on-left-side');\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$(this).removeClass('on-left-side');\r\n\t\t\t\t\t$(this).find('ul').removeClass('on-left-side');\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t}", "function openNav() {\n$('#mySidenav').css('width', '250px');\n$('#main').css('marginLeft', '250px');\n\n}", "function sideMenuShow() {\n if (sideMenu.className == \"closed\") {\n sideMenu.classList.toggle(\"closed\");\n localStorage.setItem(\"state\", \"open\");\n } else {\n sideMenu.classList.toggle(\"closed\");\n localStorage.setItem(\"state\", \"closed\");\n }\n}", "function onOpen(e) {\n DocumentApp.getUi().createAddonMenu()\n .addItem('Start', 'showSidebar')\n .addToUi();\n}", "function openMenu() {\n\n\t\t$(\"#menu-items\").css(\"display\",\"block\");\n \n $(\"#app-canvas\").velocity({\n\t\t\tleft:\"85%\",\n }, {\n duration: 300,\n complete: function() {\n\t\t\t\tsetTimeout(function(){\n isMenuOpen=true;\n },150);\n\t\t\t}\n }); \n }", "function showMenu(fast) {\n\t\t\t\tif ((smallBreakpoint && !opt.everySizes) || opt.everySizes) {\n\t\t\t\t\tmenuOpen = true;\n\t\t\t\t\t$html.addClass('extra-menu-open');\n\t\t\t\t\t$html.removeClass('extra-menu-close');\n\t\t\t\t\tif (fast) {\n\t\t\t\t\t\ttimeline.totalProgress(1);\n\t\t\t\t\t\t$window.trigger('extra:menu:ShowComplete');\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttimeline.play();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\thideMenu(true);\n\t\t\t\t}\n\t\t\t}", "hideMenu () {\n try {\n const windowWidth = window.innerWidth\n // console.log(\"Window Width : \",windowWidth)\n if (windowWidth > MENU_HIDE_WIDTH) return\n\n // Veryfies if the sideba is open\n const sidebarEle = document.getElementsByClassName('main-sidebar')\n const style = window.getComputedStyle(sidebarEle[0])\n const transform = style.transform // get transform property\n\n // If the transform property has any\n // negative property, means that the menu\n // is not visible on the screen\n if (transform.match('-')) {\n // Returns if the menu is already hidden\n return\n }\n\n const toggleEle = document.getElementsByClassName('sidebar-toggle')\n toggleEle[0].click()\n } catch (error) {\n // console.error(error)\n }\n }", "function mobileSideBar(media) {\n var sideMenu = document.getElementById('side-menu');\n\n if (media.matches) { // If media query matches.\n var items = document.getElementById('view-items');\n var current, cancelOpen = false, cancelClose = false;\n\n sideMenu.style.left = '-180px';\n\n sideMenu.addEventListener('touchend', function() { // End Touch event listener.\n cancelOpen = false, cancelClose = false;\n\n if (parseInt(sideMenu.style.left) > -90) // Over 50%.\n animateOpen();\n\n if (parseInt(sideMenu.style.left) <= -90) // Under 50%.\n animateClose();\n })\n\n sideMenu.addEventListener('touchmove', function(ev) { // Active Touch event listener.\n current = ev.targetTouches[0]; // Current Touch position.\n \n window.requestAnimationFrame(moveWith);\n cancelOpen = true, cancelClose = true;\n })\n\n items.addEventListener('click', function() { // Close Menu on item click.\n if (window.innerWidth <= 768)\n animateClose();\n })\n\n /*\n For when window is resized below threshold.\n Sidebar will collapse like in mobile.\n */\n sideMenu.addEventListener('mouseenter', function() { // Mouse enter event listener.\n if (window.innerWidth <= 768){\n cancelClose = true;\n animateOpen();\n }\n })\n\n sideMenu.addEventListener('mouseleave', function() { // Mouse leave event listener.\n if (window.innerWidth <= 768){\n cancelOpen = true;\n animateClose();\n }\n \n })\n\n /*\n JS animation functions.\n animateOpen(), animateClose(), moveWith()\n */\n function animateOpen() // Menu opening animation.\n {\n let pos = parseInt(sideMenu.style.left);\n let id = setInterval(frame, 10);\n\n function frame() { // Animate.\n for (let i = 0; i < 10; i++) {\n if (pos == 0) {\n clearInterval(id);\n cancelOpen = false, cancelClose = false;\n } else {\n if (cancelOpen) {\n clearInterval(id);\n cancelOpen = false, cancelClose = false;\n }\n pos++;\n sideMenu.style.left = pos + \"px\";\n }\n }\n }\n }\n\n function animateClose() // Menu closing animation.\n { \n let pos = parseInt(sideMenu.style.left);\n let id = setInterval(frame, 10);\n\n function frame() { // Animate.\n for (let i = 0; i < 10; i++) {\n if (pos == -180) {\n clearInterval(id);\n cancelOpen = false, cancelClose = false;\n } else {\n if (cancelClose) {\n clearInterval(id);\n cancelOpen = false, cancelClose = false;\n }\n pos--; \n sideMenu.style.left = pos + \"px\";\n }\n }\n }\n }\n\n function moveWith() // Moves the side menu with the finger.\n {\n if (parseInt(sideMenu.style.left) >= -180 && parseInt(sideMenu.style.left) <= 0)\n sideMenu.style.left = (current.clientX - sideMenu.offsetWidth) + 'px';\n\n if (parseInt(sideMenu.style.left) < -180) // Prevents over shoot.\n sideMenu.style.left = '-180px';\n\n if (parseInt(sideMenu.style.left) > 0) // Prevents over shoot.\n sideMenu.style.left = '0px';\n }\n\n } else {\n sideMenu.style.left = '0px';\n }\n }", "function openMenu() {\n g_IsMenuOpen = true;\n}", "function openNav() {\r\n side_nav.style.width = \"250px\";\r\n side_nav_shader.style.display = \"block\";\r\n}", "function ActivateSideNav() {\n $('.button-collapse').sideNav();\n }", "function OpenMobileMenu(is_authenticated) {\n if (is_authenticated === \"True\") {\n event.preventDefault();\n event.stopPropagation();\n openUserMenu();\n } else {\n $('#welcome_div').css('position','static');\n }\n}", "function openNav() \r\n{\r\n header_side_nav.style.width = \"240px\";\r\n document.querySelector(\".header-menu_icon\").style.display = 'none';\r\n}", "function openNav() {\n var windowWidth = $(window).width();\n console.log(windowWidth);\n if (windowWidth < 1000) {\n document.getElementById(\"mySidenav\").style.width = \"100%\";\n } else {\n document.getElementById(\"mySidenav\").style.width = \"500px\";\n document.getElementById(\"main\").style.paddingLeft = \"500px\";\n }\n}", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n }", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n }", "function showMenu($this){\n $this.css('display', 'none');\n $('#mobileMenu-'+$this.attr('id')).show();\n }", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n }", "checkScreenSize() {\n if (window.innerWidth > 768) {\n this.navClose();\n }\n }", "function toogleMenus(){\r\n var dropdown = document.getElementById(\"menu\");\r\n if (dropdown.style.display === \"none\") {\r\n if(window.innerWidth > 853) {\r\n dropdown.style.display = \"flex\";\r\n dropDownMenuOpenStatus = false;\r\n } else {\r\n dropdown.style.display = \"block\";\r\n dropDownMenuOpenStatus = true;\r\n }\r\n } else {\r\n if(window.innerWidth < 853) {\r\n dropDownMenuOpenStatus = false;\r\n dropdown.style.display = \"none\";\r\n }\r\n }\r\n}", "function open_sidenav() {\n document.getElementById(\"main-sidenav\").style.width = \"250px\";\n document.getElementById(\"home\").style.marginLeft = \"250px\";\n}", "function mobileMenu() {\n \"use strict\";\n if (jQuery(window).width() < 768) {\n jQuery('.mega-menu .mega').attr('id', 'menu-menu');\n jQuery('#menu-all-pages').removeClass('mega');\n jQuery('.mega-menu > ul').removeClass('mega');\n } else {\n jQuery('.mega-menu .mega > ul').addClass('mega');\n jQuery('.mega-menu .mega > ul').attr('id', 'menu-menu');\n }\n jQuery(\".main-navigation\").addClass('toggled-on');\n jQuery('.menu-toggle').click(function() {\n if (jQuery(this).parent().hasClass('active')) {\n jQuery(this).parent().removeClass('active');\n } else {\n jQuery('.menu-toggle').parent().removeClass('active');\n jQuery(this).parent().addClass('active');\n }\n });\n}", "function toggleMenusList() {\n $mdSidenav('left').toggle();\n }", "function openNav(){\n document.getElementById('mySidenav').style.width=\"200px\";\n }", "handleClick(e) {\n // media queries keep sidebar open unless under a certain size\n // when closed, activating will open or close\n document.querySelector('nav#drawer').classList.toggle('open');\n e.stopPropagation();\n }", "function openNav() {\n document.getElementById(\"mySidebar\").style.width = \"250px\";\n if (screen.width<=630) {\n document.getElementById(\"mySidebar\").style.width = \"100%\";\n document.getElementById(\"mySidebar\").style.Left = \"0px\";\n\n }\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n\n}", "function togglemenu() {\n var vw = $(window)[0].innerWidth;\n if ($(\".pcoded-navbar\").hasClass('theme-horizontal') == false) {\n if (vw <= 1200 && vw >= 992) {\n $(\".pcoded-navbar\").addClass(\"navbar-collapsed\");\n }\n if (vw < 992 || vw > 1200) {\n $(\".pcoded-navbar\").removeClass(\"navbar-collapsed\");\n }\n }\n}", "function openNav() {\n $(\"#swim-overlay-menu\").css({\"width\" : \"100%\"});\n}", "function toggleSidebarOnDesktop() {\n $target.toggleClass('sidebar--closed');\n }", "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\n\n sideopen.style.marginLeft = \"250px\"; \n sideclose.style.visibility = \"visible\";\n sideclose.style.marginLeft = \"250px\";\n sideclose.style.zIndex = \"15\";\n sideopen.style.visibility = \"hidden\";\n \n}", "function toggleMenu(){\n var isDisplay = $j('.menu').css('display');\n\n if (isDisplay == 'none'){\n $j('.menu').show(500);\n }else if (isDisplay == 'block'){\n $j('.menu').hide(500);\n }\n\n if ($j(window).width() <= 720) {\n $j('nav').width($j('header').width());\n } else {\n $j('nav').css('width','');\n }\n}", "function openNav() {\n windowSize = window.innerWidth;\n console.log(windowSize);\n if (windowSize < 300) {\n document.getElementById(\"mySidenav\").style.width = \"100%\";\n } else if (windowSize < 500) {\n document.getElementById(\"mySidenav\").style.width = \"70%\";\n } else if (windowSize < 700) {\n document.getElementById(\"mySidenav\").style.width = \"50%\";\n } else if (windowSize < 900) {\n document.getElementById(\"mySidenav\").style.width = \"40%\";\n } else if (windowSize < 1200) {\n document.getElementById(\"mySidenav\").style.width = \"30%\";\n } else if (windowSize > 1700) {\n document.getElementById(\"mySidenav\").style.width = \"450px\";\n } else {\n document.getElementById(\"mySidenav\").style.width = \"25%\";\n }\n document.getElementById(\"hamburger\").style.opacity = '0';\n}", "function openSideBar() {\n\n document.getElementById(\"small_icon\").style.display = \"none\";\n document.getElementById(\"big_icon\").style.display = \"block\";\n document.getElementById(\"hamburger_button\").style.marginLeft = \"9em\";\n document.getElementById(\"main\").style.transform = \"scale(1,1)\";\n document.getElementById(\"main\").style.paddingLeft = \"17em\";\n document.getElementById(\"main\").style.paddingTop = \"6em\";\n\n for (var i = 0; i < elements_text_of_sidebar.length; i++) {\n elements_text_of_sidebar[i].style.transitionDelay = \"0.5s\";\n elements_text_of_sidebar[i].style.display = \"block\";\n }\n\n for (var i = 0; i < elements_sidebar_container.length; i++) {\n elements_sidebar_container[i].style.width = \"16em\";\n }\n\n sideBarIsOpen = 1;\n}", "openNav() {\n document.getElementById(\"mySidenav\").style.width = \"300px\";\n }", "function OCM_simpleDropdownOpen() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('#mobile-menu').show();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('header#top .slide-out-widget-area-toggle:not(.std-menu) .lines-button').addClass('close');\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($('body.material').length > 0) {\r\n\t\t\t\t\t\t$('header#top .slide-out-widget-area-toggle a').addClass('menu-push-out');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t$('.slide-out-widget-area-toggle > div > a').removeClass('animating');\r\n\t\t\t\t\t}, 100);\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function toggleMobileMenu(e) {\n e.preventDefault();\n toggleButtonIcon();\n if (!navListOpen) {\n navListOpen = true;\n gsap.to(\".navbar__list\", 0.5, {\n height: \"auto\",\n });\n } else {\n navListOpen = false;\n gsap.to(\".navbar__list\", 0.5, {\n height: \"0\",\n });\n }\n}", "function showMenu($this){\n $this.css('display', 'none');\n $('#mobileMenu_'+$this.attr('id')).show();\n }", "function show_menu_bars(){\n if(window.innerWidth <= 1000){\n setAct(true)\n setNavs(false)\n }\n else{\n setAct(false)\n setNavs(true)\n }\n }", "function openNav() {\n document.getElementById(\"mySidenav\").classList.add('open-side');\n }" ]
[ "0.7585324", "0.7527829", "0.74937093", "0.73204434", "0.7317244", "0.71583384", "0.71583384", "0.71209353", "0.71030855", "0.7095385", "0.707023", "0.70572174", "0.70569587", "0.70569587", "0.6974056", "0.697311", "0.69715756", "0.69659543", "0.69659543", "0.6965252", "0.69488895", "0.6882228", "0.6840729", "0.68316126", "0.68296", "0.6809835", "0.6780653", "0.67620593", "0.67618906", "0.6748535", "0.67334795", "0.67124796", "0.6696643", "0.6683995", "0.6667492", "0.66584057", "0.6654687", "0.66524523", "0.66418", "0.664051", "0.66388375", "0.6632749", "0.66294104", "0.6626029", "0.66239685", "0.6614439", "0.6601442", "0.65981233", "0.65964013", "0.6590276", "0.658846", "0.657897", "0.6568524", "0.6564183", "0.65624046", "0.6559461", "0.6554752", "0.6552294", "0.65446657", "0.6541812", "0.65375024", "0.65151256", "0.65108097", "0.6506811", "0.650317", "0.64985967", "0.64973027", "0.64897066", "0.64877963", "0.6477994", "0.647527", "0.64661175", "0.64539486", "0.64464617", "0.6445992", "0.6443286", "0.6443286", "0.64362437", "0.64311695", "0.6424297", "0.6420256", "0.64197344", "0.6415409", "0.6413117", "0.6405405", "0.6392678", "0.6391998", "0.63917434", "0.63909847", "0.63900846", "0.63897914", "0.6389467", "0.63865757", "0.63805103", "0.6378771", "0.63781214", "0.63753515", "0.63720983", "0.63716435", "0.636858" ]
0.71232843
7
Open favorite selected tooltip.
function showFavoriteToast() { $mdToast.show({ hideDelay: 3000, position: 'top right', controller: 'ToastController', controllerAs: 'toast', templateUrl: 'fav_toast_template.html', bindToController: true }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "tooltipClicked() {}", "function openTooltip(row, col, action) {\n\t\t\tconsole.log(\"tooltip opened\", row, col, action);\n\t\t}", "function positionFavToolTip(tipdiv, icon) {\n var likeSym = icon.attr('src');\n if (likeSym.indexOf('Yellow') === -1) {\n tipdiv[0].innerHTML = 'Unmark Favorite';\n }\n icon.on('mouseover', function () {\n var pos = $(this).offset();\n var left = pos.left - 128 + 'px'; // width of tip is 120px\n var top = pos.top + 'px';\n tipdiv[0].style.top = top;\n tipdiv[0].style.left = left;\n tipdiv[0].style.display = 'block';\n });\n icon.on('mouseout', function () {\n tipdiv[0].style.display = 'none';\n });\n return;\n}", "OnSelectFavorite(event, index) {\n\t\tif (event.target.selectedIndex > 0)\n\t\t\tthis.AddMark(event.target.options[event.target.selectedIndex].value, true)\n\t}", "showFavoriteModal() {\n this.state.isModalVisible = true;\n this.trigger(this.state);\n }", "function showTooltip() {\n const item = this.options.foodTruck;\n\n tooltip.style.opacity = 1;\n tooltip.style.left = (event.clientX + 10) + 'px';\n tooltip.style.top = (event.clientY - 28) + 'px';\n\n tooltip.innerHTML =\n `<p><strong>${item.name}</strong>, ${item.queue} ${ checkPlural(item.queue, 'person') } waiting</p>`;\n}", "set tooltip(value) {}", "function openInfoImage(event){\n var t = torpedo.tooltip;\n $(t.find(\"#torpedoInfoImage\")[0]).qtip({\n overwrite: false,\n content: {\n text: \"<img id='torpedoPopupImage' src='\"+chrome.extension.getURL(chrome.i18n.getMessage(\"infoImage\"))+\"'> \",\n button: true\n },\n show: {\n event: event.type,\n ready: true\n },\n hide: {\n event: 'unfocus'\n },\n position: {\n at: 'center',\n my: 'center',\n target: jQuery(window)\n },\n style:{\n classes: \"torpedoPopup\"\n }\n });\n}", "function openTaxesAndFeesToolTip(){\n\t$(\"span[id^='taxesAndFees-']\").hover(function(event) {\n\t\tvar packageId = $(this).attr(\"id\").split(\"-\")[1];\n\t\tmouseEnterAnchor($(this), packageId,event);\n\t}, function() {\n\t\tvar packageId = $(this).attr(\"id\").split(\"-\")[1];\n\t\tmouseLeaveAnchor($(this), packageId);\n\t});\n}", "function showCountryName() {\n toolTip.innerHTML = event.target.getAttribute('title');\n}", "displayMoreInformationPopup (item) {\n $(item).popup('show')\n }", "function showTooltip(content, event) {\n tt.style('opacity', 1.0)\n .html(content);\n \n updatePosition(event);\n }", "function showClickWindow() {\n $(\"#tipWindow\").show();\n $(\"#tipWindow\").find(\".f-close\").click(function(){\n $('#tipWindow').hide();\n });\n}", "function showTooltip(content, event) {\n\t\t\t\n\t\t\ttt.style(\"opacity\", 1.0)\n .html(content);\n\n\t\t\tupdatePosition(event);\n\t\t}", "function showTooltip(content, event) {\n tt.style('opacity', 1)\n .html(content);\n\n updatePosition(event);\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "function showTooltip(content, event) {\n tt.style('opacity', 1.0)\n .html(content);\n\n updatePosition(event);\n }", "get tooltip() {}", "function mouseOver() {\n\t\ttooltip.style(\"display\", \"block\")\n\t\t\t .style(\"visibility\", \"visible\");\n\t}", "function showpopupimageselection(){\n\t\t$('#imageselectionpopupmenu').popup('open');\n\t}", "function show() {\n\t cancelShow();\n\t cancelHide();\n\n\t // Don't show empty tooltips.\n\t if (!ttScope.content) {\n\t return angular.noop;\n\t }\n\n\t createTooltip();\n\n\t // And show the tooltip.\n\t ttScope.$evalAsync(function() {\n\t ttScope.isOpen = true;\n\t assignIsOpen(true);\n\t positionTooltip();\n\t });\n\t }", "function showHelpTooltip() {\n $('#tooltip_help').show();\n}", "function showTooltip(content, event) {\n tt.style('opacity', 1.0)\n .html(content);\n\n updatePosition(event);\n }", "function ShowHelp() {\n $('img').tooltip('show');\n}", "showBookmarkDialog() {\n if (this.bookmarkDialogModule && !this.isReadOnlyMode && this.viewer) {\n this.bookmarkDialogModule.show();\n }\n }", "function showTooltip(d) {\n $(this).popover({\n placement: 'auto top', //place the tooltip above the item\n container: '#chart', //the name (class or id) of the container\n trigger: 'manual',\n html : true,\n content: function() { //the html content to show inside the tooltip\n return \"<span style='font-size: 11px; text-align: center;'>\" + \"sds\" + \"</span>\"; }\n });\n $(this).popover('show'); \n}//function showTooltip", "selectFavourite(data) {\n console.log(data)\n this.populateInfoWindow(data.marker, this.foursquareInfoWindow);\n }", "function shareTooltipToggle(el){\n if($(el).parents('.open').length){\n $(el).attr(\"data-original-title\", \"Share\");\n //$(el).parent().children('.tooltip').show();\n\n }else{\n /*if(!$('.share-toggle').parents('.open').length){*/\n $('.share-toggle').attr(\"data-original-title\", \"Share\");\n //$('.share-toggle').parent().children('.tooltip').show();\n /*}*/\n if($(el).parent().children('.tooltip').length > 0){\n $(el).parent().children('.tooltip').hide();\n }\n $(el).attr(\"data-original-title\", \"\");\n }\n}", "onSelectRestaurant(restaurant){\n \n this.infoWindow.setContent(`<span> ${restaurant.name} </span><span> ${restaurant.address} </span>`)\n this.infoWindow.open(this.map,this.markers.find(m=>m.restaurant.address === restaurant.address));\n }", "onSaveFavoriteClicked() {\n this._saveFavorite();\n }", "function show() {\n popupTimeout = null;\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if (transitionTimeout) {\n $timeout.cancel(transitionTimeout);\n transitionTimeout = null;\n }\n\n // Don't show empty tooltips.\n if (!(options.useContentExp ? ttScope.contentExp() : ttScope.content)) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.isOpen = true;\n if (isOpenExp) {\n isOpenExp.assign(ttScope.origScope, ttScope.isOpen);\n }\n\n if (!$rootScope.$$phase) {\n ttScope.$apply(); // digest required as $apply is not called\n }\n\n tooltip.css({ display: 'block' });\n\n positionTooltip();\n }", "function show() {\n popupTimeout = null;\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if (transitionTimeout) {\n $timeout.cancel(transitionTimeout);\n transitionTimeout = null;\n }\n\n // Don't show empty tooltips.\n if (!(options.useContentExp ? ttScope.contentExp() : ttScope.content)) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.isOpen = true;\n if (isOpenExp) {\n isOpenExp.assign(ttScope.origScope, ttScope.isOpen);\n }\n\n if (!$rootScope.$$phase) {\n ttScope.$apply(); // digest required as $apply is not called\n }\n\n tooltip.css({ display: 'block' });\n\n positionTooltip();\n }", "function TooltipShow(argument) \n{\n\tvar imageTooltip = document.getElementById(\"preview\");\n\timageTooltip.src = argument;\n\timageTooltip.alt = argument;\n\timageTooltip.style.visibility = \"visible\";\n}", "function showPopup1(e) {\n // Show the popup at the coordinates with some data\n popup\n .setLngLat(e.lngLat)\n .setHTML(\n e.features[0].properties.name + \n \"<br><a href='https://waba.org/20x20map/' target='blank'><button class=blue-button2>Take Action</button></a>\"\n )\n .addTo(map);\n }", "showFavoriteList() {\n this.blockBtnTemporarily(this.elem.favTrigger, this.animDur.favList);\n this.elem.favSection.classList.add(this.class.fav.active);\n }", "function openTipWindow(strURL){\n\tshowAndGetNonModalDialog(strURL,'Max', 'Max', true);\n}", "function showTooltip(content, event) {\n tooltip.style('opacity', 1.0)\n .html(content);\n\n updatePosition(event);\n }", "function previewTitleClick(e){\n e.preventDefault();\n var entry = getEntry(e);\n if (e.ctrlKey) {\n //Ctrl+click : open in a new tab\n openEntryInNewTab(entry);\n } else {\n var btn = gfe(entry, 'btn-preview');//span\n previewize(btn, entry, locked, e);\n }\n }", "function openFeaturePopup(feature){\n map.infoWindow.setFeatures([feature]);\n map.infoWindow.show(feature.geometry);\n }", "function showTooltip(d, ox, oy, tooltip, opts){\n var xy = d3.mouse(this),\n x = xy[0];\n\n tooltip.show(opts.tooltipText(d), xy[1] + oy + 5 + 'px', x + ox + (x < 0 ? 5 : -tooltip.offsetWidth() - 5) + 'px');\n }", "function showTooltipIndividual(d, color) {\n\t\t\n\t//Find location of mouse on page\n\tvar xpos = d3.event.pageX - 10;\n\tvar ypos = d3.event.pageY - 10;\n\n\t//Set the title and discipline\n\td3.select(\"#tooltip-individual-wrapper #tooltip-country\").html('<span>' + d.country + \"</span> - \" + d.con + \" </span>\");\n\t\n\td3.select(\"#tooltip-individual-wrapper #tooltip-medals\").html('<span>' + d.medals[0] + \" gold </span> - \" + d.medals[1] + \" silver</span> - \" + d.medals[2] + \" bronze</span>\");\n\td3.select(\"#tooltip-individual-wrapper #tooltip-active\").text(\"Active: \" + d.active);\n\n\t//Set the tooltip in the right location and have it appear\n\td3.select(\"#tooltip-individual-wrapper\")\n\t\t.style(\"top\", ypos + \"px\")\n\t\t.style(\"left\", xpos + \"px\")\n\t\t.transition().duration(0)\n\t\t.style(\"opacity\", 1);\n}//showTooltipIndividual", "function showToolTip(d, i) {\n tooltip.style({\n \"height\": \"125px\",\n \"width\": \"200px\",\n \"opacity\": 0.9\n });\n var circle = d3.event.target; \n var tippadding = 5, tipsize = { \n dx: parseInt(tooltip.style(\"width\")), \n dy: parseInt(tooltip.style(\"height\")) \n };\n \n tooltip.style({\n \"top\": (d3.event.pageY - tipsize.dy - 5) + \"px\",\n \"left\": (d3.event.pageX - tipsize.dx - 5) + \"px\"\n }).html(\"<span><b>\" + d.tag_id + \": \" + \"<br/>\" + \n \"X-axis: \" + d.x + \"<br/>\" +\n \"Y-axis: \" + d.y + \"<br/>\");\n }", "showToolTip_(event) {\n this.updateToolTip_(event);\n }", "function toolTip() {\n $('[data-toggle=\"tooltip\"]').tooltip();\n}", "function clickFeature(e) {\n var target = e.target;\n var latlng = target._latlng;\n var props = target.feature.properties;\n var popupContent ='<span class=\"popup-label\"><b>' + props.name + '</b></span>'+\n '<br /><span class=\"popup-label\"><b>Owner: ' + props.Owner + '</b></span>'+\n '<br /><span class=\"popup-label\"><b>Address: ' + props.addr_stree + '</b></span>'+\n '<br /><span class=\"popup-label\"><a href=' + props.alt_name + '.html target=\"_blank\"><b> More Info</b></a></span>';\n\n \n var popup = L.popup({closeOnClick: false}).setContent(popupContent).setLatLng(latlng);\n target.bindPopup(popup).openPopup(); \n \n }", "function openNotebook($item){\r\n $('.notes-sidebar .notes-sidebar-title h3').html( $item.text() + '<a href=\"#\" class=\"delete-notebook\"><i class=\"fa fa-trash-alt\"></i></a>');\r\n $('.sidebar-menu .sidebar-sub-menu li').removeClass('selected');\r\n $item.addClass('selected');\r\n\r\n currentNotebook = $item.find('a').attr('data-id');\r\n loadNotes(currentNotebook);\r\n }", "async showTooltip() {\n this.actionEventHandler();\n }", "function openNote($item, notebook){\r\n if($item.closest('.note-item').attr('data-notebook')){\r\n notebook = $item.closest('.note-item').attr('data-notebook');\r\n }\r\n let noteContent = getContent(notebook, $item.attr('data-id'));\r\n $('.notes-list-container .note-item').removeClass('selected');\r\n $item.addClass('selected');\r\n editorNotebook = notebook;\r\n editorNote = $item.attr('data-id');\r\n editor.setContents(noteContent);\r\n }", "function myTnTool( action, item ) {\n console.dir(item);\n \n switch( action ) {\n case 'info':\n alert('Photo title: '+item.title);\n \n break;\n case 'custom1':\n // switch favorite status\n item.customData.favorite=!item.customData.favorite;\n TnSetFavorite(item);\n break;\n }\n}", "function myTnTool( action, item ) {\n console.dir(item);\n \n switch( action ) {\n case 'info':\n alert('Photo title: '+item.title);\n \n break;\n case 'custom1':\n // switch favorite status\n item.customData.favorite=!item.customData.favorite;\n TnSetFavorite(item);\n break;\n }\n}", "function mouseover() {\n tooltip\n .style('opacity', 1)\n d3.select(this)\n .style('stroke', 'black')\n .style('opacity', 1)\n }", "function downloadJsuTip(event){\n Tip ('Click to Go to the Page of <b>JSU FREE Download</b>'); \t\n}", "function openNote() {\n // get the handle of the clicked element\n var $selectedNote = ($(this)).parent();\n var id = getNoteId($selectedNote);\n selectNote(id);\n}", "function showTip(title,message){\n\tshowMessage('','<span class = \"font-weight-bold text-uppercase\" >'+ title +' </span><span>' +message + '</span>','tip-modal',false)\n\n\t$('#tip-modal-body').append(`<form class=\"form-inline pt-3 pb-0\">\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t <div class=\"form-check mr-0\">\n \t<input type=\"checkbox\" class=\"form-check-input\" id=\"dontShowTipAgainCheckbox\" name = 'dontShowAgain' value = 'true'>\n \t<label class=\" text-uppercase form-check-label \" for=\"dontShowTipAgainCheckbox\" >Turn off tips</label>\n \t\t</div>\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t</form>`);\n\tif(localStorage.showToolTipModal == undefined || localStorage.showToolTipModal == \"undefined\"){\n\t localStorage.showToolTipModal = 'true';\n\t }\n\tif(localStorage.showToolTipModal === 'true' && walkThroughAdded == false){\n\t $('#tip-modal').modal().show();\n\t}\n\t$('#dontShowTipAgainCheckbox').change(function(){\n console.log(this.checked)\n localStorage.showToolTipModal = !this.checked;\n if(localStorage.showToolTipModal === 'false'){$('#tooltip-radio-second_toggle_label').click();}\n else if(localStorage.showToolTipModal === 'true'){$('#tooltip-radio-first_toggle_label').click();};\n });\n\n}", "function showNotificationsTooltip() {\n $('#tooltip_content').show();\n}", "function ActivateTooltip() {\n // creates the tooltip to display the y point\n $(\"<div id='tooltip'></div>\").css({\n position: \"absolute\",\n display: \"none\",\n border: \"1px solid #fdd\",\n padding: \"2px\",\n \"background-color\": \"#fee\",\n opacity: 0.80\n }).appendTo(\"body\");\n // displays the tooltip on hover\n $(\"#placeholder\").bind(\"plothover\", function (event, pos, item) {\n if (item) {\n var x = item.datapoint[0].toFixed(2), y = item.datapoint[1].toFixed(2);\n $(\"#tooltip\").html(y)\n .css({ top: item.pageY + 5, left: item.pageX + 5 })\n .fadeIn(200);\n }\n else {\n $(\"#tooltip\").hide();\n }\n });\n }", "function doTooltip(e, msg) {\nif ( typeof Tooltip == \"undefined\" || !Tooltip.ready ) return;\nTooltip.show(e, msg);\n}", "function showTooltip(d,pos) {\n // moveTooltip(d,pos);\n // console.log(d.properties.provincia);\n // tooltip.style(\"display\",\"block\")\n // .text(d.properties.provincia);\n //\n // tooltip.style(\"top\",(pos.top+tooltipOffset.y)+\"px\")\n // .style(\"left\",(pos.left+tooltipOffset.x)+\"px\");\n\n}", "displayToolTip(item) {\n console.log(\"Hovering Over Item: \", item.name);\n }", "function tooltipIcons(id) {\n hoverTooltip(id, 'smileys');\n hoverTooltip(id, 'save');\n}", "function onFavouriteButtonClicked() {\n this.toggleFavouriteActive();\n let isFavoured = this.buttons.favourite.classList.contains(\"active\");\n this.notifyAll(new Event(Config.POST_DETAIL_VIEW.EVENT\n .FAVOURISED_BUTTON_CLICKED, {\n favourite: isFavoured,\n post: this.openPost,\n }));\n}", "function openPopup(url, name, pWidth, pHeight, features, snapToLastMousePosition) {\n openPopupFocus (url, name, pWidth, pHeight, features, snapToLastMousePosition, true);\n}", "function toggleFavorite(evt) {\n console.debug(\"toggleFavorite\",evt);\n let $storyId = $(evt.target).closest('li').attr('id');\n let story = findStory($storyId);\n \n // Adds or removes story from favorites based on inclusion in favorites list\n if (!checkFavorite(story)) {\n currentUser.addFavorite(story);\n $(evt.target).addClass(\"fas\").removeClass(\"far\");\n }\n else {\n currentUser.removeFavorite(story);\n $(evt.target).addClass(\"far\").removeClass(\"fas\");\n }\n}", "function mouseOver() {\n tooltip\n .style(\"opacity\", 1)\n .style(\"display\",\"inherit\");\n}", "function showTip($tip) {\n\t\t\t$tip.animate({\n\t\t\t\topacity: 1,\n\t\t\t}, 500);\n\t\t}", "function ShowTextPoint(oTP)\n{\n\ttry\n\t{\n\t\tvar oSel = oTP.Parent.Selection;\n\t\toSel.MoveToPoint(oTP);\n\t\toSel.ActivePoint.TryToShow(vsPaneShowHow.vsPaneShowAsIs);\n\t}\n\tcatch(e)\n\t{\n\t\tthrow(e);\n\t}\n}", "function showTooltip(d) {\n tooltip\n .style(\"top\", `${d3.mouse(this)[1]}px`)\n .style(\"left\", `${d3.mouse(this)[0]}px`)\n .style(\"opacity\", 0.5)\n .html(`Country : ${d.Country}<br>Balance : ${d.Balance.toFixed(2)}mil<br>Export : ${d.Export.toFixed(2)}mil<br>Import : ${d.Import.toFixed(2)}mil<br>Total : ${d.Total.toFixed(2)}mil`)\n .on('click', hideTooltip)\n\n}", "function triggerClick() {\n $('.feed:first-child .heart').trigger('click');\n return $('.feed:first-child').hasClass('favorite'); \n }", "show() {\n if (this.options.showOn !== 'all' && !Foundation.MediaQuery.is(this.options.showOn)) {\n // console.error('The screen is too small to display this tooltip');\n return false;\n }\n\n var _this = this;\n this.template.css('visibility', 'hidden').show();\n this._setPosition();\n\n /**\n * Fires to close all other open tooltips on the page\n * @event Closeme#tooltip\n */\n this.$element.trigger('closeme.zf.tooltip', this.template.attr('id'));\n\n\n this.template.attr({\n 'data-is-active': true,\n 'aria-hidden': false\n });\n _this.isActive = true;\n // console.log(this.template);\n this.template.stop().hide().css('visibility', '').fadeIn(this.options.fadeInDuration, function() {\n //maybe do stuff?\n });\n /**\n * Fires when the tooltip is shown\n * @event Tooltip#show\n */\n this.$element.trigger('show.zf.tooltip');\n }", "function highlightFeature(e) {\n var layer = e.target;\n\n layer.setStyle({\n weight: 3,\n color: '#f4f4f4',\n fillColor: '#ad132a',\n dashArray: '',\n fillOpacity: 0.7\n \n });\n \n var latlng = L.latLng(layer.feature.properties.center);\n\n var popup = L.popup()\n .setLatLng(latlng)\n .setContent('<span><em><strong>' + layer.feature.properties.name + '</strong></em></span>')\n .openOn(map);\n\n if (!L.Browser.ie && !L.Browser.opera) {\n layer.bringToFront();\n }\n }", "function showPointHistoryPopup(p) {\n if (p.poi) {\n var events='';\n for (var i=0; i<p.events.length; i++)\n events += p.events[i].type_text + '<br/>';\n\n var html = '<h4>' + p.time_of_day + '</h4><p>' + p.speed_text + '</p><p>' + events + '</p>';\n MapPane.popup(p.poi, html);\n }\n }", "open() {\n this._opened = true;\n this.refreshDimensions();\n this.select.style.display = '';\n\n const shortcutManager = this.hot.getShortcutManager();\n\n shortcutManager.setActiveContextName('editor');\n\n this.registerShortcuts();\n }", "function rolloverToolTip(){\n jQuery('.livia_notestask').hover(\n function() {\n jQuery(this).children(\"span\").css({\n 'display':'block'\n });\n },\n function() {\n jQuery(this).children(\"span\").css({\n 'display':'none'\n });\n return false;\n });\n}", "function open_infobox(point_id) {\n var point_bullet = $(window.point_list[point_id]);\n $('.infobox h1').text(point_bullet.find('h3').text());\n $('.infobox__insertedhtml').html(point_bullet.find('.point_data__content').html());\n $('.infobox').fadeIn(\"fast\", function () {\n $(this).addClass('show');\n });\n}", "showNutritionTooltip() {\n const getNutrition = (id) => {\n if (this.state.foodsInfo.length) {\n for (const info of this.state.foodsInfo) {\n if (id === info.id) return info.NUTRITION_COLUMNS_PLACEHOLDER;\n }\n }\n return -1;\n };\n\n const renderTooltip = () => (\n <Tooltip id=\"nutrition-info-tooltip\">\n <strong>\n Nutrition index: {getNutrition(this.props.foodItem.food_id)}\n </strong>\n </Tooltip>\n );\n\n return (\n <OverlayTrigger\n placement=\"right\"\n delay={{ show: 150, hide: 400 }} // delay for show and hide the tooltip\n overlay={renderTooltip()}\n >\n <BsInfoCircle\n size=\"1.3rem\"\n color=\"#48AAAD\"\n onClick={() => {\n console.log(\"hello\");\n }}\n />\n </OverlayTrigger>\n );\n }", "function show() {\n tID = null;\n let isBrowsable = false;\n if ($.tooltip.current !== null) {\n isBrowsable = settings($.tooltip.current).isBrowsable;\n }\n\n if ((!IE || !$.fn.bgiframe) && settings($.tooltip.current).fade) {\n if (helper.parent.is(':animated'))\n helper.parent\n .stop()\n .show()\n .fadeTo(settings($.tooltip.current).fade, 100);\n else\n helper.parent.is(':visible')\n ? helper.parent.fadeTo(\n settings($.tooltip.current).fade,\n 100\n )\n : helper.parent.fadeIn(settings($.tooltip.current).fade);\n } else {\n helper.parent.show();\n }\n\n $(helper.parent[0])\n .unbind('mouseenter')\n .unbind('mouseleave')\n .mouseenter(function () {\n if (isBrowsable) {\n $.tooltip.currentHover = true;\n }\n })\n .mouseleave(function () {\n if (isBrowsable) {\n // if tooltip has scrollable content or selectionnable text - should be closed on mouseleave:\n $.tooltip.currentHover = false;\n helper.parent.hide();\n }\n });\n\n update();\n }", "function tp(poTag, psSelector)\n{\n\n if(psSelector)\n {\n var sHTML = \"\"+$(psSelector).html();\n sHTML = sHTML.split('\"').join(\"'\");\n\n $(poTag).attr('title', sHTML);\n }\n\n\n $(poTag).tooltip(\n {content: function()\n {\n if(!$(this).attr('title'))\n $(this).attr('title', $(this).text());\n\n return $(this).attr('title');\n }\n }).blur().mouseenter();\n\n return true;\n}", "clickListPriceToolTip() {\n return this\n .waitForElementVisible('@listPriceTooltipIcon')\n .click('@listPriceTooltipIcon');\n }", "function mouseOver(e) {\r\n var layer_marker = e.target;\r\n // layer_marker.openPopup();\r\n }", "open () {\n return super.open('checkboxes')\n }", "function overName() {\r\n\tget(\"tooltip-display\").style.display = \"block\";\r\n\tget(\"tooltip-text\").innerHTML = \"My name is \" + playerDetails.name + \", that much I remember...\";\r\n}", "function overSkill0() {\r\n\tget(\"tooltip-display\").style.display = \"block\";\r\n\tget(\"tooltip-text\").innerHTML = skillsDescArray[0]\r\n}", "handleClick(item){\n var markTitle=item.innerText;\n var markers=this.props.markers;\n var element=markers.filter((marker)=>(marker.title===markTitle));\n this.props.openInfoWindow(element[0]);\n }", "function showTooltip(content, refIndic,event) {\n tt.style('opacity', 1.0)\n .html(content);\n\n updatelineChart(refIndic)\n updatePosition(event);\n }", "function showPopup2(e) {\n // Show the popup at the coordinates with some data\n popup\n .setLngLat(e.lngLat)\n .setHTML(\n e.features[0].properties.name + \n \"<br><a href='https://waba.org/20x20map/' target='blank'><button class=blue-button2>Get Involved</button></a>\"\n )\n .addTo(map);\n }" ]
[ "0.6379989", "0.61024755", "0.59959525", "0.59472454", "0.59302825", "0.59131324", "0.58705443", "0.58630896", "0.5851942", "0.58032167", "0.573925", "0.5735299", "0.5717863", "0.5707356", "0.5691553", "0.56903785", "0.56903785", "0.56903785", "0.56903785", "0.56903785", "0.56903785", "0.56903785", "0.56903785", "0.56903785", "0.56903785", "0.56903785", "0.56903785", "0.56903785", "0.56903785", "0.56903785", "0.56903785", "0.56903785", "0.5682593", "0.5664644", "0.565895", "0.564823", "0.56432074", "0.5637309", "0.558376", "0.5568206", "0.5557091", "0.55515707", "0.5546741", "0.55437857", "0.55345345", "0.55271804", "0.55233157", "0.55233157", "0.55024123", "0.5493659", "0.5492507", "0.5478319", "0.5472894", "0.5472404", "0.54697615", "0.5466416", "0.54556644", "0.5453093", "0.5451928", "0.54512274", "0.5442203", "0.54294336", "0.5420582", "0.54149073", "0.53977776", "0.53977776", "0.53930867", "0.5391787", "0.5390937", "0.5389368", "0.53875935", "0.538725", "0.53780955", "0.5373104", "0.5372788", "0.53698176", "0.5362208", "0.5356518", "0.5349956", "0.53496855", "0.5338076", "0.5323367", "0.5313222", "0.5308804", "0.53020513", "0.5299503", "0.5296008", "0.529582", "0.5283523", "0.52774066", "0.5274707", "0.5261054", "0.5257693", "0.5245712", "0.52412575", "0.52386475", "0.52366865", "0.5235644", "0.52343905", "0.5232236", "0.52263975" ]
0.0
-1
Go to requested URL..
function navigateTo(url){ $window.open(url, '_blank'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function goToUrl(url) {\n\tlocation.href = url;\n}//end goToUrl", "function gotoURL(location) {document.location=location;}", "function gotoURL(url){\r\n\tdocument.location.href = url;\r\n}", "function gotoURL(url){\n\twindow.location=url;\n}", "function gotoURL(url){\n\twindow.location=url;\n}", "function gotoUrl(addr){\r\n\twindow.location = addr;\r\n}", "function gotoUrl(url) {\n window.location = url;\n}", "function goto(url) {\n window.location = url;\n}//goto", "function goToPage(url){\n \n console.log(\"Go to page: \"+url);\n window.location=url;\n}", "function redirectByUrl() {\n location.href = u;\n }", "function ir(url){ \n\t location.href =url;\n}", "function navagateTo(url) {\n try {\n window.location.href = url;\n console.log(\"status pass : Navigated to \" + url);\n } catch (err) {\n console.log(\"status fail : Broken link or no network connection\");\n }\n}", "function navigateTo(url) {\n window.location = url;\n }", "function goURL(url){\nsetTimeout(function(){window.location.href=url},500)\n}", "function goPage(url) {\n //alert(\"goPage(\" + url + \")\");\n if (url != null) window.location = url;\n}", "function openURL(url) {\r\n document.location = url;\r\n}", "function goToURL() {\n location.href = 'http://127.0.0.1:8000/apps/reservoir-management/sabana-yegua/';\n}", "function urlView(url) {\n CLS();\n clearline(0);\n iplot(0, 0, 'Loading '+url+' ...');\n let start = Date.now();\n wget(\n url,\n function(h, err, nid, url) {\n showPage(h, err, nid, url,\n\t Date.now()-start);\n });\n}", "function goTo(location) {\n window.location = location\n}", "navigate(url) {\n return this.agent.invoke_navigate({ url });\n }", "function handleRequestOne(request, response) { //whats the request? req to the url.\n//\n // Send the below string to the client when the user visits the PORT URL\n response.end(\"You are a javascript wizard! \" + request.url);\n} //creates the strung & sends it back to the browser.", "function gotoPage(url)\n{\n\t//llamada Ajax...\n\tajaxCall(httpMethod=\"GET\", \n\t\t\t\t\turi= url + \"?pagenumber=\" + currentPage, \n\t\t\t\t\tdivResponse=\"response\", \n\t\t\t\t\tdivProgress=\"grid-progress\", \n\t\t\t\t\tformName=null, \n\t\t\t\t\tafterResponseFn=showCurrentPage, \n\t\t\t\t\tonErrorFn=null); \t\n}", "function\tForward(url)\n{\n\twindow.location.href = url;\n}", "open() {\n super.open(\"https://google.com\"); //provide your additional URL if any. this will append to the baseUrl to form complete URL\n browser.pause(3000);\n }", "function navigateToUrl(url) {\n Reporter_1.Reporter.debug(`Navigate to '${url}'`);\n tryBlock(() => browser.url(url), `Failed to navigate to '${url}'`);\n }", "function gotoPage(pageURL) {\n console.log(\"Moving to \" + pageURL);\n window.location.assign(pageURL);\n}", "function myNewPage() {\n\twindow.location.assign(\"http://www.google.md\");\n}", "open () {\n super.open('https://www.choucairtesting.com/servicio/') //provide your additional URL if any. this will append to the baseUrl to form complete URL\n browser.pause(1000);\n }", "function start() {\n console.log('click!');\n $.get('/questions', function (data) {\n window.location = \"/questions\"\n })\n }", "function visitLink(link) {\n window.location = link;\n}", "open() {\n browser.url(this.url);\n }", "function goToScore() {\n fetch( '/scores', {\n method:'GET',\n })\n .then( function( r ) {\n window.location.href = r.url\n });\n return false;\n}", "function go(url, routesOnly) {\n\n\t\t//if a url is given\n\t\tif(typeof url === 'string') {\n\n\t\t\t//if the redirect is absolute then redirect\n\t\t\tif(url.match(/https?:\\/\\/[a-z0-9]+.[a-z0-9\\-]+.[a-z]/)) {\n\t\t\t\topen(url, '_blank');\n\n\t\t\t//if the url is relative to the domain\n\t\t\t} else {\n\t\t\t\tif(getRoutes(url) || getPointer(url) || routesOnly) {\n\t\t\t\t\twindow.location.hash = url;\n\t\t\t\t} else {\n\t\t\t\t\topen(location.pathname + '#' + url, '_blank');\n\t\t\t\t}\n\t\t\t}\n\n\t\t//if no url is given then reload the page\n\t\t} else {\n\t\t\tlocation.reload();\n\t\t}\n\t}", "open() {\n super.open('/') //provide your additional URL if any. this will append to the baseUrl to form complete URL\n browser.pause(1000);\n }", "function setUrl(url) {\n\t\twindow.location = url; }", "function mForward (strURL) {\r\n\twindow.location.href = strURL;\r\n}", "function goToExplore() {\n console.log(\"Redirecting to explore page\");\n location.href = \"explorepage.html\";\n}", "function goToExplore() {\n console.log(\"Redirecting to explore page\");\n location.href = \"explorepage.html\";\n}", "function getLink(url) {\n //console.log(url);\n\trequest({url: url, followRedirect : false}, function (error, response, body) {\n\t\t\n\t\tif (!error && response.statusCode == 302) {\t\t\n\t\t\t//console.log('Get url : ' + response.headers['location']);\n checkCountry(url,response.headers['location']);\n\t\t\t//login(url,response.headers['location']);\n\t\t}\n\t});\n}", "function get(e){\n\t\t\t\n\t\t\tvar start = new Date().getTime(),\n\t\t\t\t$this = $(this).removeClass(\"queued\").addClass('calling');\n\t\t\t\n\t\t\t$.ajax( $this.find(\"a.url\").text(), {\n\t\t\t\terror:function( xhr, status, err ){\n\t\t\t\t\t// Just notification for now but this could handle redirects later\n\t\t\t\t\tconsole && console.error(err);\n\t\t\t\t\t$this.addClass(\"error\").append(\"<div>\"+err+\"</div>\");\n\t\t\t\t\t$gc.trigger('next')\n\t\t\t\t},\n\t\t\t\tsuccess: function( data, status, xhr ){\n\t\t\t\t\tvar time = new Date().getTime() - start;\n\t\t\t\t\t$this.addClass(\"done\")\n\t\t\t\t\t\t.trigger(\"done\",data)\n\t\t\t\t\t\t.find(\".time\").html(time+\"ms\");\n\t\t\t\t},\n\t\t\t\tcomplete:function(xhr, status){\n\t\t\t\t\t$this.removeClass(\"calling\");\n\t\t\t\t},\n\t\t\t\tconverters:{\n\t\t\t\t\t\"* text\": window.String,\n\t\t\t\t\t\"text html\": true,\n\t\t\t\t\t\"text xml\": true\n\t\t\t\t},\n\t\t\t\tdataType:'html'\n\t\t\t});\n\t\t}", "function handleRequest(request,response){\n\n //capture the url the request is made to\n\n var path =req.url;\n\n //depending on the URL,display a different HTML file \n\n response.end(\"It Works!!\" +request.url);\n\n}", "function loadURL()\n{\n exec( 'window.location.href' ).then( URL => {\n URL = URL.slice( 0, -1 );\n payloadInput.value = decodeURI( URL );\n loadPostData();\n loadReferer();\n });\n}", "function goToFeed() {\n console.log(\"Redirecting to explore page\");\n location.href = \"feedpage.html\";\n}", "function goToFeed() {\n console.log(\"Redirecting to explore page\");\n location.href = \"feedpage.html\";\n}", "function next(){\n\twindow.location.href = nexturl;\n}", "function goTo(folio, sequence) {\n // For some reason we have to wait before jumping.\n // @TODO: Why do we have to wait before jumping?\n setTimeout(function () {\n var url = (sequence) ? folio + '/' + sequence : folio;\n data.current_diva.gotoPageByAliasedNumber(folio.replace(/^0+/, ''));\n }, 1);\n }", "function appGoTo(page, params){\n\tvar params_ = (params != null) ? params : '';\n document.location.href = 'index.php?'+page + params_;\n}", "function goToPage(path){\n\tvar currentUrl = window.location.href;\n\tnewUrl = currentUrl.split(\"/\");\n\tnewUrl = newUrl[0] + \"//\" + newUrl[2] + path;\n\twindow.location.href = newUrl;\n}", "function navigateToUrl(url) {\n Reporter_1.Reporter.debug(`Navigate to ${url}`);\n tryBlock(() => browser.url(url), `Failed to navigate to ${url}`);\n expectCurrentUrl(url);\n }", "function handleRequest(request, response){\n\t//below statements are triggered (user side) when the user visits the PORT url\n\tresponse.end(\"It works. Path hit: \" + request.url);\n\n}", "function goToTravelTodo() {\n console.log(\"TravelTODO\");\n //Apply code to continue to travels\n //Make connection with Jonas page\n}", "function handleRequest1(request, response){\n\n //send the below string to the client when the user visits the PORT1 URL\n response.end(\"You are awesome! This works: \" + request.url);\n}", "function goTo(path) {\n\t\t\t$window.location.href = path;\n\t\t}", "function $goto(a) {\n\ta.addEventListener('click', event => {\n\t\tevent.preventDefault();\n\t\thistory.pushState({}, '', a.href);\n\t\tmain();\n\t});\n}", "function forward(url, update) {\n if (url === '/articles') {\n goToArticles(update);\n }\n else if (url === '/') {\n goToIndex(update);\n }\n else if (url === 'SpecRunner.html') {\n doGet(url, function () {\n });\n setNewUrl(url);\n }\n else if (url === 'SpecRunner') {\n doGet(url, function () {\n });\n setNewUrl(url);\n }\n else {\n try {\n goToArticleView(url.split('/').slice(-1)[0], update);\n }\n catch (error) {\n goToIndex(update);\n }\n }\n}", "function navigateTo() {\n testLog.logStart(\"Navigate to homepage\");\n cy.server()\n cy.route('GET', '/apps?**').as('getHomePage')\n\n // Open application\n cy.visit('http://localhost:5050')\n cy.wait('@getHomePage')\n testLog.logEnd();\n}", "function nextPage() \n{\n\tgotoUrl( nextIndexPageUrl );\n}", "function hitUrl(url) {\n // create an iFrame to call out to the url\n var b = document.getElementsByTagName('body')[0];\n var frameId = 'goToUrlFrame';\n var frameElem = document.getElementById(frameId);\n if (!frameElem) {\n var divElem = document.createElement('div');\n divElem.style.display = 'none';\n b.appendChild(divElem);\n // Must do this because the name attribute in IE cannot be set\n divElem.innerHTML = '<iframe src=\"javascript:false\" style=\"display:none;\" id=\"' + frameId + '\" name=\"' + frameId + '\"></iframe>';\n frameElem = document.getElementById(frameId);\n frameElem.title = 'blank - ignore';\n }\n var formElem = document.createElement('form');\n b.appendChild(formElem);\n formElem.target = frameId;\n formElem.method = 'POST';\n formElem.action = url;\n formElem.submit();\n b.removeChild(formElem);\n\n}", "function getstarted(){\n window.location.href=\"login.html\";\n}", "function e() {\n window.location = linkLocation;\n}", "function sendTo(url) {\n window.location.href = \"/\"\n}", "GoTo(route, params, query){// function used to change the path of our browser\n var path = routes[route].path(params)\n var qs = Qs.stringify(query)\n var url = path + (qs == '' ? '' : '?'+qs)\n history.pushState({},\"\",url)\n Link.onPathChange()\n }", "function onRequest(request, response){\n var pathName = url.parse(request.url).pathname\n //console.log(pathName);\n showPage(response, pathName);\n}", "function goLocationPage(page){\n window.location.href = page;\n}", "open() {\n browser.url(this.url);\n }", "open() {\n browser.url(this.url);\n }", "function handleRequest(request, response) {\n\n // Send the below string to the client when the user visits the PORT URL\n response.end(\"It Works!! Path Hit: \" + request.url + \"YOU ROCK!\");\n}", "viewIteration (baseUrl,username,spacename,iterationname){\n browser.get(baseUrl + username + \"/\" + spacename +\"/plan?iteration=\" + iterationname);\n }", "function nav(){\n var path = currentTest().path;\n window.location = path;\n }", "function goBabyGo(goString)\n{\n\twindow.location.href= goString;\n}", "function call_try(){\n var currentlocation = window.location;\n var url = \"try.py\" + currentlocation.search;\n request = new XMLHttpRequest();\n request.addEventListener('readystatechange', handle_response1, false);\n request.open('GET', url, true);\n request.send(null);\n}", "function redirection(url) {\n \n window.location.href = url;\n \n}", "function setLocation(url){\n window.location.href = url;\n}", "function goToFirstPage(){\r\n console.log(\"working\");\r\n location.replace(\"../html/StartHere.html\");\r\n}", "function redirect(url) {\r\n url = url || 'index.html';\r\n location.href = url;\r\n }", "function handleRequestOne(request, response) {\n\n // The below statement is triggered (client-side) when the user visits the PORT URL\n response.end(\"You are awesome!!!\" + request.url);\n}", "redirect(url) {\n window.location.href = url + Utils.getQueryString();\n }", "function OpenwebPage(url) {\n setWEBPAGEURL(url)\n setOpenWebPage(true)\n }", "function go() {\n logAllActions()\n trackAllActions()\n updateTitle()\n setReducer(reducer)\n dispatch({\n type: 'SET_CURRENT_USER_ID',\n currentUserID: cookie.get('currentUserID'),\n })\n route(window.location.pathname + window.location.search)\n init({\n view: indexView,\n el: document.body\n })\n}", "function handleRequestTwo(request, response) { //whats the request? req to the url.\n//console.log(request.url);\n // Send the below string to the client when the user visits the PORT URL\n response.end(\"I guess javasccript is not your forte! \" + request.url);\n} //creates the strung & sends it back to the browser.", "function goPage(url){\n var index=url.indexOf('#');\n if(index==-1){\n url=url+window.location.hash;\n }\n reload(url);\n}", "function requestHandler(request, response) {\n if (request.url == \"/\") {\n response.end(\"Welcome!\");\n } else if (request.url == \"/urls\") {\n response.end(\"www.lighthouselabs.ca\\nwww.google.com\");\n } else {\n response.statusCode = 404;\n response.end(\"Unknown Path\");\n }\n} //this send the URL and REquest method which is in our case '/'' and 'GET'", "function loadURL(url, step)\n{\n\t// TODO:\n\tif (step)\n\t\tcounterDepth -= 1;\n\n\tURLToBeLoaded = url;\n\n\tcountcount = 0;\n\tpage.open(url);\n}", "function navigateInWindow(url) {\n window.location.href = url;\n}", "function navigateInWindow(url) {\n window.location.href = url;\n}", "function requestPORT(request, response) {\n response.end(\"Good request! Path hit: \" + request.url);\n}", "function matchHandler (url)\n{\n request (url, cb);\n}", "function callModel(targetURL,targetInterface) {\r\n window.document.location.href=setURL(targetURL,targetInterface)\r\n}", "function visitHomePageBuy() {\n var dirPath = dirname(location.href);\n var fullPath = dirPath + \"/index.html\";\n window.location = fullPath;\n}", "open() {\n super.open('http://10.10.10.250:8060/');\n browser.pause(2000);\n }", "function activeLink(sUrl)\r\n{\r\n window.location = sUrl;\r\n}", "function startGrab(orgUrl) {\n // 1. grab [link|html] content;\n https.get(orgUrl, cb4Request).on('error', function (err) {\n console.log(err);\n });\n}", "function openMyPage(requestDetails){\n\n var url = requestDetails.url;\n console.log(\"Debug: openMyPage: \" + url);\n\n if (url === \"https://testsfocus.com/\"){\n browser.tabs.update({\n \"url\": \"/tests.html\"\n });\n return {\"cancel\": true};\n }\n \n if(shouldBlockSite(url)){\n\n console.log(\"Debug: openMyPage: Blocked site: \" + url);\n\n browser.tabs.update({\n \"url\": \"/focus.html\"\n });\n\n lastBlockedPage = url;\n\n return {\"cancel\": true};\n }\n}", "function redirect(url){\r\n window.location.href= url;\r\n}", "function nav(url) {\n console.log(\"Navigating to: \" + url);\n chrome.tabs.getSelected(null, function(tab) {\n chrome.tabs.update(tab.id, {url: url});\n });\n }", "function redirect (url) {\n window.location.href = url;\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}", "loadPage(){\n\t\tsuper.loadPage('https://www.google.com');\n\t}", "function go_mainpage(){\n\n object.getpage('mainpage.html');\n }", "navigateToUrl(url, external) {\n window.location = this.getNavigationUrl(url, external);\n }", "function handleRequest(request, response){\n response.end(\"It worked!!! Path Hit: \" + request.url);\n}" ]
[ "0.72707605", "0.7268128", "0.71793854", "0.71392524", "0.71392524", "0.70997506", "0.7072296", "0.7005128", "0.68039715", "0.66246307", "0.65706575", "0.6469302", "0.64624864", "0.64185584", "0.6386184", "0.6375138", "0.63592535", "0.63289505", "0.6302043", "0.6266948", "0.62517583", "0.62094903", "0.6202943", "0.6194419", "0.6138843", "0.6126738", "0.6125401", "0.6111546", "0.6098355", "0.6095605", "0.60832834", "0.6083249", "0.60812163", "0.6073476", "0.60689485", "0.60667974", "0.6059014", "0.6059014", "0.6049719", "0.6043553", "0.60423976", "0.60061973", "0.5998041", "0.5998041", "0.59980226", "0.59677833", "0.594828", "0.58959323", "0.5887485", "0.58823127", "0.5873888", "0.58563596", "0.58562326", "0.5850382", "0.58493185", "0.5847375", "0.584523", "0.5843288", "0.5838078", "0.58363134", "0.5835412", "0.582702", "0.5814813", "0.5814589", "0.5787654", "0.5787654", "0.5783868", "0.578224", "0.5780578", "0.5774248", "0.5771372", "0.5768714", "0.57642555", "0.5763977", "0.5747505", "0.5745334", "0.573336", "0.5717501", "0.57093", "0.5709266", "0.5702964", "0.569412", "0.5689353", "0.56887823", "0.56887823", "0.5685258", "0.5679842", "0.56737286", "0.5666392", "0.56656307", "0.56638944", "0.56595427", "0.56566447", "0.564427", "0.5641967", "0.56408936", "0.56397986", "0.56332123", "0.5622331", "0.5616206", "0.5614685" ]
0.0
-1
Checks for validity of common search params (non resource specific).
function validateCommonParams(params, onSuccess, onError) { var countRegExp = /^\d+$/; var errors = []; // validate _count if (params._count) { // _count should be an integer if (!countRegExp.test(params._count)) { errors.push(validationErrors.INVALID_COUNT); } } // FHIR _sort param takes different forms (_sort=propName, _sort:asc=propName, _sort:desc=propName) // this is reflected in the query as three different query parameters. if (hasMoreThanOneSortParameter(params)) { // FHIR supports multiple _sort parameters but JDS does not, so we allow only one _sort query parameter. errors.push(validationErrors.TOO_MANY_SORT_PARAMS); } if (errors.length > 0) { onError(errors); } else { onSuccess(); // all common parameters passed validation } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkSearchParam(search) {\n check(search, String);\n }", "function check_params(params){\n for(var i=0; i < params.length; i ++){\n if(!params_search[params[i]]){\n return false\n }\n }\n return true;\n }", "function searchParams() {\n let searchLang = lang.value;\n let devLoc = devLocation.value;\n let minRepo = minimumRepos.value;\n\n // test\n // console.log(searchLang);\n // console.log(devLoc);\n // console.log(minRepo);\n //check\n\n // validate client request data here with Joi \n // make API request\n\n // \n apiRequest.getProfiles(searchLang, devLoc, minRepo)\n .then(data => {\n\n uiResults.renderResults(data);\n\n });\n\n}", "function notSearchParam(key) {\n\t\t\t\t\treturn fromAndToState.params[key].location != \"search\";\n\t\t\t\t}", "function notSearchParam(key) {\n\t return fromAndToState.params[key].location != \"search\";\n\t }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "function notSearchParam(key) {\n return fromAndToState.params[key].location !== \"search\";\n }", "_entityVerify (entity, params, inputSearch) {\n\t\treturn params.reduce((valid, param) => {\n\t\t\tif (!valid)\n\t\t\t\treturn false\n\n\t\t\tif (param.operator === '$' && param.descriptor.type === String)\n\t\t\t\tparam.operator = '$in'\n\n\t\t\tlet attrValue\n\n\t\t\tif (entity instanceof Array && param.attr.match(/\\./)) {\n\t\t\t\tconst attr = param.attr.split('.').slice(1).join('.')\n\t\t\t\tattrValue = entity.genres.map(g => this._getAttr(attr, entity))\n\t\t\t} else {\n\t\t\t\tattrValue = entity[param.attr]\n\t\t\t}\n\n\t\t\tif (param.descriptor.searchSepAnd && inputSearch.match(param.descriptor.searchSepAnd)) {\n\t\t\t\tconst values = param.value.split(param.descriptor.searchSepAnd)\n\t\t\t\t\t.map(value => this._verify(attrValue, param.operator, value))\n\n\t\t\t\treturn values.reduce((p, valid) => p && valid, true)\n\t\t\t} else if (param.descriptor.searchSepOr && inputSearch.match(param.descriptor.searchSepOr)) {\n\t\t\t\tconst values = param.value.split(param.descriptor.searchSepOr)\n\t\t\t\t\t.map(value => this._verify(attrValue, param.operator, value))\n\n\t\t\t\treturn values.reduce((p, valid) => p || valid, false)\n\t\t\t}\n\n\t\t\treturn this._verify(attrValue, param.operator, param.value)\n\t\t}, true)\n\t}", "_entityVerifyOr (entity, params, inputSearch) {\n\t\treturn params.reduce((valid, and) => {\n\t\t\tif (valid) return true\n\t\t\treturn this._entityVerify(entity, and, inputSearch)\n\t\t}, false)\n\t}", "function checkParams(cb) {\n if (Array.isArray(request.params)) {\n\t //since were limiting to two request we're only taking first two items from params array\n makeRequests(request.params.slice(0, 2));\n } else {\n if (typeof request.params === 'string') {\n makeSingleRequest(request.params);\n }\n }\n}", "function paramQuerySearch() {\n var params = getParam(\"paramQuery\");\n parameterSearch(params);\n}", "searchIsValid(search) {\n if (search) {\n return true;\n }\n return false;\n }", "function systemVmGetSearchParams() {\n var moreCriteria = [];\t\n\n\tvar searchInput = $(\"#basic_search\").find(\"#search_input\").val();\t \n if (searchInput != null && searchInput.length > 0) {\t \n moreCriteria.push(\"&keyword=\"+todb(searchInput));\t \n } \n\n\tvar $advancedSearchPopup = getAdvancedSearchPopupInSearchContainer();\n\tif ($advancedSearchPopup.length > 0 && $advancedSearchPopup.css(\"display\") != \"none\" ) {\t \n\t\tvar state = $advancedSearchPopup.find(\"#adv_search_state\").val();\n\t\tif (state!=null && state.length > 0) \n\t\t\tmoreCriteria.push(\"&state=\"+todb(state));\t\t\n\t\t\t\t\n\t\tvar zone = $advancedSearchPopup.find(\"#adv_search_zone\").val();\t\n\t if (zone!=null && zone.length > 0) \n\t\t\tmoreCriteria.push(\"&zoneId=\"+zone);\t\n\t\t\n\t\tif ($advancedSearchPopup.find(\"#adv_search_pod_li\").css(\"display\") != \"none\") {\t\n\t\t var pod = $advancedSearchPopup.find(\"#adv_search_pod\").val();\t\t\n\t if (pod!=null && pod.length > 0) \n\t\t\t moreCriteria.push(\"&podId=\"+pod);\n } \n\t} \t\n\t\n\treturn moreCriteria.join(\"\"); \n}", "function searchHelper() {\r\n let searchValue = searchField.value;\r\n if (searchValue.length) search(searchValue);\r\n else getAll();\r\n }", "function cmdValidate(value, msg, args) {\n return value == \"search\" || value == \"details\";\n}", "async checkSearch(input, searchby) {\n\n if (await this.clientsPage.Search(input, searchby)) {\n await this.clientsPage.ValidateSearchResults(input, searchby)\n }\n\n return\n\n }", "function shouldSearch(query){\n return query && query.length > 2;\n}", "validateParams(params) {\n const { vendor_id, fulfillment_center_id } = params;\n if (\n !vendor_id &&\n !fulfillment_center_id\n ) {\n throw new Error('Vendor or Fulfillment center Id is required!');\n }\n }", "function checkMainArguments() {\n if (!this.operator) {\n error('\"operator\" parameter is missing');\n }\n\n if (!this.oldApiKey) {\n error('\"oldApiKey\" parameter is missing');\n }\n\n if (!this.newApiKey) {\n error('\"newApiKey\" parameter is missing');\n }\n}", "function searchQueryValidate(){\n\tfor (var i = 0; i < suburbs.length; i++){\n\n\t\tsuburbs[i] = suburbs[i].replace(\"&#39;\", \"'\");\n\t\tif (searchbarInput.value.toUpperCase() == suburbs[i].toUpperCase()){\n\t\t\treturn true;\n\t\t}\n\t}\t\n\tfor (var i = 0; i < parkNames.length; i++){\n\t\t\tparkNames[i] = parkNames[i].replace(\"&#39;\", \"'\");\n\t\tif (searchbarInput.value.toUpperCase() == parkNames[i].toUpperCase()){\n\t\t\treturn true;\n\t\t}\n\t}\n\tsearchbarInput.style.color = \"red\";\n\tsearchbarInput.value = \"Invalid Search Request\";\n\tsearchbarButton.disabled = true;\n return false;\n}", "function validateSearch(userInput){\n\tvar errorFlag = true;\n\tvar errorMessages = \"Error: \";\n\t\n\tvar validGenders = [\"unisex\",\"male\",\"female\",\"all\"];\n\tvar validMoods = [\"neutral\",\"serious\",\"funny\",\"all\"];\n\t\n\t//validate name\n\tif(/[^a-z0-9]/.test(userInput[0])){\n\t\terrorFlag = false; errorMessages += \"Invalid characters, \";\n\t}\n\t\n\t//validate gender\n\tif(!compareVarAgainstVarArray(userInput[1], validGenders)){ \n\t\terrorFlag = false; errorMessages += \"Invalid gender, \"; \n\t}\n\t\n\t//validate mood\n\tif(!compareVarAgainstVarArray(userInput[2], validMoods)){ \n\t\terrorFlag = false; errorMessages += \"Invalid mood, \"; \n\t}\n\t\n\t//validate length\n\tif( /[^0-9]/.test(userInput[3]) || (userInput[3] < 1) ) { \n\t\terrorFlag = false; errorMessages += \"Length must be greater than 0, \"; \n\t}\n\t\n\treturn [errorFlag, errorMessages];\n}", "async function validate_params(params_criteria, dataObj, MongooseModel = {}) {\r\n const errors = { missing_params: [], invalid_params: [], not_unique: [] };\r\n for (const item of Object.entries(params_criteria)) {\r\n const [param, options] = item;\r\n\r\n // check if param's value is required and missing\r\n if (options.required && (!(param in dataObj) || param == \"\")) {\r\n errors.missing_params.push(param);\r\n continue; // skip to next iteration. No need to check for param validity further if it's missing.\r\n }\r\n\r\n // check if param's value patten is not valid\r\n if (options.pattern && !options.pattern.test(dataObj[param])) {\r\n errors.invalid_params.push(param);\r\n continue;\r\n }\r\n\r\n // check if param's value length isn't valid\r\n if (options.len) { // len: length (should always be an array of min and max)\r\n const [min, max] = options.len;\r\n const str_len = dataObj[param].length; // param's value's string length\r\n if (!(str_len > min && str_len < max)) {\r\n errors.invalid_params.push(param);\r\n continue;\r\n }\r\n }\r\n if (options.min) { // min: minimum param's value length\r\n const { min } = options;\r\n const str_len = dataObj[param].length; // param's value's string length\r\n if (!(str_len > min)) {\r\n errors.invalid_params.push(param);\r\n continue;\r\n }\r\n }\r\n if (options.min) { // min: minimum param's value length\r\n const { min } = options;\r\n const str_len = dataObj[param].length;\r\n if (!(str_len > min)) {\r\n errors.invalid_params.push(param);\r\n continue;\r\n }\r\n }\r\n if (options.max) { // max: maximum param's value length\r\n const { max } = options;\r\n const str_len = dataObj[param].length;\r\n if (!(str_len > max)) {\r\n errors.invalid_params.push(param);\r\n continue;\r\n }\r\n }\r\n\r\n // check if param's value unique\r\n if (options.unique) {\r\n try {\r\n const query = {};\r\n query[param] = dataObj[param];\r\n const matched = await MongooseModel.findOne(query);\r\n if (matched) {\r\n errors.not_unique.push(param);\r\n continue;\r\n }\r\n } catch (err) {\r\n return err;\r\n }\r\n }\r\n }\r\n\r\n if (!(errors.missing_params.length || errors.invalid_params.length || errors.not_unique.length)) {\r\n return { isValid: true, errors: \"\" }; // all params are valid\r\n } // else: has invalid params\r\n\r\n // clean errors object\r\n Object.entries(errors).forEach((item) => {\r\n const [key, arr] = item; // arr: array\r\n if (arr.length == 0) {\r\n delete errors[key];\r\n }\r\n });\r\n return { isValid: false, errors };\r\n }", "function checkSearchQuery() {\n\n $inputs.each(function() {\n\n // identify our elements\n $input = $(this);\n $form = $input.closest('form');\n\n if (($input.val() == '') || ($input.val() == 'Search content, people, units, classes or applications')) {\n $input.val('');\n $form.find('.typeahead').typeahead('val', '');\n $form.find(\".search-submit\").attr('disabled', 'disabled');\n\n $form.find(\".searchClear\").hide();\n //console.log('was empty');\n } else {\n $form.find(\".searchClear\").show();\n $form.find(\".search-submit\").removeAttr('disabled');\n //console.log('not empty');\n }\n\n })\n }", "checkCallURLSelections() {\n\t\t\n\t\tif (!this.initialURLParameters) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet scope = this.initialURLParameters['scope'];\n\t\tlet time = this.initialURLParameters['time'];\n\t\tlet type = this.initialURLParameters['type'];\n\n\t\tif (scope) {\n\t\t\tif (GSearchUtils.setInitialOption(this.portletNamespace + 'ScopeFilterOptions', scope)) {\n\t\t\t\tthis.setQueryParam('scopeFilter', scope, false);\n\t\t\t}\n\t\t} \n\t\t\n\t\tif (time) {\n\t\t\tif (GSearchUtils.setInitialOption(this.portletNamespace + 'TimeFilterOptions', time)) {\n\t\t\t\tthis.setQueryParam('timeFilter', time, false);\n\t\t\t}\n\t\t}\n\n\t\tif (type) {\n\t\t\tif (GSearchUtils.setInitialOption(this.portletNamespace + 'TypeFilterOptions', type)) {\n\t\t\t\tthis.setQueryParam('typeFilter', time, false);\n\t\t\t}\n\t\t}\n\t}", "function determineSearch() {\n let val = { invalid: false, searchFunc: searchDept };\n let r1 = /^\\s*[a-z]{2,4}\\s*$/i; // regex for dept code\n let r2 = /^\\s*[a-z0-9]{3,4}\\s*$/i; // regex for course and section code\n let re = /^\\s*$/; // regex for blank field\n\n let deptKeyid = r1.test(dept.value);\n let courseKeyid = r2.test(course.value);\n let sectionValid = r2.test(section.value);\n let deptEmpty = re.test(dept.value);\n let courseEmpty = re.test(course.value);\n let sectionEmpty = re.test(section.value);\n\n if (!sectionEmpty) {\n if (courseEmpty || !courseKeyid) {\n markInput(course, false);\n val.invalid = true;\n } else {\n markInput(course, true);\n }\n if (deptEmpty || !deptKeyid) {\n markInput(dept, false);\n val.invalid = true;\n } else {\n markInput(dept, true);\n }\n markInput(section, sectionValid);\n if (!sectionValid) val.invalid = true;\n val.searchFunc = searchSection;\n } else if (!courseEmpty) {\n if (deptEmpty || !deptKeyid) {\n markInput(dept, false);\n val.invalid = true;\n } else {\n markInput(dept, true);\n }\n markInput(course, courseKeyid);\n markInput(section, true);\n if (!courseKeyid) val.invalid = true;\n val.searchFunc = searchCourse;\n } else if (deptEmpty || !deptKeyid) {\n markInput(dept, false);\n val.invalid = true;\n markInput(course, true);\n markInput(section, true);\n } else {\n markInput(dept, true);\n markInput(course, true);\n markInput(section, true);\n }\n return val;\n}", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n\t // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n\t function notSearchParam(key) {\n\t return fromAndToState.params[key].location != \"search\";\n\t }\n\t var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n\t var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n\t var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n\t return nonQueryParamSet.$$equals(fromParams, toParams);\n\t }", "function validParams (params) {\t\n\tfor(var param in params){\n\t\tif(!params[param])\n\t\t\treturn false;\n\t}\n\treturn true;\n}", "function searchCheck() {\n switch(searchType) {\n case \"my-tweets\":\n\tmyTweets();\n\tbreak;\n case \"spotify-this-song\":\n\tcheckName();\n\tbreak;\n case \"movie-this\":\n checkName();\n\tbreak;\n case \"do-what-this-says\":\n\trandomSearch();\n\tbreak;\n }\n}", "function serviceOfferingGetSearchParams() {\n var moreCriteria = [];\t\n\n\tvar searchInput = $(\"#basic_search\").find(\"#search_input\").val();\t \n if (searchInput != null && searchInput.length > 0) {\t \n moreCriteria.push(\"&keyword=\"+todb(searchInput));\t \n } \n\n\tvar $advancedSearchPopup = getAdvancedSearchPopupInSearchContainer();\n\tif ($advancedSearchPopup.length > 0 && $advancedSearchPopup.css(\"display\") != \"none\" ) {\n if ($advancedSearchPopup.find(\"#adv_search_domain_li\").css(\"display\") != \"none\"\n\t && $advancedSearchPopup.find(\"#domain\").hasClass(\"textwatermark\") == false) {\n\t var domainName = $advancedSearchPopup.find(\"#domain\").val();\n\t if (domainName != null && domainName.length > 0) { \t\n\t\t\t\tvar domainId;\t\t\t\t\t\t\t \n\t\t\t if(autoCompleteDomains != null && autoCompleteDomains.length > 0) {\t\t\t\t\t\t\t\t\t\n\t\t\t\t for(var i=0; i < autoCompleteDomains.length; i++) {\t\t\t\t\t \n\t\t\t\t if(fromdb(autoCompleteDomains[i].name).toLowerCase() == domainName.toLowerCase()) {\n\t\t\t\t domainId = autoCompleteDomains[i].id;\n\t\t\t\t break;\t\n\t\t\t\t }\n\t\t\t } \t\t\t\t\t \t\t\t \n\t\t\t } \t \t\n\t if(domainId == null) { \n\t\t\t showError(false, $advancedSearchPopup.find(\"#domain\"), $advancedSearchPopup.find(\"#domain_errormsg\"), g_dictionary[\"label.not.found\"]);\n\t\t\t }\n\t\t\t else { //e.g. domainId == 5 (number)\n\t\t\t showError(true, $advancedSearchPopup.find(\"#domain\"), $advancedSearchPopup.find(\"#domain_errormsg\"), null)\n\t\t\t moreCriteria.push(\"&domainid=\"+todb(domainId));\t\n\t\t\t }\n\t\t\t}\n\t } \n\t} \n\t\t\n\treturn moreCriteria.join(\"\"); \n}", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n\t\t\t\t// Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n\t\t\t\tfunction notSearchParam(key) {\n\t\t\t\t\treturn fromAndToState.params[key].location != \"search\";\n\t\t\t\t}\n\t\t\t\tvar nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n\t\t\t\tvar nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n\t\t\t\tvar nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n\t\t\t\treturn nonQueryParamSet.$$equals(fromParams, toParams);\n\t\t\t}", "validateComponent() {\n let requiredFunctions = ['initSearch', 'openSearch', 'closeSearch', 'navigateUp', 'navigateDown'];\n for (var f in requiredFunctions) {\n if (typeof(this.searchComponent[requiredFunctions[f]]) != \"function\") {\n return false; }\n }\n return true;\n }", "function checkStandardSearchTerm(req, _item, _searchesToDo){\n \n _item.search = false\n _item.searchrelevance = 0\n\n var _matchedsearch = false\n for (var i = 0; i < _searchesToDo.length; i++) {\n var _thisItem = _searchesToDo[i]\n if(Array.isArray(_thisItem.searchOn)){\n _thisItem.searchOn.forEach(function(_arrayPart, index) {\n doSearches(_arrayPart)\n });\n } else {\n doSearches(_thisItem.searchOn)\n }\n function doSearches(_itemToSearch){\n //Exact check\n if(_thisItem.exactrelevance && _itemToSearch.toUpperCase() == req.session.myData.searchTerm.toUpperCase()){\n _item.searchrelevance = _item.searchrelevance + _thisItem.exactrelevance\n _matchedsearch = true\n if(_thisItem.ifmatch == \"exit\"){\n return\n }\n }\n // Within check\n if(_thisItem.withinrelevance && _itemToSearch.toUpperCase().indexOf(req.session.myData.searchTerm.toUpperCase()) != -1){\n _item.searchrelevance = _item.searchrelevance + _thisItem.withinrelevance\n _matchedsearch = true\n if(_thisItem.ifmatch == \"exit\"){\n return \n }\n }\n }\n if(_matchedsearch == true && _thisItem.ifmatch == \"exit\") {\n break\n }\n }\n if(_matchedsearch && _item.searchrelevance > 1){\n req.session.myData.hasAMatchcount++\n }\n }", "function search_is_null(keyword, filters){\n\n\tif(keyword.length == 0 && filters.length == 0){return true;}\n\treturn false;\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n\t\treturn false;\n\t}\n\n\t// Brand-checking and more duck-typing as optional condition.\n\treturn obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n // Duck-typing as a necessary condition.\n if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n return false;\n }\n\n // Brand-checking and more duck-typing as optional condition.\n return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function isURLSearchParams(obj) {\n // Duck-typing as a necessary condition.\n if (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {\n return false;\n } // Brand-checking and more duck-typing as optional condition.\n\n\n return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';\n}", "function checkReqFields() {\n \n}", "function paramCheck() {\n\t\tvar e = getParameterByName( \"version\" );\n\t\tif ( \"\" == e || \"standard\" == e ) {\n\t\t\tgtm_pageName = gtm_pageNameVariationStandard;\n\t\t}\n\t\tif ( \"wireless\" == e ) {\n\t\t\tgtm_pageName = gtm_pageNameVariationWireless;\n\t\t}\n\t\tif ( \"upgrade\" == e ) {\n\t\t\tgtm_pageName = gtm_pageNameVariationUpgrade;\n\t\t}\n\t}", "function hasRequiredParams(data, reqParams, fail) {\n var errList = [];\n var lcKey = {};\n for (key in data) {\n lcKey[key.toLowerCase()] = key;\n }\n reqParams.forEach(function (n) {\n if (typeof lcKey[n.toLowerCase()] == \"undefined\") {\n errList.push(\"Expected Parameter: \" + n);\n }\n });\n if (errList.length > 0) {\n fail(errList);\n return false;\n }\n return true;\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function searchFormValidation() {\n var searchValue = document.forms[\"search-form\"].elements[\"search-key\"].value;\n if (searchValue.length == 0 || searchValue == null) {\n alert(\"Searh key is not valid.\")\n return false;\n } else {\n return true;\n }\n}", "function SearchCriteria(params) {\n if (params) {\n this.textQuery = params.q;\n this.countryCode = params.c;\n this.audienceIds = params.a; // csv\n this.themeIds = params.t; // csv\n this.specified = true;\n } else {\n this.specified = false;\n }\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }", "function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }" ]
[ "0.7056248", "0.67399013", "0.6473527", "0.63690734", "0.63413846", "0.62511694", "0.62457293", "0.62457293", "0.62457293", "0.62457293", "0.62457293", "0.62457293", "0.62457293", "0.62457293", "0.62457293", "0.62457293", "0.62457293", "0.62457293", "0.62457293", "0.62457293", "0.61709464", "0.58834416", "0.5808703", "0.58033156", "0.5786613", "0.5770642", "0.5767571", "0.5763222", "0.56778556", "0.5655151", "0.564871", "0.56315243", "0.56252396", "0.5622467", "0.5592112", "0.55776876", "0.5564282", "0.55641687", "0.55555344", "0.55321115", "0.55249447", "0.5505647", "0.5503368", "0.5497181", "0.54772425", "0.5458814", "0.5445947", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5429674", "0.5422908", "0.54057103", "0.53918934", "0.53843725", "0.5375821", "0.53683084", "0.53670084", "0.5366978", "0.5364986", "0.5364986", "0.5364986", "0.5364986", "0.5364986", "0.5364986", "0.5364986", "0.5364986", "0.5364986", "0.5364986", "0.5364986", "0.5364986", "0.5364986", "0.5364986" ]
0.7054256
1
Returns a date range query that includes the missing date specificity (if any). A date that specifies year, month, date but not time will search for a range within that day (from 00:00 to 23:59), a date that specifies year, month, but not date, will search for a range within that month (from 1st day to the last), and so forth. Note: JDS has a granularity of minutes. Ex. 20150126T01:23:45 Exact search 20150126 Between 20150126T00:00 and 20150126T23:59 (inclusive) 201501 Between 20150101T00:00 and 20150131T23:59 (inclusive) 2015 Between 20150101T00:00 and 20151231T23:59 (inclusive)
function buildImplicitDateRangeQuery(dateStr, jdsProperty, isNegated, ignoreTime, includeSeconds) { var query = ''; if (YYYY_MM_DD_HH_MM_SS_Regex.test(dateStr)) { // this is an exact match search query = getExactDateQuery(new Date(dateStr), jdsProperty, isNegated, ignoreTime, true); } else { query = getDateRangeQuery(getDateRange(dateStr), jdsProperty, isNegated, ignoreTime, includeSeconds); } return query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupDateQuery( params ) {\n if( 'all' !== params.dateFrom ) {\n // we will not always provide a time range\n if( !params.duration && !params.dateTo ) {\n params.duration = 'day';\n }\n\n if( 'now' === params.dateFrom ) {\n params.dateFrom = moment();\n } else if( 'today' === params.dateFrom ) {\n params.dateFrom = moment().startOf( 'day' );\n }\n\n if( params.duration ) {\n params.dateFrom = moment( params.dateFrom );\n if( !params.dateFrom.isValid() ) {\n return false;\n }\n }\n }\n return true;\n }", "filterBySearchDate(fieldName, operator, searchTerms, version) {\n let query = '';\n let searchValues;\n if (Array.isArray(searchTerms) && searchTerms.length > 1) {\n searchValues = searchTerms;\n if (operator !== OperatorType.rangeExclusive && operator !== OperatorType.rangeInclusive) {\n operator = this._gridOptions.defaultFilterRangeOperator;\n }\n }\n // single search value\n if (!Array.isArray(searchValues) && Array.isArray(searchTerms) && searchTerms.length === 1 && searchTerms[0]) {\n const searchValue1 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchTerms[0], true));\n if (searchValue1) {\n return `${fieldName} ${this.mapOdataOperator(operator)} ${searchValue1}`;\n }\n }\n // multiple search value (date range)\n if (Array.isArray(searchValues) && searchValues.length === 2 && searchValues[0] && searchValues[1]) {\n // date field needs to be UTC and within DateTime function\n const searchValue1 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchValues[0], true));\n const searchValue2 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchValues[1], true));\n if (searchValue1 && searchValue2) {\n if (operator === OperatorType.rangeInclusive) {\n // example:: (Finish >= DateTime'2019-08-11T00:00:00Z' and Finish <= DateTime'2019-09-12T00:00:00Z')\n query = `(${fieldName} ge ${searchValue1} and ${fieldName} le ${searchValue2})`;\n }\n else if (operator === OperatorType.rangeExclusive) {\n // example:: (Finish > DateTime'2019-08-11T00:00:00Z' and Finish < DateTime'2019-09-12T00:00:00Z')\n query = `(${fieldName} gt ${searchValue1} and ${fieldName} lt ${searchValue2})`;\n }\n }\n }\n return query;\n }", "filterBySearchDate(fieldName, operator, searchTerms, version) {\n let query = '';\n let searchValues;\n if (Array.isArray(searchTerms) && searchTerms.length > 1) {\n searchValues = searchTerms;\n if (operator !== OperatorType.rangeExclusive && operator !== OperatorType.rangeInclusive) {\n operator = this._gridOptions.defaultFilterRangeOperator;\n }\n }\n // single search value\n if (!Array.isArray(searchValues) && Array.isArray(searchTerms) && searchTerms.length === 1 && searchTerms[0]) {\n const searchValue1 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchTerms[0], true));\n if (searchValue1) {\n return `${fieldName} ${this.mapOdataOperator(operator)} ${searchValue1}`;\n }\n }\n // multiple search value (date range)\n if (Array.isArray(searchValues) && searchValues.length === 2 && searchValues[0] && searchValues[1]) {\n // date field needs to be UTC and within DateTime function\n const searchValue1 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchValues[0], true));\n const searchValue2 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchValues[1], true));\n if (searchValue1 && searchValue2) {\n if (operator === OperatorType.rangeInclusive) {\n // example:: (Finish >= DateTime'2019-08-11T00:00:00Z' and Finish <= DateTime'2019-09-12T00:00:00Z')\n query = `(${fieldName} ge ${searchValue1} and ${fieldName} le ${searchValue2})`;\n }\n else if (operator === OperatorType.rangeExclusive) {\n // example:: (Finish > DateTime'2019-08-11T00:00:00Z' and Finish < DateTime'2019-09-12T00:00:00Z')\n query = `(${fieldName} gt ${searchValue1} and ${fieldName} lt ${searchValue2})`;\n }\n }\n }\n return query;\n }", "function dateWithinRange(date) {\n \n var currentDate = new Date(date);\n \n var minDate = new Date(startDate);\n var maxDate = new Date(endDate);\n\n if (currentDate > minDate && currentDate < maxDate ){ // checks if dates are within range\n return true;\n }\n\n if(isNaN(minDate.valueOf() || maxDate.valueOf )){ //if no contraints are entered, return all dates\n return true;\n }\n else{\n return false;\n } \n }", "function getDateCriteria(dateRange) {\n switch (dateRange) {\n case \"Daily\":\n return new Date(Date.now() - 24 * 60 * 60 * 1000);\n break;\n case \"Weekly\":\n return new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);\n break;\n case \"Monthly\":\n return new Date(Date.now() - 4 * 7 * 24 * 60 * 60 * 1000);\n break;\n case \"Annual\":\n return new Date(Date.now() - 12 * 4 * 7 * 24 * 60 * 60 * 1000);\n break;\n }\n}", "function DateRange(start, end) {\n if (start === void 0) {\n start = null;\n }\n if (end === void 0) {\n end = null;\n }\n this.start = start;\n this.end = end;\n }", "function getCreationDateRangeQuery(prefix, prop, fromDate, toDate)\r\n{\r\n var luceneQuery = \" +@\"+prefix+\"\\\\:\"+prop+\":[\";\r\n if (fromDate !== null && ! isNaN(fromDate.getTime()))\r\n {\r\n luceneQuery += getLuceneDateString(fromDate);\r\n }\r\n else\r\n {\r\n luceneQuery += \"1970\\\\-01\\\\-01T00:00:00\";\r\n }\r\n luceneQuery += \" TO \";\r\n if (toDate !== null && ! isNaN(toDate.getTime()))\r\n {\r\n luceneQuery += getLuceneDateString(toDate);\r\n }\r\n else\r\n {\r\n luceneQuery += \"3000\\\\-12\\\\-31T00:00:00\";\r\n }\r\n luceneQuery += \"] \";\r\n return luceneQuery;\r\n}", "findRangeofDates(){ \n\t\tlet min=new Date(2030,1,1); \n\t\tlet max=new Date(1990,1,1);\n\t\tconst ar=this.props.data;\n\t\tfor(let i=0;i<ar.length;i++){\n\t\t\tif(ar[i].start<min)\n\t\t\t\tmin=ar[i].start;\n\t\t\tif(ar[i].end>max)\n\t\t\t\tmax=ar[i].end;\n\t\t}\n\t\tthis.min=min;\n\t\tthis.max=max;\n\t}", "findShallowIntersectingRange(date1, date2) {\n const thisRange = date1.toRange();\n const otherRange = date2.toRange(); // Start with infinite start and end dates\n\n let start = null;\n let end = null; // This start date exists\n\n if (thisRange.start) {\n // Use this definite start date if other start date is infinite\n if (!otherRange.start) {\n start = thisRange.start;\n } else {\n // Otherwise, use the earliest start date\n start = thisRange.start < otherRange.start ? thisRange.start : otherRange.start;\n } // Other start date exists\n\n } else if (otherRange.start) {\n // Use other definite start date as this one is infinite\n start = otherRange.start;\n } // Assign end date to this one if it is valid\n\n\n if (thisRange.end && (!start || thisRange.end >= start)) {\n end = thisRange.end;\n } // Assign end date to other one if it is valid and before this one\n\n\n if (otherRange.end && (!start || otherRange.end >= start)) {\n if (!end || otherRange.end < end) end = otherRange.end;\n } // Return calculated range\n\n\n return {\n start,\n end\n };\n }", "findShallowIntersectingRange(date1, date2) {\n const thisRange = date1.toRange();\n const otherRange = date2.toRange(); // Start with infinite start and end dates\n\n let start = null;\n let end = null; // This start date exists\n\n if (thisRange.start) {\n // Use this definite start date if other start date is infinite\n if (!otherRange.start) {\n start = thisRange.start;\n } else {\n // Otherwise, use the earliest start date\n start = thisRange.start < otherRange.start ? thisRange.start : otherRange.start;\n } // Other start date exists\n\n } else if (otherRange.start) {\n // Use other definite start date as this one is infinite\n start = otherRange.start;\n } // Assign end date to this one if it is valid\n\n\n if (thisRange.end && (!start || thisRange.end >= start)) {\n end = thisRange.end;\n } // Assign end date to other one if it is valid and before this one\n\n\n if (otherRange.end && (!start || otherRange.end >= start)) {\n if (!end || otherRange.end < end) end = otherRange.end;\n } // Return calculated range\n\n\n return {\n start,\n end\n };\n }", "function restrictPassedDate(){\n let date = new Date(),\n day = date.getDate(),\n month = date.getMonth()+1,\n year = date.getFullYear();\n if(day < 10){\n day = `0${day}`;\n }\n if(month < 10){\n month = `0${month}`;\n }\n dateStart.min = `${year}-${month}-${day}`;\n dateEnd.min = `${year}-${month}-${day}`;\n}", "resetDateRange() {\n var beg, end;\n beg = Data.toDateStr(Data.begDay, Data.monthIdx);\n end = Data.advanceDate(beg, Data.numDays - 1);\n return this.res.dateRange(beg, end, this.resetRooms);\n }", "function prepareQueryDates() {\n var userProperties = PropertiesService.getUserProperties();\n var configurationData = userProperties.getProperties();\n\n var startDateHTML = isoToDate(configurationData.StartDate);\n var endDateHTML = isoToDate(configurationData.EndDate);\n\n var startDate = new Date(startDateHTML);\n var endDate = new Date(endDateHTML);\n\n var startDateMil = startDate.getTime();\n var endDateMil = endDate.getTime();\n\n // Set the unit values in milliseconds.\n var msecPerMinute = 1000 * 60;\n var msecPerHour = msecPerMinute * 60;\n var msecPerDay = msecPerHour * 24;\n var daysInData = (endDate - startDate) / msecPerDay;\n\n var dateObj = {\n startDate: startDate,\n startDateHTML: startDateHTML,\n startDateMil: startDateMil,\n endDate: endDate,\n endDateHTML: endDateHTML,\n endDateMil: endDateMil,\n daysInData: daysInData,\n msecPerDay: msecPerDay\n };\n\n return dateObj;\n\n}", "function createESQueryFromDate(mustQueryTerms, mustNotQueryTerms, date) {\n var mustQueryTermsWithDate = addDateRangeToQueries(mustQueryTerms, date);\n return {\n size: 5000,\n query: {\n bool: {\n must: mustQueryTermsWithDate,\n must_not: mustNotQueryTerms\n }\n }\n };\n }", "function getDateRestriction (dateReport){\n\tvar restriction = \" gp.date_start <= #Date%\" + dateReport + \"% AND gp.date_end >= #Date%\" + dateReport + \"%\";\n\treturn restriction;\n}", "function get_publication_date_query(){\n let query = [];\n\n let minDate = document.getElementById(\"minDate\").value;\n let maxDate = document.getElementById(\"maxDate\").value;\n let tmp = 0;\n\n if ((new Date(minDate).getTime() > new Date(maxDate).getTime())){\n tmp = minDate;\n minDate = maxDate;\n maxDate = tmp\n }\n\n query.push(\"minDate=\"+minDate);\n query.push(\"maxDate=\"+maxDate);\n console.log(query);\n return query.join(\"&\");\n}", "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n return date;\n}", "function getDateRangeFrom(request) {\n var qs = (request && request.query) ? request.query : {};\n var from = moment(new Date(qs.from));\n var to = qs.to ? moment(new Date(qs.to)) : from.isValid() ? from : moment();\n var som = (from.isValid() ? from.clone() : to.clone()).startOf('month');\n var eom = som.clone().endOf('month');\n\n if (qs.tz) {\n var dt = moment()\n .subtract(qs.monthsAgo || 0, 'months')\n .subtract(qs.daysAgo || 0, 'days');\n\n if (qs.from)\n dt = moment(new Date(qs.from));\n\n from = moment.tz(dt, qs.tz).startOf('day');\n to = moment.tz(dt, qs.tz).endOf('day');\n som = moment.tz(dt, qs.tz).startOf('month');\n eom = moment.tz(dt, qs.tz).endOf('month');\n }\n\n if (request && request.monthRange) {\n from = som;\n to = eom;\n }\n\n return {\n 'from': from.toISOString(),\n 'to': to.toISOString(),\n 'startOfMonth': som.toISOString(),\n 'endOfMonth': eom.toISOString()\n };\n}", "function datesSearch() {\n let error = false;\n\n dateFrom = $('#dateFrom').val();\n dateTo = $('#dateTo').val();\n\n if (dateFrom.length !== 0) {\n $('#dateFrom').removeClass('error');\n } else {\n $('#dateFrom').addClass('error');\n error = true;\n }\n if (dateTo.length !== 0) {\n $('#dateTo').removeClass('error');\n } else {\n $('#dateTo').addClass('error');\n error = true;\n }\n if (error) {\n $('#dateLengthErr').show();\n } else {\n $('#dateLengthErr').hide();\n }\n\n let dateFromMoment = moment(dateFrom, \"YYYY-MM-DD\");\n if (dateFromMoment.isAfter(dateTo)) {\n $('#dateFrom').addClass('error');\n $('#dateError').show();\n error = true;\n } else {\n $('#dateError').hide();\n }\n\n if (error) {\n return;\n }\n\n // Custom datatable search function to only return rows that are between the 2 dates\n $.fn.dataTableExt.afnFiltering.push(\n function(oSettings, aData, iDataIndex) {\n let dateFrom = parseDateValue($('#dateFrom').val());\n let dateTo = parseDateValue($('#dateTo').val());\n\n let evalDate = parseDateValue(aData[1]);\n\n if (evalDate >= dateFrom && evalDate <= dateTo) {\n return true;\n } else {\n return false;\n }\n }\n );\n\n // Once the table has been searched it must be redrawn to show the filtered results\n datatable.draw();\n\n sumTableData();\n updateChart();\n}", "function dt_add_rangedate_filter(begindate_id, enddate_id, dateCol) {\n $.fn.dataTableExt.afnFiltering.push(\n function( oSettings, aData, iDataIndex ) {\n\n var beginDate = Date_from_syspref($(\"#\"+begindate_id).val()).getTime();\n var endDate = Date_from_syspref($(\"#\"+enddate_id).val()).getTime();\n\n var data = Date_from_syspref(aData[dateCol]).getTime();\n\n if ( !parseInt(beginDate) && ! parseInt(endDate) ) {\n return true;\n }\n else if ( beginDate <= data && !parseInt(endDate) ) {\n return true;\n }\n else if ( data <= endDate && !parseInt(beginDate) ) {\n return true;\n }\n else if ( beginDate <= data && data <= endDate) {\n return true;\n }\n return false;\n }\n );\n}", "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n\n return date;\n }", "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n return date;\n }", "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n return date;\n }", "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n return date;\n }", "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n return date;\n }", "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n\n return date;\n }", "function executeAssociatedDateCondition(options) {\n const filterSearchType = options && (options.filterSearchType || options.fieldType) || FieldType.dateIso;\n const FORMAT = mapMomentDateFormatWithFieldType(filterSearchType);\n const searchTerms = Array.isArray(options.searchTerms) && options.searchTerms || [];\n let isRangeSearch = false;\n let dateSearch1;\n let dateSearch2;\n // return when cell value is not a valid date\n if (searchTerms.length === 0 || searchTerms[0] === '' || searchTerms[0] === null || !moment$3(options.cellValue, FORMAT, true).isValid()) {\n return false;\n }\n // cell value in moment format\n const dateCell = moment$3(options.cellValue, FORMAT, true);\n if (searchTerms.length === 2 || (searchTerms[0].indexOf('..') > 0)) {\n isRangeSearch = true;\n const searchValues = (searchTerms.length === 2) ? searchTerms : searchTerms[0].split('..');\n const searchValue1 = (Array.isArray(searchValues) && searchValues[0] || '');\n const searchValue2 = (Array.isArray(searchValues) && searchValues[1] || '');\n const searchTerm1 = moment$3(searchValue1, FORMAT, true);\n const searchTerm2 = moment$3(searchValue2, FORMAT, true);\n // return if any of the 2 values are invalid dates\n if (!moment$3(searchTerm1, FORMAT, true).isValid() || !moment$3(searchTerm2, FORMAT, true).isValid()) {\n return false;\n }\n dateSearch1 = moment$3(searchTerm1, FORMAT, true);\n dateSearch2 = moment$3(searchTerm2, FORMAT, true);\n }\n else {\n // return if the search term is an invalid date\n if (!moment$3(searchTerms[0], FORMAT, true).isValid()) {\n return false;\n }\n dateSearch1 = moment$3(searchTerms[0], FORMAT, true);\n }\n // run the filter condition with date in Unix Timestamp format\n if (isRangeSearch) {\n const isInclusive = options.operator && options.operator === OperatorType.rangeInclusive;\n const resultCondition1 = testFilterCondition((isInclusive ? '>=' : '>'), parseInt(dateCell.format('X'), 10), parseInt(dateSearch1.format('X'), 10));\n const resultCondition2 = testFilterCondition((isInclusive ? '<=' : '<'), parseInt(dateCell.format('X'), 10), parseInt(dateSearch2.format('X'), 10));\n return (resultCondition1 && resultCondition2);\n }\n return testFilterCondition(options.operator || '==', parseInt(dateCell.format('X'), 10), parseInt(dateSearch1.format('X'), 10));\n}", "dateShallowIncludesDate(date1, date2) {\n // First date is simple date\n if (date1.isDate) {\n if (date2.isDate) {\n return date1.dateTime === date2.dateTime;\n }\n\n if (!date2.startTime || !date2.endTime) {\n return false;\n }\n\n return date1.dateTime === date2.startTime && date1.dateTime === date2.endTime;\n } // Second date is simple date and first is date range\n\n\n if (date2.isDate) {\n if (date1.start && date2.date < date1.start) {\n return false;\n }\n\n if (date1.end && date2.date > date1.end) {\n return false;\n }\n\n return true;\n } // Both dates are date ranges\n\n\n if (date1.start && (!date2.start || date2.start < date1.start)) {\n return false;\n }\n\n if (date1.end && (!date2.end || date2.end > date1.end)) {\n return false;\n }\n\n return true;\n }", "dateShallowIncludesDate(date1, date2) {\n // First date is simple date\n if (date1.isDate) {\n if (date2.isDate) {\n return date1.dateTime === date2.dateTime;\n }\n\n if (!date2.startTime || !date2.endTime) {\n return false;\n }\n\n return date1.dateTime === date2.startTime && date1.dateTime === date2.endTime;\n } // Second date is simple date and first is date range\n\n\n if (date2.isDate) {\n if (date1.start && date2.date < date1.start) {\n return false;\n }\n\n if (date1.end && date2.date > date1.end) {\n return false;\n }\n\n return true;\n } // Both dates are date ranges\n\n\n if (date1.start && (!date2.start || date2.start < date1.start)) {\n return false;\n }\n\n if (date1.end && (!date2.end || date2.end > date1.end)) {\n return false;\n }\n\n return true;\n }", "function withinDate(d, m, y) {\n\n startDateArray = $('#startDate').val().split(\" \");\n endDateArray = $('#endDate').val().split(\" \");\n\n var startDay = parseInt(startDateArray[0]);\n var startMonth2 = monthNames.indexOf(startDateArray[1]) + 1;\n if (startMonth2 < 10){\n startMonth2 = \"0\" + startMonth2;\n }\n var startMonth = parseInt(startMonth2);\n var startYear = parseInt(startDateArray[2]);\n\n var endDay = parseInt(endDateArray[0]);\n var endMonth2 = monthNames.indexOf(endDateArray[1]) + 1;\n if (endMonth2 < 10){\n endMonth2 = \"0\" + endMonth2;\n }\n var endMonth = parseInt(endMonth2);\n var endYear = parseInt(endDateArray[2]);\n\n var d1 = [startMonth, startDay, startYear];\n var d2 = [endMonth, endDay, endYear];\n var c = [m, d, y];\n\n var from = new Date(d1); // -1 because months are from 0 to 11\n var to = new Date(d2);\n var check = new Date(c);\n\n return(check >= from && check <= to);\n }", "dateShallowIntersectsDate(date1, date2) {\n if (date1.isDate) {\n return date2.isDate ? date1.dateTime === date2.dateTime : this.dateShallowIncludesDate(date2, date1);\n }\n\n if (date2.isDate) {\n return this.dateShallowIncludesDate(date1, date2);\n } // Both ranges\n\n\n if (date1.start && date2.end && date1.start > date2.end) {\n return false;\n }\n\n if (date1.end && date2.start && date1.end < date2.start) {\n return false;\n }\n\n return true;\n }", "dateShallowIntersectsDate(date1, date2) {\n if (date1.isDate) {\n return date2.isDate ? date1.dateTime === date2.dateTime : this.dateShallowIncludesDate(date2, date1);\n }\n\n if (date2.isDate) {\n return this.dateShallowIncludesDate(date1, date2);\n } // Both ranges\n\n\n if (date1.start && date2.end && date1.start > date2.end) {\n return false;\n }\n\n if (date1.end && date2.start && date1.end < date2.start) {\n return false;\n }\n\n return true;\n }", "function validateDateRange(form) {\r\n var bValid = true;\r\n var focusField = null;\r\n var i = 0;\r\n var fields = new Array();\r\n var formName = form.getAttributeNode(\"name\");\r\n var focus = true;\r\n var isStrict = true;\r\n\r\n oDate = eval('new ' + formName.value + '_dateRange()');\r\n\r\n for (x in oDate) {\r\n var field = form[oDate[x][0]];\r\n var value = field.value;\r\n var datePattern = oDate[x][2](\"datePatternStrict\");\r\n\r\n // try loose pattern\r\n if (datePattern == null) {\r\n datePattern = oDate[x][2](\"datePattern\");\r\n isStrict = false;\r\n }\r\n\r\n if ((field.type == 'hidden' ||\r\n field.type == 'text' ||\r\n field.type == 'textarea') &&\r\n (value.length > 0) &&\r\n (datePattern != null && datePattern.length > 0) &&\r\n field.disabled == false) {\r\n\r\n var MONTH = \"MM\";\r\n var DAY = \"dd\";\r\n var YEAR = \"yyyy\";\r\n var orderMonth = datePattern.indexOf(MONTH);\r\n var orderDay = datePattern.indexOf(DAY);\r\n var orderYear = datePattern.indexOf(YEAR);\r\n\r\n if (orderDay < orderYear && orderDay > orderMonth) {\r\n var iDelim1 = orderMonth + MONTH.length;\r\n var iDelim2 = orderDay + DAY.length;\r\n var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);\r\n var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);\r\n\r\n if (iDelim1 == orderDay && iDelim2 == orderYear) {\r\n dateRegexp = isStrict\r\n ? new RegExp(\"^(\\\\d{2})(\\\\d{2})(\\\\d{4})$\")\r\n : new RegExp(\"^(\\\\d{1,2})(\\\\d{1,2})(\\\\d{4})$\");\r\n } else if (iDelim1 == orderDay) {\r\n dateRegexp = isStrict\r\n ? new RegExp(\"^(\\\\d{2})(\\\\d{2})[\" + delim2 + \"](\\\\d{4})$\")\r\n : new RegExp(\"^(\\\\d{1,2})(\\\\d{1,2})[\" + delim2 + \"](\\\\d{4})$\");\r\n } else if (iDelim2 == orderYear) {\r\n dateRegexp = isStrict\r\n ? new RegExp(\"^(\\\\d{2})[\" + delim1 + \"](\\\\d{2})(\\\\d{4})$\")\r\n : new RegExp(\"^(\\\\d{1,2})[\" + delim1 + \"](\\\\d{1,2})(\\\\d{4})$\");\r\n } else {\r\n dateRegexp = isStrict\r\n ? new RegExp(\"^(\\\\d{2})[\" + delim1 + \"](\\\\d{2})[\" + delim2 + \"](\\\\d{4})$\")\r\n : new RegExp(\"^(\\\\d{1,2})[\" + delim1 + \"](\\\\d{1,2})[\" + delim2 + \"](\\\\d{4})$\");\r\n }\r\n\r\n var matched = dateRegexp.exec(value);\r\n if(matched != null) {\r\n if (!isValidDate(matched[2], matched[1], matched[3])) {\r\n if (field.type != 'hidden' && focus) {\r\n focusField = field;\r\n focus = false;\r\n }\r\n fields[i++] = oDate[x][1];\r\n bValid = false;\r\n } else {\r\n\r\n var startDateStr = oDate[x][2](\"startDate\");\r\n if (startDateStr != null\r\n && startDateStr.length > 0) {\r\n var startMatched\r\n = dateRegexp.exec(startDateStr);\r\n if (startMatched != null\r\n && isValidDate(startMatched[2],\r\n startMatched[1],\r\n startMatched[3])) {\r\n var date = new Date(matched[2],\r\n matched[1],\r\n matched[3]);\r\n var startDate = new Date(startMatched[2],\r\n startMatched[1],\r\n startMatched[3]);\r\n if (date < startDate) {\r\n if (field.type != 'hidden' && focus) {\r\n focusField = field;\r\n focus = false;\r\n }\r\n fields[i++] = oDate[x][1];\r\n bValid = false;\r\n continue;\r\n }\r\n }\r\n }\r\n\r\n var endDateStr = oDate[x][2](\"endDate\");\r\n if (endDateStr != null && endDateStr.length > 0) {\r\n var endMatched = dateRegexp.exec(endDateStr);\r\n if (endMatched != null\r\n && isValidDate(endMatched[2],\r\n endMatched[1],\r\n endMatched[3])) {\r\n var date = new Date(matched[2],\r\n matched[1],\r\n matched[3]);\r\n var endDate = new Date(endMatched[2],\r\n endMatched[1],\r\n endMatched[3]);\r\n if (date > endDate) {\r\n if (field.type != 'hidden' && focus) {\r\n focusField = field;\r\n focus = false;\r\n }\r\n fields[i++] = oDate[x][1];\r\n bValid = false;\r\n continue;\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n if (field.type != 'hidden' && focus) {\r\n focusField = field;\r\n focus = false;\r\n }\r\n fields[i++] = oDate[x][1];\r\n bValid = false;\r\n }\r\n\r\n } else if (orderMonth < orderYear && orderMonth > orderDay) {\r\n var iDelim1 = orderDay + DAY.length;\r\n var iDelim2 = orderMonth + MONTH.length;\r\n var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);\r\n var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);\r\n\r\n if (iDelim1 == orderMonth && iDelim2 == orderYear) {\r\n dateRegexp = isStrict\r\n ? new RegExp(\"^(\\\\d{2})(\\\\d{2})(\\\\d{4})$\")\r\n : new RegExp(\"^(\\\\d{1,2})(\\\\d{1,2})(\\\\d{4})$\");\r\n } else if (iDelim1 == orderMonth) {\r\n dateRegexp = isStrict\r\n ? new RegExp(\"^(\\\\d{2})(\\\\d{2})[\" + delim2 + \"](\\\\d{4})$\")\r\n : new RegExp(\"^(\\\\d{1,2})(\\\\d{1,2})[\" + delim2 + \"](\\\\d{4})$\");\r\n } else if (iDelim2 == orderYear) {\r\n dateRegexp = isStrict\r\n ? new RegExp(\"^(\\\\d{2})[\" + delim1 + \"](\\\\d{2})(\\\\d{4})$\")\r\n : new RegExp(\"^(\\\\d{1,2})[\" + delim1 + \"](\\\\d{1,2})(\\\\d{4})$\");\r\n } else {\r\n dateRegexp = isStrict\r\n ? new RegExp(\"^(\\\\d{2})[\" + delim1 + \"](\\\\d{2})[\" + delim2 + \"](\\\\d{4})$\")\r\n : new RegExp(\"^(\\\\d{1,2})[\" + delim1 + \"](\\\\d{1,2})[\" + delim2 + \"](\\\\d{4})$\");\r\n }\r\n\r\n var matched = dateRegexp.exec(value);\r\n if(matched != null) {\r\n if (!isValidDate(matched[1], matched[2], matched[3])) {\r\n if (field.type != 'hidden' && focus) {\r\n focusField = field;\r\n focus = false;\r\n }\r\n fields[i++] = oDate[x][1];\r\n bValid = false;\r\n } else {\r\n\r\n var startDateStr = oDate[x][2](\"startDate\");\r\n if (startDateStr != null\r\n && startDateStr.length > 0) {\r\n var startMatched\r\n = dateRegexp.exec(startDateStr);\r\n if (startMatched != null\r\n && isValidDate(startMatched[1],\r\n startMatched[2],\r\n startMatched[3])) {\r\n var date = new Date(matched[1],\r\n matched[2],\r\n matched[3]);\r\n var startDate = new Date(startMatched[1],\r\n startMatched[2],\r\n startMatched[3]);\r\n if (date < startDate) {\r\n if (field.type != 'hidden' && focus) {\r\n focusField = field;\r\n focus = false;\r\n }\r\n fields[i++] = oDate[x][1];\r\n bValid = false;\r\n continue;\r\n }\r\n }\r\n }\r\n\r\n var endDateStr = oDate[x][2](\"endDate\");\r\n if (endDateStr != null && endDateStr.length > 0) {\r\n var endMatched = dateRegexp.exec(endDateStr);\r\n if (endMatched != null\r\n && isValidDate(endMatched[1],\r\n endMatched[2],\r\n endMatched[3])) {\r\n var date = new Date(matched[1],\r\n matched[2],\r\n matched[3]);\r\n var endDate = new Date(endMatched[1],\r\n endMatched[2],\r\n endMatched[3]);\r\n if (date > endDate) {\r\n if (field.type != 'hidden' && focus) {\r\n focusField = field;\r\n focus = false;\r\n }\r\n fields[i++] = oDate[x][1];\r\n bValid = false;\r\n continue;\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n if (field.type != 'hidden' && focus) {\r\n focusField = field;\r\n focus = false;\r\n }\r\n fields[i++] = oDate[x][1];\r\n bValid = false;\r\n }\r\n\r\n } else if (orderMonth > orderYear && orderMonth < orderDay) {\r\n var iDelim1 = orderYear + YEAR.length;\r\n var iDelim2 = orderMonth + MONTH.length;\r\n var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);\r\n var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);\r\n\r\n if (iDelim1 == orderMonth && iDelim2 == orderDay) {\r\n dateRegexp = isStrict\r\n ? new RegExp(\"^(\\\\d{4})(\\\\d{2})(\\\\d{2})$\")\r\n : new RegExp(\"^(\\\\d{4})(\\\\d{1,2})(\\\\d{1,2})$\");\r\n } else if (iDelim1 == orderMonth) {\r\n dateRegexp = isStrict\r\n ? new RegExp(\"^(\\\\d{4})(\\\\d{2})[\" + delim2 + \"](\\\\d{2})$\")\r\n : new RegExp(\"^(\\\\d{4})(\\\\d{1,2})[\" + delim2 + \"](\\\\d{1,2})$\");\r\n } else if (iDelim2 == orderDay) {\r\n dateRegexp = isStrict\r\n ? new RegExp(\"^(\\\\d{4})[\" + delim1 + \"](\\\\d{2})(\\\\d{2})$\")\r\n : new RegExp(\"^(\\\\d{4})[\" + delim1 + \"](\\\\d{1,2})(\\\\d{1,2})$\");\r\n } else {\r\n dateRegexp = isStrict\r\n ? new RegExp(\"^(\\\\d{4})[\" + delim1 + \"](\\\\d{2})[\" + delim2 + \"](\\\\d{2})$\")\r\n : new RegExp(\"^(\\\\d{4})[\" + delim1 + \"](\\\\d{1,2})[\" + delim2 + \"](\\\\d{1,2})$\");\r\n }\r\n\r\n var matched = dateRegexp.exec(value);\r\n if(matched != null) {\r\n if (!isValidDate(matched[3], matched[2], matched[1])) {\r\n if (field.type != 'hidden' && focus) {\r\n focusField = field;\r\n focus = false;\r\n }\r\n fields[i++] = oDate[x][1];\r\n bValid = false;\r\n } else {\r\n\r\n var startDateStr = oDate[x][2](\"startDate\");\r\n if (startDateStr != null\r\n && startDateStr.length > 0) {\r\n var startMatched\r\n = dateRegexp.exec(startDateStr);\r\n if (startMatched != null\r\n && isValidDate(startMatched[3],\r\n startMatched[2],\r\n startMatched[1])) {\r\n var date = new Date(matched[1],\r\n matched[2],\r\n matched[3]);\r\n var startDate = new Date(startMatched[1],\r\n startMatched[2],\r\n startMatched[3]);\r\n if (date < startDate) {\r\n if (field.type != 'hidden' && focus) {\r\n focusField = field;\r\n focus = false;\r\n }\r\n fields[i++] = oDate[x][1];\r\n bValid = false;\r\n continue;\r\n }\r\n }\r\n }\r\n\r\n var endDateStr = oDate[x][2](\"endDate\");\r\n if (endDateStr != null && endDateStr.length > 0) {\r\n var endMatched = dateRegexp.exec(endDateStr);\r\n if (endMatched != null\r\n && isValidDate(endMatched[3],\r\n endMatched[2],\r\n endMatched[1])) {\r\n var date = new Date(matched[1],\r\n matched[2],\r\n matched[3]);\r\n var endDate = new Date(endMatched[1],\r\n endMatched[2],\r\n endMatched[3]);\r\n if (date > endDate) {\r\n if (field.type != 'hidden' && focus) {\r\n focusField = field;\r\n focus = false;\r\n }\r\n fields[i++] = oDate[x][1];\r\n bValid = false;\r\n continue;\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n if (field.type != 'hidden' && focus) {\r\n focusField = field;\r\n focus = false;\r\n }\r\n fields[i++] = oDate[x][1];\r\n bValid = false;\r\n }\r\n\r\n } else {\r\n if (field.type != 'hidden' && focus) {\r\n focusField = field;\r\n focus = false;\r\n }\r\n fields[i++] = oDate[x][1];\r\n bValid = false;\r\n }\r\n }\r\n }\r\n if (fields.length > 0) {\r\n if (focusField != null) {\r\n focusField.focus();\r\n }\r\n alert(fields.join('\\n'));\r\n }\r\n return bValid;\r\n }", "function queryEqualDate(path,key,date,criteria){\n\t\tif(!(date==null || date==\"\")) {\n\t\t\tstartAt=date+\"T00:00:00\";\n\t\t\tendAt=date+\" 23:59:59\";\n\t\t\tqueryBetween(path,key,startAt,endAt,criteria)\n\t\t}\n\t\telse throw {\"message\":\"Date cannot be null\"};\n\t}", "function makeRange() {\n var result = {}\n /*\n year: 2015,\n month: [3, 4],\n days: [[30, 31], [1,2,3,4,5,6]],\n */\n ;\n\n var startDate = new Date($scope.range.start);\n var endDate = new Date($scope.range.end);\n\n var yearNum = startDate.getFullYear();\n\n var startDay = startDate.getDate();\n var endDay = endDate.getDate();\n\n\n var startMonthNum = (startDate.getMonth() + 1);\n var endMonthNum = (endDate.getMonth() + 1);\n\n var daysInStartDate = new Date(yearNum, startMonthNum, 0).getDate();\n\n //define month array\n console.log(startMonthNum + ' - ' + endMonthNum);\n if(startMonthNum === endMonthNum) {\n month = [startMonthNum, null];\n } else {\n month = [startMonthNum, endMonthNum];\n }\n\n //define days array\n var days = [[],[]];\n\n if(month[1] === null) {\n for(var i = startDay; i <= endDay; i++) {\n days[0].push(i);\n }\n\n days[1] = null;\n } else {\n for(var i = startDay; i <= daysInStartDate; i++) {\n days[0].push(i);\n }\n\n for(var j = 1; j <= endDay; j++){\n days[1].push(j);\n }\n }\n\n result.year = yearNum;\n result.month = month;\n result.days = days;\n\n return result;\n }", "function testToKeyRange_DateTime() {\n var table = schema.table('TableC');\n var d1 = new Date(1443646468270);\n\n var p = new lf.pred.ValuePredicate(table['hireDate'], d1, lf.eval.Type.EQ);\n assertTrue(p.isKeyRangeCompatible());\n assertEquals(\n '[' + d1.getTime() + ', ' + d1.getTime() + ']',\n p.toKeyRange().toString());\n\n p = new lf.pred.ValuePredicate(table['hireDate'], d1, lf.eval.Type.GTE);\n assertTrue(p.isKeyRangeCompatible());\n assertEquals('[' + d1.getTime() + ', unbound]', p.toKeyRange().toString());\n\n p = new lf.pred.ValuePredicate(table['hireDate'], d1, lf.eval.Type.GT);\n assertTrue(p.isKeyRangeCompatible());\n assertEquals('(' + d1.getTime() + ', unbound]', p.toKeyRange().toString());\n\n p = new lf.pred.ValuePredicate(table['hireDate'], d1, lf.eval.Type.LTE);\n assertTrue(p.isKeyRangeCompatible());\n assertEquals('[unbound, ' + d1.getTime() + ']', p.toKeyRange().toString());\n\n p = new lf.pred.ValuePredicate(table['hireDate'], d1, lf.eval.Type.LT);\n assertTrue(p.isKeyRangeCompatible());\n assertEquals('[unbound, ' + d1.getTime() + ')', p.toKeyRange().toString());\n\n var d2 = new Date();\n p = new lf.pred.ValuePredicate(\n table['hireDate'], [d1, d2], lf.eval.Type.BETWEEN);\n assertTrue(p.isKeyRangeCompatible());\n assertEquals(\n '[' + d1.getTime() + ', ' + d2.getTime() + ']',\n p.toKeyRange().toString());\n\n p.setComplement(true);\n assertEquals(\n '[unbound, ' + d1.getTime() + '),(' + d2.getTime() + ', unbound]',\n p.toKeyRange().toString());\n}", "function filtering(data, startdate, enddate)\r\n {\r\n return _.filter(data, function(value)\r\n {\r\n var month = parseInt(value.date.substr(3,4));\r\n var year = parseInt(value.date.substr(6,9));\r\n if((year == startdate.getYear()+1900) && year == (enddate.getYear()+1900))\r\n {\r\n if(month >= (startdate.getMonth()+1) && month <= (enddate.getMonth()+1))\r\n return true;\r\n else\r\n return false;\r\n }\r\n else\r\n {\r\n if(month >= (startdate.getMonth()+1) && year == (startdate.getYear()+1900))\r\n return true;\r\n else if(month <= (enddate.getMonth()+1) && year == (enddate.getYear()+1900))\r\n return true;\r\n else if(year > (startdate.getYear()+1900) && year < (enddate.getYear()+1900))\r\n return true;\r\n else\r\n return false;\r\n }\r\n });\r\n }", "customQuery(value) {\n\t\tlet query = null;\n\t\tif (value) {\n\t\t\tquery = {\n\t\t\t\trange: {\n\t\t\t\t\t[this.props.appbaseField]: {\n\t\t\t\t\t\tgte: new Date(moment(value).subtract(24, \"hours\").format(\"YYYY-MM-DD\")).getTime(),\n\t\t\t\t\t\tlte: new Date(moment(value).format(\"YYYY-MM-DD\")).getTime()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\treturn query;\n\t}", "whereBetweenDate(field, date) {\r\n const zeroTime = { h: 0, m: 0, s: 0, ms: 0 };\r\n if (Array.isArray(date)) {\r\n if (date.length > 0) {\r\n if (date.length === 2) {\r\n if (moment.utc(date[1]).diff(moment.utc(date[0])) < 0) {\r\n throw new Exception('whereBetweenDate expect second date more than first date');\r\n }\r\n }\r\n let fromDate = moment.utc(date[0]).set(zeroTime);\r\n let toDate = moment\r\n .utc(new Date())\r\n .set(zeroTime)\r\n .add(1, 'days');\r\n if (date.length > 1) {\r\n toDate = moment\r\n .utc(date[1])\r\n .set(zeroTime)\r\n .add(1, 'days');\r\n }\r\n this.where(field, 'between', [fromDate.toDate(), toDate.toDate()]);\r\n }\r\n } else {\r\n let momentDate = moment.utc(date).set(zeroTime);\r\n this.where(field, 'between', [momentDate.toDate(), momentDate.add(1, 'days').toDate()]);\r\n }\r\n return this;\r\n }", "function getFilteredReservationByDate(roomUsages, date, dateEnd){\n\tvar dateFilteredReservations = [];\n\tif(date == null && dateEnd == null){\n\t\tlog(reservations);\n\t\treturn reservations;\n\t} else if (date != null && dateEnd == null) {\n\t\t$.when($.each(roomUsages , function(index, reservation){\n\t\t\tif(reservation.reservedDate == date){\n\t\t\t\tdateFilteredReservations.push(reservation);\n\t\t\t}\n\t\t})).then(function(noResult){\n\t\t\tlog(dateFilteredReservations);\n\t\t\treturn dateFilteredReservations;\n\t\t});\n\t} else if (date != null && dateEnd != null) {\n\t\t$.when($.each(roomUsages , function(index, reservation){\n\t\t\tif(date <= reservation.reservedDate && reservation.reservedDate <= dateEnd){\n\t\t\t\tdateFilteredReservations.push(reservation);\n\t\t\t}\n\t\t})).then(function(noResult){\n\t\t\tlog(dateFilteredReservations);\n\t\t\treturn dateFilteredReservations;\n\t\t});\n\t} else {\n\t\talert(\"No Result Cursed by Missing of Argument\");\n\t}\n}", "_getValidDates(dateOrDates) {\n let result = [];\n\n function validate(date) {\n if (date instanceof Date) {\n return date;\n }\n else if (JQX.Utilities.DateTime && date instanceof JQX.Utilities.DateTime) {\n return date.toDate();\n }\n else if (typeof (date) === 'string') {\n if (date.trim() === 'new Date()' || date.trim() === 'new JQX.Utilities.DateTime()') {\n return new Date();\n }\n\n let regex = /(\\d+[,-.\\/]{1}\\s*\\d+[,-.\\/]{1}\\s*\\d+)/;\n\n const parseDateString = () => {\n date = date.replace(/[,-.\\/]/g, ',').split(',');\n if (date.length > 2) {\n date = new Date(parseInt(date[0]), parseInt(date[1]) - 1, parseInt(date[2]));\n }\n else {\n return new Date();\n }\n\n return date;\n }\n\n if (regex.test(date)) {\n date = regex.exec(date)[0].replace(/[,-.\\/]/g, ',').split(',');\n if (date) {\n return new Date(parseInt(date[0]), parseInt(date[1]) - 1, parseInt(date[2]));\n }\n else {\n return parseDateString();\n }\n }\n else {\n return parseDateString();\n\n }\n }\n }\n\n if (dateOrDates === undefined) {\n return null;\n }\n\n if (Array.isArray(dateOrDates)) {\n for (let i = 0; i < dateOrDates.length; i++) {\n result.push(validate(dateOrDates[i]));\n }\n }\n else {\n result.push(validate(dateOrDates));\n }\n\n result = result.filter(date => date && date.toDateString() !== 'Invalid Date'); //remove invalid dates\n result.map(date => date.setHours(0, 0, 0, 0)); //reset time, important for date comparing\n\n return result;\n }", "function getActivityDateRange(params) {\n var beginDate = params.beginDate,\n endDate = params.endDate,\n beginEnd = params.beginEnd,\n date = params.date;\n\n var findParams = {};\n var begin = beginDate ? _moment2.default.utc(beginDate, 'MM-DD-YYYY').startOf('day') : (0, _moment2.default)().subtract(100, 'years');\n var end = endDate ? _moment2.default.utc(endDate, 'MM-DD-YYYY').endOf('day') : (0, _moment2.default)().add(100, 'years');\n if (beginDate && endDate) {\n findParams.created = { $gt: begin.toDate(), $lt: end.toDate() };\n // Begin date only\n } else if (beginEnd === 'begin' && date) {\n findParams.created = { $gt: begin.toDate() };\n }\n if (typeof params.companyId !== 'undefined') {\n findParams.company = params.companyId;\n }\n if (_typeof(params.rejected) && params.rejected === 'true') {\n params.rejected = true;\n }\n // Only sold\n findParams.soldToLiquidation = true;\n\n return findParams;\n}", "function _getDateRange(dateStr, granularity) {\n var start = new Date(dateStr);\n var end = new Date(dateStr);\n\n switch (granularity) {\n case 'year':\n end.setUTCFullYear(end.getUTCFullYear() + 1);\n break;\n case 'month':\n end.setUTCMonth(end.getUTCMonth() + 1);\n break;\n case 'day':\n end.setUTCDate(end.getUTCDate() + 1);\n break;\n }\n return {\n inclusiveStart: start,\n exclusiveEnd: end\n };\n}", "function getDateRange(dataPassed){\r\n //called by slider start & end dates\r\n //get first object in dataPassed array, and get the date\r\n firstObj=dataPassed.filter(function(d,i){\r\n return i==0\r\n });\r\n //get last object in dataPassed array, and get the date\r\n lastObj = dataPassed.filter(function(d,i){\r\n return i==dataPassed.length-1\r\n });\r\n datefrom = firstObj[0].Day;\r\n dateto=lastObj[0].Day;\r\n datejson = {'start':datefrom,'end':dateto};\r\n return datejson;\r\n }", "dateRange(name, options={}) {\n keys.push(name);\n data[name] = entries[name];\n settings[name] = options;\n schema[name] = Joi.array().items(\n Joi.array().ordered().items(\n Joi.date().timestamp('unix').raw(),\n ).dateComparator('a <= b', ALLOW_NULL, options.pastDates).length(2)\n ).min(0).max(options.allowMultipleDates ? 365 : 1);\n if(options.allowNull) schema[name] = schema[name].allow(null);\n return this;\n }", "function constrainMarkerToRange$1(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n return date;\n }", "function addRangeQuery( query, from, to ) { // from < start/end < to\n var\n begin, end;\n\n if( from && 'all' !== from ) {\n begin = moment( from );\n query.end = query.end || {};\n query.end.$gte = begin;\n }\n\n if( 'day' === to ) {\n end = moment( from ).endOf( 'day' );\n } else if( to ) {\n end = moment( to );\n }\n\n if( end ) {\n query.start = query.start || {};\n query.start.$lte = end;\n }\n }", "function customRangeCheck(d, constraints, selector) {\n\t\t\t\t\t\treturn (\"min\" in constraints ? (gdate.compare(d, constraints.min, selector) >= 0) : true)\n\t\t\t\t\t\t\t\t&& (\"max\" in constraints ? (gdate.compare(d, constraints.max, selector) <= 0) : true); // Boolean\n\t\t\t\t\t}", "function filterRequestByDate(requestList) {\n const filteredData = requestList.filter(function (request) {\n // console.log(\"Request Date : \", request.date);\n // console.log(\"dateQuery.starDate : \", dateQuery.startDate);\n // console.log(\"request.date >= dataQuery.startDate\", (request.date >= dateQuery.startDate))\n return (\n request.date >= dateQuery.startDate && request.date <= dateQuery.endDate\n );\n });\n return filteredData;\n }", "_validateSelectedDates(dates) {\n const that = this;\n let outOfRangeDates = [];\n\n if (!dates) {\n dates = that.selectedDates;\n }\n\n let selectedDates = dates.slice(0),\n filter = function (date) {\n if (date.getTime() >= that.min.getTime() && date.getTime() <= that.max.getTime() && !isRestrictedDate(date)) {\n return true;\n }\n\n outOfRangeDates.push(date);\n return;\n },\n isRestrictedDate = function (date) {\n for (let d = 0; d < that.restrictedDates.length; d++) {\n if (that.restrictedDates[d].getTime() === date.getTime()) {\n return true;\n }\n }\n }\n\n //Synchronize the attribute.\n that.selectedDates = selectedDates.filter(filter);\n\n //Unselects dates that are out of range.\n if (that._viewDates) {\n outOfRangeDates.map(date => that._selectDate(date));\n that._focusCell();\n }\n }", "get hasValidDates() {\n let me = this,\n start = me.startDateMS,\n end = me.endDateMS;\n\n return !start || !end || end - start >= 0;\n }", "function dateRangeCalculator(){\n\n\t//start date\n\n\t//end date\n\n\t//Api call request that reloads page/section based off of time span requested OR trimming original data object/array based off of new specified date range \n\n\n}", "function validateDateRange(strIdfield)\n{\n var field = getObject(strIdfield);\n var strDate = field.value;\n if ((empty(field)) || (empty(strDate)) || (strDate.indexOf('_') != -1))\n return false;\n var fieldJquery = $('#' + strIdfield);\n var strMinDate = convertDate(fieldJquery.datepicker('option', 'minDate'), 'd/m/Y');\n var strMaxDate = convertDate(fieldJquery.datepicker('option', 'maxDate'), 'd/m/Y');\n if ((!compareDatesValues(strMinDate, strDate)) || (!compareDatesValues(strDate, strMaxDate))) {\n field.value = '';\n return false;\n }\n return true;\n}", "function getDateRangeArray(date, dateRangeType, firstDayOfWeek, workWeekDays, daysToSelectInDayView) {\n if (daysToSelectInDayView === void 0) { daysToSelectInDayView = 1; }\n var datesArray = [];\n var startDate;\n var endDate = null;\n if (!workWeekDays) {\n workWeekDays = [_dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DayOfWeek.Monday, _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DayOfWeek.Tuesday, _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DayOfWeek.Wednesday, _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DayOfWeek.Thursday, _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DayOfWeek.Friday];\n }\n daysToSelectInDayView = Math.max(daysToSelectInDayView, 1);\n switch (dateRangeType) {\n case _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DateRangeType.Day:\n startDate = getDatePart(date);\n endDate = addDays(startDate, daysToSelectInDayView);\n break;\n case _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DateRangeType.Week:\n case _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DateRangeType.WorkWeek:\n startDate = getStartDateOfWeek(getDatePart(date), firstDayOfWeek);\n endDate = addDays(startDate, _dateValues_timeConstants__WEBPACK_IMPORTED_MODULE_0__.TimeConstants.DaysInOneWeek);\n break;\n case _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DateRangeType.Month:\n startDate = new Date(date.getFullYear(), date.getMonth(), 1);\n endDate = addMonths(startDate, 1);\n break;\n default:\n throw new Error('Unexpected object: ' + dateRangeType);\n }\n // Populate the dates array with the dates in range\n var nextDate = startDate;\n do {\n if (dateRangeType !== _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DateRangeType.WorkWeek) {\n // push all days not in work week view\n datesArray.push(nextDate);\n }\n else if (workWeekDays.indexOf(nextDate.getDay()) !== -1) {\n datesArray.push(nextDate);\n }\n nextDate = addDays(nextDate, 1);\n } while (!compareDates(nextDate, endDate));\n return datesArray;\n}", "function constrainDate(date, range) {\n\tdate = date.clone();\n\n\tif (range.start) {\n\t\tdate = maxMoment(date, range.start);\n\t}\n\n\tif (range.end && date >= range.end) {\n\t\tdate = range.end.clone().subtract(1);\n\t}\n\n\treturn date;\n}", "function constrainDate(date, range) {\n\tdate = date.clone();\n\n\tif (range.start) {\n\t\tdate = maxMoment(date, range.start);\n\t}\n\n\tif (range.end && date >= range.end) {\n\t\tdate = range.end.clone().subtract(1);\n\t}\n\n\treturn date;\n}", "function constrainDate(date, range) {\n\tdate = date.clone();\n\n\tif (range.start) {\n\t\tdate = maxMoment(date, range.start);\n\t}\n\n\tif (range.end && date >= range.end) {\n\t\tdate = range.end.clone().subtract(1);\n\t}\n\n\treturn date;\n}", "function queryDataTest3() {\n var start_q ='\\\"'+(new Date(Date.UTC(2017,11,1,8,0,0))).toISOString()+'\\\"';\n var end_q = '\\\"'+(new Date(Date.UTC(2017,11,2,10,0,0))).toISOString()+'\\\"';;\n var or1 = '{\"start_time\":{\"$gte\":'+start_q+',\"$lte\":'+end_q+'}},';\n var or2 = '{\"end_time\":{\"$gte\":'+start_q+',\"$lte\":'+end_q+'}},';\n var or3 = '{\"start_time\":{\"$lt\":'+start_q+'},\"end_time\":{\"$gt\":'+end_q+'}}';\n var query ='where={\"$or\":['+or1+or2+or3+']}';\n console.log(query)\n XHR.GET(SERVER_URL+'/classes/Sleep?'+encodeURI(query))\n}", "function valDate(dateStar, dateEnd) {\n\tvar arrayDateStart = dateStar.split(\"-\");\n\tvar arrayDateEnd = dateEnd.split(\"-\");\n\tvar dateStarDay = arrayDateStart[0];\n\tvar dateStarMonth = arrayDateStart[1];\n\tvar dateStarYear = arrayDateStart[2];\n\tvar dateEndDay = arrayDateEnd[0];\n\tvar dateEndMonth = arrayDateEnd[1];\n\tvar dateEndYear = arrayDateEnd[2];\n\n\tif (dateStar == dateEnd) {\n\t\treturn true;\n\t} else {\n\t\tif (parseInt(dateStarYear) < parseInt(dateEndYear)) {\n\t\t\treturn true;\n\t\t} else if (parseInt(dateStarYear) > parseInt(dateEndYear)) {\n\t\t\treturn false;\n\t\t} else if (parseInt(dateStarYear) == parseInt(dateEndYear)) {\n\t\t\tif (parseInt(dateStarMonth) < parseInt(dateEndMonth)) {\n\t\t\t\treturn true;\n\t\t\t} else if (parseInt(dateStarMonth) > parseInt(dateEndMonth)) {\n\t\t\t\treturn false;\n\t\t\t} else if (parseInt(dateStarMonth) == parseInt(dateEndMonth)) {\n\t\t\t\tif (parseInt(dateStarDay) > parseInt(dateEndDay)) {\n\t\t\t\t\treturn false;\n\t\t\t\t} else if (parseInt(dateStarDay) < parseInt(dateEndDay)) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else if (parseInt(dateStarDay) == parseInt(dateEndDay)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t}\n}", "function searchHotelsByDate(){\n totalNight();\n resultHotel= [];\n const start = new Date (dateFrom.value).getTime();\n const end = new Date (dateTo.value).getTime();\n if(start <= end){\n resultHotel = hotels.filter((hotel)=>{\n let available = false\n hotel.availability.forEach( date =>{\n var availableFrom = new Date(date.from.split('-').reverse().join('-')).getTime();\n var availableTo = new Date(date.to.split('-').reverse().join('-')).getTime();\n if(start <= availableFrom && end >= availableTo ){\n return available = true\n }\n // let fromString = date.from.split('-');\n // let toString = date.to.split('-');\n // let fromDate = new Date(fromString[2], fromString[1]-1, fromString[0]);\n // let toDate = new Date(toString[2], toString[1]-1, toString[0]);\n // if(fromDate.getTime() >= start && toDate.getTime() <= end)\n // {\n // // resultHotel.push(hotel);\n // return available = true;\n // }\n\n })\n return available;\n }) \n }else{\n alerts(\"Select Correct Range\",3000);\n }\n // console.log(resultHotel)\n display(resultHotel);\n range();\n filterByPrice();\n}", "function setDefaultDates() {\n /**\n * Return the day of the month of the provided date as a two-digit number\n * Example:\n * First day of month = \"01\"\n */\n function getTwoDigitDay(date) {\n return date.getDate().toString().padStart(2, \"0\");\n }\n\n /**\n * Return the month of the provided date as a two-digit number\n * Example:\n * January = \"01\"\n */\n function getTwoDigitMonth(date) {\n return (date.getMonth() + 1).toString().padStart(2, \"0\");\n }\n\n /**\n * Set the start date default to one year ago\n */\n function setStartDate() {\n const lastYearDate = new Date();\n const lastYear = lastYearDate.getFullYear() - 1;\n lastYearDate.setFullYear(lastYear);\n const month = getTwoDigitMonth(lastYearDate);\n const day = getTwoDigitDay(lastYearDate);\n\n $(\"#search-start\").val(`${lastYear}-${month}-${day}`);\n }\n\n /**\n * Set the end date default to the current date\n */\n function setEndDate() {\n const today = new Date();\n const year = today.getFullYear();\n const month = getTwoDigitMonth(today);\n const day = getTwoDigitDay(today);\n\n // YYYY-MM-DD\n $(\"#search-end\").val(`${year}-${month}-${day}`);\n }\n\n setStartDate();\n setEndDate();\n}", "function checkDates(date){\n if (dateInputInt === 0){\n return true;\n }\n else {\n if (dateCond === 'equalsdate'){\n return date === dateInputInt;\n }\n else if (dateCond === 'greaterthan'){\n return date > dateInputInt;\n }\n else if (dateCond === 'lessthan'){\n return date < dateInputInt;\n }\n }\n }", "getDateParams(excludePerPage = false) {\n const dateRange = Object.assign({}, this.displayData.dateRange);\n // Format begin and end date\n if (dateRange.dateBegin) {\n dateRange.dateBegin = this.formatDateSelection(dateRange, 'dateBegin');\n }\n if (dateRange.dateEnd) {\n dateRange.dateEnd = this.formatDateSelection(dateRange, 'dateEnd');\n }\n // String for the pagination component\n if (!excludePerPage) {\n dateRange.perPage = parseInt(this.displayData.perPage);\n dateRange.page = this.displayData.page;\n }\n return dateRange;\n }", "function validateDateRange(sMonth,sDay,sYear,eMonth,eDay,eYear,what){\r\n\t// validate date range 1 \r\n\t// make sure month is there\r\n\tvar sM = document.getElementById(sMonth);\t\t\r\n\tif(sM.value == \"\") {\r\n\t\talert(\"A starting month must be selected for \" + what + \".\");\r\n\t\tsM.focus();\r\n\t\treturn false;\r\n\t}\r\n\tvar sD = document.getElementById(sDay);\r\n\tvar sY = document.getElementById(sYear);\r\n\tvar mm = sM.value;\r\n\tif (mm.length == 1) mm = \"0\" + mm;\r\n\tvar dd = sD.value;\r\n\tif (dd.length == 1) dd = \"0\" + dd;\r\n\tvar year = sY.value;\r\n\tvar sFD = mm + \"/\" + dd + \"/\" + year;\r\n\t// validate the whole date\r\n\tif(!isDate(sFD)) {\r\n\t\talert(\"The starting date in \" + what + \" is not a valid date.\");\r\n\t\tsM.focus();\r\n\t\treturn false;\r\n\t}\r\n\t// 1st date in range is valid, try next\r\n\tvar eM = document.getElementById(eMonth);\t\t\r\n\tif(eM.value == \"\") {\r\n\t\talert(\"An ending month must be selected for \" + what + \".\");\r\n\t\teM.focus();\t\t\t\r\n\t\treturn false;\r\n\t}\t\r\n\tvar eD = document.getElementById(eDay);\r\n\tvar eY = document.getElementById(eYear);\t\t\t\t\r\n\tmm = eM.value;\r\n\tif (mm.length == 1) mm = \"0\" + mm;\r\n\tdd = eD.value;\r\n\tif (dd.length == 1) dd = \"0\" + dd;\r\n\tyear = eY.value;\r\n\tvar eFD = mm + \"/\" + dd + \"/\" + year;\r\n\t// validate the whole date\r\n\tif(!isDate(eFD)) {\r\n\t\talert(\"The ending date in \" + what + \" is not a valid date.\");\r\n\t\teM.focus();\r\n\t\treturn false;\r\n\t}\r\n\t// so far so good. make sure the ending date falls on or after the starting date\r\n\tif(!compareDates(sFD,eFD)) {\r\n\t\talert(\"The ending date in \" + what + \" must be the same or past the starting date.\");\r\n\t\teM.focus();\r\n\t\treturn false;\r\n\t}\r\n\treturn (sFD + \" - \" + eFD);\r\n}", "static dateOutOfRange(date, minDate, maxDate, config) {\n let result = false;\n if (minDate != null && date.isBefore(minDate, 'day')) {\n result = true;\n }\n if (maxDate != null && date.isAfter(maxDate, 'day')) {\n result = true;\n }\n if (config && config.calendarSettings) {\n const settings = config.calendarSettings;\n if (settings.disableDays &&\n settings.disableDays.some(disabledDate => this.checkDayForDisabled(disabledDate, date))) {\n result = true;\n }\n }\n return result;\n }", "function getOccurrences(num, format, type) {\n const dates = []\n\n if (!this.start && !this.from) {\n throw new Error(\"Cannot get occurrences without start or from date.\")\n }\n\n if (type === \"all\" && !this.end) {\n throw new Error(\"Cannot get all occurrences without an end date.\")\n }\n\n if (!!this.end && (this.start > this.end)) {\n throw new Error(\"Start date cannot be later than end date.\")\n }\n\n // Return empty set if the caller doesn't want any for next/prev\n if (type !== \"all\" && num <= 0) {\n return dates\n }\n\n // Start from the from date, or the start date if from is not set.\n const currentDate = (this.from || this.start).clone()\n\n // Reset the pattern builder, which dramatically speeds up queries\n recurPattern.rebuild(this.rules)\n\n // Include the initial date to the results if wanting all dates\n if (type === \"all\") {\n if (this.matches(currentDate, false)) {\n const date = format ? currentDate.format(format) : currentDate.clone()\n\n dates.push(date)\n }\n }\n\n // Get the next N dates, if num is null then infinite\n while (dates.length < (num == null ? dates.length + 1 : num)) {\n getNextDate(currentDate, type)\n\n // Don't match outside the date if generating all dates within start/end\n if (this.matches(currentDate, type !== \"all\")) {\n const date = format ? currentDate.format(format) : currentDate.clone()\n\n dates.push(date)\n }\n\n // when searching for \"all\" or \"next\" dates, if the end date occurs prior to next date, exit the loop\n if (currentDate >= this.end) {\n break\n }\n }\n\n return dates\n}", "function validateSelectedDates(dataSource, startDate, endDate){\n\t\t for(var i in dataSource) {\t\n \t \tif((dataSource[i].startDate.getTime() >= startDate.getTime() && dataSource[i].startDate.getTime() <= endDate.getTime())\t||\n \t \t (dataSource[i].endDate.getTime() <= endDate.getTime() && dataSource[i].endDate.getTime() >= startDate.getTime()) ||\n \t \t (startDate.getTime() >= dataSource[i].startDate.getTime() && startDate.getTime() <= dataSource[i].endDate.getTime())){\n \t \t\treturn false;\n \t \t}\n }\n\t\t return true;\n\t}", "function getNosOfFirstAndLastMatchesInPeriod()\n{\n var selectedPeriodStartDateArray = getSelectedPeriodStartDateArray();\n var selectedPeriodFinishDateArray = getSelectedPeriodFinishDateArray();\n\n // Test that startDate is earlier than or equal to finishDate.\n if (compareDateArrays(selectedPeriodStartDateArray, selectedPeriodFinishDateArray) > 0)\n error( 'Start date (' + selectedPeriodStartDateArray\n + ') later than finish date (' + selectedPeriodFinishDateArray\n + \") in function 'icdb_data_retrieval_form'::getNosOfFirstAndLastMatchesInPeriod().\");\n\n // NOTE: Selected dates may be outside the total database period.\n\n // Find no. of first match after (or on) startDate.\n if (compareDateArrays(selectedPeriodStartDateArray,\n MATCHES_ARRAY[N_MATCHES - 1]['dateArray']) <= 0)\n {\n // StartDate is earlier than or equal to the last match date.\n\n var f = 0;\n while (compareDateArrays(MATCHES_ARRAY[f]['dateArray'], selectedPeriodStartDateArray) < 0)\n ++f;\n }\n else\n // StartDate is after the last match date, so no matches in period.\n return -1;\n\n // Find no. of last match before (or on) finishDate.\n if (compareDateArrays(selectedPeriodFinishDateArray, MATCHES_ARRAY[0]['dateArray']) >= 0)\n {\n // FinishDate is later than or equal to the first match date.\n\n var l = N_MATCHES - 1;\n while (compareDateArrays(MATCHES_ARRAY[l]['dateArray'], selectedPeriodFinishDateArray) > 0)\n --l;\n }\n else\n // FinishDate is before the first match date, so no matches in period.\n return -1;\n\n if (f <= l) return [f, l]; // (Array literal).\n else return -1; // No matches in period.\n}", "function dieselBetweenDates(startDate, endDate, list) {\n let datearray = [];\n return new Promise((resolve, reject) => {\n list.forEach(element => { //filter list according to date comparison\n // console.log(moment(element.createdDate, \"YYYY-MM-DD\"))\n let dbdate = moment(element.date, \"YYYY-MM-DD\");\n // console.log(moment(inputdate).isSame(dbdate,'date'))\n if (moment(startDate).isSame(endDate, 'date')) {\n if (moment(startDate).isSame(dbdate, 'date')) {\n datearray.push(element);\n }\n }\n else {\n if (moment(dbdate).isBetween(startDate, endDate, null, '[]')) {\n console.log('date matched')\n datearray.push(element);\n // console.log(montharray)\n }\n }\n\n })\n resolve(datearray)\n })\n}", "function getDates(callback) {\n var d = new Date();\n var queryObject = {};\n\n //check already there is one year data in db\n if (initialResults.data != null) {\n d.setDate(d.getDate());\n if (initialResults.data.updated < new Date()) {\n var endDate = initialResults.data.updated;\n endDate.setDate(endDate.getDate() + 1);\n var updated = moment(endDate).format('YYYY-MM-DD');\n d.setDate(d.getDate() + 1);\n var now = moment(d).format('YYYY-MM-DD');\n var query = initialResults.object.channelObjectId + \"/insights/\" + initialResults.metric.objectTypes[0].meta.fbMetricName + \"?since=\" + updated + \"&until=\" + now;\n queryObject = {\n query: query, metricId: initialResults.metric._id, metric: initialResults.metric,\n startDate: updated,\n endDate: now\n };\n callback(null, queryObject);\n }\n else {\n var endDate = initialResults.data.updated;\n endDate.setDate(endDate.getDate() + 1);\n var updated = moment(endDate).format('YYYY-MM-DD');\n d.setDate(d.getDate() + 1);\n var now = moment(d).format('YYYY-MM-DD');\n queryObject = {\n query: 'DataFromDb', metricId: initialResults.metric._id, metric: initialResults.metric,\n startDate: updated,\n endDate: now\n };\n callback(null, queryObject);\n }\n\n }\n }", "function init_dates(){\n domo.get('/data/v1/dataset?fields=date&groupby=date&orderby=date descending&limit=8').then(function(data){\n start_date = data[data.length-1].date;\n end_date = data[0].date;\n\n $(function() {\n $(\"#datepicker\").daterangepicker({\n datepickerOptions : {\n numberOfMonths : 2\n }\n });\n });\n $(\"#datepicker\").daterangepicker({\n initialText : moment(start_date, \"YYYY-MM-DD\").format(\"MMM DD, YYYY\") + \" - \" + moment(end_date, \"YYYY-MM-DD\").format(\"MMM DD, YYYY\")\n });\n\n // show filters\n $(\".filterpanel\").show();\n\n // Init main routine\n // update_data();\n\n });\n}", "get hasValidDates() {\n const {\n startDateMS,\n endDateMS\n } = this;\n return !startDateMS || !endDateMS || endDateMS - startDateMS >= 0;\n }", "function getRange(flower, day) {\n var startRange = new Date();\n startRange.setDate(day - 1);\n var endRange = new Date();\n endRange.setDate(startRange.getDate() + 2);\n\n var arr = [\n 'select * where flowerType=',\n \"'\",\n flower,\n \"'\",\n ' and created gte ',\n startRange.getTime(),\n ' and created lte ',\n endRange.getTime(),\n ' order by created asc'\n ]\n\n var searchParameters = arr.join('');\n return (encodeURIComponent(searchParameters));\n}", "function between(vals) {\n if (!Array.isArray(vals)) { return; }\n if (vals.length != 2) { return; }\n // Quote intelligently\n // No CAST('2003-01-01' AS DATE) needed for time fields (as told by some legacy mysql doc)\n return \" BETWEEN \"+vals.join(\" AND \");\n}", "function queryFromUserByAgeBetween(arr, start, end) {\n return arr.filter(function (ele) {\n return ((new Date().getFullYear() - new Date(ele.DOB).getFullYear()) > start && (new Date().getFullYear() - new Date(ele.DOB).getFullYear()) < end);\n })\n}", "function checkDate(value) {\n\tvar matches = DATETIME.exec(value);\n\tif (matches) {\n\t\treturn makeDate(matches);\n\t}\n\tmatches = DATETIME_RANGE.exec(value);\n\tif (matches) {\n\t\treturn {start: makeDate(matches), end: makeDate(matches.slice(7))};\n\t}\n\tmatches = DATEONLY.exec(value);\n\tif (matches) {\n\t\treturn makeDate(matches.concat([0, 0, 0, '']));\n\t}\n\treturn value;\n}", "function testDates(startString, endString) {\n // Convert the strings into Date objects\n const startDate = parseDate(startString);\n const endDate = parseDate(endString);\n const currentDate = new Date();\n\n // Fail if either date is in the future\n if (startDate > currentDate || endDate > currentDate) {\n console.log(\"Error: The user entered a future date.\");\n searchProblems.push(\"Unable to search: You cannot use future dates for your search.\");\n\n return false;\n } else if (startDate > endDate) {\n // Fail if the start date is after the end date\n console.log(\"Error: The user entered a start date that was after the end date.\");\n searchProblems.push(\"Unable to search: Your start date cannot be after your end date.\");\n\n return false;\n }\n\n return true;\n }", "function initDateRange() {\n\tvar elements = $('[data-date-range-set]');\n\t\n\t// defining constants\n\tvar con = {'CURRENT_WEEK': 0,\n\t\t\t'CURRENT_MONTH' : 1,\n\t\t\t'DAYS_30': 2,\n\t\t\t'LAST_MONTH': 3\n\t\t};\n\t\n\tif (elements.length === 0) {\n\t\treturn;\n\t}\n\telements.click(function(e) {\n\t\tconf = $(this).attr('data-date-range-set');\n\t\tvar from = new Date();\n\t\tvar to = new Date();\n\t\tswitch(con[conf]) {\n\t\t\tcase con.CURRENT_WEEK:\n\t\t\t\tfrom.setDate(from.getDate() - from.getDay() + 1);\n\t\t\t\t$($(this).attr('data-date-range-input-from')).val(dateToString(from));\n\t\t\t\t$($(this).attr('data-date-range-input-to')).val(dateToString());\n\t\t\t\tbreak;\n\t\t\tcase con.CURRENT_MONTH:\n\t\t\t\tfrom.setDate(1);\n\t\t\t\t$($(this).attr('data-date-range-input-from')).val(dateToString(from));\n\t\t\t\t$($(this).attr('data-date-range-input-to')).val(dateToString());\n\t\t\t\tbreak;\n\t\t\tcase con.DAYS_30:\n\t\t\t\tfrom.setDate(from.getDate() - 30);\n\t\t\t\t$($(this).attr('data-date-range-input-from')).val(dateToString(from));\n\t\t\t\t$($(this).attr('data-date-range-input-to')).val(dateToString());\n\t\t\t\tbreak;\n\t\t\tcase con.LAST_MONTH:\n\t\t\t\tfrom.setMonth(from.getMonth() - 1);\n\t\t\t\tfrom.setDate(1);\n\t\t\t\t$($(this).attr('data-date-range-input-from')).val(dateToString(from));\n\t\t\t\t\n\t\t\t\tto.setDate(0);\n\t\t\t\t$($(this).attr('data-date-range-input-to')).val(dateToString(to));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t});\n}", "function TestRangeD(callback) {\n var q = cb.view(docname, \"simple\", {\n endkey : 3,\n startkey : 10,\n stale: false,\n descending : true,\n limit : 10\n });\n q.query(function(err, results) {\n assert(!err, \"TestRangeD query failed\")\n assert(results[0].key > results[1].key, \"TestRangeD not descending\")\n var sum = u.reduce(\n u.pluck(results, 'key'),\n function(acc, n){ return acc + n; }, 0\n );\n assert(sum===52, \"TestRange without inclusive_end does not add up\");\n\n // Apply `limit`\n q.query({limit: 3}, function(err, results) {\n assert(!err, \"TestRange query with limit failed\")\n assert(results[0].key === 10, \"TestRange first key is not 10\");\n assert(results.length === 3, \"TestRange lenght is not 3\");\n\n // Apply `skip`\n q.query({skip: 2}, function(err, results) {\n assert(!err, \"TestRange query with skip failed\")\n assert(results[0].key === 8, \"TestRange first key is not 8\");\n assert(results.length === 6, \"TestRange lenght is not 6\");\n callback(null, 6);\n });\n });\n })\n }", "_rangeValidation(initialDate) {\n const that = this;\n\n if (initialDate.compare(that.min) === -1) {\n return that.min.clone();\n }\n else if (initialDate.compare(that.max) === 1) {\n return that.max.clone();\n }\n else {\n return initialDate;\n }\n }", "inWindowForStartAndEndDates({startDate,endDate}){\n return (\n ((!this.getStartDate() || this.getStartDate().isSameOrBefore(endDate)) && (!this.getEndDate() || this.getEndDate().isSameOrAfter(startDate))) ||\n ((!this.getEndDate() || this.getEndDate().isSameOrAfter(startDate)) && (!this.getStartDate() || this.getStartDate().isSameOrBefore(endDate)))\n )\n }", "function filterDate() {\r\n var startDate = new Date(\"2015-08-04\");\r\n var endDate = new Date(\"2015-08-12\");\r\n\r\n var resultProductData = product_data.filter(function(a) {\r\n var hitDates = a.ProductHits || {};\r\n // extract all date strings\r\n hitDates = Object.keys(hitDates);\r\n // improvement: use some. this is an improment because .map()\r\n // and .filter() are walking through all elements.\r\n // .some() stops this process if one item is found that returns true in the callback function and returns true for the whole expression\r\n hitDateMatchExists = hitDates.some(function(dateStr) {\r\n var date = new Date(dateStr);\r\n return date >= startDate && date <= endDate\r\n });\r\n return hitDateMatchExists;\r\n });\r\n console.log(resultProductData);\r\n}", "function filterbyDate(dataset, inDateStr) {\n // initialize filterdData array\n var filteredData = [];\n\n // parse the date and check to see if valid date\n var parseDate = d3.timeParse(\"%m/%d/%Y\");\n var inputDate = parseDate(inDateStr);\n \n if (inputDate !== null) {\n console.log(`${inDateStr} parsed to datetime: ${inputDate}`);\n\n // filter table by date-time that is taken from inputvalue.\n // var filteredData = tableData.filter(report => (parseDate(report.datetime) == inputDate));\n filteredData = \n dataset.filter(report => (parseDate(report.datetime).getTime() === inputDate.getTime()));\n\n // console.log(filteredData);\n \n } else {\n console.log(`INPUT ERROR: Invalid date entered: ${inDateStr}`)\n }\n\n return filteredData\n}", "function dateValidation(startDate,endDate,date,date1,duramt,durunit)\n{\n console.log(startDate+\" \"+endDate+\" \"+date+\" \"+date1+\" \"+duramt+\" \"+durunit);\n if(startDate)\n var st=new Date(startDate.split(\" \")[0]);\n if(endDate)\n var ed=new Date(endDate.split(\" \")[0]);\n if(date)\n var d=new Date(date.split(\" \")[0]);\n if(date1)\n var d1=new Date(date1.split(\" \")[0]);\n if(startDate && endDate) //date-period mentioned\n {\n const no=difbetweenDates(st,ed)+1;\n if(no<0)\n {\n datavalid=false;\n return false;\n }\n if(duramt)\n {\n if(durunit==='day' && duramt===no)\n return true;\n if(durunit==='wk' && no===duramt*7)\n return true; \n if(durunit==='mo' && no===duramt*31)\n return true;\n if(durunit==='mo' && no!==duramt*30)\n return true;\n if(durunit==='yr' && no!==duramt*365)\n return true; \n datavalid=false;\n return false;\n }\n }\n if(date && date1) //2 dates specified\n {\n const no=difbetweenDates(d,d1)+1;\n //console.log(no);\n if(no<0)\n {\n datavalid=false;\n return false;\n }\n if(duramt)\n {\n if(durunit==='day' && duramt===no)\n return true;\n if(durunit==='wk' && no===duramt*7)\n return true; \n if(durunit==='mo' && no===duramt*31)\n return true;\n if(durunit==='mo' && no!==duramt*30)\n return true;\n if(durunit==='yr' && no!==duramt*365)\n return true; \n datavalid=false;\n return false; \n }\n }\n //only one date iven for duration intent\n if((date && duramt) && (date1===undefined && startDate===undefined && endDate===undefined) )\n {\n datavalid=false;\n return false; \n }\n else \n {\n datavalid=true;\n return true;\n }\n}", "function Query_If_RangeHasChanged(){\n\n var sFrom = document.getElementById(\"txt_dtmFrom\").value;\n var sTo = document.getElementById(\"txt_dtmTo\").value;\n\n if(sFrom != sParamDateFrom || sTo != sParamDateTo)\n ExecuteNewSearch();\n}", "intersectsDate(date) {\n return !this.excludesDate(date) && (this.dates.find(function (d) {\n return d.intersectsDate(date);\n }) || false);\n }", "intersectsDate(date) {\n return !this.excludesDate(date) && (this.dates.find(function (d) {\n return d.intersectsDate(date);\n }) || false);\n }", "getAllInBetweenDates(sStartDate, sEndDate) {\n let aDates = [];\n //to avoid modifying the original date\n const oStartDate = new Date(sStartDate);\n const oEndDate = new Date(sEndDate);\n while (oStartDate <= oEndDate) {\n aDates = [...aDates, new Date(oStartDate)];\n oStartDate.setDate(oStartDate.getDate() + 1)\n }\n return aDates;\n }", "function inRange(start, end, date) {\n if (start && date.isBefore(start)) {\n return false\n }\n if (end && date.isAfter(end)) {\n return false\n }\n return true\n}", "function roomsWithSameDate(rooms, query) {\n\n var queryDate = query.date;\n var queryMoment = moment(query.date).hour(query.from);;\n\n return rooms.filter(function (room) {\n var check = false;\n for (var i = 0; i < room.slots.length; i++) {\n if (room.slots[i].isDate && moment(room.slots[i].date).isSame(queryDate, 'day')) {\n\n var roomMomentFrom = moment(room.slots[i].date).hour(room.slots[i].hoursFrom)\n var roomMomentTo = moment(room.slots[i].date).hour(room.slots[i].hoursTo)\n\n if(queryMoment.isBetween(roomMomentFrom, roomMomentTo) || queryMoment.isSame(roomMomentFrom, 'hour')) {\n check = true;\n }\n }\n }\n return check;\n })\n}", "function getValidityRange(startdate, enddate, type, max_duration=20) {\n validity = {};\n var today = new Date();\n\n // no start date in the past\n if (startdate < today) {\n startdate = today;\n }\n\n var valid_from = startdate;\n var valid_until = new Date();\n\n var diff = timeDifference(startdate, enddate, type);\n\n if ( diff < max_duration && diff > 0 ) {\n valid_until = enddate;\n } else {\n switch (type) {\n case 'minute':\n valid_until = new Date(valid_until.setTime(valid_from.getTime() + (max_duration * 60000))); \n break;\n case 'hour':\n valid_until = new Date(valid_until.setTime(valid_from.getTime() + (max_duration * 60000 * 60))); \n break; \n default:\n valid_until = new Date(valid_until.setDate(valid_from.getDate() + max_duration));\n break;\n }\n }\n\n validity['from'] = Date.parse(valid_from.toUTCString());\n validity['until'] = Date.parse(valid_until.toUTCString());\n\n return validity;\n}", "function customRange(input)\n {\n return {\n minDate: $('#edate').val()\n };\n }", "function filter_projects_by_date(projects) {\n 'use strict';\n\n var i = 0,\n s = projects.length,\n the_date;\n\n //reset projects array\n presidents.all.projects = [];\n for (i; i < s; i = i + 1) {\n the_date = new Date(projects[i][fields[graph.active_date]]);\n if (the_date) {\n the_date = the_date.getTime();\n //is the project's date within the boundaries?\n if (\n (the_date >= new Date(graph.min.date).getTime())\n && (the_date <= new Date(graph.max.date).getTime())\n ) {\n //console.log('assigning obama');\n presidents.all.projects.push(projects[i]);\n }\n }//start_date\n }//for\n\n //update the agencies\n presidents.all.agencies = [];\n //presidents.all.agencies = filter_all('agency_name', presidents.all.projects);\n presidents.all.agencies = d3.nest()\n .key(function (d) { return d[fields.agency_name]; })\n .sortKeys(d3.ascending)\n .entries(presidents.all.projects);\n\n console.log('# projects: ' + presidents.all.projects.length);\n\n}//filter_projects_by_date", "contains_exclusive(dat_or_drange){\n return this.starts_before(dat_or_drange) && this.ends_after(dat_or_drange) ;\n }", "function fillDate(array) {\n var last = array.length - 1;\n var firstDate = array[0].datestamp;\n var lastDate = array[last].datestamp;\n\n var fullarray = betweenDate(firstDate, lastDate);\n\n return fullarray;\n }", "matches(dateToMatch, ignoreStartEnd) {\n const date = moment(dateToMatch, ISO_FORMAT).dateOnly()\n\n if (!date.isValid()) {\n throw new Error(`Invalid date supplied to match method: ${dateToMatch}`)\n }\n\n if (!ignoreStartEnd && !inRange(this.start, this.end, date)) {\n return false\n }\n\n if (isExcepted(this.excepted, date)) {\n return false\n }\n\n if (!matchAllRules(this.rules, date, this.start)) {\n return false\n }\n\n // if we passed everything above, then this date matches\n return true\n }", "overlaps(dat_range){\n if (!(dat_range.start && dat_range.end)){\n console.error(\"dat_range items must all respond to a method called 'start' and 'end', this dat_range was:\", dat_range);\n }\n return this.contains_exclusive(dat_range.end) || this.contains_exclusive(dat_range.start) || this.during(dat_range);\n }", "get dates() {\n const { from, to, query, timeRegistrations } = this.store;\n let dates = [];\n if (query) {\n dates = [...new Set(timeRegistrations.map(r => r.date))].sort((a, b) => a < b);\n } else {\n let days = differenceInDays(to, from) + 1;\n for (let i = 0; i < days; i++) {\n let date = new Date(from);\n date.setDate(date.getDate() + i);\n dates.push(date);\n }\n }\n return dates;\n }", "function searchUFO() {\n // set function query and create array of rows\n \n let query = d3.select('#dateSearch').property('value');\n let searchDate = new Date(query);\n // let searchDate = new Date(`${query[2]}/${query[1]}/${query[0]}`);\n // loop through each row in table\n for (let i = 0; i < data.length; i++){\n let row = d3.select(`#sighting_${i}`);\n\n // compare dates using Date()\n let rowDate = row.select('.datetime').text();\n if (rowDate != searchDate) {\n row.style('display', 'none');\n console.log(searchDate);\n console.log(rowDate);\n }\n else {\n row.style('display', 'table-row');\n // console.log(searchDate);\n // console.log(rowDate);\n }\n }\n\n}", "function applyDateRange() {\n const mindate = mindate_input.property('value');\n const maxdate = maxdate_input.property('value');\n\n context.features().dateRange = [mindate, maxdate];\n context.features().redraw();\n\n updateUrlParam();\n }" ]
[ "0.60283846", "0.5931526", "0.5931526", "0.5898166", "0.5627309", "0.56107116", "0.5594415", "0.5552875", "0.5550687", "0.5550687", "0.5547632", "0.549748", "0.54855233", "0.53691137", "0.5366445", "0.53458875", "0.5334486", "0.53310484", "0.5328851", "0.5316035", "0.53124607", "0.52606565", "0.52606565", "0.52606565", "0.52606565", "0.52581644", "0.52526397", "0.52349156", "0.52349156", "0.52299845", "0.5224724", "0.5224724", "0.5216367", "0.52126515", "0.52079976", "0.5203448", "0.5188736", "0.51842654", "0.5176672", "0.517396", "0.515146", "0.5141906", "0.5137076", "0.5084874", "0.50653976", "0.5063574", "0.505468", "0.5024571", "0.5007145", "0.5006979", "0.5001432", "0.49698454", "0.4955277", "0.49418783", "0.49269903", "0.49269903", "0.49269903", "0.49269465", "0.48968887", "0.48756605", "0.48429492", "0.48393896", "0.48355293", "0.4829718", "0.48295605", "0.48127395", "0.47894475", "0.47824618", "0.4779833", "0.47682646", "0.47647008", "0.47528136", "0.47518942", "0.47484487", "0.4747565", "0.47350708", "0.47304255", "0.47290528", "0.47279963", "0.47275203", "0.47262195", "0.47185117", "0.47148728", "0.47132406", "0.47115093", "0.46660691", "0.46660691", "0.46602622", "0.46588942", "0.4647023", "0.4644941", "0.46380296", "0.46270776", "0.46257183", "0.4620358", "0.46158653", "0.46096373", "0.46091735", "0.46026933", "0.45845312" ]
0.68885946
0
Returns a date range where the start date is inclusive and the end date is exclusive.
function _getDateRange(dateStr, granularity) { var start = new Date(dateStr); var end = new Date(dateStr); switch (granularity) { case 'year': end.setUTCFullYear(end.getUTCFullYear() + 1); break; case 'month': end.setUTCMonth(end.getUTCMonth() + 1); break; case 'day': end.setUTCDate(end.getUTCDate() + 1); break; } return { inclusiveStart: start, exclusiveEnd: end }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DateRange(start, end) {\n if (start === void 0) {\n start = null;\n }\n if (end === void 0) {\n end = null;\n }\n this.start = start;\n this.end = end;\n }", "function $R(start, end, exclusive) {\n return new ObjectRange(start, end, exclusive);\n}", "getAllInBetweenDates(sStartDate, sEndDate) {\n let aDates = [];\n //to avoid modifying the original date\n const oStartDate = new Date(sStartDate);\n const oEndDate = new Date(sEndDate);\n while (oStartDate <= oEndDate) {\n aDates = [...aDates, new Date(oStartDate)];\n oStartDate.setDate(oStartDate.getDate() + 1)\n }\n return aDates;\n }", "findShallowIntersectingRange(date1, date2) {\n const thisRange = date1.toRange();\n const otherRange = date2.toRange(); // Start with infinite start and end dates\n\n let start = null;\n let end = null; // This start date exists\n\n if (thisRange.start) {\n // Use this definite start date if other start date is infinite\n if (!otherRange.start) {\n start = thisRange.start;\n } else {\n // Otherwise, use the earliest start date\n start = thisRange.start < otherRange.start ? thisRange.start : otherRange.start;\n } // Other start date exists\n\n } else if (otherRange.start) {\n // Use other definite start date as this one is infinite\n start = otherRange.start;\n } // Assign end date to this one if it is valid\n\n\n if (thisRange.end && (!start || thisRange.end >= start)) {\n end = thisRange.end;\n } // Assign end date to other one if it is valid and before this one\n\n\n if (otherRange.end && (!start || otherRange.end >= start)) {\n if (!end || otherRange.end < end) end = otherRange.end;\n } // Return calculated range\n\n\n return {\n start,\n end\n };\n }", "findShallowIntersectingRange(date1, date2) {\n const thisRange = date1.toRange();\n const otherRange = date2.toRange(); // Start with infinite start and end dates\n\n let start = null;\n let end = null; // This start date exists\n\n if (thisRange.start) {\n // Use this definite start date if other start date is infinite\n if (!otherRange.start) {\n start = thisRange.start;\n } else {\n // Otherwise, use the earliest start date\n start = thisRange.start < otherRange.start ? thisRange.start : otherRange.start;\n } // Other start date exists\n\n } else if (otherRange.start) {\n // Use other definite start date as this one is infinite\n start = otherRange.start;\n } // Assign end date to this one if it is valid\n\n\n if (thisRange.end && (!start || thisRange.end >= start)) {\n end = thisRange.end;\n } // Assign end date to other one if it is valid and before this one\n\n\n if (otherRange.end && (!start || otherRange.end >= start)) {\n if (!end || otherRange.end < end) end = otherRange.end;\n } // Return calculated range\n\n\n return {\n start,\n end\n };\n }", "function datesBetween(start, end, includeTime) {\n var list = [];\n var last = start.getDate();\n var cur;\n\n while (true) {\n var next = new Date(\n start.getFullYear(),\n start.getMonth(),\n ++last\n );\n\n if (next > end) {\n throw new Error(\n 'sanity fails next is greater then end'\n );\n }\n\n if (!isSameDate(next, end)) {\n list.push(next);\n continue;\n }\n\n break;\n }\n\n if (includeTime) {\n list.unshift(start);\n list.push(end);\n } else {\n list.unshift(createDay(start));\n list.push(createDay(end));\n }\n\n return list;\n }", "function range(start, end) {\n start = Number(start) || 0;\n if (end === undefiend) {\n return function getEnd(end) {\n return getRange(start, end);\n }\n } else {\n end = Number(end) || 0;\n return getRange(start, end);\n }\n function getRange(start, end) {\n let ret = [];\n for (let i = start; i <= end; i++) {\n ret.push(i);\n }\n return ret;\n }\n}", "inWindowForStartAndEndDates({startDate,endDate}){\n return (\n ((!this.getStartDate() || this.getStartDate().isSameOrBefore(endDate)) && (!this.getEndDate() || this.getEndDate().isSameOrAfter(startDate))) ||\n ((!this.getEndDate() || this.getEndDate().isSameOrAfter(startDate)) && (!this.getStartDate() || this.getStartDate().isSameOrBefore(endDate)))\n )\n }", "function removeOutsideDateRange(rangeStart, rangeEnd) {\n var startIndex = 0;\n var endIndex = allCalendarEvents.length - 1;\n\n for (var i = 0; i < allCalendarEvents.length - 1; i++) {\n // If an event ends after the rangeStart cutoff, it's included.\n var startCompare = compareDateTimes(allCalendarEvents[i].end, rangeStart);\n if (startCompare >= 0) {\n startIndex = i;\n break;\n }\n }\n\n for (var i = startIndex; i < allCalendarEvents.length - 1; i++) {\n // If an event starts before the rangeEnd cutoff, it's included.\n var endCompare = compareDateTimes(allCalendarEvents[i].start, rangeEnd);\n if (endCompare < 0) {\n endIndex = i;\n }\n }\n\n // I'm not sure if slice is safe to assign directly back to the array being sliced, so I'm using a temp.\n var temp = allCalendarEvents.slice(startIndex, endIndex + 1);\n allCalendarEvents = temp;\n}", "function dateRange(startDate, endDate) {\n let start = startDate.split('-');\n let end = endDate.split('-');\n let startYear = parseInt(start[0]);\n let endYear = parseInt(end[0]);\n let dates = [];\n\n for (let i = startYear; i <= endYear; i++) {\n let endMonth = i !== endYear ? 11 : parseInt(end[1]) - 1;\n let startMon = i === startYear ? parseInt(start[1]) - 1 : 0;\n for (let j = startMon; j <= endMonth; j = j > 12 ? j % 12 || 11 : j + 1) {\n let month = j + 1;\n let displayMonth = month < 10 ? '0' + month : month;\n dates.push([i, displayMonth, '01'].join('-'));\n }\n }\n return dates;\n}", "function range(start,end)\n{\n let resultat=[];\n if (end >= start) {\n for (let i=start;i <= end;i++) {\n resultat.push(i);\n }\n return resultat;\n }\n if (start > end) {\n for (let i=start;i >= end;i--) {\n resultat.push(i);\n }\n return resultat;\n }\n}", "function range(start, end) {\n if ((start && end) || end == 0) {\n let result = [];\n for (i = start; i <= end; i++) {\n result.push(i);\n }\n return result;\n }\n\n if (arguments[1] === undefined) {\n return function rangeTill(end) {\n let result = [];\n for (i = start; i <= end; i++) {\n result.push(i);\n }\n return result;\n };\n }\n}", "function makeRange() {\n var result = {}\n /*\n year: 2015,\n month: [3, 4],\n days: [[30, 31], [1,2,3,4,5,6]],\n */\n ;\n\n var startDate = new Date($scope.range.start);\n var endDate = new Date($scope.range.end);\n\n var yearNum = startDate.getFullYear();\n\n var startDay = startDate.getDate();\n var endDay = endDate.getDate();\n\n\n var startMonthNum = (startDate.getMonth() + 1);\n var endMonthNum = (endDate.getMonth() + 1);\n\n var daysInStartDate = new Date(yearNum, startMonthNum, 0).getDate();\n\n //define month array\n console.log(startMonthNum + ' - ' + endMonthNum);\n if(startMonthNum === endMonthNum) {\n month = [startMonthNum, null];\n } else {\n month = [startMonthNum, endMonthNum];\n }\n\n //define days array\n var days = [[],[]];\n\n if(month[1] === null) {\n for(var i = startDay; i <= endDay; i++) {\n days[0].push(i);\n }\n\n days[1] = null;\n } else {\n for(var i = startDay; i <= daysInStartDate; i++) {\n days[0].push(i);\n }\n\n for(var j = 1; j <= endDay; j++){\n days[1].push(j);\n }\n }\n\n result.year = yearNum;\n result.month = month;\n result.days = days;\n\n return result;\n }", "function range(start, end){\n let arr = [start];\n if(start >= end){return start};\n return arr.concat(range(start+1, end));\n }", "function range(start, end) {\n if (start >= end) {\n return [];\n } else {\n return [start].concat(range(start + 1, end));\n }\n}", "function range(start, end) {\n if (start +1 >= end) {\n return [];\n }\n return (range(start, end-1).concat([end-1]));\n}", "function range(start, end = -1) {\n\n if (end == -1) {\n end = start;\n start = 0;\n }\n\n let range = [];\n\n for (let element = start; element <= end; element++) {\n range.push(element);\n }\n\n return range;\n}", "function createDateArray(start,end){\n let\n dateArray = [],\n dt = new Date(start);\n\n while (moment(dt).dayOfYear() <= moment(end).dayOfYear()) {\n dateArray.push(new Date(dt));\n dt.setDate(dt.getDate() + 1);\n }\n return dateArray;\n}", "function createRange(start, end) {\n const range = Array.from({ length: end - start + 1 }, function(item, index) {\n return index + start;\n });\n return range;\n}", "function range(start, end) {\n rangeArr = [];\n for(var i = start; i <= end; i++) {\n rangeArr.push(i);\n }\n return rangeArr;\n}", "function inRange(start, end, date) {\n if (start && date.isBefore(start)) {\n return false\n }\n if (end && date.isAfter(end)) {\n return false\n }\n return true\n}", "findRangeofDates(){ \n\t\tlet min=new Date(2030,1,1); \n\t\tlet max=new Date(1990,1,1);\n\t\tconst ar=this.props.data;\n\t\tfor(let i=0;i<ar.length;i++){\n\t\t\tif(ar[i].start<min)\n\t\t\t\tmin=ar[i].start;\n\t\t\tif(ar[i].end>max)\n\t\t\t\tmax=ar[i].end;\n\t\t}\n\t\tthis.min=min;\n\t\tthis.max=max;\n\t}", "function getDateArray(start, end) {\n\t\tvar arr = new Array();\n\n\t\twhile (start <= end) {\n\t\t\tarr.push(new Date(start));\n\t\t\tstart.setDate(start.getDate() + 1);\n\t\t}\n\t\t\n\t\treturn arr;\n\t}", "function range(start, end)\n{\n if (arguments.length == 1) {\n var end = start;\n start = 0;\n }\n \n var r = [];\n if (start < end) {\n while (start != end)\n r.push(start++);\n }\n else {\n while (start != end)\n r.push(start--);\n }\n return r;\n}", "function defineStartAndEndDate(list) {\n var minDate;\n var maxDate;\n\n $.each(list, function(key, value) {\n if (moment(value[4], 'MM-DD-YY', true).isValid()) {\n if (!minDate && !maxDate) {\n minDate = value[4];\n maxDate = value[4];\n }\n if (moment(value[4]).isBefore(minDate)) {\n // if(value[4] < minDate) {\n minDate = value[4];\n }\n if (moment(value[4]).isAfter(maxDate)) {\n // if(value[4] > maxDate) {\n maxDate = value[4];\n }\n }\n });\n\n minDate = moment(minDate,'MM-DD-YY').format('YYYY-MM-DD');\n maxDate = moment(maxDate,'MM-DD-YY').format('YYYY-MM-DD');\n\n $('.input-daterange').attr('data-start-date',minDate);\n $('#startdate').val(minDate);\n $('.input-daterange').attr('data-end-date',maxDate);\n $('#enddate').val(maxDate);\n }", "function range(start, end) {\r\n\tif (end === undefined) {\r\n\t\tend = start;\r\n\t\tstart = 0;\r\n\t}\r\n\tlet res = []; //newArray(end-start,0);\r\n\tstart = start | 0;\r\n\tfor (let i = start; i < end; i++) res.push(i);\r\n\treturn res;\r\n}", "function range(start, end) {\n\t if (end === undefined) {\n\t end = start;\n\t start = 0;\n\t }\n\t let res = []; //newArray(end-start,0);\n\t start = start | 0;\n\t for (let i = start; i < end; i++) res.push(i);\n\t return res;\n\t}", "function range (startNumber, endNumber) {\n const range2 = [];\n if (startNumber < endNumber) {\n for (let i = startNumber; i <= endNumber; i++) {\n range2.push(i);\n }\n } else {\n for (let i = startNumber; i >= endNumber; i--) {\n range2.push(i);\n }\n }\n return range2;\n}", "function dateWithinRange(date) {\n \n var currentDate = new Date(date);\n \n var minDate = new Date(startDate);\n var maxDate = new Date(endDate);\n\n if (currentDate > minDate && currentDate < maxDate ){ // checks if dates are within range\n return true;\n }\n\n if(isNaN(minDate.valueOf() || maxDate.valueOf )){ //if no contraints are entered, return all dates\n return true;\n }\n else{\n return false;\n } \n }", "function range(start, end){\n if(arguments.length < 2){\n end = start;\n start = 0;\n }\n \n var result = [];\n for (var i = start; i <= end; i++){\n result.push(i);\n }\n return result;\n}", "function range(start, end) {\n let r = [];\n for (let i = start; i < end; i++) {\n r.push(i);\n }\n return r;\n}", "function rangei(start,end){\n return Array(end - start + 1).fill().map((_, idx) => start + idx)\n\n // var list = [];\n // for (var i = lowEnd; i <= highEnd; i++) {\n // list.push(i);\n // return list\n}", "resetDateRange() {\n var beg, end;\n beg = Data.toDateStr(Data.begDay, Data.monthIdx);\n end = Data.advanceDate(beg, Data.numDays - 1);\n return this.res.dateRange(beg, end, this.resetRooms);\n }", "function range(start, end) {\n return Array(end - start + 1).fill().map((_, idx) => start + idx)\n}", "function range(end, start=1) {\n return Array(end - start + 1).fill().map((_, idx) => start + idx)\n}", "function getDatesBetween(startDate, stopDate) {\n var dateArray = new Array();\n var nextDate = startDate.addDays(1);\n var penultimateDate = stopDate.subtractDays(1);\n //add first date if necessary\n if (nextDate < stopDate)\n dateArray.push(new Date (nextDate));\n //add second date if necessary\n if (nextDate < penultimateDate)\n dateArray.push(new Date (penultimateDate));\n return dateArray;\n}", "function genRange(start, end) {\n var range = [];\n while (start <= end) {\n range.push(start);\n start += 1;\n }\n return range;\n }", "function range(start, end) {\n var foo = [];\n for (var i = start; i <= end; i++) {\n foo.push(i);\n }\n return foo;\n}", "function range(start,end){\r\n\t\tvar foo = [];\r\n\t\tfor (i = start; i < end; i++) {\r\n\t\t\tfoo.push(i);\r\n\t\t}\r\n\t\treturn foo;\r\n\t}", "function dt_add_rangedate_filter(begindate_id, enddate_id, dateCol) {\n $.fn.dataTableExt.afnFiltering.push(\n function( oSettings, aData, iDataIndex ) {\n\n var beginDate = Date_from_syspref($(\"#\"+begindate_id).val()).getTime();\n var endDate = Date_from_syspref($(\"#\"+enddate_id).val()).getTime();\n\n var data = Date_from_syspref(aData[dateCol]).getTime();\n\n if ( !parseInt(beginDate) && ! parseInt(endDate) ) {\n return true;\n }\n else if ( beginDate <= data && !parseInt(endDate) ) {\n return true;\n }\n else if ( data <= endDate && !parseInt(beginDate) ) {\n return true;\n }\n else if ( beginDate <= data && data <= endDate) {\n return true;\n }\n return false;\n }\n );\n}", "function rangeOrIndividual(start, end) {\n if (end - start === 1) {\n return start;\n }\n else {\n return [start, end];\n }\n}", "function range(start, end) {\n // YOUR CODE GOES BELOW HERE //\n // declaring and assigning the variable range to an empty array\n let range = [];\n \n // conditional statement that runs if start is less than end parameter\n if(start < end) {\n \n /** for loop that initialzies i as the starting number and will iterate\n * by 1 each time i is less than or equal to end */\n for(var i = start; i <= end; i++) {\n // using push method to push i to range array each time loop runs\n range.push(i);\n }\n // conditional else that runs if start is greater than end\n } else {\n /** for loop that initialzies i as the start number and will iterate\n * by 1 each time i is greater than or equal to end */\n for(var i = start; i >= end; i--) {\n // using push method to push i to range array each time loop runs\n range.push(i)\n }\n // returning range array\n } return range\n \n // YOUR CODE GOES ABOVE HERE //\n}", "function getDates(startDate, stopDate) {\r\n\tvar dateArray = new Array();\r\n\tvar currentDate = startDate;\r\n\twhile (currentDate <= stopDate) {\r\n\t\tdateArray.push(currentDate)\r\n\t\tcurrentDate = addDays(currentDate,1);\r\n\t}\r\n\treturn dateArray;\r\n}", "function restrictPassedDate(){\n let date = new Date(),\n day = date.getDate(),\n month = date.getMonth()+1,\n year = date.getFullYear();\n if(day < 10){\n day = `0${day}`;\n }\n if(month < 10){\n month = `0${month}`;\n }\n dateStart.min = `${year}-${month}-${day}`;\n dateEnd.min = `${year}-${month}-${day}`;\n}", "function range(start, end) {\n var arr = [];\n for (var i = start; i <= end; i++) {\n arr.push(i);\n }\n return arr;\n}", "range(startIndex, endIndex){\n if( startIndex < 0 )\n throw new Error(\"Start Index cannot be negative\");\n if( endIndex <= 0 )\n throw new Error(\"End Index must be greater than 0\");\n if( startIndex > endIndex )\n throw new Error(\"End Index cannot be less than Start Index\");\n\n var flow = new RangeMethodFlow(startIndex, endIndex);\n setRefs(this, flow);\n\n return flow;\n }", "function gSrange(begin,end,inclusive) {\n var start = begin;\n var finish = end;\n var reverse = false;\n if (finish<start) {\n start = finish;\n finish = begin;\n reverse = true;\n if (!inclusive) {\n start = start + 1;\n }\n } else {\n if (!inclusive) {\n finish = finish - 1;\n }\n }\n\n var result,number,count;\n for (result=[], number=start, count=0 ; number<=finish ; number++,count++) {\n result[count] = number;\n }\n if (reverse) {\n result = result.reverse()\n }\n var object = gSlist(result);\n object.toList = function() {\n return gSlist(this.values());\n }\n return object;\n}", "function rangeArr(start, end) {\n if (start === end) return [];\n\n return ([start].concat(rangeArr(start + 1, end)));\n\n}", "function getDates(startDate, stopDate) {\n\tvar dateArray = new Array();\n\tvar currentDate = startDate;\n\twhile (currentDate <= stopDate) {\n\t\tdateArray.push(currentDate);\n\t\tcurrentDate = currentDate.addDays(1);\n\t}\n\treturn dateArray;\n}", "function range(start, end) {\n // YOUR CODE GOES BELOW HERE //\n // create an Array literal that we can push into\n let myArr = [];\n \n // make an iff statement that says if the start is less than the end\n if(start < end){\n // then we loop, starting at the start, and ending at the end, increment up\n for(let i = start; i <= end; i++){\n // push i at each iteration into our Array literal\n myArr.push(i);\n // finally return it. \n } return myArr;\n } else {\n // same down here we just flip the greater than or equal sign with end\n for (let i = start; i >= end; i--){\n myArr.push(i);\n } return myArr;\n }\n \n \n // YOUR CODE GOES ABOVE HERE //\n}", "function range (start, end) {\n var step = 1;\n if (arguments.length == 3) {\n\tstep = arguments[2];\n }\n\n var result = [];\n \n if (step < 0) {\n\tfor(var i = start; i >= end; i += step) {\n\t result.push(i);\n\t}\n } else {\n\tfor(var i = start; i <= end; i += step) {\n\t result.push(i);\n\t}\n }\n\n return result;\n}", "function range(start, end) {\n return Array.apply(null, Array(end-start)).map(function (_, i) {return i + start;})\n}", "function range(start, end) {\n\tvar arr = [];\n\tfor (let i = start; i <= end; i++) {\n\t\tarr.push(i);\n\t}\n\treturn arr;\n}", "setDateRange () {\n const dates = [];\n\n const startDate = this.state.from.clone();\n const endDate = this.state.to.clone();\n\n dates.push(startDate.clone());\n\n while (startDate.add(1, 'day').diff(endDate) < 0) {\n dates.push(startDate.clone());\n }\n\n this.setState({\n dates\n });\n }", "function getWeeksDates(start, end) {\n var sDate;\n var eDate;\n var dateArr = [];\n var daysHash = {};\n var daysArr = [];\n\n while (start <= end) {\n daysHash[getTimestamp(start, 'yyyymmdd')] = dateArr.length\n daysArr.push(getTimestamp(new Date(start.getTime())))\n if (start.getDay() == 1 || (dateArr.length == 0 && !sDate)) {\n sDate = new Date(start.getTime());\n }\n if ((sDate && start.getDay() == 0) || start.getTime() == end.getTime()) {\n eDate = new Date(start.getTime());\n }\n if (sDate && eDate) {\n dateArr.push([sDate, eDate]);\n sDate = undefined;\n eDate = undefined;\n }\n start.setDate(start.getDate() + 1);\n }\n\n daysHash[getTimestamp(end, 'yyyymmdd')] = dateArr.length\n var lastDate = new Date(dateArr[dateArr.length - 1][1])\n if (lastDate < end) {\n dateArr.push([new Date(lastDate.setDate(lastDate.getDate() + 1)), end]);\n }\n return { \"weeksDates\": dateArr, \"daysHash\": daysHash, \"daysArr\": daysArr }\n }", "overlaps(dat_range){\n if (!(dat_range.start && dat_range.end)){\n console.error(\"dat_range items must all respond to a method called 'start' and 'end', this dat_range was:\", dat_range);\n }\n return this.contains_exclusive(dat_range.end) || this.contains_exclusive(dat_range.start) || this.during(dat_range);\n }", "function rangeOfNumbers(startNum, endNum) {\n if (startNum === endNum) {\n return [startNum];\n }\n return rangeOfNumbers(startNum, endNum - 1).concat(endNum);\n}", "function getDatesBetween(from, to) {\n const initialDate = from <= to ? from : to;\n const finalDate = from > to ? from : to;\n \n // Return empty list if dates are not well-formed.\n if (initialDate === undefined || finalDate === undefined) {\n return [];\n }\n \n // If they are the same date, there is only 1 day between them.\n if (initialDate === finalDate) {\n return [initialDate];\n }\n\n const dates = [];\n\n // Generate dates.\n let tmpDate = new Date(initialDate);\n while (getDate(tmpDate) !== finalDate) {\n dates.push(getDate(tmpDate));\n tmpDate.setDate(tmpDate.getDate() + 1);\n }\n dates.push(finalDate);\n\n return dates;\n}", "function rangeOfNumbers(startNum, endNum) {\r\n return startNum === endNum\r\n ? [startNum]\r\n : rangeOfNumbers(startNum, endNum - 1).concat(endNum);\r\n}", "validateTwoDates(startDate, endDate){\n if( startDate < endDate) {\n return true;\n } else {\n return false\n }\n }", "function createRange(end) {\n if (end === 0) {\n return [];\n }\n var results = [];\n var current = 1;\n var step = 0 <= end ? 1 : -1;\n\n results.push(current);\n\n while (current !== end) {\n current += step;\n results.push(current);\n }\n\n return results;\n}", "function newDates(low, high){\n let tempArray = [];\n for(var i=0; i<datesProvided.length; i++){\n if ((i>=low) && (i<=high)){\n tempArray.push(datesProvided[i]);\n }\n }\n return tempArray;\n}", "function rangeOfNumbers(startNum, endNum) {\n return startNum === endNum\n ? [startNum]\n : rangeOfNumbers(startNum, endNum - 1).concat(endNum);\n}", "function getRange(array, start, end) {\n const ret = [];\n if (start <= array.length && start <= end) {\n for (let i = start - 1; i < end; i++) {\n ret.push(array[i]);\n }\n }\n return ret;\n}", "function range(start, end) {\n //Input sanitization\n if (!start && !end) return \"Please provide both start and end points\";\n if (!end) return \"Please provide an endpoint\";\n if (isNaN(start) || isNaN(end))\n return \"Both start and end points must be numbers\";\n\n let arr = [];\n while (start <= end) {\n arr.push(start);\n start++;\n }\n return arr;\n}", "function range(min,max)\n{\n var output = [];\n return rangeRec(min,max,output);\n}", "function getDaysArray (start, end) {\n for(var dt=new Date(start); dt<=end; dt.setDate(dt.getDate()+1)){\n groundTruthCopy.push({date: new Date(dt), y: -999});\n }\n }", "function newDates(low, high){\n /* let tempArray = [];\n for(var i=0; i<datesProvided.length; i++){\n if ((i>=low) && (i<=high)){\n tempArray.push(new Date(datesProvided[i]));\n }\n }\n\n //And one last value to account for range\n let tempDate = new Date(tempArray[tempArray.length-1])\n console.log(\"Temp Date:\")\n console.log(tempDate)\n let moreMinutes = tempDate.getMinutes();\n console.log(\"Minutes: \")\n console.log(moreMinutes)\n console.log(selectionInterval)\n console.log((moreMinutes+(+selectionInterval)))\n tempDate.setMinutes((moreMinutes+(+selectionInterval)))\n console.log(\"New Temp Date\")\n console.log(tempDate)\n tempArray.push(tempDate)\n\n return tempArray;*/\n let tempArray = [];\n for(var i=low; i<=high; i++){\n tempArray.push(new Date(datesProvided[i]));\n }\n\n //And one last value to account for range\n let tempDate = new Date(tempArray[tempArray.length-1])\n console.log(\"Temp Date:\")\n console.log(tempDate)\n let moreMinutes = tempDate.getMinutes();\n console.log(\"Minutes: \")\n console.log(moreMinutes)\n console.log(selectionInterval)\n console.log((moreMinutes+(+selectionInterval)))\n tempDate.setMinutes((moreMinutes+(+selectionInterval)))\n console.log(\"New Temp Date\")\n console.log(tempDate)\n tempArray.push(tempDate)\n\n return tempArray;\n}", "function getDates(startDate, stopDate) {\n var dateArray = new Array();\n var currentDate = startDate;\n while (currentDate <= stopDate) {\n dateArray.push((new Date (currentDate)).toISOString());\n currentDate = currentDate.addDays(1);\n }\n return dateArray;\n }", "function range(start, end, inc=1) {\n var array = [];\n if(start <= end){\n for (var i=start; i<= end; i+= inc){\n array.push(i);\n }\n }\n else{\n for(var x = start; x>= end; x-=inc){\n array.push(x);\n }\n }\n return array;\n}", "function findStartAndEndDate() {\n return [dayOfLastWeek(1), dayOfLastWeek(0)];\n}", "getTimeRange(){\n let start = this.props.startTime instanceof IntegerTime ? this.props.startTime: IntegerTime.fromArmyTime(this.props.startTime);\n let end = this.props.endTime instanceof IntegerTime ? this.props.endTime: IntegerTime.fromArmyTime(this.props.endTime);\n return new IntegerTimeInterval(start, end);\n }", "function dateRangeCalculator(){\n\n\t//start date\n\n\t//end date\n\n\t//Api call request that reloads page/section based off of time span requested OR trimming original data object/array based off of new specified date range \n\n\n}", "function range (start,end, step = 1){\n var array =[];\n if(start < end){\n for(var i=start; i<=end; i = i + step){\n array.push(i);\n }\n return array;\n }\n else {\n for (var j = start; j>=end; j = j + step){\n array.push(j);\n }\n return array;\n }\n}", "function getDateRange(dataPassed){\r\n //called by slider start & end dates\r\n //get first object in dataPassed array, and get the date\r\n firstObj=dataPassed.filter(function(d,i){\r\n return i==0\r\n });\r\n //get last object in dataPassed array, and get the date\r\n lastObj = dataPassed.filter(function(d,i){\r\n return i==dataPassed.length-1\r\n });\r\n datefrom = firstObj[0].Day;\r\n dateto=lastObj[0].Day;\r\n datejson = {'start':datefrom,'end':dateto};\r\n return datejson;\r\n }", "contains_exclusive(dat_or_drange){\n return this.starts_before(dat_or_drange) && this.ends_after(dat_or_drange) ;\n }", "_unixRangeForDatespan(startDate, endDate) {\n return {\n start: moment(startDate).unix(),\n end: moment(endDate).add(1, 'day').subtract(1, 'second').unix(),\n };\n }", "static dateOutOfRange(date, minDate, maxDate, config) {\n let result = false;\n if (minDate != null && date.isBefore(minDate, 'day')) {\n result = true;\n }\n if (maxDate != null && date.isAfter(maxDate, 'day')) {\n result = true;\n }\n if (config && config.calendarSettings) {\n const settings = config.calendarSettings;\n if (settings.disableDays &&\n settings.disableDays.some(disabledDate => this.checkDayForDisabled(disabledDate, date))) {\n result = true;\n }\n }\n return result;\n }", "function queryFromUserByAgeBetween(arr, start, end) {\n return arr.filter(function (ele) {\n return ((new Date().getFullYear() - new Date(ele.DOB).getFullYear()) > start && (new Date().getFullYear() - new Date(ele.DOB).getFullYear()) < end);\n })\n}", "function rangeToSegments(start, end) {\n\n\t\tvar rowCnt = t.getRowCnt();\n\t\tvar colCnt = t.getColCnt();\n\t\tvar segments = []; // array of segments to return\n\n\t\t// day offset for given date range\n\t\tvar rangeDayOffsetStart = dateToDayOffset(start);\n\t\tvar rangeDayOffsetEnd = dateToDayOffset(end); // an exclusive value\n\t\tvar endTimeMS = +end.time();\n\t\tif (endTimeMS && endTimeMS >= nextDayThreshold) {\n\t\t\trangeDayOffsetEnd++;\n\t\t}\n\t\trangeDayOffsetEnd = Math.max(rangeDayOffsetEnd, rangeDayOffsetStart + 1);\n\n\t\t// first and last cell offset for the given date range\n\t\t// \"last\" implies inclusivity\n\t\tvar rangeCellOffsetFirst = dayOffsetToCellOffset(rangeDayOffsetStart);\n\t\tvar rangeCellOffsetLast = dayOffsetToCellOffset(rangeDayOffsetEnd) - 1;\n\n\t\t// loop through all the rows in the view\n\t\tfor (var row=0; row<rowCnt; row++) {\n\n\t\t\t// first and last cell offset for the row\n\t\t\tvar rowCellOffsetFirst = row * colCnt;\n\t\t\tvar rowCellOffsetLast = rowCellOffsetFirst + colCnt - 1;\n\n\t\t\t// get the segment's cell offsets by constraining the range's cell offsets to the bounds of the row\n\t\t\tvar segmentCellOffsetFirst = Math.max(rangeCellOffsetFirst, rowCellOffsetFirst);\n\t\t\tvar segmentCellOffsetLast = Math.min(rangeCellOffsetLast, rowCellOffsetLast);\n\n\t\t\t// make sure segment's offsets are valid and in view\n\t\t\tif (segmentCellOffsetFirst <= segmentCellOffsetLast) {\n\n\t\t\t\t// translate to cells\n\t\t\t\tvar segmentCellFirst = cellOffsetToCell(segmentCellOffsetFirst);\n\t\t\t\tvar segmentCellLast = cellOffsetToCell(segmentCellOffsetLast);\n\n\t\t\t\t// view might be RTL, so order by leftmost column\n\t\t\t\tvar cols = [ segmentCellFirst.col, segmentCellLast.col ].sort();\n\n\t\t\t\t// Determine if segment's first/last cell is the beginning/end of the date range.\n\t\t\t\t// We need to compare \"day offset\" because \"cell offsets\" are often ambiguous and\n\t\t\t\t// can translate to multiple days, and an edge case reveals itself when we the\n\t\t\t\t// range's first cell is hidden (we don't want isStart to be true).\n\t\t\t\tvar isStart = cellOffsetToDayOffset(segmentCellOffsetFirst) == rangeDayOffsetStart;\n\t\t\t\tvar isEnd = cellOffsetToDayOffset(segmentCellOffsetLast) + 1 == rangeDayOffsetEnd; // +1 for comparing exclusively\n\n\t\t\t\tsegments.push({\n\t\t\t\t\trow: row,\n\t\t\t\t\tleftCol: cols[0],\n\t\t\t\t\trightCol: cols[1],\n\t\t\t\t\tisStart: isStart,\n\t\t\t\t\tisEnd: isEnd\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn segments;\n\t}", "function rangeToSegments(start, end) {\n\n\t\tvar rowCnt = t.getRowCnt();\n\t\tvar colCnt = t.getColCnt();\n\t\tvar segments = []; // array of segments to return\n\n\t\t// day offset for given date range\n\t\tvar rangeDayOffsetStart = dateToDayOffset(start);\n\t\tvar rangeDayOffsetEnd = dateToDayOffset(end); // an exclusive value\n\t\tvar endTimeMS = +end.time();\n\t\tif (endTimeMS && endTimeMS >= nextDayThreshold) {\n\t\t\trangeDayOffsetEnd++;\n\t\t}\n\t\trangeDayOffsetEnd = Math.max(rangeDayOffsetEnd, rangeDayOffsetStart + 1);\n\n\t\t// first and last cell offset for the given date range\n\t\t// \"last\" implies inclusivity\n\t\tvar rangeCellOffsetFirst = dayOffsetToCellOffset(rangeDayOffsetStart);\n\t\tvar rangeCellOffsetLast = dayOffsetToCellOffset(rangeDayOffsetEnd) - 1;\n\n\t\t// loop through all the rows in the view\n\t\tfor (var row=0; row<rowCnt; row++) {\n\n\t\t\t// first and last cell offset for the row\n\t\t\tvar rowCellOffsetFirst = row * colCnt;\n\t\t\tvar rowCellOffsetLast = rowCellOffsetFirst + colCnt - 1;\n\n\t\t\t// get the segment's cell offsets by constraining the range's cell offsets to the bounds of the row\n\t\t\tvar segmentCellOffsetFirst = Math.max(rangeCellOffsetFirst, rowCellOffsetFirst);\n\t\t\tvar segmentCellOffsetLast = Math.min(rangeCellOffsetLast, rowCellOffsetLast);\n\n\t\t\t// make sure segment's offsets are valid and in view\n\t\t\tif (segmentCellOffsetFirst <= segmentCellOffsetLast) {\n\n\t\t\t\t// translate to cells\n\t\t\t\tvar segmentCellFirst = cellOffsetToCell(segmentCellOffsetFirst);\n\t\t\t\tvar segmentCellLast = cellOffsetToCell(segmentCellOffsetLast);\n\n\t\t\t\t// view might be RTL, so order by leftmost column\n\t\t\t\tvar cols = [ segmentCellFirst.col, segmentCellLast.col ].sort();\n\n\t\t\t\t// Determine if segment's first/last cell is the beginning/end of the date range.\n\t\t\t\t// We need to compare \"day offset\" because \"cell offsets\" are often ambiguous and\n\t\t\t\t// can translate to multiple days, and an edge case reveals itself when we the\n\t\t\t\t// range's first cell is hidden (we don't want isStart to be true).\n\t\t\t\tvar isStart = cellOffsetToDayOffset(segmentCellOffsetFirst) == rangeDayOffsetStart;\n\t\t\t\tvar isEnd = cellOffsetToDayOffset(segmentCellOffsetLast) + 1 == rangeDayOffsetEnd; // +1 for comparing exclusively\n\n\t\t\t\tsegments.push({\n\t\t\t\t\trow: row,\n\t\t\t\t\tleftCol: cols[0],\n\t\t\t\t\trightCol: cols[1],\n\t\t\t\t\tisStart: isStart,\n\t\t\t\t\tisEnd: isEnd\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn segments;\n\t}", "function getWorkDates(boundDates, holidays) {\n const { minDate, maxDueDate} = boundDates;\n const workdays = [];\n const lastDate = maxDueDate;\n let withinBounds = true, nextDate = minDate; \n do {\n if (!isWeekendOrHoliday(nextDate, holidays))\n workdays.push(nextDate);\n nextDate = new Date(nextDate);\n nextDate.setDate(nextDate.getDate() + 1);\n withinBounds = nextDate < lastDate; \n } while (withinBounds);\n workdays.push(maxDueDate);\n return workdays;\n}", "function range(start, end) {\n //YOUR CODE GOES BELOW HERE //\n \n \n var startNumber = start; //setting up variables so we can later switch the start and finish values. \n var endNumber = end;\n var reverse = false; // setting reverse to false so that the code knows that this is false now and then we can make it true later and return the array in reverse order. \n var arrayToHoldResults = [];\n \n if(start > end) { // conditional stmt to say that if the start number is greater than the end number, set reverse equal to true and switch the start number to the value end holds and same for the end number variable.\n reverse = true;\n startNumber = end;\n endNumber = start;\n }\n \n for (var i = startNumber; i <= endNumber; i++) { //this will loop over the array of numbers and push them into our arrayToHoldResults array. start and end numbers are inclusive. \n arrayToHoldResults.push(i); //pushes the values into our array in ascending order. \n } \n \n if(reverse === true) { //conditional stmt stating that if reverse strictly equals true, then take the array of numbers and list them in reverse or descending order. \n arrayToHoldResults.reverse();\n }\n return arrayToHoldResults; //returns the array after the conditional stmts are tested. \n\n\n \n \n \n // YOUR CODE GOES ABOVE HERE //\n}", "inWindowForEndDate(endDate){\n return !this.getStartDate() || this.getStartDate().isSameOrBefore(endDate)\n }", "function makeIntervals(start, end, unit) {\n var r = moment.range(start, end);\n return getInterval(unit, r);\n}", "function range(start, stop) {\n let rangeArr = [];\n\n while (start <= stop) {\n rangeArr.push(start);\n start++;\n }\n return rangeArr;\n }", "function GetAEPDateRange(option, date) {\n\t\t\t\t\t\tvar dte;\n\t\t\t\t\t\tvar year = new Date().getFullYear();\n\n\t\t\t\t\t\tif (option == \"Start\") {\n\t\t\t\t\t\t\t\t\tdte = new Date(year + \"-\" + date + \" 00:00:00.000\");\n\t\t\t\t\t\t} else if (option == \"End\") {\n\t\t\t\t\t\t\t\t\tdte = new Date(year + \"-\" + date + \" 23:59:00.000\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn dte;\n\t\t\t}", "function rangeArray(start, end) {\n var arr = []\n for (var i=start; i <= end; i++) {\n\tarr.push(i)\n }\n return arr\n}", "function normalizeDates(startDate, endDate, { min, showMultiDayTimes }) {\n if (!showMultiDayTimes) {\n return [startDate, endDate]\n }\n\n const current = new Date(min) // today at midnight\n let c = new Date(current)\n let s = new Date(startDate)\n let e = new Date(endDate)\n\n // Use noon to compare dates to avoid DST issues.\n s.setHours(12, 0, 0, 0)\n e.setHours(12, 0, 0, 0)\n c.setHours(12, 0, 0, 0)\n\n // Current day is at the start, but it spans multiple days,\n // so we correct the end.\n if (+c === +s && c < e) {\n return [startDate, dates.endOf(startDate, 'day')]\n }\n\n // Current day is in between start and end dates,\n // so we make it span all day.\n if (c > s && c < e) {\n return [current, dates.endOf(current, 'day')]\n }\n\n // Current day is at the end of a multi day event,\n // so we make it start at midnight, and end normally.\n if (c > s && +c === +e) {\n return [current, endDate]\n }\n\n return [startDate, endDate]\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 reverseRange(start, end){\n var selection = [];\n\n//Feedback: v-- needs spaces around it\n for(var i = end-1; i > start; i--){\n selection.push(i);\n }\n\n return selection;\n}", "range(from, to = from) { return Range.create(from, to, this); }", "function myRange(start, end) {\n let range = [];\n for (var i = start; i < end; i++) {\n range.push(i);\n }\n range.push(end);\n console.log(range);\n}", "function range(start, stop, step) {\n if (start != null && typeof start != 'number') {\n throw new Error('start must be a number or null');\n }\n\n if (stop != null && typeof stop != 'number') {\n throw new Error('stop must be a number or null');\n }\n\n if (step != null && typeof step != 'number') {\n throw new Error('step must be a number or null');\n }\n\n if (stop == null) {\n stop = start || 0;\n start = 0;\n }\n\n if (step == null) {\n step = stop > start ? 1 : -1;\n }\n\n var toReturn = [];\n var increasing = start < stop; //← here’s the change\n\n for (; increasing ? start < stop : start > stop; start += step) {\n toReturn.push(start);\n }\n\n return toReturn;\n }", "@expression(\"items <start> to <end> of <List>\", { types: [ Integer, Integer, List ], returns: List })\n\tstatic range(list, start, end) {\n\t\tif (!(list instanceof List)) return undefined\n\t\tif (!(start instanceof Integer)) return undefined\n\t\tif (!(end instanceof Integer)) return undefined\n\n\t\tif (end === undefined) end = list.items.length\n\t\tlet duplicate = List.duplicate(list)\n\t\tduplicate.items = list.items.slice(list, start - 1, end)\n\t\treturn duplicate\n\t}", "function rangeDateBootstrapDatePicker(idStartDate,idEndDate,optionStartDate='',optionEndDate='')\n{\n let options = {\n language: 'es',\n autoclose:true,\n };\n\n if(optionStartDate !== ''){\n options.startDate = optionStartDate;\n }\n\n if(optionEndDate !== ''){\n options.endDate = optionEndDate;\n }\n\n $(`#${idStartDate}`).datepicker(options).on('changeDate', function() {\n $(`#${idEndDate}`).datepicker('setStartDate',this.value);\n });\n\n $(`#${idEndDate}`).datepicker(options).on('changeDate', function() {\n $(`#${idStartDate}`).datepicker('setEndDate',this.value);\n });\n}", "getDateParams(excludePerPage = false) {\n const dateRange = Object.assign({}, this.displayData.dateRange);\n // Format begin and end date\n if (dateRange.dateBegin) {\n dateRange.dateBegin = this.formatDateSelection(dateRange, 'dateBegin');\n }\n if (dateRange.dateEnd) {\n dateRange.dateEnd = this.formatDateSelection(dateRange, 'dateEnd');\n }\n // String for the pagination component\n if (!excludePerPage) {\n dateRange.perPage = parseInt(this.displayData.perPage);\n dateRange.page = this.displayData.page;\n }\n return dateRange;\n }", "function range(start, end, step=1){\n\tlet ret_array = [];\n\tif(start-end>0){\n\t\tfor(let i=start; i>end-1; i+=step){\n\t\t\tret_array.push(i);\n\t\t}\n\t}\n\tfor(let i=start; i<end+1; i+=step){\n\t\tret_array.push(i);\n\t}\n\treturn ret_array;\n}", "function range(opt_start, stop, opt_step) {\r\n if (arguments.length < 2) {\r\n stop = opt_start;\r\n opt_start = 0;\r\n }\r\n for (var ret = [], t = (opt_step = opt_step || 1) > 0; t ? opt_start < stop : opt_start > stop; opt_start += opt_step) {\r\n ret.push(opt_start);\r\n }\r\n return ret;\r\n }", "function range(start, end, step = start <= end ? 1 : -1) {\n let result = [];\n // loop iterates up for positive step values\n // and iterates down for negative step values\n for (let i = start; step >= 0 ? i <= end : i >= end; i+=step) {\n result.push(i);\n }\n return result;\n }" ]
[ "0.7164459", "0.6706143", "0.6672647", "0.65351856", "0.65351856", "0.6472308", "0.6406881", "0.64038455", "0.636442", "0.6354096", "0.62863606", "0.62810355", "0.62770015", "0.6275293", "0.6262072", "0.6257856", "0.6240677", "0.6220563", "0.6194373", "0.6193076", "0.61842734", "0.61799943", "0.6166478", "0.61318725", "0.6130526", "0.6064019", "0.60517025", "0.60508156", "0.60045767", "0.59837997", "0.595268", "0.5917249", "0.59154373", "0.59112376", "0.5881996", "0.5867708", "0.5856547", "0.5855967", "0.58540964", "0.58482194", "0.5828178", "0.5827542", "0.5821832", "0.5820526", "0.5775358", "0.5769647", "0.57634693", "0.5752741", "0.5749978", "0.5749321", "0.5745706", "0.5738979", "0.5738079", "0.57219946", "0.57019866", "0.56937146", "0.56914455", "0.5685208", "0.5684908", "0.56836087", "0.5683037", "0.5678329", "0.5661746", "0.56603986", "0.5659758", "0.565846", "0.5653467", "0.5634277", "0.5622306", "0.5609765", "0.5607283", "0.5603158", "0.559801", "0.55897504", "0.55810815", "0.5557913", "0.55562866", "0.5542957", "0.55394834", "0.55376947", "0.55376947", "0.553023", "0.5529269", "0.55230707", "0.5518782", "0.5517865", "0.5491036", "0.548987", "0.5487821", "0.54873836", "0.54836386", "0.54825634", "0.5481625", "0.5476909", "0.54741484", "0.54719883", "0.5460987", "0.545519", "0.5454154", "0.5453082" ]
0.5865899
36
Returns true if there's a sort parameter specified and its criteria has a mapped property.
function isSortCriteriaValid(params, fhirToJDSSortMap) { if (nullchecker.isNotNullish(params._sort)) { return nullchecker.isNotNullish(fhirToJDSSortMap[params._sort]); } else if (nullchecker.isNotNullish(params['_sort:asc'])) { return nullchecker.isNotNullish(fhirToJDSSortMap[params['_sort:asc']]); } else if (nullchecker.isNotNullish(params['_sort:desc'])) { return nullchecker.isNotNullish(fhirToJDSSortMap[params['_sort:desc']]); } else { return true; // there's no _sort parameter, thus it is not invalid } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isSortingRequired() {\n const entriesType = this.getEntriesType();\n const { isSortingRequired = false } = this.props.state.entries[entriesType];\n\n return isSortingRequired;\n }", "_isSorted() {\n return this._sort.active == this.id &&\n (this._sort.direction === 'asc' || this._sort.direction === 'desc');\n }", "_isSorted() {\n return this._sort.active == this.id &&\n (this._sort.direction === 'asc' || this._sort.direction === 'desc');\n }", "function isSortable(object){\n\treturn !!object.sort; \n}", "get isSorting() {\r\n return this.i.cf;\r\n }", "function someProperties(map, predicate) {\n for (var key in map) {\n if (!predicate || predicate(map[key], key))\n return true;\n }\n return false;\n }", "function truthCheck(collection, pre) {\n var counter = 0;\n for (var c in collection) {\n if (collection[c].hasOwnProperty(pre) && (collection[c][pre])) {\n counter++;\n }\n }\n \n return counter == collection.length;\n }", "hasProperty(aProperty){\n for(let i = 0; i < this._properties.length; i++){\n let prop = this._properties[i];\n if(aProperty.matches(prop)){\n return true;\n }\n }\n return false;\n }", "static isComparable(prop, root) {\n const virtual = prop.persist === false;\n const inverse = prop.reference === enums_1.ReferenceType.ONE_TO_ONE && !prop.owner;\n const discriminator = prop.name === root.discriminatorColumn;\n const collection = prop.reference === enums_1.ReferenceType.ONE_TO_MANY || prop.reference === enums_1.ReferenceType.MANY_TO_MANY;\n return !virtual && !collection && !inverse && !discriminator && !prop.version;\n }", "function canBeSorted() {\n return true;\n }", "function validateSort(sort) {\n if (typeof sort !== 'string') {\n return false;\n }\n\n return sorts.includes(sort);\n}", "compareBy(a, b) {\n const { key, order } = this.state.sort;\n\n if (key && order) {\n if (a[key] < b[key]) return -1;\n if (a[key] > b[key]) return 1;\n return 0;\n }\n\n return false;\n }", "function isSortable(o) {\n if (o && // o is not null, undefined, etc.\n typeof o === \"object\" && // o is an object\n typeof o.sort === \"function\") // o.sort is a function\n return true; // Then o is array-like\n else\n return false; // Otherwise it is not\n}", "function isSortable(o) {\n if (o && // o is not null, undefined, etc.\n typeof o === \"object\" && // o is an object\n typeof o.sort === \"function\") // o.sort is a function\n return true; // Then o is array-like\n else\n return false; // Otherwise it is not\n}", "canUp() {\n if (!this.parent) {\n return false;\n }\n const props = this.parent.order ? this.parent.order : Object.keys(this.parent.properties);\n const index = props.indexOf(this.name);\n if (index >= 0) {\n return index > 0;\n }\n else {\n for (const p of props) {\n if (Array.isArray(p)) {\n if (p.indexOf(this.name) >= 0) {\n return p.indexOf(this.name) > 0;\n }\n }\n }\n }\n }", "function truthCheck(collection, pre) {\r\n\t\tfor (var i = 0; i < collection.length; i++) {\r\n\t\t\tif (!collection[i].hasOwnProperty(pre)) {\r\n\t\t\t\treturn false;\r\n\t\t\t} else {\r\n\t\t\t\tif (!collection[i][pre]) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function isSortedMap(maybeSortedMap) {\n return isMap(maybeSortedMap) && isSorted(maybeSortedMap);\n}", "prepareSort(orderBy, allowed_cols, tableAlias, excludeOrder = false, validatedAggAliases) {\n let column_names = this.column_names.slice(0);\n const throwErr = () => {\n throw \"\\nInvalid orderBy option -> \" + JSON.stringify(orderBy) +\n \"\\nExpecting { key2: false, key1: true } | { key1: 1, key2: -1 } | [{ key1: true }, { key2: false }] | [{ key1: 1 }, { key2: -1 }]\";\n }, parseOrderObj = (orderBy, expectOne = false) => {\n if (!isPlainObject(orderBy))\n return throwErr();\n if (expectOne && Object.keys(orderBy).length > 1)\n throw \"\\nInvalid orderBy \" + JSON.stringify(orderBy) +\n \"\\nEach orderBy array element cannot have more than one key\";\n /* { key2: bool, key1: bool } */\n if (!Object.values(orderBy).find(v => ![true, false].includes(v))) {\n return Object.keys(orderBy).map(key => ({ key, asc: Boolean(orderBy[key]) }));\n }\n else if (!Object.values(orderBy).find(v => ![-1, 1].includes(v))) {\n return Object.keys(orderBy).map(key => ({ key, asc: orderBy[key] === 1 }));\n }\n else if (!Object.values(orderBy).find(v => ![\"asc\", \"desc\"].includes(v))) {\n return Object.keys(orderBy).map(key => ({ key, asc: orderBy[key] === \"asc\" }));\n }\n else\n return throwErr();\n };\n if (!orderBy)\n return \"\";\n let allowedFields = [];\n if (allowed_cols) {\n allowedFields = this.parseFieldFilter(allowed_cols);\n }\n let _ob = [];\n if (isPlainObject(orderBy)) {\n _ob = parseOrderObj(orderBy);\n }\n else if (typeof orderBy === \"string\") {\n /* string */\n _ob = [{ key: orderBy, asc: true }];\n }\n else if (Array.isArray(orderBy)) {\n /* Order by is formed of a list of ascending field names */\n let _orderBy = orderBy;\n if (_orderBy && !_orderBy.find(v => typeof v !== \"string\")) {\n /* [string] */\n _ob = _orderBy.map(key => ({ key, asc: true }));\n }\n else if (_orderBy.find(v => isPlainObject(v) && Object.keys(v).length)) {\n if (!_orderBy.find(v => typeof v.key !== \"string\" || typeof v.asc !== \"boolean\")) {\n /* [{ key, asc }] */\n _ob = Object.freeze(_orderBy);\n }\n else {\n /* [{ [key]: asc }] | [{ [key]: -1 }] */\n _ob = _orderBy.map(v => parseOrderObj(v, true)[0]);\n }\n }\n else\n return throwErr();\n }\n else\n return throwErr();\n if (!_ob || !_ob.length)\n return \"\";\n let bad_param = _ob.find(({ key }) => !(validatedAggAliases || []).includes(key) &&\n (!column_names.includes(key) ||\n (allowedFields.length && !allowedFields.includes(key))));\n if (!bad_param) {\n return (excludeOrder ? \"\" : \" ORDER BY \") + (_ob.map(({ key, asc }) => `${tableAlias ? pgp.as.format(\"$1:name.\", tableAlias) : \"\"}${pgp.as.format(\"$1:name\", key)} ${asc ? \" ASC \" : \" DESC \"}`).join(\", \"));\n }\n else {\n throw \"Unrecognised orderBy fields or params: \" + bad_param.key;\n }\n }", "function truthCheck(collection, pre) {\n //set counter variable\n var counter = 0;\n //check for each object\n for(var c in collection) {\n //check if it has the property and is true\n if(collection[c].hasOwnProperty(pre) && Boolean(collection[c][pre])) {\n counter++;\n }\n }\n //check to see if it is truthy and return true or false\n return counter == collection.length;\n}", "get isDataPreSorted() {\r\n return this.i.k9;\r\n }", "function truthCheck(collection, pre) {\n // For every object in collection\n for (var object of collection) {\n // If the (pre) property of that object returns false - return false \n if (!object[pre]) return false;\n }\n // All objects have properties (pre) with a truthy value - return true\n return true;\n }", "function isPropFiltered(propertyKey) {\n let filtered = false;\n filtered = Object.keys(propertyKey).some((propertyValue) => !propertyKey[propertyValue][0]);\n return filtered;\n }", "function dynamicSort(property) {\n\n var sortOrder = -1;\n\n return function (a,b) {\n // if first of properties to sort is undefined, push it to the end\n if (!a[property]) {\n return 1;\n // if second of properties to sort is undefined, push it to the end\n } else if (!b[property]) {\n return -1; \n } else { \n // compare the selected property of each person\n if (sortOrder == -1) {\n return b[property].localeCompare(a[property]);\n } else {\n return a[property].localeCompare(b[property]);\n } \n }\n }\n}", "function hasProperty(selected) {\n return (property && (selected[property] !== undefined)) ||\n (method && (typeof selected[method] === 'function'));\n }", "_checkParam() {\n if (this.datascales && this.dataInfo.entity_items && Object.keys(this.dataInfo.entity_items)) {\n this.datascales.range = this.datascales.range || 24\n this.datascales.aggregate = this.datascales.aggregate || \"last\"\n return true\n }\n return false\n }", "hasProps(obj) {\n const size = this.size;\n\n for (let i = 0; i < size; ++i) {\n const prop = this.getProp(obj, i);\n\n if (prop === null || prop === undefined) {\n return false;\n }\n }\n\n return true;\n }", "get shouldDisplayParams() {\n let params = this.args.item?.params || [];\n\n return params.some((p) => p.description || p.name.includes('.'));\n }", "getSortCriteria(args) {\n var al = args.length, props;\n \n if (args.length == 1) {\n var firstParameter = args[0];\n if (_.isString(firstParameter) && firstParameter.search(/,|\\s/) > -1)\n return this.parseSortBy(firstParameter);\n }\n\n if (al > 1) {\n // passing multiple property names sortBy(a, \"aa\", \"bb\", \"cc\");\n var a = _.toArray(args);\n props = _.map(a, x => {\n return this.normalizeSortByValue(x, true);\n });\n } else {\n // expect a single string; or an object\n props = this.normalizeSortByValue(args[0]);\n }\n return props;\n }", "function HasProperty(O, P) { // eslint-disable-line no-unused-vars\n\t\t// Assert: Type(O) is Object.\n\t\t// Assert: IsPropertyKey(P) is true.\n\t\t// Return ? O.[[HasProperty]](P).\n\t\treturn P in O;\n\t}", "hasSuggestions() {\n return this.filteredAirports && Object.keys(this.filteredAirports).length > 1;\n }", "function test_props( props, callback ) {\n for ( var i in props ) {\n if ( m_style[ props[i] ] !== undefined && ( !callback || callback( props[i], m ) ) ) {\n return true;\n }\n }\n }", "function test_props( props, callback ) {\n for ( var i in props ) {\n if ( m_style[ props[i] ] !== undefined && ( !callback || callback( props[i], m ) ) ) {\n return true;\n }\n }\n }", "sort(predicate) {\n if (this._multiple && this.selected) {\n this._selected.sort(predicate);\n }\n }", "function customComparator(actual, expected) {\n // console.debug('act, expect', actual, expected);\n // console.debug('type act', typeof actual);\n\n var isBeforeActivated = expected.before;\n var isAfterActivated = expected.after;\n var isLower = expected.lower;\n var isHigher = expected.higher;\n var higherLimit;\n var lowerLimit;\n var itemDate;\n var queryDate;\n\n\n if (ng.isObject(expected)) {\n\n //date range\n if (expected.before || expected.after) {\n try {\n if (isBeforeActivated) {\n higherLimit = expected.before;\n\n itemDate = new Date(actual);\n queryDate = new Date(higherLimit);\n\n if (itemDate > queryDate) {\n return false;\n }\n }\n\n if (isAfterActivated) {\n lowerLimit = expected.after;\n\n\n itemDate = new Date(actual);\n queryDate = new Date(lowerLimit);\n\n if (itemDate < queryDate) {\n return false;\n }\n }\n\n return true;\n } catch (e) {\n return false;\n }\n\n } else if (isLower || isHigher) {\n //number range\n if (isLower) {\n higherLimit = expected.lower;\n\n if (actual > higherLimit) {\n return false;\n }\n }\n\n if (isHigher) {\n lowerLimit = expected.higher;\n if (actual < lowerLimit) {\n return false;\n }\n }\n\n return true;\n }\n //etc\n\n return true;\n\n }\n return standardComparator(actual, expected);\n }", "function HasProperty(O, P) { // eslint-disable-line no-unused-vars\n // Assert: Type(O) is Object.\n // Assert: IsPropertyKey(P) is true.\n // Return ? O.[[HasProperty]](P).\n return P in O;\n }", "function HasProperty(O, P) { // eslint-disable-line no-unused-vars\n\t// Assert: Type(O) is Object.\n\t// Assert: IsPropertyKey(P) is true.\n\t// Return ? O.[[HasProperty]](P).\n\treturn P in O;\n}", "function HasProperty(O, P) { // eslint-disable-line no-unused-vars\n\t// Assert: Type(O) is Object.\n\t// Assert: IsPropertyKey(P) is true.\n\t// Return ? O.[[HasProperty]](P).\n\treturn P in O;\n}", "function isMapProperty(name) {\n return isObjectProperty(name) || ['any','collect',\n 'collectEntries','collectMany','countBy','dropWhile',\n 'each','eachWithIndex','every','find','findAll',\n 'findResult','findResults','get','getAt','groupBy',\n 'inject','intersect','max','min',\n 'putAll','putAt','reverseEach', 'clear',\n 'sort','spread','subMap','add','take','takeWhile',\n 'withDefault','count','drop','keySet',\n 'put','size','isEmpty','remove','containsKey',\n 'containsValue','values'].indexOf(name) >= 0;\n }", "function truthCheck(collection, pre) {\n for (let i=0; i < collection.length; i++) {\n \t\n let obj = collection[i];\n\n if(obj[pre]) {\n continue;\n }\n else {\n return false;\n }\n }\n // all fine\n return true;\n}", "function noSort(inSortInfo){\n \n if(inSortInfo == 5){\n return false;\n }else{\n return true;\n }\n }", "has(param) {\n this.init();\n return this.map.has(param);\n }", "hasComparableType () {\n\t\treturn this.type.isComparable();\n\t}", "function isColumnSortable(columnSequence, column) {\r\n var columnSort = {};\r\n if(column.isSortable == undefined || (column.isSortable && !column.isSortable())) {\r\n columnSort[\"sorter\"] = false;\r\n }\r\n return (columnSort);\r\n }", "function isParam(obj) {\n var func = pred_table.find(o => o.line == obj.line && o.type == 'function declaration');\n\n if (func)\n return true;\n\n return false;\n}", "function truthCheck(collection, pre) {\n\tlet result;\n\n\tfor (let i = 0; i < collection.length; i++) {\n\t\tif (pre in collection[i] && collection[i][pre]) {\n\t\t\tresult = true;\n\t\t} else {\n\t\t\tresult = false;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn result;\n}", "function contains(obj, prop) {\n\t return Object.prototype.hasOwnProperty.call(obj, prop);\n\t}", "function compareProperty(ob1, ob2, p) {\n if (typeof (ob2[p]) === \"undefined\") {\n return false;\n }\n\n if (ob1.hasOwnProperty(p)) {\n if (typeof (ob1[p]) === typeof (ob2[p]) && typeof (ob1[p]) === \"object\") {\n if (!isEqual(ob1[p], ob2[p])) {\n return false;\n }\n } else if (typeof (ob1[p]) === \"function\") {\n return false; // not supporting functions\n } else {\n if (ob1[p] !== ob2[p]) {\n return false;\n }\n }\n }\n return true;\n }", "function checkURL() {\n // Try URL first\n var param = loc.search;\n\n if (param) {\n // Most Recent: ?sk=h_chr\n // Top Stories: ?sk=h_nor\n\n // Not currently sorted by most recent\n if (param.indexOf('sk=h_chr') === -1) {\n changeSort();\n }\n\n // Successfully determined sort\n return true;\n }\n else {\n param = loc.pathname.replace(/^\\//, '');\n\n if (param && param.length) {\n // We're not on the home page, so sorting is not applicable\n return true;\n }\n }\n\n // Failed to determine sort via URL\n return false;\n }", "function processQueryParameters(queryObject) {\n var start;\n if (!queryObject)\n return {\n Sort: 'Start'\n };\n else if (!queryObject.sort) {\n if (Object.keys(queryObject).length > 0) return false;\n else return {\n Sort: 'Start'\n };\n } else if (queryObject.sort === \"start\") {\n if (queryObject.end) {\n if (!queryObject.start)\n return false;\n start = parseInt(queryObject.start);\n var end = parseInt(queryObject.end);\n if (isNaN(start) || isNaN(end))\n return false;\n if (moment(end).isBefore(start))\n return false;\n return {\n Sort: 'Start',\n Start: queryObject.start,\n End: queryObject.end\n };\n } else if (queryObject.start) {\n start = parseInt(queryObject.start);\n if (isNaN(start))\n return false;\n return {\n Sort: 'Start',\n Start: queryObject.start\n };\n } else\n return {\n Sort: 'Start'\n };\n } else if (queryObject.sort === \"name\") {\n if (Object.keys(queryObject).length > 1) return false;\n return {\n Sort: 'Name'\n };\n } else if (queryObject.sort === \"distance\") {\n if (queryObject.lat && queryObject.lon) {\n var lat = parseFloat(queryObject.lat);\n var lon = parseFloat(queryObject.lon);\n if (isNaN(lat) || isNaN(lon))\n return false;\n if (lat < -90.0 || lat > 90.0 || lon < -180.0 || lon > 180.0)\n return false;\n return {\n Sort: 'Distance',\n Lat: queryObject.lat,\n Lon: queryObject.lon\n };\n } else if (queryObject.addr) {\n return {\n Sort: 'Distance',\n Address: queryObject.addr\n };\n } else {\n return {\n Sort: 'Distance'\n };\n }\n } else\n return false;\n}", "has(param) {\n this.init();\n return this.map.has(param);\n }", "has(param) {\n this.init();\n return this.map.has(param);\n }", "has(param) {\n this.init();\n return this.map.has(param);\n }", "has(param) {\n this.init();\n return this.map.has(param);\n }", "has(param) {\n this.init();\n return this.map.has(param);\n }", "matches(aProperty){\n if(aProperty.name == this.name){\n return true;\n } else {\n for(let i = 0; i < this.aliases.length; i++){\n let myAlias = this.aliases[i];\n if(aProperty.hasAlias(myAlias)){\n return true;\n }\n }\n }\n return false;\n }", "function matches(property) {\n var property = original[property];\n return location.indexOf(property) !== -1;\n }", "function matches(property) {\n var property = original[property];\n return location.indexOf(property) !== -1;\n }", "function SortByProperty(a,b)\n\t{\n\t\treturn a[sortType] - b[sortType];\n\t}", "function validateByOrder(params) {\r\n\t\tvar x;\r\n\r\n\t\t//Loop through all properties in schema and check if required ones exist\r\n\t\tfor(x = 0; x < schema.length; x++) {\r\n\t\t\tif(schema[x].required) {\r\n\t\t\t\tif(!params.hasOwnProperty(x)) {\r\n\t\t\t\t\treturn false\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//Loop through all existing params and check if they are valid\r\n\t\tfor(x = 0; x < params.length; x++) {\r\n\t\t\tif(schema.length >= x) {\r\n\t\t\t\tif(!validateInstance(schema[x], resolveReferences, params[x])) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif(names.hasOwnProperty('*')) {\r\n\t\t\t\t\tif(!validateInstance(names['*'], resolveReferences, params[x])) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "shouldUseCorrespondingResults() {\n return this.meta.shouldResultsCorrespond;\n }", "function has( object, propNames ) {\n\t\t\t\t\tfor( var i = 0; i < propNames.length; ++i ) {\n\t\t\t\t\t\tif( object.hasOwnProperty( propNames ) )\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn true;\n\t\t\t\t}", "function hasOrder() {\n return this.orders.length > 0;\n }", "function verifyParam(attribute, param, collectionName) {\n if (attribute.toLowerCase() == param || collectionName == param) {\n return true;\n }\n return false;\n}", "function hasProp(o, prop) {\n\treturn o.hasOwnProperty(prop);\n}", "any() {\n return Object.keys(this._rawQuery).length > 0;\n }", "any() {\n return Object.keys(this._rawQuery).length > 0;\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 sortByProperty(property){ \n return function(a,b){ \n if(a[property] > b[property]) \n return 1; \n else if(a[property] < b[property]) \n return -1; \n \n return 0; \n } \n}", "function truthCheck(collection, pre) {\n\n // check if all elements in collection has pre as a property\n // and that each element is a truthy\n return collection.every(function(element) {\n \n // check if the element has the property\n // check if the element is a truthy\n return element.hasOwnProperty(pre) && Boolean(element[pre]);\n });\n \n }", "function objectPropertyHasValue(prop) {\r\n\r\n return typeof prop !== 'undefined' && prop !== \"\" ? true : false;\r\n}", "hasProperty(property) {\n if (property(this))\n return true;\n if (this.isSetView)\n return this.setViewType.hasProperty(property);\n return false;\n }", "function dynamicSort(property) {\r\n var sortOrder = 1;\r\n if (property[0] === \"-\") {\r\n sortOrder = -1;\r\n property = property.substr(1);\r\n }\r\n return function (a, b) {\r\n var result = (a[property] > b[property]) ? -1 : (a[property] < b[property]) ? 1 : 0;\r\n return result * sortOrder;\r\n }\r\n}", "function sortByProperty(property){ \n return function(a,b){ \n if(a[property] < b[property]) \n return 1; \n else if(a[property] > b[property]) \n return -1; \n \n return 0; \n } \n }", "sort(predicate) {\n if (this._multiple && this.selected) {\n this._selected.sort(predicate);\n }\n }", "sort(predicate) {\n if (this._multiple && this.selected) {\n this._selected.sort(predicate);\n }\n }", "dynamicSort(property) {\n var sortOrder = 1;\n //check for \"-\" operator and sort asc/desc depending on that\n if (property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function (a, b) {\n var result =\n a[property] < b[property] ? -1 : a[property] > b[property] ? 1 : 0;\n return result * sortOrder;\n };\n }", "function sortByProperty(property){ \n return function(a,b){ \n if(a[property] < b[property]) \n return 1; \n else if(a[property] > b[property]) \n return -1; \n \n return 0; \n } \n }", "function sortByProperty(property){ \n return function(a,b){ \n if(a[property] < b[property]) \n return 1; \n else if(a[property] > b[property]) \n return -1; \n \n return 0; \n } \n }", "function getDependsOnOwnProps(mapToProps) {\n\t return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n\t}", "function getDependsOnOwnProps(mapToProps) {\n\t return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n\t}", "function getDependsOnOwnProps(mapToProps) {\n\t return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n\t}", "function getDependsOnOwnProps(mapToProps) {\n\t return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n\t}", "function getDependsOnOwnProps(mapToProps) {\n\t return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n\t}", "function getDependsOnOwnProps(mapToProps) {\n\t return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n\t}", "function getDependsOnOwnProps(mapToProps) {\n\t return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n\t}", "function getDependsOnOwnProps(mapToProps) {\n\t return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n\t}", "function getDependsOnOwnProps(mapToProps) {\n\t return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n\t}", "function getDependsOnOwnProps(mapToProps) {\n\t return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n\t}", "function getDependsOnOwnProps(mapToProps) {\n\t return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n\t}", "get sortOrder()\n\t{\n\t\treturn true;\n\t}", "function dynamicSort(property) {\n var sortOrder = 1;\n if(property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function (a,b) {\n var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;\n return result * sortOrder;\n }\n}", "function sortBy(prop){\r\n return function(a,b){\r\n if( a[prop] > b[prop]){\r\n return 1;\r\n }else if( a[prop] < b[prop] ){\r\n return -1;\r\n }\r\n return 0;\r\n }\r\n}", "function paramIsEmpty(paramObj) {\n\treturn Object.keys(paramObj).length === 0;\n}", "function dynamicSort(property) {\n var sortOrder = 1;\n if (property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function (a, b) {\n var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;\n return result * sortOrder;\n }\n}", "function isIncluded(maybe) {\n\tif( (typeof maybe) !== 'object' ) {\n\t\treturn false\n\t}\n\n\tlet keys = Object.keys(maybe) \n\tif( keys.includes('name') || keys.includes('age') || keys.includes('favFood') || keys.includes('loves') || keys.includes('imgName') || keys.includes('wins') || keys.includes('defeats') || keys.includes('games') ) {\n\t\treturn true\n\t}\n\n\treturn false\n}", "function queryHasCriteria(query) {\n if (query && query.args) {\n var leafQueries = query.args.filter(function (arg) {\n return isLeaf(arg.name) || isOperator(arg.name);\n });\n if (leafQueries.length === 1 && RqlQueryUtils.isFreeTextMatch(leafQueries[0])) {\n return false;\n }\n return leafQueries.length > 0;\n }\n return false;\n }", "function dynamicSort(property) {\n var sortOrder = 1;\n if (property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function (a, b) {\n var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;\n return result * sortOrder;\n }\n }", "function truthCheck(collection, pre) {\r\n // Is everyone being true?\r\n var isValid = true;\r\n\r\n for(var i = 0, max = collection.length; i < max; i += 1) {\r\n if(!collection[i].hasOwnProperty(pre) || !collection[i][pre]) {\r\n isValid = false;\r\n break\r\n }\r\n }\r\n\r\n return isValid;\r\n}", "function dynamicSort(property) {\n var sortOrder = 1;\n if (property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function(a, b) {\n var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;\n return result * sortOrder;\n }\n }", "function dynamicSort(property) {\n var sortOrder = 1;\n if(property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function (a,b) {\n var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;\n return result * sortOrder;\n };\n}" ]
[ "0.6573961", "0.6372966", "0.6372966", "0.59564346", "0.5885027", "0.569908", "0.5341275", "0.53161395", "0.52838004", "0.5260939", "0.51858646", "0.5172329", "0.51653075", "0.51653075", "0.51466787", "0.51355976", "0.51302564", "0.51179063", "0.510106", "0.5091016", "0.5077008", "0.4989091", "0.49870053", "0.49852154", "0.49627548", "0.49620554", "0.49433503", "0.49276003", "0.49120867", "0.4909593", "0.48270005", "0.48270005", "0.4823767", "0.4809321", "0.48047662", "0.48037937", "0.48037937", "0.48023814", "0.47976875", "0.47939", "0.47856858", "0.47846967", "0.47796863", "0.47685185", "0.47617006", "0.4751271", "0.47429755", "0.47367918", "0.47358456", "0.47249815", "0.47249815", "0.47249815", "0.47249815", "0.47249815", "0.47175083", "0.4715613", "0.4715613", "0.47114432", "0.47113144", "0.4706393", "0.47032622", "0.46998936", "0.46986592", "0.46974376", "0.4697069", "0.4697069", "0.46910727", "0.46902734", "0.46877745", "0.46870914", "0.46869847", "0.46864527", "0.4684059", "0.46759716", "0.46759716", "0.46736717", "0.46653602", "0.46653602", "0.46619776", "0.46619776", "0.46619776", "0.46619776", "0.46619776", "0.46619776", "0.46619776", "0.46619776", "0.46619776", "0.46619776", "0.46619776", "0.46533218", "0.46467894", "0.46446466", "0.46440873", "0.46431407", "0.46397406", "0.46340257", "0.46323305", "0.46294218", "0.46290097", "0.4628208" ]
0.6775237
0
Post / Router CB
function getBanMain (req, res){ res.send("메인배너"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "post(...args) {\n this.route('post', ...args);\n }", "post(uri, action) {\n\n this.route('POST', uri, action);\n }", "function POST(){\n \n}", "function Post() {}", "function postRESTlet(datain) {\n\n}", "handleSubmit(val) {\n val.id = uuid()\n val.timestamp = Date.now()\n \n //API.createPost(val).then((res) => console.log(res))\n alert('post entered succesfully')\n window.location.href = \"/\"\n }", "postData(route, obj, callback) {\n let headers = this.getSecureHeader();\n // This free online service receives post submissions.\n this.http.post(this.site + route, { obj }, { headers })\n .subscribe(\n // Data is received from the post request.\n (data) => {\n // Inspect the data to know how to parse it.\n console.log(\"POST call successful. Inspect response.\", JSON.stringify(data));\n data['errorMessage'] = \"\";\n callback(data, this._that);\n }, \n // An error occurred. Data is not received. \n error => {\n callback({ errorMessage: JSON.stringify(error) }, this._that);\n });\n }", "post (request, response) {\n // Compare the post request url to all valid requests.\n if (request.url === '/register') {\n // If register was post requested call the register post function.\n this.registerPost(request, response);\n } else if (request.url === '/login') {\n // If login was post requested call the login post function.\n this.loginPost(request, response);\n } else if (request.url === '/update') {\n // If update was post requested call the update post function.\n this.updatePost(request, response);\n } else if (request.url === '/logout') {\n // If logout was post requested call the logout post function.\n this.logout(request, response);\n } else if (request.url === '/unregister') {\n // If unregister was post requested call the unregister post function.\n this.unregisterPost(request, response);\n } else if (request.url === '/highscore') {\n // If highscore was post requested call the highscore post function.\n this.highscorePost(request, response);\n } else {\n // If the request did not match any of the above default to index.\n this.index(request, response);\n }\n }", "done() {\n this.post(); \n navigateToRoute({});\n }", "function Post () {\n}", "function http_post(req_url){\n request.post(\n req_url,\n function(error, response, body) {\n console.log(\"Clickatell POST:\")\n console.log(req_url);\n console.log(body);\n if (!error && response.statusCode == 200) {\n node.send({topic:\"Clickatell POST:\",payload:body});\n } else {\n console.log(error);\n node.send({topic:\"Clickatell ERROR:\",payload:error});\n\t\t\t\t}\n }\n );\n }", "submitPost(e) {\n e.preventDefault();\n\n if(this.props.router.match.params.postId != null)\n Meteor.call('post.update', this.props.router.match.params.postId, this.state, (err, results) => {\n if(err){\n console.log(err)\n }else{\n\n }\n });\n else\n Meteor.call('posts.insert', this.state, (err, results) => {\n if(err)\n console.log(err)\n });\n\n this.props.router.history.push(\"/\");\n }", "post(path, handler) {\n\t\tconst {routMap} = this;\n\t\tconst key = getHandlerKey('POST', path);\n\t\troutMap[key] = handler;\n\t\treturn this;\n\t}", "function postRequest() {\n // TODO\n}", "function doPost(e){\n  return handleResponse(e);\n}  \n \n// here handle with parameter", "function submitCustomerInfo(Post){\n $.post(\"/api/customerposts/\", Post, function(){\n window.location.href = \"/customer\"\n \n })\n }", "onFormSubmit(evt) {\n\t\tevt.preventDefault()\n\t\t//send an axios request to post it to the databse\n\t\taxios({method: 'post',url:`/api/posts/${this.state.fields.location}`, data:{\n\t\t\t...this.state.fields\n\t\t}})\n\t\t//then redirect them to their new post!\n\t\t.then((post)=>{\n\t\t\tif (post.data.success){\n\t\t\t\tthis.props.history.push(`/posts/${post.data.post.location}/${post.data.post._id}`)\n\t\t\t}\n\t\t\telse{\n\t\t\t\talert('Whoops! Something went wrong!')\n\t\t\t}\n\t\t})\n\t}", "function doPost(e){\n return handleResponse(e);\n}", "async function handleAddPost() {\n router.push(\"/posts/create\");\n }", "onSubmit(values){ \n // values are form fields values\n this.props.createPost(values, ()=>{\n this.props.history.push('/');\n }); \n }", "function handlePost() {\n\tvar bodyStr = $.request.body ? $.request.body.asString() : undefined;\n\tif (bodyStr === undefined) {\n\t\t$.response.status = $.net.http.INTERNAL_SERVER_ERROR;\n\t\treturn {\"myResult\": \"Missing BODY\"};\n\t}\n\t// Extract body insert data to DB and return results in JSON/other format\n\t$.response.status = $.net.http.CREATED;\n\treturn {\"myResult\": \"POST success\"};\n}", "function postApi(route){\n var jsonRoute = JSON.stringify({ data: route })\n fetch('http://vps1.nickforall.nl:6123/route', {\n method: 'post',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: jsonRoute\n })\n .then(function (response) {\n return response;\n })\n .then(function (result) {\n console.log(\"post succes: \"+ result);\n })\n .catch (function (error) {\n console.log('Request failed', error);\n });\n}", "_post (urlPath, obj, portalOpts) {\n const options = {\n method: 'POST',\n data: obj\n };\n return this.request(urlPath, options, portalOpts);\n }", "function __post(path, callback) {\n app.post(path, callback);\n}", "post(url, data = {}, succCb = null, errCb = null) {\n return this.request('POST', url, data, succCb, errCb);\n }", "function submitPost(post) {\n $.post(\"/api/posts\", post, function() {\n window.location.href = \"/addexercise\";\n });\n }", "post(data,onSuccess){\n\n this.db.type = 'POST';\n this.status = data ;\n\n const url = server.base()+ '/' + this.model;\n\n //preLoad('post');\n axios.post(url,data,this.db.config)\n .then((res)=>{\n\n //preLoad('stop');\n //this.listenDataChange(res) // CAP NHAT REDUX STORE\n onSuccess(res.data) // callback for auto notification\n\n\n },(error)=>{\n\n this.onError(error);\n\n });\n\n }", "function handlePost() {\n\tvar bodyStr = $.request.body ? $.request.body.asString() : undefined;\n\tif ( bodyStr === undefined ){\n\t\t $.response.status = $.net.http.INTERNAL_SERVER_ERROR;\n\t\t return {\"myResult\":\"Missing BODY\"};\n\t}\n\t// Extract body insert data to DB and return results in JSON/other format\n\t$.response.status = $.net.http.CREATED;\n return {\"myResult\":\"POST success\"};\n}", "function submit(event){\nconsole.log(\"starting up\");\nsendPostRequest('/submission','running')\n .then(function (data) {\n console.log(\"got back the following string\");\n console.log(data); \n })\n .catch(function (error) {\n console.error('Error:', error);\n });\n}", "function submitPost(Post) {\n $.post(\"/event\", Post, function() {\n window.location.href = \"/event\";\n });\n }", "onSubmit(values) {\n console.log(values);\n this.props.createPost(values, () => { this.props.history.push('/') });\n\n }", "onSubmit(values) {\n // this === component\n // console.log(values);\n\n // must match one of the routes defined in app\n // only attempt nav only after post has been created\n // callback function created, account for in reducer\n this.props.createPost(values, () => {\n this.props.history.push('/');\n });\n }", "handleSubmit(event) {\n event.preventDefault();\n $.post( 'http://localhost:3000/drivers', {destination: this.state.destination, origin: this.state.origin, name: this.state.name, date: this.state.date, seats: this.state.seats, price: this.state.price, email: this.state.email} ).then(function(data){console.log(data)})\n }", "function newPost(req, res, next){\n courseService.newPost(req.body.post, req).then(x => {\n res.json(x);\n })\n}", "registerPost (request, response) {\n // Save class this in variable as this is not defiend\n // as this router class inside callback functions.\n const router = this;\n // Send data to user controller for registration.\n this.users.register(request.body, function (error, result) {\n // Confirm there was no error in registration.\n if (!error){\n // Confirm the result.\n if (result){\n // If there was a result send json and set response message to success.\n response.writeHead(200, {\"Content-Type\": \"application/json\"}); // Status 200: All OK.\n response.end(JSON.stringify({status: true, message: 'You have been registered.'}));\n } else {\n // If there was a false result set message to the username was taken.\n response.writeHead(200, {\"Content-Type\": \"application/json\"}); // Status 409: Conflict.\n response.end(JSON.stringify({status: false, message: router.taken}));\n }\n } else {\n // If there was an error registering the user set message to error message.\n response.writeHead(200, {\"Content-Type\": \"application/json\"}); // Status 500: Internal server error.\n response.end(JSON.stringify({status: false, message: router.error}));\n console.error(error);\n }\n });\n }", "onSubmit(values) {\n // this === component\n console.log(values);\n\n // must match one of the routes defined in app\n // only attempt nav only after post has been created\n // callback function created, account for in reducer\n this.props.createPost(values, () => {\n this.props.history.push('/');\n });\n }", "function _processRequestPOST(req, res){\n\t\t\n\t}", "forward(info) {\r\n return this.clone(Post, \"forward\").postCore({\r\n body: jsS(info),\r\n });\r\n }", "roomConfigureSubmit(data) {\n this.setState({ currentComp: components.LOBBY })\n let post = \"post\"\n fetch('/username', {\n method: \"POST\",\n headers: {\n 'Content-type': 'application/json'\n },\n body: JSON.stringify(\n { post: this.state.nickname }\n ),\n }).then((result) => result.json()).then((info) => { console.log(info); })\n\n }", "function formPOST(){\n\n\tthis.submit();\n\n}", "function addRoutes(api) {\n //api.post('/api/v2/outbound/:name', postItem);\n}", "function submitPost(Post) {\n console.log(\"ajax\");\n $.post(\"/new/item\", Post, function() {\n window.location.href = \"/browse/styles/all\";\n});\n}", "onSubmit(values) {\n this.props.createPost(values, () => {\n this.props.history.push('/');\n });\n }", "post(url, data, opt = {}) {\n opt.method = 'POST';\n opt.data = data;\n return this.sendRequest(url, opt);\n }", "handleSubmit(event) {\n axios\n .post(`${config.serverUrl}/api/register/registervoter`, {\n name: this.state.name,\n lastname: this.state.lastname,\n ci: this.state.ci,\n city: this.state.city,\n location: this.state.location,\n dataUri: this.state.dataUri\n })\n .then(res => {\n const info = res.data.body;\n alert(info);\n this.setState({ redirect: true });\n })\n .catch(e => {\n alert(\"Error de sintaxis\");\n });\n event.preventDefault();\n }", "function postEvents(req, res, next) {\n jackalopeApp.jackrabbitConnection.publish('queue.simple', req.body);\n res.status(200).end();\n }", "function doPost(e){\n return doGet(e)\n}", "postNewBlock() {\r\n this.server.route({\r\n method: 'POST',\r\n path: '/api/block',\r\n handler: async (request, h) => {\r\n if(request.payload==undefined || request.payload.length==0 || !request.payload.body){\r\n throw Boom.badRequest(\"You have to specify a valid json object with a body property.\");\r\n }\r\n let newBlock = new Block.Block(request.payload.body);\r\n let blockData = await this.blockChain.addBlock(newBlock);\r\n return h.response(blockData).code(201);\r\n }\r\n });\r\n }", "function onActionHttpPostForm (callback, args) {\n util.genericRequestHelper('A30 action.http_post_form', 'post', args, {form: args.data}).then(result => {\n if (result.response.statusCode === 200 ||\n result.response.statusCode === 201 ||\n result.response.statusCode === 202) {\n return callback(null, true)\n }\n callback(result.response.statusCode)\n }).catch(callback)\n}", "init(): void {\n this.router.post('/progress/:taskUUID/:progress', this.dispatchProgress);\n this.router.post('/message/:taskUUID', this.dispatchMessages);\n this.router.post('/prompt/:taskUUID/:type', this.dispatchWithResponsePrompt);\n this.router.post('/manageTasks/:taskUUID', this.dispatchManageTasks);\n }", "sendPost(e) {\n\t\t// Prevent the page from reloading\n\t\te.preventDefault();\n\n\t\t// Create the object we send to the server\n\t\tlet data = {\n\t\t\t\"text\": document.querySelector(\"#postText\").value,\n\t\t\t\"img\": \n\t\t\t(document.querySelector(\".preview img\").src != \"\") ? document.querySelector(\".preview img\").src : \"\"\n\t\t};\n\t\t// Use fetch() and send the data from this.postInput\n\t\tfetch(postURL, {\n\t\t\tmethod: 'POST', // or 'PUT'\n\t\t\tbody: JSON.stringify(data), // data can be `string` or {object}!\n\t\t\theaders: new Headers({\n\t\t\t\t'Content-Type': 'application/json'\n\t\t})});\n\t}", "function remotePostAction(name, url, path='') {\n var requestAction = `${name.toUpperCase()}_REQUEST`;\n var successAction = `${name.toUpperCase()}_SUCCESS`;\n var failureAction = `${name.toUpperCase()}_FAILURE`;\n\n var requestStart = () => {\n return {\n type: requestAction\n }\n };\n\n var requestSuccess = (entity, res) => {\n return {\n type: successAction,\n payload: entity,\n location: res.headers['location']\n }\n };\n\n var requestFailed = () => {\n return {\n type: failureAction\n }\n };\n\n return (entity, path='') => {\n return (dispatch) => {\n dispatch(requestStart());\n console.log('call ' + url + path);\n request\n .post(url + path)\n .withCredentials()\n .type('form')\n .send(entity)\n .end((err, res) => {\n if (res.statusType == 2 || res.statusType == 3 ) {\n console.log(res);\n dispatch(requestSuccess(entity, res));\n } else {\n dispatch(requestFailed());\n }\n });\n }\n };\n}", "postNewBlock() {\n this.server.route({\n method: 'POST',\n path: '/block',\n handler: (request, h) => {\n return new Promise ((resolve,reject)=>{\n var ctype = request.headers[\"content-type\"];\n if (!ctype || ctype.indexOf(\"application/json\") !== 0) {\n reject (Boom.badRequest(\"Wrong content-type. Required \\\"application/json\\\"\"));\n }\n const blockdata = request.payload.body;\n if (typeof blockdata === \"undefined\" || !blockdata || blockdata.trim().length === 0) { \n reject(Boom.badRequest(\"Bad Request expecting {\\\"data\\\":\\\"block body\\\"}\"));\n } else {\n this.blockChain.addBlock(new BlockClass.Block(blockdata)).then ((newblock)=>{\n resolve (JSON.stringify(newblock));\n });\n }\n });\n }\n });\n }", "function PostRequestHandler(HandledRequest, response, request, body) {\n switch (request.url) {\n case '/AuthUser':\n HandledRequest.body = JSON.parse(body);\n HandledRequest.type = 'AuthUser'\n break;\n case '/PriPubKeys':\n HandledRequest.body = JSON.parse(body);\n HandledRequest.type = 'ChangePriPubKey';\n break;\n case '/UpdateCreatePDID':\n HandledRequest.body = JSON.parse(body);\n HandledRequest.type = 'ChangePDID'\n break;\n case '/PDIDToUSB':\n HandledRequest.body = JSON.parse(body);\n HandledRequest.type = 'WritePDID';\n break;\n case '/PostPassword':\n HandledRequest.body = body.split('\\t');\n let cookies = parseCookies(request)\n if (Object.keys(cookies).length === 0 && cookies.constructor === Object) {\n RejectRequest(response, \"smile\")\n } else {\n HandledRequest.cookies = {\n UserID: cookies['user-id'],\n MasterPw: cookies.masterpw,\n Message: JSON.parse(cookies.message),\n }\n HandledRequest.type = 'PostPassword'\n }\n break;\n case '/ChooseUserUSB':\n HandledRequest.body = JSON.parse(body);\n HandledRequest.type = 'ChooseUserUSB';\n break;\n case '/ChooseUserPDID':\n HandledRequest.body = JSON.parse(body);\n HandledRequest.type = 'ChooseUserPDID';\n break;\n default:\n break;\n }\n return HandledRequest;\n}", "onSubmit(props){\n // this action return promise\n this.props.createPost(props).then(()=>{\n // blog post created\n alert('don');\n this.context.router.push('/');\n });\n\n }", "saveAgentRefferal(data){\nreturn this.post(Config.API_URL + Constant.AGENT_SAVEAGENTREFFERAL, data);\n}", "onSubmit(values) {\n this.props.addPost(values, () => {\n this.props.history.push('/');\n });\n }", "handleEvent(e) { \n let firstName= document.getElementById(\"firstName\").value;\n let lastName= document.getElementById(\"lastName\").value;\n let body={firstName,lastName};\n ajax\n .post('http://localhost:3000/posts', body)\n .then(response => {\n console.log(`POST successful: ${response.status} ${response.statusText}`);\n })\n .catch(error => {\n console.log(error);\n });\n }", "static new_post(req, dynamoDb, callback) {\n if (Login.authenticate(req)) {\n const post = {\n staging: true,\n postId: 10\n };\n callback('render', 'posts/new', {post: post});\n } else {\n callback('redirect', '/login');\n }\n }", "function doPost(e) {\r\n // data e kita verifikasi\r\n var update = tg.doPost(e);\r\n\r\n // jika data valid proses pesan\r\n if (update) {\r\n prosesPesan(update);\r\n }\r\n}", "function post(req, res, next) {\n const prop = toProp(req.params.resource)\n req.body[prop] = toId(req.params.id)\n req.url = `/${req.params.nested}`\n next()\n }", "postNewBlock() {\n this.server.route({\n method: 'POST',\n path: '/api/block',\n handler: (request, h) => {\n return new Promise ((resolve,reject)=>{\n var ctype = request.headers[\"content-type\"];\n if (!ctype || ctype.indexOf(\"application/json\") !== 0) {\n reject (Boom.badRequest(\"Wrong content-type. Required \\\"application/json\\\"\"));\n }\n const blockdata = request.payload.body;\n if (typeof blockdata === \"undefined\" || !blockdata || blockdata.trim().length === 0) { \n reject(Boom.badRequest(\"Bad Request expecting {\\\"data\\\":\\\"block body\\\"}\"));\n } else {\n this.blockChain.addBlock(new BlockClass.Block(blockdata)).then ((newblock)=>{\n resolve (newblock);\n });\n }\n });\n }\n });\n }", "async send ({ route, data, headers = {}}) {\n return await Axios.post( route, data, headers )\n }", "addPostRoute(route, ...handlers) {\n this.addRoute('post', route, ...handlers);\n }", "function onPostSuccess(data,status)\n {\n\t\t\tconsole.log(\"Server status (POST): \" + status);\n }", "createPost(event){\n // prevent default stops the page from auto reloading on form submit\n event.preventDefault();\n // this grabs the data from the form \n let formData = event.target;\n // creates a JavaScript object\n let rawPost = {\n body: formData.body.value\n };\n // console.log(\"creating the post\")\n PostService.createPost(rawPost);\n // form reset says go clear that form\n formData.reset();\n _draw();\n }", "function postName() {\n logPadded(\"/GET \" + AUT_HOSTNAME);\n let post_api = new AUT.POST_API();\n let req = rb.setAPI(post_api)\n .replaceInURL('{{post}}', 'post')\n .replaceInJSONBody('{{name}}','Gabriel')\n .addHeader('Content-Type', 'application/json')\n .replaceInHeaders('{{Bearer}}','MyToken')\n\n let res = req.send();\n let pass = check(res, {\n 'Request returns HTTP 200 OK': (r) => res.status === 200,\n });\n\n logPadded(JSON.stringify(rb.toString(), null, 2));\n logResponseDetails(res);\n return res;\n}", "forwardMessageToAPI(message) {\n\t\tthis.connection.publish(\"post\", message, {}, () => {});\n\t}", "save(data){\nreturn this.post(Config.API_URL + Constant.AGENT_SAVE, data);\n}", "post(uri, argsOrCallback, callback) {\n this.request(\"POST\", uri, argsOrCallback, callback);\n }", "function onSubmitRegister(event){\r\n fetch('/register_admin',{\r\n method: 'put',\r\n headers: {\r\n 'Content-Type':'application/json',\r\n 'Accept':'application/json'\r\n },\r\n body: JSON.stringify({\r\n userName: localStorage.getItem(\"Admin\"),\r\n name: userData.name,\r\n contactNumber: userData.contactNumber,\r\n adminEmail: userData.adminEmail,\r\n adharNumber: userData.adharNumber,\r\n category: userData.category,\r\n address: userData.address,\r\n pin: userData.pin,\r\n district: userData.district,\r\n state: userData.state,\r\n timingsopen: userData.timingsopen,\r\n timingsclose: userData.timingsclose,\r\n license: userData.license,\r\n jobdescription: userData.jobdescription,\r\n visitingCharges: userData.visitingCharges\r\n })\r\n }).then(res => res.json({\r\n Message: 'Successfully send the data'\r\n })) \r\n }", "post(url, body, options = {}) {\n return this.request('POST', url, addBody(options, body));\n }", "function post(path, data, headers, callback) {\r\n \trequest(path, \"POST\", data, headers, callback);\r\n }", "function method() {\n return \"post\";\n}", "function method() {\n return \"post\";\n}", "onSubmit(e) {\n e.preventDefault();\n const visitor = {\n name: this.state.name,\n email: this.state.email,\n phone: this.state.phone,\n hostName: this.state.hostName,\n address: this.state.address\n\n }\n\n console.log(visitor);\n\n axios.post('http://localhost:9000/visitor/addInfo', visitor)\n .then(res => {\n console.log(res.data);\n\n setTimeout(() => window.location = '/checkOutPage/' + res.data, 1000);\n })\n .catch(err => console.log(err))\n\n\n\n\n\n }", "postRequest(ntsReq) {\n\tconst uid = this.props.uid;\n\tconst requests = this.state.requests;\n\tconst key = `request-${ntsReq.id}`;\n\tconst path = `requests/${key}`;\n\tif (uid == null)\n\t\treturn;\n\t// push the request key and its data. \n\tbase.post(path, {\n data: ntsReq,\n then(err){\n if(!err){\n \tconsole.log(err); \n }\n }\n\t});\n\tconst vesselKey = `vessel-${ntsReq.vesselId}`;\n\t// update the vessel to active\n\tbase.post(`/active-vessels/${vesselKey}`, {\n data: this.state.vessels[vesselKey],\n then(err){\n if(!err){\n console.log(err);\n }\n }\n\t});\n\t// Send Request Email Confirmation\n\tntsReq['email'] = this.state.email;\n\tntsReq['displayName'] = this.state.displayName;\n\tthis.sendJSONEmail('mailer/request-submitted', ntsReq);\n}", "function post(body) {\n\tif (body)\n\t\trequest(body.url, (res, err) => {\n\t\t\tif (err) return err\n\t\t\treturn console.log(res)\n\t\t})\n}", "function submitCallback(data,page, handler){\n\tvar request = createRequest();\n\tif(request){\n\t\t\t// prepare request\n\t\t\trequest.open('POST', page, true);\n\t\t\trequest.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\n\t\t\t// when the request is answered, relayResponse() will be called\n\t\t\trequest.onreadystatechange = function(){ relayResponse(request, handler); }\n\n\t\t\t// fire off the request\n\t\t\trequest.send(data);\n\t}\n\telse{\n\t\t// request object wasn't instantiated\n\t\thandler(false, 'Unable to create request object.');\n\t}\n}", "post() {\n throw \"post not implemented yet\";\n }", "function generalPOST ( genHost, genPath, post_data, err, res )\n{\n\t// check if arg param err does not exist\n\tif (typeof(err) != \"function\")\n\t{\n\t\terr = function(e) \n\t\t{\n\t\t\tif(debug) debugLog(\"Lost connection to \" + genHost + \"removing from ring\");\n\n\t\t\ttokenRing.removeRingMember(genHost);\n\n\t\t\tprocessApproval(genHost);\n\n\t\t\tif(debug) debugLog(\"generalPOST err called \"+ e);\n\t\t};\n\t}\n\n\t// check if arg param res does not exist\n\tif (typeof(res) != \"function\")\n\t{\n\t\tres = function(r) {} ;\n\t}\n\n\tvar dataString = JSON.stringify( post_data );\n\n\tvar headers = {\n\t\t'Content-Type': 'application/json',\n\t\t'Content-Length': dataString.length\n\t};\n\n\tvar post_options = {\n\t\thost: genHost,\n\t\tport: '3000',\n\t\tpath: genPath,\n\t\tmethod: 'POST',\n\t\theaders: headers\n\t};\n\n\tvar post_request = http.request(post_options, function(res){\n\t\tres.setEncoding('utf-8');\n\t\t\n\t\tvar responseString = '';\n\n\t\tres.on('data', function(data){\n\t\t\tresponseString += data;\n\t\t});\n\n\t\tres.on('end', function(){\n\t\t\t//var resultObject = JSON.parse(responseString);\n\t\t});\n\t});\n\t\n\tpost_request.on('error', err );\n\tpost_request.write(dataString);\n\tpost_request.end();\n}", "function endpointHandler(req, res) {\n\n // Extract stuff we're interested in from the POST.\n const refererQueryParams = utils.extractQueryParams(req.headers['referer']);\n // const userLogin = req.body['custom_canvas_user_loginid'];\n // const assignmentId = refererQueryParams['assignment'];\n\n // Secret path for debugging that shows us what is getting passed to the endpoint\n // https://ourdomain.instructure.com/accounts/1/external_tools/67839876483?display=borderless&assignment=abcxyz&route=showpost\n if (refererQueryParams['route'] === 'showpost') {\n postParamsHandler(req, res); \n } else if (isValidRequest('POST', process.env.CST_LTI_LAUNCH_URL, req.body)) {\n // Special redirect handling for particular user first names\n var firstName = req.body['custom_person_name_given'];\n if (['Candidate', 'Teacher'].includes(firstName)) {\n termRedirectHandler(req, res, '989');\n } else { // Normal redirect handling']\n redirectHandler(req, res);\n }\n } else {\n res.send('OAuth post not authenticated');\n }\n}", "watch_post ( ) {\n let _that = this;\n yootil.form.any_posting().each(function(){\n $(this).find('[type=\"submit\"]').mousedown(function(){\n let packet = _that.intercept_post();\n _that.send(packet);\n });\n });\n }", "function AjaxRequestPost(objForm,actionPage){\r\n\tAjaxRequestPostWithHandler(objForm,actionPage,SuccessfulOperation)\r\n}", "function postPost(req, res) {\n let post = req.body;\n addExtraPostProperties(post);\n log.msg('adding post ' + JSON.stringify(post));\n postModel\n .create(post)\n .then(() => {\n addPostToBackup(post);\n res.status(200).send();\n })\n .catch((err) => {\n res.status(500).send(err);\n log.err('post_database:postPost:' + err);\n });\n}", "function submitPost(Post) {\n $.post(\"/spotAFriends/posts\", Post, function() {});\n }", "post(opts) {\n opts.method = \"post\";\n\t\treturn this.request(opts);\n\t}", "addPost(){\n\n }", "function post_action(obj){\r\n$.ajax({\r\n type:\"post\",\r\n url:\"https://5ef88b09ae8ccb0016fd725b.mockapi.io/data_to_do\",\r\n data:obj\r\n})\r\n}", "async function handleSubmit() {\n // check what text was put into the form field\n let loc = await document.getElementById('location').value;\n const postURL = 'http://localhost:8800/inputSubmit';\n // call to post function\n await postData(postURL, loc);\n}", "function recordResponse(Post) {\n $.post(\"/api/response/\", Post, function() {\n // window.location.href = \"/\";\n console.log(\"Posted: \" + JSON.stringify(Post));\n });\n}", "function submitBtnHandler(e){\n e.preventDefault();\n let form = document.querySelector('form');\n\n let formData = processForm(form);\n let path = document.getElementById('stackID').value;\n let url = `${form.action}${path.replace(' ','')}`;\n \n xhr.onload = success;\n\n if(form.method === 'post'){\n url += `/${formData[\"act\"]}`;\n xhr.open(form.method,url,true);\n xhr.send(JSON.stringify(formData));\n return;\n }\n\n xhr.open(form.method,url,true);\n xhr.send();\n}", "function submitPost(){\n const title = document.querySelector('#title').value;\n const body = document.querySelector('#body').value;\n const id = document.querySelector('#id').value;\n\n const data = {\n title, // em ES6, esta linha equivale a title:title\n body // em ES6, esta linha equivale a body:body\n }\n\n // verifica que campos do form nao estao vazios\n if (title === '' || body === '') {\n ui.showAlert('Please fill in all fields', 'alert alert-danger');\n } else {\n\n // condicional verifica se eh um estado de ADD ou EDIT, pois o campo oculto de ID vem vazio por padrao, e eh limpo ao cancelar o estado de edicao\n if (id === '') {\n // cria post\n http.post('http://localhost:3000/posts', data)\n .then(data => {\n // confirma envio do post\n ui.showAlert('Post added', 'alert alert-success');\n // limpa campos do formulario\n ui.clearFields();\n \n // retorna na interface todos os posts, inclusive o que acabamos de adicionar\n getPosts();\n })\n .catch(err => console.log(err));\n } else {\n // edita post\n http.put(`http://localhost:3000/posts/${id}`, data)\n .then(data => {\n // confirma edicao do post\n ui.showAlert('Post updated', 'alert alert-success');\n // retorna estado para ADD\n ui.changeFormState('add');\n \n // retorna na interface todos os posts, inclusive o que acabamos de editar\n getPosts();\n })\n .catch(err => console.log(err));\n \n }\n }\n}", "save(data){\nreturn this.post(Config.API_URL + Constant.REFFERAL_SAVE, data);\n}", "Post() {\n return {\n method: 'POST',\n path: '/contact',\n config: {\n description: 'Create a contact ',\n notes: 'Create a new contact and returns it.',\n tags: ['api'],\n handler: (request, reply) => {\n return this.BasePostHandler(this.GetCollectionName(), request.payload)\n .then((item) => {\n reply(item);\n })\n .catch((err) => {\n reply(Boom.wrap(err, 400));\n })\n\n },\n validate: {\n payload: {\n name: joi.string().required().description(\"Name of the contact person\"),\n phonenumber: joi.phone.e164().optional().allow('').description(\"The contact's phone number\"),\n email: joi.string().email().optional().allow('').description(\"The contact's email\"),\n address: joi.string().optional().allow('').description(\"The contact's address\"),\n birthday: joi.date().iso().optional().max('now').allow('').description(\"The contact's birthday\"),\n picture: joi.string().optional().allow('').description(\"The contact's picture\"),\n }\n }\n }\n };\n }", "onSubmit(props) {\n\t\tthis.props.createPost(props)\n\t\t .then(() => {\n\t\t \t// blog has been created,\n\t\t \t// So we navigate the user to index\n\t\t \t// We navigate by calling 'this.context.router.push'\n\t\t \t// with the new path to navigate to.\n\t\t \tthis.context.router.push('/');\n\t\t });\n\t}", "function post(event) {\n\n event.stopPropagation();\n\n return core.ajax('POST', url + 'new',\n function(xhr, resolve){\n logFeedback(xhr);\n\n resolve(event);\n\n },\n getMessage(),\n contentJson)\n .then(refresh)\n }", "submitStarData() {\n this.server.route({\n method: 'POST',\n path: '/block',\n handler: async (request, h) => {\n const result = await this.mempool.verifyAddressRequest(request.payload);\n if (result.address !== undefined) {\n //add block to blockchain\n let blockResult = await this.blockchain.addBlock(new BlockClass.Block(result));\n return await this.blockchain.addDecodedStoryToReturnObj(blockResult); \n }\n return result; \n }\n });\n }", "function submitClothing(Clothing) {\n $.post(\"/api/top/\", Clothing, function() {\n window.location.href = \"/blog\";\n });\n }", "init() {\n this.router.post('/', this.extract);\n this.router.post('/verify', this.verify);\n }", "function generalPOST ( genHost, genPath, post_data,portNum, err, res )\n{\n if( typeof(portNum) == 'undefined' )\n {\n portNum = '3000';\n if (debug) console.log(\"Using default port\");\n }\n // check if arg param err does not exist\n if (typeof(err) != \"function\")\n {\n err = function(e) \n {\n if(debug) console.log(\"Lost connection to \" + genHost + \"removing from ring\");\n\n removeRingMember(genHost);\n\n// processApproval(genHost);\n\n if(debug) console.log(\"generalPOST err called \"+ e);\n };\n }\n\n // check if arg param res does not exist\n if (typeof(res) != \"function\")\n {\n res = function(r) {} ;\n }\n\n var dataString = JSON.stringify( post_data );\n\n var headers = {\n 'Content-Type': 'application/json',\n 'Content-Length': dataString.length\n };\n\n var post_options = {\n host: genHost,\n port: portNum,\n path: genPath,\n method: 'POST',\n headers: headers\n };\n\n var post_request = http.request(post_options, function(res){\n res.setEncoding('utf-8');\n \n var responseString = '';\n\n res.on('data', function(data){\n responseString += data;\n });\n\n res.on('end', function(){\n //var resultObject = JSON.parse(responseString);\n });\n });\n \n post_request.on('error', err );\n post_request.write(dataString);\n post_request.end();\n}" ]
[ "0.68558985", "0.6849009", "0.6802756", "0.6722503", "0.65469474", "0.6508485", "0.64831126", "0.64621675", "0.64328134", "0.6425097", "0.6380548", "0.62980235", "0.6257236", "0.6250193", "0.6210722", "0.61699176", "0.6166567", "0.6133692", "0.6129557", "0.60990965", "0.60826176", "0.60816586", "0.60775316", "0.6071216", "0.6038502", "0.60336715", "0.60304487", "0.6020589", "0.5987554", "0.5973297", "0.5972456", "0.5952593", "0.59444475", "0.59436154", "0.5933469", "0.5930523", "0.59268826", "0.5923728", "0.5907519", "0.5905754", "0.589489", "0.58840466", "0.58824766", "0.5880855", "0.5872222", "0.5852145", "0.5841341", "0.58350986", "0.582125", "0.58174706", "0.5814384", "0.5813804", "0.580652", "0.5801662", "0.5798931", "0.5797484", "0.5795137", "0.57909155", "0.5776959", "0.5769293", "0.5764805", "0.576403", "0.57583475", "0.5754835", "0.57504344", "0.5745313", "0.574482", "0.57325554", "0.5730027", "0.5728602", "0.5723705", "0.5717397", "0.57144713", "0.5712532", "0.5712532", "0.5701124", "0.5697875", "0.5697713", "0.5691781", "0.5686068", "0.56812596", "0.5681084", "0.56681705", "0.5665411", "0.56553656", "0.56521314", "0.5651221", "0.56498075", "0.5648439", "0.5647995", "0.5647207", "0.5643076", "0.5640533", "0.56359196", "0.56315297", "0.56232786", "0.56162786", "0.5596065", "0.55942893", "0.5592164", "0.55875075" ]
0.0
-1
Delete All Items with Sweet Alert Library
function del_all_item(){ Swal.fire({ title: 'Are you sure?', text: "You Want to Delete Whole TODO List!", icon: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'Yes, delete it!' }).then((result) => { if (result.value) { li.innerHTML=""; Swal.fire( 'Deleted!', 'Your TODO List Has Been Deleted.', 'success' ) } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function postDelete() {\n console.log('item deleted');\n swal({\n title: \"Dare Approved!\",\n icon: \"success\",\n button: \"Done\"\n })\n .then( () => {\n location.reload();\n })\n }", "handleDeleteButtonClick() {\n Alert.alert(\"Hold on!\", \"Are you sure you want to clear all data?\", [\n {\n text: \"Cancel\",\n onPress: () => null,\n style: \"cancel\"\n },\n { text: \"YES\", onPress: () => this.deleteAll() }\n ]);\n return true;\n }", "function alDelete(id) {\n swal({\n title: \"Bạn chắc muốn xóa bỏ?\",\n // text: \"Bạn sẽ không thể khôi phục lại bản ghi này!!\",\n type: \"warning\",\n showCancelButton: true,\n confirmButtonColor: \"#DD6B55\",\n cancelButtonText: \"Không\",\n confirmButtonText: \"Có\",\n // closeOnConfirm: false,\n },\n function (isConfirm) {\n if (isConfirm) {\n $.ajax({\n type: \"delete\",\n url: \"/report/market/\" + id,\n success: function (res) {\n if (!res.error) {\n toastr.success('Đã xóa!');\n $('#data-' + id).remove();\n }\n },\n error: function (xhr, ajaxOptions, thrownError) {\n toastr.error(thrownError);\n }\n });\n } else {\n toastr.error(\"Hủy bỏ thao tác!\");\n }\n });\n}", "function swalCancelDelete() {\n return swalWithBootstrapBtns.fire(\n 'Cancelled',\n 'Your imaginary data is safe :)',\n 'error'\n )\n}", "function DeleteI(id) {\nswal({\ntitle: 'Deseas Eliminar el Registro?',\ntext: \"Recueda,Una vez eliminado no se puede Recuperar\",\ntype: 'warning',\nshowCancelButton: true,\nconfirmButtonColor: '#3085d6',\ncancelButtonColor: '#d33',\nconfirmButtonText: 'Si,Eliminarlo!'\n}).then(function () {\n$.post(\"../../model/items/delete.php\", {\nid: id\n},\nfunction (data, status) {\nreadRecordsI();\n}\n);\n})\n}", "function deleteAlert(text) {\n swal({\n title: \"Warning\",\n text: text,\n type: \"warning\",\n showCancelButton: true,\n confirmButtonText: \"Delete\",\n cancelButtonText: \"Cancel\",\n closeOnConfirm: false\n }, function (result) {\n if (result === true) {\n //if (language === 'cy' && !(path.match(/\\/bulletins\\//) || path.match(/\\/articles\\//))) {\n if (language === 'cy') {\n path = path + '/data_cy.json';\n }\n deleteContent(collectionId, path, function () {\n viewCollectionDetails(collectionId);\n swal({\n title: \"Page deleted\",\n text: \"This page has been deleted\",\n type: \"success\",\n timer: 2000\n });\n }, function (error) {\n handleApiError(error);\n }\n );\n }\n });\n }", "function swalSuccessDelete() {\n return swalWithBootstrapBtns.fire(\n 'Deleted!',\n 'Your data has been deleted.',\n 'success'\n )\n}", "'click #remove'() {\n var id_listItem = this._id;\n swal({ \n title: \"Your task will be deleted!\", \n text: \"Are you sure to proceed?\", \n icon: \"warning\", \n buttons: [\n 'No, cancel it!',\n 'Yes, I am sure!'\n ],\n dangerMode: true,\n }).then(function(isConfirm)\n { \n if (isConfirm) \n { \n Meteor.call(\"task_list_remove\",id_listItem,function(error,result){\n if(error){\n alert(\"ERROR,THERE IS SOMETHING WRONG\");\n }\n else{\n swal({\n text : \"Your Task deleted\",\n icon : \"success\",\n });\n }\n }); \n } \n else{ \n swal(\"Your task is safe\"); \n } \n });\n }", "function delete_selected_user_reviews(message) {\n swal({\n text: message,\n icon: \"warning\",\n buttons: true,\n buttons: [sweetalert_cancel, sweetalert_ok],\n dangerMode: true,\n }).then(function (willDelete) {\n if (willDelete) {\n\n var review_ids = [];\n $(\"input[name='checkbox-table']:checked\").each(function () {\n review_ids.push(this.value);\n });\n var data = {\n 'review_ids': review_ids,\n };\n data[csfr_token_name] = $.cookie(csfr_cookie_name);\n $.ajax({\n type: \"POST\",\n url: base_url + \"admin_controller/delete_selected_user_reviews\",\n data: data,\n success: function (response) {\n location.reload();\n }\n });\n\n }\n });\n}", "function delete_post_list_item_database(item_id, post_type, message) {\n swal({\n text: message,\n icon: \"warning\",\n buttons: [sweetalert_cancel, sweetalert_ok],\n dangerMode: true,\n }).then(function (willDelete) {\n if (willDelete) {\n var data = {\n 'item_id': item_id,\n 'post_type': post_type\n };\n data[csfr_token_name] = $.cookie(csfr_cookie_name);\n $.ajax({\n type: \"POST\",\n url: base_url + \"post_controller/delete_post_list_item_post\",\n data: data,\n success: function (response) {\n $('#panel_list_item_' + item_id).remove();\n }\n });\n }\n });\n}", "function delete_task(url){\n swal({\n title: \"Are you sure?\",\n text: \"Once deleted, you will not be able to recover this labour task!\",\n icon: \"warning\",\n buttons: true,\n dangerMode: true,\n })\n .then((willDelete) => {\n if (willDelete) {\n\n $.LoadingOverlay(\"show\");\n $.ajax({\n url: url,\n type: \"DELETE\",\n \n data:{ \"_token\": $('meta[name=\"csrf-token\"]').attr('content')},\n success: function (data) {\n $.LoadingOverlay(\"hide\");\n toastr.success('Labour task successfully deleted.', 'Success', {timeOut: 5000});\n daily_task_management_table.ajax.reload(null, false);\n },\n error: function(jqXHR, textStatus, errorThrown) {\n $.LoadingOverlay(\"hide\");\n var response=jqXHR.responseJSON;\n var status=jqXHR.status;\n if(status=='404'){\n toastr.error('Invalid URL', 'Error', {timeOut: 5000});\n }else{\n toastr.error('Internal server error.', 'Error', {timeOut: 5000});\n }\n }\n });\n\n \n\n\n } \n });\n\n }", "removeAlert(id) {\n console.log('Remove Alert');\n swal({\n title: \"Are you sure?\",\n text: \"Once deleted, you will not be able to recover this project file!\",\n icon: \"warning\",\n buttons: true,\n dangerMode: true,\n })\n .then((willDelete) => {\n if (willDelete) {\n { this.removeProject(id) };\n swal(\"Poof! Your project file has been deleted!\", {\n icon: \"success\",\n\n });\n } else {\n swal(\"Your project file is safe!\");\n }\n });\n }", "function deleteconfirm(title,text,location)\n{\n swal({\n title: title,\n text: text,\n type: \"warning\",\n showCancelButton: true,\n confirmButtonText: \"OK\",\n closeOnConfirm: false,\n confirmButtonColor: \"#DD6B55\"\n },\n function(){\n window.location = location\n });\n}", "function excluir(obj){\n swal({\n title: 'Você está certo disso?',\n text: \"Ação irreversivel!\",\n type: 'warning',\n showCancelButton: true,\n confirmButtonColor: '#3085d6',\n cancelButtonColor: '#d33',\n confirmButtonText: 'Sim, tenho certeza!',\n cancelButtonText: 'Cancelar...'\n }).then((result) => \n { if (result.value) \n { \n fetch(URL_BASE +obj,{\n method:'DELETE'\n })\n //Na primera promisse nao tem o json\n //.then(response => console.log(response))\n .then(response => response.json())\n .then(json => swal(json.mensagem ))\n .then(json => printTela(json))\n }\n })\n \n \n \n}", "function acceptDelete() {\n var x = $('#data-google-drive:checkbox:checked').length;\n if (x != 0) {\n swal({\n title: 'Confirm To Delete',\n text: \"Are you sure you want to delete?\",\n type: 'warning',\n showCancelButton: true,\n confirmButtonColor: '#3085d6',\n cancelButtonColor: '#d33',\n confirmButtonText: 'Yes, delete it!'\n }).then((result) => {\n if (result.value) {\n var ids = $('tbody input[type=checkbox]:checked').map(function () {\n return $(this).val();\n }).get();\n deleteFile(ids);\n }\n });\n } else {\n swal({\n title: 'Warning',\n text: \"You have not selected file!\",\n type: 'warning',\n });\n }\n}", "function delete_selected_products_permanently(message) {\n swal({\n text: message,\n icon: \"warning\",\n buttons: true,\n buttons: [sweetalert_cancel, sweetalert_ok],\n dangerMode: true,\n }).then(function (willDelete) {\n if (willDelete) {\n var product_ids = [];\n $(\"input[name='checkbox-table']:checked\").each(function () {\n product_ids.push(this.value);\n });\n var data = {\n 'product_ids': product_ids,\n };\n data[csfr_token_name] = $.cookie(csfr_cookie_name);\n $.ajax({\n type: \"POST\",\n url: base_url + \"product_admin_controller/delete_selected_products_permanently\",\n data: data,\n success: function (response) {\n location.reload();\n }\n });\n }\n });\n}", "function removeCustomAlert() {\n console.log(\"function: removeCustomAlert\");\n\n let alertElements = $(\".customAlert\")\n\n for (let i=0; i<alertElements.length; i++){\n alertElements[i].remove();\n }\n}", "function removeAlert() {\n $.uikitNotify.remove($alert);\n }", "function deleteAllNotices() {\n axios({\n method: 'DELETE',\n url: '/deleteAllNotices'\n }).then(function () {\n store.dispatch(setNoticeDisplay(0));\n window.location.reload();\n })\n .catch(function (error) {\n console.log(error);\n })\n .then(function () {\n // always executed\n });\n}", "function contentDelete(id){\n Swal.fire({\n title: 'Are you sure?',\n text: \"You won't be able to revert this!\",\n icon: 'warning',\n showCancelButton: true,\n confirmButtonText: 'Yes, delete it!',\n customClass: {\n confirmButton: 'btn btn-primary',\n cancelButton: 'btn btn-outline-danger ml-1'\n },\n buttonsStyling: false\n }).then(function (result) {\n if (result.value) {\n $.ajax({\n url: './contents/delete/' + id,\n type: 'DELETE',\n dataType: 'json',\n contentType: 'application/json; charset=utf-8',\n success: function (data) {\n if( id != null){\n Swal.fire({\n icon: 'success',\n title: \"Deleted!\",\n text: data.message,\n customClass: {\n confirmButton: 'btn btn-success'\n }\n });\n resetForm()\n }else{\n Swal.fire({\n icon: 'error',\n title: \"Error\",\n text: data.message,\n customClass: {\n confirmButton: 'btn btn-success'\n }\n });\n }\n },\n error: function (err) {\n Swal.fire({\n icon: 'error',\n title: \"Error\",\n text: \"An error occurred during the delete operation\",\n customClass: {\n confirmButton: 'btn btn-success'\n }\n });\n console.log(err)\n }\n })\n }\n });\n}", "function deleteIt(){\n \tupdateDB(\"delete\", pageElements.alertText.dataset.id);\n }", "deleteMotocycle(maSP){\n Alert.alert(\"Xác nhận!\", \"Bạn có chắc chắn muốn xóa dữ liệu?\", [\n {text: \"Hủy\", onPress: ()=>console.log(\"Cancel tapped\")},\n {text: \"Đồng ý\", onPress: ()=> this.deleteData(maSP)},\n ],\n {cancelable: false});\n }", "function delete_li(rm){\nrm.parentNode.remove()\nsweetAlertSuccessMsg(\"Deleted Successfully\")\n}", "function DeleteConfirmAlert(me, first_messages, final_messages, datatable_name){\n $.confirm({\n title: 'Confirmation',\n content: first_messages,\n icon: 'fa fa-exclamation-triangle',\n animation: 'scale',\n closeAnimation: 'scale',\n opacity: 0.5,\n buttons: {\n 'confirm': {\n text: 'Proceed',\n btnClass: 'btn-blue',\n action: function(){\n $.confirm({\n title: 'This maybe critical',\n content: final_messages,\n icon: 'fa skull-crossbones',\n animation: 'scale',\n closeAnimation: 'zoom',\n buttons: {\n confirm: {\n text: 'Yes, sure!',\n btnClass: 'btn-danger',\n action: function(){\n $.ajaxSetup({\n headers: {\n 'X-CSRF-TOKEN': $('meta[name=\"csrf-token\"]').attr('content')\n }\n });\n var url = me.data('url');\n $.ajax({\n url: url,\n type: 'DELETE',\n dataType: 'json',\n data: {method: '_DELETE', submit: true},\n success: function(data){\n var session = data.msg;\n if(data.status == 'success'){\n $(datatable_name).DataTable().draw(false);\n if (session != \"\"){\n Swal.fire({\n title: 'Good job!',\n text: session,\n type: 'success',\n // confirmButtonText: 'Deposit Funds'\n }).then(function() {\n // window.location = \"https://cryptolico.com/portal/deposit-fund\";\n });\n }\n }else{\n if (session != \"\"){\n Swal.fire({\n title: 'Sorry!',\n text: session,\n type: 'warning',\n })\n }\n }\n \n }\n })\n }\n },\n cancel: function(){\n //$.alert('you clicked on <strong>cancel</strong>');\n }\n }\n });\n }\n },\n cancel: function(){\n //$.alert('you clicked on <strong>cancel</strong>');\n },\n \n }\n });\n\n}", "function delete_user(url){\nswal({\ntitle: \"Are you sure?\",\ntext: \"Once deleted, you will not be able to recover this unit!\",\nicon: \"warning\",\nbuttons: true,\ndangerMode: true,\n})\n.then((willDelete) => {\nif (willDelete) {\n\n $.LoadingOverlay(\"show\");\n $.ajax({\n url: url,\n type: \"DELETE\",\n data:{ \"_token\": $('meta[name=\"csrf-token\"]').attr('content')},\n success: function (data) {\n\n units_table.ajax.reload(null, false);\n $.LoadingOverlay(\"hide\");\n toastr.success('Unit successfully deleted.', 'Success', {timeOut: 5000});\n },\n error: function(jqXHR, textStatus, errorThrown) {\n $.LoadingOverlay(\"hide\");\n var response=jqXHR.responseJSON;\n var status=jqXHR.status;\n if(status=='404'){\n toastr.error('Invalid URL', 'Error', {timeOut: 5000});\n }else if(status=='400'){\n if(response.message){\n toastr.error(response.message, 'Error', {timeOut: 5000});\n }else{\n toastr.error('Server error', 'Error', {timeOut: 5000});\n }\n \n }else{\n toastr.error('Internal server error.', 'Error', {timeOut: 5000});\n }\n }\n });\n\n} \n});\n\n}", "function deleteSession() {\n\n swal({\n title: '?אתה בטוח רוצה לצאת מהאתר',\n type: 'warning',\n showCancelButton: true,\n confirmButtonColor: '#3085d6',\n cancelButtonColor: '#d33',\n confirmButtonText: 'כן, תוציא אותי',\n cancelButtonText: 'ביטול',\n confirmButtonClass: 'btn btn-success btn-lg',\n cancelButtonClass: 'btn btn-danger btn-lg',\n buttonsStyling: false\n }).then(function () {\n $.ajax({\n type: 'POST',\n url: endSessionBuyer,\n data: {},\n success: function (response) {\n localStorage.clear();\n window.location.href = \"http://buy-with-friends.com\";\n }\n });\n })\n}", "function deleteAllCompletedTodos() {\n // Write your code here...\n}", "function deleteAllCompletedTodos() {\n // Write your code here...\n}", "function deleteAllCompletedTodos() {\n // Write your code here...\n}", "function deleteWishlistItem(id) {\n // alert(id);\n\n var wishlist = JSON.parse(localStorage.getItem('wishlistObj'));\n wishlist.splice(id, 1);\n localStorage.setItem('wishlistObj',JSON.stringify(wishlist)); \n console.log(JSON.parse(localStorage.getItem('wishlistObj')));\n\n Swal.fire({\n title: \"<i>SUCCESS</i>\", \n html: \"item successfully removed from the <b>WISHLIST</b>\", \n confirmButtonText: \"<u>close</u>\", \n });\n\n}", "function deleteAll() {\r\n todoList.innerHTML = \"\";\r\n alert(\"Deleted Successfully\");\r\n}", "clearAlert() {\n const currentAlert = document.querySelector('.is-danger'); //get the alert with class 'is-danger'\n if (currentAlert) { //if there is such alert then remove it\n\n currentAlert.remove();\n \n }\n }", "function deleteEvent(eventID) \n {\n swal({\n title: \"Attention\",\n text: \"Are you sure you want to delete this event?\",\n type: \"warning\",\n showCancelButton: true,\n confirmButtonColor: \"#DD6B55\",\n confirmButtonText: \"Yes!\",\n cancelButtonText: \"No!\"\n /*closeOnConfirm: false,\n closeOnCancel: false*/\n }).then(function(result){\n\n if (result.value) \n {\n //name vairables\n var table = $('#events');\n var rowCount = table.find('tbody tr').length; \n\n blockUI(); \n\n $.ajax({\n type: 'DELETE',\n url: API_URL_ROOT+'v1/admin/events/delete/'+eventID,\n dataType: 'json',\n headers: {Authorization:'Bearer '+token},\n success: function(response)\n {\n if(response.error == false)\n {\n unblockUI();\n showSimpleMessage(\"Success\", response.message, \"success\");\n rowCount > 1 ? table.DataTable().ajax.reload(null, false) : loadEVents(); \n }\n else\n {\n unblockUI();\n showSimpleMessage(\"Attention\", response.message, \"error\");\n }\n },\n error: function(req, status, error)\n {\n showSimpleMessage(\"Attention\", \"ERROR - \"+req.status+\" : \"+req.statusText, \"error\");\n }\n });\n } \n else \n {\n showSimpleMessage('Canceled', 'Process Abborted', 'error');\n }\n });\n }", "function deleteFunction() {\n event.preventDefault(); // prevent form submit\n var form = event.target.form; // storing the form\n swal({\n title: \"Are you sure?\",\n text: \"But you will still be able to retrieve this data.\",\n type: \"warning\",\n showCancelButton: true,\n confirmButtonColor: \"#DD6B55\",\n confirmButtonText: \"Yes, delete it!\",\n cancelButtonText: \"No, cancel please!\",\n closeOnConfirm: false,\n closeOnCancel: false\n },\n function (isConfirm) {\n if (isConfirm) {\n form.submit(); // submitting the form when user press yes\n } else {\n swal(\"Cancelled\", \"Your data is safe :)\", \"error\");\n }\n });\n}", "allDelete(){\n\n}", "function destroyData(id) {\n // id is passed by onclick function\n swal({\n title: \"Are you sure you want to delete?\",\n text: \"You won't be able to revert this!\",\n icon: \"warning\",\n buttons: true,\n dangerMode: true,\n }).then((willDelete) => {\n if (willDelete) {\n $.ajax({\n type: \"POST\",\n DataType: \"json\",\n url: \"/categoriesDestroyData/\" + id,\n success: function (data) {\n getAllData();\n },\n });\n } else {\n }\n });\n}", "deleteAllItem() {\n this.items = [];\n }", "function deleteAll() {\n dispatch({\n type: TodosActionTypes.DELETE_ALL\n });\n }", "function deletePostListItemDatabase(itemId, postType, message) {\n swal({\n text: message,\n icon: 'warning',\n buttons: [VrConfig.textCancel, VrConfig.textOk],\n dangerMode: true,\n }).then(function (willDelete) {\n if (willDelete) {\n var data = {\n 'item_id': itemId,\n 'post_type': postType\n };\n addCsrf(data);\n $.ajax({\n type: 'POST',\n url: VrConfig.baseURL + '/PostController/deletePostListItemPost',\n data: data,\n success: function (response) {\n $('#panel_list_item_' + itemId).remove();\n }\n });\n }\n });\n}", "deleteSavedItems() {\n this.savedItemsDeleteListButton.value.forEach(function (el) {\n el.click()\n })\n }", "function queryDeleteAllTask() {\n\tnavigator.notification.confirm(\n 'Вы действительно хотите удалить все задачи из этого списка?', // message\n deleteAllTask, // callback to invoke with index of button pressed\n 'Удаление задач', // title\n ['Да','Нет'] // buttonLabels\n\t);\t\n}", "function deleteDepartment(deptId, department_tr) {\n const swalWithBootstrapButtons = Swal.mixin({\n customClass: {\n confirmButton: 'btn btn-success',\n cancelButton: 'btn btn-danger'\n },\n buttonsStyling: false\n });\n swalWithBootstrapButtons.fire({\n title: `'${department_tr}' silenecek!`,\n text: `'${department_tr}' silmek iseter misiniz?`,\n type: 'warning',\n showCancelButton: true,\n confirmButtonText: 'Evet, sil !',\n cancelButtonText: 'Hayır , silme!',\n reverseButtons: true\n }).then((result) => {\n if (result.value) {\n $.ajax({\n type: \"GET\",\n contentType: \"application/json;charset=utf-8\",\n url: HttpUrls.DeleteDepartment + deptId,\n success: (num) => {\n if (num !== 0) {\n GetAllDepartmentAjaxCall();\n GetAllDeprtmentCount(); \n Swal.fire({\n title: 'Başarılı!',\n text: 'Department Başarı ile Silendi',\n type: 'success',\n timer: 1500\n\n });\n }\n else {\n Swal.fire({\n type: 'error',\n title: 'Oops...',\n text: 'Beklenmeyen bir hata oluştu',\n timer: 1500\n });\n }\n }\n\n });\n }\n \n });\n}", "function deletePost(blogID) \n {\n swal({\n title: \"Attention\",\n text: \"Are you sure you want to delete this post?\",\n type: \"warning\",\n showCancelButton: true,\n confirmButtonColor: \"#DD6B55\",\n confirmButtonText: \"Yes!\",\n cancelButtonText: \"No!\"\n /*closeOnConfirm: false,\n closeOnCancel: false*/\n }).then(function(result){\n\n if (result.value) \n {\n //name vairables\n var table = $('#posts');\n blockUI(); \n\n $.ajax({\n type: 'DELETE',\n url: `${API_URL_ROOT}/blog/${blogID}`,\n dataType: 'json',\n headers: {'x-access-token':token},\n success: function(response)\n {\n if(response.error == false)\n {\n unblockUI();\n showSimpleMessage(\"Success\", response.message, \"success\");\n table.DataTable().ajax.reload(null, false) \n }\n else\n {\n unblockUI();\n showSimpleMessage(\"Attention\", response.message, \"error\");\n }\n },\n error: function(req, status, error)\n {\n unblockUI();\n showSimpleMessage(\"Attention\", \"ERROR - \"+req.status+\" : \"+req.statusText, \"error\");\n }\n });\n } \n else \n {\n showSimpleMessage('Canceled', 'Process Abborted', 'error');\n }\n });\n }", "function DeleteApprovalSheetDocument(obj) {\r\n $(\"#loadingPage\").fadeIn();\r\n var approvalSheetDocumentID = (obj.id).slice(2);\r\n var documentName = unescape(obj.name);\r\n swal({\r\n title: '',\r\n text: \"Are you sure you want to <span style='font-weight:700'>delete '\" + documentName + \"'</span>?\",\r\n type: 'warning',\r\n showCancelButton: true,\r\n confirmButtonText: 'Yes',\r\n cancelButtonText: 'No',\r\n html: true\r\n },\r\n function (confirmed) {\r\n if (confirmed) {\r\n $(\"#loadingPage\").fadeIn();\r\n $.ajax({\r\n url: vApiBaseSiteUrl +'/api/accounts/' + localStorage.AccountID + '/documents?documentid=' + approvalSheetDocumentID,\r\n type: 'DELETE',\r\n dataType: 'json',\r\n \"Content-Type\": \"application/json\",\r\n headers: { 'eContracts-ApiKey': localStorage.APIKey, username: localStorage.UserName },\r\n cache: false,\r\n success: function (data) {\r\n //manoj\r\n $(\"#btnApprovalSheetCreate\").css('display', '');\r\n $(\"#lblApprovalSheetTempdocuments\").html(\"\");\r\n $(\"#lblApprovalSheetTempdocuments\").css('display', 'none');\r\n clearTimeout(cleartimevalue);\r\n cleartimevalue = setTimeout(refreshdocuemnt, 10000);\r\n\r\n //$(\"#ddlDocumentList\").trigger('chosen:updated');\r\n $(\"#loadingPage\").fadeOut();\r\n },\r\n error: function () {\r\n $(\"#loadingPage\").fadeOut();\r\n }\r\n });\r\n }\r\n return;\r\n });\r\n}", "function clear_alert() {\n let action = {\n type: 'clear/set',\n data: \"\",\n }\n store.dispatch(action);\n }", "function initDelete() {\n\t\t\t$list.find('[aria-click=\"delete\"]').on('click', function () {\n\t\t\t\tvar $item = $(this).closest('.item');\n\n\t\t\t\tpopupPrompt({\n\t\t\t\t\ttitle: _t.form.confirm_title,\n\t\t\t\t\tcontent: _t.investor.view.manager.delete_confirm,\n\t\t\t\t\ttype: 'warning',\n\t\t\t\t\tbuttons: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttext: _t.form.yes,\n\t\t\t\t\t\t\ttype: 'warning',\n\t\t\t\t\t\t\thandle: function () {\n\t\t\t\t\t\t\t\ttoggleLoadStatus(true);\n\t\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\t\t\turl: '/investors/delete/' + $item.data('value'),\n\t\t\t\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\t\t\t\tcontentType: 'JSON'\n\t\t\t\t\t\t\t\t}).always(function () {\n\t\t\t\t\t\t\t\t\ttoggleLoadStatus(false);\n\t\t\t\t\t\t\t\t}).done(function (data) {\n\t\t\t\t\t\t\t\t\tif (data.status == 0) {\n\t\t\t\t\t\t\t\t\t\t$item.parent().remove();\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\tpopupPrompt({\n\t\t\t\t\t\t\t\t\t\t\ttitle: _t.form.error_title,\n\t\t\t\t\t\t\t\t\t\t\tcontent: _t.form.error_content,\n\t\t\t\t\t\t\t\t\t\t\ttype: 'danger'\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}).fail(function () {\n\t\t\t\t\t\t\t\t\tpopupPrompt({\n\t\t\t\t\t\t\t\t\t\ttitle: _t.form.error_title,\n\t\t\t\t\t\t\t\t\t\tcontent: _t.form.error_content,\n\t\t\t\t\t\t\t\t\t\ttype: 'danger'\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\t{\n\t\t\t\t\t\t\ttext: _t.form.no\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}", "function deleteDraft_process() {\n $('body').on('click', '[data-action=\"delete_draft\"]', function(e) {\n if (e) {\n e.preventDefault();\n }\n var $object = $(this);\n swal({\n title: \"Are you sure?\",\n text: \"You will not be able to recover this draft! Please note that history function are only for published answer/question\",\n type: \"warning\",\n showCancelButton: true,\n confirmButtonColor: \"#DD6B55\",\n confirmButtonText: \"Yes, delete it!\",\n closeOnConfirm: false\n }, function(){\n $.post('/draft/' + $object.data('id') + '/delete', {\n type : $object.data('type')\n }, function() {\n // refresh page\n swal({\n title : \"Deleted!\",\n text : \"Your draft has been deleted.\",\n type : \"success\"\n }, function() {\n window.location.reload();\n });\n });\n });\n })\n}", "deleteClick(e, key) {\n e.preventDefault();\n swal({\n title: \"¿Confirmar acción?\",\n text: this.props.delete_btn.title,\n icon: \"warning\",\n dangerMode: true,\n buttons: [\"Cancelar\", \"Eliminar\"],\n })\n .then(willDelete => {\n if (willDelete) {\n let url = `${this.props.delete_btn.path}/${key}`;\n this.handleRefresh(false);\n\n GetApiData(url, 'DELETE', null, (status, data, msg) => {\n if (status) {\n // let msg = 'El Registro se Elimino Correctamente';\n toast(msg, {\n type: \"success\",\n position: \"bottom-center\"\n });\n this.reloadDataTable();\n } else {\n toast(msg, {\n type: \"error\",\n position: \"bottom-center\"\n });\n }\n this.handleRefresh(true);\n });\n\n }\n });\n }", "function delete_note(rowid){\n swal({\n title: \"Are you sure?\",\n text: \"You won't be able to revert this Message!\",\n type: \"warning\",\n showCancelButton: !0,\n confirmButtonText: \"Yes,Delete\",\n cancelButtonText: \"No, Cancel!\",\n reverseButtons: !1\n }).then(function(ey) {\n if(ey.value){\n $.ajax({\n url:BASE_URL+\"/delete.note\",\n type: 'POST',\n data: {_token:$('meta[name=\"csrf-token\"]').attr('content'),rowid:rowid},\n success: function (resp) {\n console.log(resp);\n if(resp.status==0){\n swal(\"Deleted Alert!\", \"Cann't not delete\", \"error\").then(function(eyz){\n if(eyz.value){\n location.reload();\n }\n });\n }else{\n swal(\"Deleted!\", \"Your note has been deleted.\", \"success\").then(function(eyz){\n if(eyz.value){\n location.reload();\n }\n });\n }\n\n\n },\n dataType : 'json'\n });\n\n }\n\n })\n\n}", "function deleteInvoice(transactionID) \n {\n swal({\n title: \"Attention\",\n text: \"Are you sure you want to delete this invoice?\",\n type: \"warning\",\n showCancelButton: true,\n confirmButtonColor: \"#DD6B55\",\n confirmButtonText: \"Yes!\",\n cancelButtonText: \"No!\"\n /*closeOnConfirm: false,\n closeOnCancel: false*/\n }).then(function(result){\n\n if (result.value) \n {\n //name vairables\n var table = $('#invoices');\n var rowCount = table.find('tbody tr').length; \n\n blockUI(); \n\n $.ajax({\n type: 'DELETE',\n url: API_URL_ROOT+'/transactions/'+transactionID,\n dataType: 'json',\n headers: {'x-access-token':token},\n success: function(response)\n {\n if(response.error == false)\n {\n unblockUI();\n showSimpleMessage(\"Success\", response.message, \"success\");\n rowCount > 1 ? table.DataTable().ajax.reload(null, false) : loadInvoices(); \n }\n else\n {\n unblockUI();\n showSimpleMessage(\"Attention\", response.message, \"error\");\n }\n },\n error: function(req, status, error)\n {\n unblockUI();\n showSimpleMessage(\"Attention\", \"ERROR - \"+req.status+\" : \"+req.statusText, \"error\");\n }\n });\n } \n else \n {\n showSimpleMessage('Canceled', 'Process Abborted', 'error');\n }\n });\n }", "function delete_all(){\n\n $('#file_div').on(\"click\", \"#delete\", function(){\n // get data from form fields\n var supplier_name = $(\"#supplier option:selected\").text();\n var supplierid = $(\"#supplier\").val();\n\n // console.log(supplier_name);\n // console.log(supplierid);\n // console.log(pricelist_filename);\n // importExcelPricelist(true,supplier_name, supplierid, pricelist_filename, $(this));\n var type = \"delete\";\n var title = \"Are you want to delete?\";\n var message = supplier_name + \"'s pricelist files.\";\n\n confirmAction(type, title, message, null, supplier_name, supplierid, null, null, null, $(this));\n // we return false to prevent page reloading\n return false;\n });\n\n}", "addItemWalletById(id) {\r\n Alert.alert(\r\n 'Deseja excuir o cupom?',\r\n 'Esta ação não pode ser desfeita!',\r\n [\r\n { text: 'Cancelar', style: 'cancel' },\r\n { text: 'Confirmar', onPress: () => this.handledeleteItembyId(id) },\r\n ],\r\n { cancelable: false }\r\n )\r\n\r\n }", "function handleDelete() {\n console.log('clicked delete button');\n //identify the unique ID of task to be deleted\n let idToDelete = $(this).closest('tr').data('id');\n swal({\n title: \"Are you sure?\",\n text: \"Once deleted, the task will be permanently deleted from the database\",\n icon: \"warning\",\n buttons: true,\n dangerMode: true,\n })\n .then((willDelete) => {\n if (willDelete) {\n $.ajax({\n type: 'DELETE',\n url: `/todo/${idToDelete}`,\n }).then(function (response) {\n console.log('in handleDelete', response)\n getList(response);\n }).catch(function (error) {\n console.log('in handleDelete:', error);\n });\n\n\n swal(\"The task has been deleted\", {\n icon: \"success\",\n });\n } else {\n swal(\"Your task was not deleted!\");\n }\n });\n}", "function deleteItem(array) {\n // searches for every delete button\n $(\".minus_button\").each(function () {\n let deleteButton = $(this);\n // adds a click event to the specific delete button\n deleteButton.click(function (e) {\n // selects parent of the button\n // e.target.parentNode;\n let parent = $(this).parent();\n // select content from p-tag\n // parent.children[1].textContent;\n let content = parent.children().first().text();\n // see below: searchArrayForItem(array, item)\n let index = searchArrayForItem(array, content);\n\n // deletes array at click/index position\n // see documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice\n array.splice(index, 1);\n\n // deletes html\n parent.remove();\n\n // refresh count\n countListItems(array);\n });\n });\n}", "function deleteUser(userID) \n {\n swal({\n title: \"Attention\",\n text: \"Are you sure you want to delete this user?\",\n type: \"warning\",\n showCancelButton: true,\n confirmButtonColor: \"#DD6B55\",\n confirmButtonText: \"Yes!\",\n cancelButtonText: \"No!\"\n /*closeOnConfirm: false,\n closeOnCancel: false*/\n }).then(function(result){\n\n if (result.value) \n {\n //name vairables\n var table = $('#users');\n var rowCount = table.find('tbody tr').length; \n\n blockUI(); \n\n $.ajax({\n type: 'DELETE',\n url: API_URL_ROOT+'/users/'+userID,\n dataType: 'json',\n headers: {'x-access-token':token},\n success: function(response)\n {\n if(response.error == false)\n {\n unblockUI();\n showSimpleMessage(\"Success\", response.message, \"success\");\n rowCount > 1 ? table.DataTable().ajax.reload(null, false) : loadUsers(); \n }\n else\n {\n unblockUI();\n showSimpleMessage(\"Attention\", response.message, \"error\");\n }\n },\n error: function(req, status, error)\n {\n unblockUI();\n showSimpleMessage(\"Attention\", \"ERROR - \"+req.status+\" : \"+req.statusText, \"error\");\n }\n });\n } \n else \n {\n showSimpleMessage('Canceled', 'Process Abborted', 'error');\n }\n });\n }", "deleteAll() {\n\n return new Promise(resolve => {\n\n (async () => {\n\n // Abrir connection\n let request = await this.request(this.connection, this.store);\n\n // Excluir item\n request.openCursor().onsuccess = (event) => {\n\n let current = event.target.result;\n\n if (current) {\n\n let currentValue = current.value;\n\n current.delete(currentValue);\n\n current.continue();\n\n } else {\n resolve();\n }\n\n }\n\n })();\n });\n\n }", "function deleteAllMessage() {\r\n\tvar db = window.sqlitePlugin.openDatabase({\r\n\t\tname : \"PushDB\"\r\n\t});\r\n\tdb\r\n\t\t\t.transaction(function(tx) {\r\n\t\t\t\ttx\r\n\t\t\t\t\t\t.executeSql(\r\n\t\t\t\t\t\t\t\t\"delete from message where type=0 or type=1 or type=2 or type=3 \",\r\n\t\t\t\t\t\t\t\t[],\r\n\t\t\t\t\t\t\t\tfunction(tx, res) {\r\n\t\t\t\t\t\t\t\t\tvar deleteResult = res.rowsAffected;\r\n\t\t\t\t\t\t\t\t\tconsole.log(deleteResult);\r\n\t\t\t\t\t\t\t\t\tif (deleteResult !== 0) {\r\n\t\t\t\t\t\t\t\t\t\t$('.ul_pushList li').each(function() { // loops\r\n\t\t\t\t\t\t\t\t\t\t\t$(this).remove(); // Remove li one\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t$('.ul_pushList')\r\n\t\t\t\t\t\t\t\t\t\t\t\t.html(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<br/><br/><br/><p style=\"text-align:center;color:#1172b6;\">수신된 메세지가 없습니다.</p>');\r\n\t\t\t\t\t\t\t\t\t\tconsole.log(\"전체 메세지 삭제\");\r\n\t\t\t\t\t\t\t\t\t\toScroll.refresh();\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\tconsole.log(\"전체 메세지 삭제 실패\");\r\n\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});\r\n}", "function deleteAll() {\n var itemList = document.getElementsByClassName('modal-item');\n for (item = 0; item < itemList.length; item++) {\n itemList[item].style.display = 'none';\n }\n balance = 0;\n document.getElementById('amountTotal').innerHTML = balance;\n}", "function displayConfirmDeleteAgentAlert() {\n\t\t \t$(\".deleteAgent\").on(\"click\", function() {\n\t\t \t\tvar delBtn = $(this);\n\t\t \t\tswal({\n\t\t \t\t\t title: \"Are you sure?\",\n\t\t \t\t\t text: \"You will not be able to recover this agent account !\",\n\t\t \t\t\t type: \"warning\",\n\t\t \t\t\t showCancelButton: true,\n\t\t \t\t\t confirmButtonColor: \"#DD6B55\",\n\t\t \t\t\t confirmButtonText: \"Yes, delete it!\",\n\t\t \t\t\t closeOnConfirm: false,\n\t\t \t\t\t showLoaderOnConfirm: true,\n\t\t \t\t\t},\n\t\t \t\t\tfunction(){\n\t\t \t\t\t\tvar url = \"/admin/\" + $(delBtn).attr(\"admin_id\") + \"/delete/agent/\" + $(delBtn).attr(\"agent_id\");\n\t\t \t\t\t\t$.ajax( url )\n\t\t \t\t\t\t .done(function(msg) {\n\t\t \t\t\t\t swal({\n\t\t \t\t\t\t \ttitle: \"The action was successfully completed !\",\n\t\t \t\t\t\t \ttext: \"The agent number \" + $(delBtn).attr(\"agent_id\") + \" has been successfully deleted.\",\n\t\t \t\t\t\t \ttype: \"success\",\n\t\t \t\t\t\t \ttimer: 3000,\n\t\t \t\t\t\t \tshowConfirmButton: false\n\t\t \t\t\t\t });\n\t\t \t\t\t\t })\n\t\t \t\t\t\t .fail(function() {\n\t\t \t\t\t\t\t swal(\"Error!\", \"Agent account not found or already deleted !\", \"error\");\n\t\t \t\t\t\t });\n\t\t \t\t\t\t\n\t\t \t\t\t\tsetTimeout(function() {\n\t\t \t\t\t\t\t$(delBtn).parent().parent().remove();\n\t\t \t\t\t\t}, 3000);\n\t\t \t\t\t});\n\t\t \t});\n\t\t }", "delete() {\n this.items().then(instances => {\n instances.forEach(instance => {\n instance.delete();\n })\n }).catch(error => {\n debugger;\n throw error;\n })\n }", "function deleteConfirm() {\n swal({\n title: \"Are you sure?\",\n text: \"You will not be able to recover this layer!\",\n type: \"warning\",\n showCancelButton: true,\n confirmButtonColor: \"#DD6B55\",\n confirmButtonText: \"Yes, delete it!\",\n closeOnConfirm: true\n },\n function(){\n\t\t\tremoveLayer();\n });\n}", "function removeAllData() {\r\n if (confirm(\"Pressing OK will clear all saved data.\\n\"+\r\n \"This action can not be undone!\\nPress Cancel to retrun without clearning.\")){\r\n let transactionTable = document.getElementById('transactionTableBody');\r\n while(transactionTable.rows.length > 0){\r\n transactionTable.deleteRow(transactionTable.rows.length-1);\r\n }\r\n budget.clearAllData();\r\n } else {\r\n // The user cancelled. Do nothing!\r\n }\r\n}", "function deleteImage(imageID) \n {\n swal({\n title: \"Attention\",\n text: \"Are you sure you want to delete this image?\",\n type: \"warning\",\n showCancelButton: true,\n confirmButtonColor: \"#DD6B55\",\n confirmButtonText: \"Yes!\",\n cancelButtonText: \"No!\"\n /*closeOnConfirm: false,\n closeOnCancel: false*/\n }).then(function(result){\n\n if (result.value) \n {\n //name vairables\n var table = $('#images');\n var rowCount = table.find('tbody tr').length; \n\n blockUI(); \n\n $.ajax({\n type: 'DELETE',\n url: API_URL_ROOT+'v1/contributor/gallery/delete/'+imageID,\n dataType: 'json',\n headers: {Authorization:'Bearer '+token},\n success: function(response)\n {\n if(response.error == false)\n {\n unblockUI();\n showSimpleMessage(\"Success\", response.message, \"success\");\n rowCount > 1 ? table.DataTable().ajax.reload(null, false) : loadImages(); \n }\n else\n {\n unblockUI();\n showSimpleMessage(\"Attention\", response.message, \"error\");\n }\n },\n error: function(req, status, error)\n {\n showSimpleMessage(\"Attention\", \"ERROR - \"+req.status+\" : \"+req.statusText, \"error\");\n }\n });\n } \n else \n {\n showSimpleMessage('Canceled', 'Process Abborted', 'error');\n }\n });\n }", "function eliminarImpresora(seleccionado) {\n var table = $('#lista-impresora').DataTable();\n var celda = $(seleccionado).parent();\n var rowData = table.row(celda).data();\n var id = rowData['imID'];\n swal({\n title: \"Esta seguro que desea eliminar la impresora seleccionada?\",\n text: \"El estado de la impresora\",\n type: \"warning\",\n showCancelButton: true,\n confirmButtonColor: \"#DD6B55\",\n confirmButtonText: \"Si, eliminar la impresora!\" ,\n cancelButtonText: \"No deseo eliminar la impresora\",\n closeOnConfirm: false,\n closeOnCancel: false },\n function(isConfirm){\n if (isConfirm) {\n $.ajax({\n url: site_url+'/impresora/eliminarImpresora',\n data: 'id='+id,\n type: 'post',\n success: function(registro){\n if (registro == 'error'){\n swal(\"Error\", \"Problemas al eliminar\", \"error\");\n }else{\n swal(\"Eliminado!\", \"La impresora ha sido eliminada.\", \"success\");\n $('#cerrar-impresora').click();\n recargarTablaImpresora();\n }\n }\n });\n } else {\n swal(\"Cancelado\", \"Accion cancelada.\", \"error\");\n }\n });\n}", "deleteItem() {\n if (window.confirm('Etes-vous sur de vouloir effacer cet outil ?')) {\n sendEzApiRequest(this.DELETE_ITEM_URI + this.props.id, \"DELETE\")\n .then((response) => {\n this.props.deleteButtonCB(this.props.tool)\n }, error => {\n alert(\"Impossible de suprimer l'outil\")\n\n console.log(error)\n })\n }\n }", "function eliminarCliente(idCliente) {\n Swal.fire({\n title: 'Estas Seguro?',\n text: \"Esta Accion Sera Irreversible\",\n icon: 'warning',\n showCancelButton: true,\n confirmButtonColor: '#d33',\n cancelButtonColor: '#3085d6',\n confirmButtonText: 'Si, borralo',\n cancelButtonText: 'no'\n }).then(respuesta=> {\n if(respuesta.value){\n axios({\n method: 'DELETE',\n url: URLC+`?idCliente=${idCliente}`,\n responseType: 'JSON'\n }).then(function(respuesta){\n verClientes();\n });\n }\n });\n \n}", "deleteAll(){\n for(var i = 0;i<this.array.length;i++){\n this.array[i].body.remove()\n }\n this.array = [];\n }", "deleteSavedItems() {\n\n }", "function deleteItems(id) {\n $.ajax(\"/api/delete/\" + id, {\n type: \"PUT\"\n }).then(function (result) {\n console.log(result);\n console.log(\"Deleted\");\n location.reload();\n })\n }", "_addActionDelete() {\n let btn = this._actions.getElementsByClassName('delete')[0];\n if (btn === undefined) {\n return;\n }\n\n btn.onclick = ((event) => {\n\n let confirm = (() => {\n this._api.removeService(this._api.getSlug());\n this._dialog.hide();\n }).bind(this);\n\n const params = {\n title: this._i18n('actions.delete.item'),\n content: this._i18n('actions.delete.info'),\n actions: [\n {title: this._i18n('dialog.cancel'), attrs: null, className: 'btn-default abort'},\n {title: this._i18n('dialog.confirm'), attrs: [['onclick', confirm]], className: 'btn btn-outline-danger confirm'}\n ],\n _class: 'confirmation-dialog delete'\n };\n\n this._dialog = new Dialog(params);\n this._dialog.show();\n\n }).bind(this);\n\n this._btns.delete = btn;\n }", "function delete_selected_blog_comments(message) {\n swal({\n text: message,\n icon: \"warning\",\n buttons: true,\n buttons: [sweetalert_cancel, sweetalert_ok],\n dangerMode: true,\n }).then(function (willDelete) {\n if (willDelete) {\n\n var comment_ids = [];\n $(\"input[name='checkbox-table']:checked\").each(function () {\n comment_ids.push(this.value);\n });\n var data = {\n 'comment_ids': comment_ids,\n };\n data[csfr_token_name] = $.cookie(csfr_cookie_name);\n $.ajax({\n type: \"POST\",\n url: base_url + \"blog_controller/delete_selected_comments\",\n data: data,\n success: function (response) {\n location.reload();\n }\n });\n\n }\n });\n}", "async function deleteItem() {\n setLoadingScreen(true)\n try {\n const response = await axios.delete(`/api/note/${itemToDelete}`)\n\n if (response.status === 201) {\n setAlertBox({ alert: false, message: '', handler: null })\n setLoadingScreen(false)\n getDocuments()\n } else {\n setLoadingScreen(false)\n setError({ isError: true, message: 'Something went wrong. Try again later'})\n }\n } catch (err) {\n setLoadingScreen(false)\n setError({ isError: true, message: err.response.data.message })\n }\n }", "function removeContent(object, wrapper_id) { \n swal({\n title: \"Xác nhận xóa\",\n text: \"Bạn có chắc muốn xóa nội dung này không?\",\n type: \"info\", showCancelButton: true,\n closeOnConfirm: false,\n }, function () {\n // Xoa noi dung\n $(object).parent().remove();\n \n // sort table\n arrayInfo = $('#' + wrapper_id).sortable('toArray');\n \n swal({\n title: \"Xóa thành công!\",\n html: true\n });\n }); \n}", "addItemWalletById(id) {\n Alert.alert(\n 'Deseja excuir o cupom?',\n 'Esta ação não pode ser desfeita!',\n [\n { text: 'Cancelar', style: 'cancel' },\n { text: 'Confirmar', onPress: () => this.handledeleteItembyId(id) },\n ],\n { cancelable: false }\n )\n\n }", "function swalPopUp() {\n return swalWithBootstrapBtns.fire({\n title: 'Are you sure?',\n text: \"You won't be able to revert this!\",\n icon: 'warning',\n showCancelButton: true,\n confirmButtonText: 'Yes, delete it!',\n cancelButtonText: 'No, cancel!',\n reverseButtons: true\n })\n}", "function deleteItem(id, ajaxUrl, $dataTable) {\n Swal.fire({\n title: '¿Estás seguro?',\n text: \"¿Realmente deseas eliminar el campo de id = \" + id + \" ?\",\n icon: 'warning',\n confirmButtonColor: '#3085d6',\n confirmButtonText: '¡Sí, elimínelo!',\n showCancelButton: true,\n cancelButtonText: '¡Cancelar!',\n cancelButtonColor: '#d33',\n }).then((result) => {\n\n if (result.value === true) {\n\n $.ajax({\n url: ajaxUrl + id,\n type: 'DELETE',\n data: {\n id: id\n },\n success: function(response) {\n\n if (response.message != undefined) {\n mostrarMensaje(\"#mensaje\", 'true', response.message, $dataTable);\n } else {\n swal(\"Error!\", results.message, \"error\");\n }\n }\n });\n\n } else {\n\n result.dismiss;\n\n }\n\n\n })\n\n }", "function eliminar_trj() {\n\tswal({\n\t\ttitle: \"¿Está seguro?\",\n\t\ttext: \"Una vez eliminado no se podrá recuperar\",\n\t\ticon: \"warning\",\n\t\tbuttons: true,\n\t\tdangerMode: true,\n\t}).then((willDelete) => {\n\t\tif (willDelete) {\n\t\t\tvar envio = { numero: valor('numero_consulta') }\n\t\t\tcargando()\n\t\t\t$.ajax({\n\t\t\t\tmethod: \"POST\",\n\t\t\t\turl: \"/admin-tarjetas/eliminar-numero\",\n\t\t\t\tdata: envio\n\t\t\t}).done((respuesta) => {\n\t\t\t\tswal(respuesta)\n\t\t\t})\n\t\t}\n\t})\n}", "function deleteNotification(){\n for(let i = 0; i < notificationClear.length; i++){\n notificationClear[i].addEventListener(\"click\", (e) => {\n let notification = e.target.parentElement;\n dropDown.removeChild(notification);\n sizeNotificationContainer();\n notificationHeader();\n });\n }\n}", "onDeleteSuccess(id) {\n let newId = parseInt(id);\n this.searchResults = this.searchResults.filter((r) => {\n return r.postId !== newId });\n this.deletionMessage = 'Listing deleted.'\n toastr.success(this.deletionMessage);\n }", "removerAlerta() {\n const msjAlerta = document.querySelector(\".alert\");\n if (msjAlerta) {\n msjAlerta.remove();\n }\n }", "_onDeleteClicked() {\n $('<p>')\n .text(_`\n This integration will be permanently removed. This cannot\n be undone.\n `)\n .modalBox({\n buttons: [\n $('<button>')\n .text(_`Cancel`),\n $('<button class=\"danger\">')\n .text(_`Delete Integration`)\n .click(() => this.model.destroy({\n beforeSend: xhr => {\n xhr.setRequestHeader(\n 'X-CSRFToken',\n this.model.collection.options.csrfToken);\n },\n })),\n ],\n title: _`Are you sure you want to delete this integration?`,\n });\n }", "function deletefeedbacksubscriber($kode) {\n Swal.fire({\n title: 'Apakah anda yakin?',\n text: 'Data akan terhapus permanen dari sistem',\n icon: 'warning',\n showCancelButton: true,\n confirmButtonColor: '#3085d6',\n cancelButtonColor: '#d33',\n confirmButtonText: 'Hapus',\n cancelButtonText: 'Batal'\n }).then(function(result) {\n if (result.value)\n {\n var url = '/feedback/subscribercontroller/hapusdata';\n\n $.ajax({\n type: \"post\",\n url: BASE_URL + url,\n data: {\n kode: $kode,\n },\n dataType: \"json\",\n success: function(response) {\n if (response.success){\n Swal.fire(\n 'Pemberitahuan',\n response.success.data,\n 'success',\n ).then(function() {\n $('#datatable-feedbacksubscribe').DataTable().ajax.reload();\n });\n }\n },\n error: function(xhr, ajaxOptions, thrownError) {\n alert(xhr.status + \"\\n\" + xhr.responseText + \"\\n\" + thrownError);\n }\n });\n }\n else if (result.dismiss == 'batal')\n {\n swal.dismiss();\n }\n });\n}", "deleteItem(item) {\n const index = this.clientes.indexOf(item)\n if (confirm('¿Estás seguro de que quieres eliminar el cliente?') && this.clientes.splice(index, 1)) {\n this.$http.delete('http://localhost:3000/api/clientes/' + item.id).then(\n function (response) {\n console.log(response);\n }\n );\n }\n }", "function addAlertListener(){\n for(let i = 0; i < clearAlert.length; i++){\n clearAlert[i].addEventListener(\"click\", (event) => {\n let node = event.target;\n let fullMessage = node.parentElement;\n alertMessage.removeChild(fullMessage);\n });\n }\n}", "function eventDeleteAll(e){\n\t\te.preventDefault();\n\t\tlet filas = document.querySelectorAll(\".btn-delete\");\n\t\tfor (let i = 0; i < filas.length-1; i++) {\n\t\t\tdel(filas[i], false);\n\t\t}\n\t\tdel(filas[filas.length-1], true);\t//suponiendo que los del() no se ejecutan antes por asincronismo\n\t\t/*get();*/\n\t}", "function _closeAlert(index) {\n $rootScope.alerts.splice(index, 1);\n }", "function deleteAlarm(x)\n{\n console.log(\"delete alarm getting called\");\n\tstopRingtone();\n for(var count=0; count< alarmList.length; count++)\n {\n if(alarmList[count].aId == x.id)\n {\n break;\n }\n }\n clearTimeout(alarmList[count].alarmTimer);\n alarmList.splice(count,1);\n $(x).closest(\"tr\").remove();\n localStorage.setItem(\"AlarmList\",JSON.stringify(alarmList));\n\n}", "function deleteProgram(){\n $(document).ready(function(){\n $(document).on(\"click\", \".delete_program\", function(){\n var programId = $(this).attr(\"id\");\n swal({\n title: '¿Está seguro de que desea excluir este programa?',\n type: 'warning',\n showCancelButton: true,\n confirmButtonColor: '#4fa7f3',\n cancelButtonColor: '#d57171',\n confirmButtonText: 'Sí!'\n }).then(function () {\n $.ajax({\n url: '/del/program',\n type: 'POST',\n dataType: 'json',\n data: {\"id\" : programId},\n });\n location.reload();\n \n }) \n });\n });\n}", "clearAlert() {\n const currentAlert = document.querySelector('.alert');\n\n //check if an alert is in the DOM\n if (currentAlert) {\n //remove alert if present\n currentAlert.remove();\n }\n }", "function Delete_Wishlist_item(id) {\n $.ajax({\n url: '/wishlist/delete_item',\n method:\"GET\",\n data:{ \n pid:id,\n },\n success: function (response) {\n if(response['deleteSts'] == 1){\n $(\"#WishlistTr\"+id).remove();\n total_wishlist_itmes()\n Toastify({\n text: response['status'],\n backgroundColor: \"linear-gradient(to right, #F50057, #1B1F85)\",\n className: \"error\",\n }).showToast();\n }\n }\n });\n}", "function confirmDelete(message, buttonCallback) {\n Alert.alert(\n 'Confirm Delete',\n message,\n [\n {text: 'Cancel', onPress: () => console.log('Canceled Delete')},\n {text: 'Delete', onPress: buttonCallback},\n ],\n )\n}", "deleteModalities(modalities){\n for (var i = 0; i < modalities.length; i++) {\n Modalities.remove({_id: modalities[i]});\n }\n }", "removerAlerta() {\n const msjAlerta = document.querySelector(\".alert\");\n if (msjAlerta) {\n msjAlerta.remove();\n }\n }", "handleAlertDismiss() {\n this.setState({\n removedItem: ''\n })\n }", "function _closeAlert(index) {\n $rootScope.alerts.splice(index, 1);\n }", "function clearAllHandler() {\n trash = toDoList.filter((task) => task.isDone == true);\n toDoList = toDoList.filter((task) => task.isDone == false);\n commitToLocalStorage(toDoList);\n reRender();\n}", "function _onDeleteSuccess() {\n var eventList = vm.items;\n var removeIndex = eventList.findIndex(function (element, index, eventList) {\n return element._id === vm.items._id;\n });\n eventList.splice(removeIndex, 1);\n vm.item = null;\n vm.toggleAdd = !vm.toggleAdd;\n }", "static deleteFoods(foods) {\n foods.forEach(food => {\n fetch(`${this.url}/foods/${food.id}`, {\n method: 'DELETE'\n })\n .then(response => response.json())\n .then(data => {\n Food.delete(data.id);\n AppContainer.renderFoods();\n })\n .catch(err => alert(err))\n })\n \n }", "function removeCompletedItems() {\n fetch('clearCompleted', {\n method: 'delete',\n headers: {\n 'Content-Type': 'application/json'\n }\n }).then(function(response) {\n window.location.reload()\n })\n}", "function deletePost(sellerId) {\n $.ajax({\n method: 'DELETE',\n url: '/api/listings/' + sellerId\n }).then(function() {\n\n alertify.alert(\n 'Item Removed',\n 'Thank you. Your listing has been deleted from Online Garage Sale.',\n function() {\n alertify.success('ok');\n window.location.href = '/';\n }\n );\n });\n}" ]
[ "0.6923511", "0.6760819", "0.6533076", "0.65206444", "0.6511105", "0.6489903", "0.6449423", "0.6402988", "0.6351242", "0.6327346", "0.63090575", "0.62964463", "0.62917703", "0.6267454", "0.6261281", "0.6260393", "0.6259438", "0.6249951", "0.62380636", "0.62273246", "0.6222594", "0.62101537", "0.62064946", "0.6189411", "0.61868924", "0.6183827", "0.6179959", "0.6179959", "0.6179959", "0.6170409", "0.616009", "0.61587363", "0.61558443", "0.61231005", "0.6110137", "0.6095906", "0.6083358", "0.60763747", "0.60622454", "0.6057387", "0.6027636", "0.6017415", "0.59993315", "0.59974563", "0.5988223", "0.59868854", "0.5983632", "0.59811777", "0.5980517", "0.59599364", "0.5953756", "0.5945841", "0.5945685", "0.5940708", "0.5913212", "0.5910209", "0.5899286", "0.5885554", "0.58703333", "0.5866164", "0.58631057", "0.5851223", "0.58495325", "0.58472234", "0.5845872", "0.58447635", "0.5838196", "0.5836989", "0.5827992", "0.5813526", "0.58034545", "0.5802844", "0.5795784", "0.5793892", "0.57882464", "0.5778796", "0.5774516", "0.5773261", "0.57703733", "0.57676554", "0.57620573", "0.5761491", "0.57595134", "0.57591456", "0.5757138", "0.5756761", "0.5753741", "0.5752677", "0.5747321", "0.5740891", "0.5731532", "0.57284886", "0.5728324", "0.5728114", "0.57261324", "0.57205456", "0.5718575", "0.5717099", "0.571561", "0.5712986" ]
0.8119842
0
Delete a Single li
function delete_li(rm){ rm.parentNode.remove() sweetAlertSuccessMsg("Deleted Successfully") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteListItem(){\n \t\t$(this).parent().remove();\n \t}", "function deleteListItem(li){\n\t\tli.classList.add(\"delete\")\n\t\tsaveData();\n\t}", "function deleteListItem() {\n\tthis.parentNode.remove();\n}", "function deleteListItem(){\n\t\tli.classList.add(\"delete\")\n\t\tsaveData();\n\t}", "function deleteListItem(e) {\n\t\te.remove();\n\t}", "function deleteListItem() {\n item.remove();\n }", "function deleteListElement() {\n\tvar deleteItem = document.querySelector('li');\n\tdeleteItem.parentNode.removeChild(deleteItem);\n\tvar deleteButton = document.getElementById('delete');\n\tdeleteButton.remove();\n}", "function deleteLi() {\n //Add the delete to the list item\n li.classList.add(\"delete\");\n }", "function deleteListItem() {\n\t\tli.classList.add(\"delete\");\n\t}", "function removeListItem() {\n\t\t\t\t$(this).parent().remove();\n\t\t\t}", "function removeListItem() {\n li.parentNode.removeChild(li);\n }", "function deleteListItem(element){\n element.parentNode.remove(\"li\"); \n}", "function deleteItem(){\n\tul.removeChild(this.parentElement);\n}", "function dltSingle(currentLi) {\n currentLi.parentNode.parentNode.removeChild(currentLi.parentNode);\n}", "function deleteElement(listElement) {\n var text = $(listElement).text();\n var itemText = text.slice(0,-1) // Removes the x from the list's text\n $.post('/deleteItem', {\"itemText\": itemText})\n listElement.style.display = \"none\";\n}", "function deleteListItem() {\n\n\tvar removeThis = document.getElementById('added-list-item');\n\tremoveThis.parentNode.removeChild(removeThis);\n\treturn false;\n}", "function eliminarEntrada() {\n\tli.remove(); //remueve la entrada con el click del botoncito\n\t}", "function removeItemAfterClick(e){\n\t // if (e.target.tag === deleteElementList){\n\t \t// console.log(e.target.tagName);\n\t \t// deleteElementList.querySelector(\"li\").remove();\n\t \te.target.parentNode.remove();\n\t\t// e.deleteElementList.remove();\n\t\t// deleteElementList.removeChild(deleteElementList.childNodes[i]);\n\t\n\n}", "function deleteListItem() {\n li.classList.add('delete'); // Add class 'delete' to element\n }", "function deleteListItem() {\n li.addClass('delete');\n }", "function deleteItem() {\n\tlet item = this.parentNode;\n\tdomStrings.todoList.removeChild(item);\n}", "function deleteListItem(e) {\n let myTarget = e.target.parentElement.parentElement.parentElement;\n myTarget.remove();\n\n const myTitle = myTarget.querySelector('.notes-list-item-title');\n const mySubtext = myTarget.querySelector('.notes-list-item-subtext');\n\n deleteFromLocalStorage(myTitle.textContent, mySubtext.textContent);\n}", "function removeThisListItem() {\n $(this).parent().remove();\n delCount();\n }", "function deleteListItem(){ // add CLASS delete with (DISPLAY: NONE)\r\n li.classList.add(\"delete\"); // with display= none then after clicking\r\n // the X button the li item gets removed\r\n\t}", "function deleteListItem() {\r\n\t// In order to delete entire list item we have to use parent method > without parent method we would only delete our delete button\r\n\t$(this).parent().fadeOut(1000, function(){\r\n\t\t$(this).remove();\r\n\t});\r\n\r\n\t// This deletes list items in our local storage\r\n\tlocalStorage.removeItem(\"list\", $('#List').html());\r\n}", "function removeListItem() {\n var listItem = this.parentNode;\n listItem.parentNode.removeChild(listItem);\n}", "function deleteLi(el){\n parentNode = el.parentNode.parentNode.parentNode\n nodeToDelete = el.parentNode.parentNode;\n parentNode.removeChild(nodeToDelete) \n}", "function deleteItem(){ \n $(this).parent().remove();\n }", "function deleteLine(){\n\t\tul.removeChild(li);\n\t\tli.removeChild(btn);\n\t}", "function deleteList(e){\n const targetItem = e.target;\n const todo = targetItem.parentElement;\n\n if(targetItem.tagName == \"I\"){\n removeTodos(todo);\n targetItem.parentElement.remove();\n }\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 deleteItem(elem) {\r\n var id = elem.parent().attr(\"id\");\r\n firebase\r\n .database()\r\n .ref(\"/todos/\" + id)\r\n .remove();\r\n }", "function removeListItem(liItem) {\n let liElem = document.getElementById(liItem);\n liElem.parentNode.removeChild(liElem);\n}", "function liDoubleClicked() {\n removeListItem()\n }", "function removeItem (){\n //grab the <li> by accessing the parent nodes \n let item = this.parentNode.parentNode; //the <li>\n let parent = item.parentNode; //in order to remove its child <li>\n let id = parent.id; //check id if its 'todo' or 'completed'\n let value = item.innerText;\n\n //if its an item to be completed...\n if(id === 'todo') {\n //remove one item from todo, based on index\n data.todo.splice(data.todo.indexOf(value, 1));\n //else if it was already completed...\n } else {\n //remove one item from completed, based on index\n data.completed.splice(data.completed.indexOf(value, 1));\n }\n\n //update localstorage\n dataObjectUpdated();\n\n //remove it\n parent.removeChild(item);\n\n}", "function borrarLi(li_borrar) {\n $(li_borrar).parent().remove();\n}", "function remove(){\n addEventListener('click',function(e){\n if(e.target.className==='delete'){\n const li= e.target.parentElement;\n\n li.parentNode.removeChild(li);\n }\n });\n}", "function removeFromShowList(li){\n\n \n let parent = document.getElementById(\"showList\");\n\n parent.removeChild(li);\n\n }", "function deleteItem() {\n $('.shopping-list').on('click', '.shopping-item-delete', function (event) {\n this.closest('li').remove();\n });\n }", "deleteListItem(listItemIndex) {\n return this.listItems[listItemIndex].$(\"=Delete\").click();\n }", "'click .delete'() {\n \t\tMeteor.call('lists.remove', this._id, (error) => {\n\t\t\tif (error) {\n\t\t\t\tBert.alert( 'An error occured: ' + error + '! Only the creator of the list can delete it.', 'danger', 'growl-top-right' );\n\t\t\t} else {\n\t\t\t\tBert.alert( 'List removed successfully!', 'success', 'growl-top-right' );\n\t\t\t\tFlowRouter.go('/');\n\t\t\t}\n\t\t});\n\t}", "deleteFromList() {\n list.splice((this.id), 1)\n }", "function delitem(evt) {\n if (evt.keyCode == 46) ul.removeChild(ul.lastElementChild);\n}", "function Delete(ev) {\r\n mainList.remove(ev.target.parentNode);\r\n }", "function delFromList () {\n /* get rid of the button and bullet from our arrays before deleting it */\n listItems.splice(delBtns.indexOf(this), 1)\n delBtns.splice(delBtns.indexOf(this), 1)\n\n /* also get rid of the drop zone below the element being deleted */\n dropZones.splice(delBtns.indexOf(this), 1)\n\n redrawList()\n}", "function removeItem()\r\n{\r\n\tconst item = this.parentNode.parentNode;\r\n\tconst currentListId = item.parentNode.id;\r\n\tconst text = item.innerText;\r\n\r\n\titem.remove();\r\n\r\n\tif (currentListId === \"todo-list\") \r\n\t{\r\n\t\ttodo.splice(todo.indexOf(text),1);\r\n\t}\r\n\telse\r\n\t{\r\n\t\tcompleted.splice(completed.indexOf(text),1);\r\n\t}\r\n\r\n\tlocalStorage.setItem('todos',JSON.stringify(todo));\r\n\tlocalStorage.setItem('completed',JSON.stringify(completed));\r\n}", "function removeItem(e) {\n var wdlist = Array.from(gList);\n let identifier = null;\n let idElement = e.currentTarget.id.split(\"-\")[0];\n console.log(idElement);\n for (var i = 0; i < list.length; i++) {\n if (list[i].id === parseInt(idElement)) {\n identifier = i;\n console.log(identifier);\n }\n }\n console.log(identifier);\n wdlist.splice(identifier, 1);\n gSetList(wdlist);\n }", "function removeItem() {\n let value = this.parentNode.lastChild.textContent;\ntodo.splice(todo.indexOf(value), 1);\n this.parentNode.parentNode.removeChild(this.parentNode);\n saveTodos();\n}", "function deleteItem(evt) {\r\n // get the text field object that we're using to edit this list item\r\n var oTextField = document.getElementById(\"itemText\");\r\n // Since we've inserted the editing UI directly into the LI tag, then \r\n // the parent node of the text box is the LI tag itself. We just need \r\n // to use the parentNode property of the text box to get the LI, then\r\n // pass that to the removeChild() function on the UL list itself.\r\n gTheList.removeChild(oTextField.parentNode);\r\n}", "function removeListEntry() {\n\t$(this).closest(\".list_entry\").remove();\n}", "function deleteListFromDom(e) {\n error_delete = true;\n var DeleteButton = e.target;\n var idDelete = DeleteButton.parentElement.id;\n todoArray.splice(idDelete, 1);\n clearDOM();\n AppendListToDom();\n error_delete = false;\n}", "removeTodo(i){\n this.ulContent.splice(i, 1);\n }", "function deleteItem(e){\n const element=e.currentTarget.parentElement.parentElement;\n const id=element.dataset.id;\n list.removeChild(element);\n if (list.children.length===0) {\n container.classList.remove('show-container');\n }\n displayAlert('item removed','danger');\n setBackToDefault();\n removeFromLocalStorage(id);\n //remove from local storage\n // removeFromLocalStorage(id);\n \n}", "function deleteFromList(element){\n if(confirm('Would you like to delete this item?') == 1){\n $(element).parent().remove();\n }\n}", "function deleteItem(){\n $('ul').on('click', '.shopping-item-delete', event => {\n $(event.currentTarget).closest('li').remove();\n });\n}", "function deleteItem(element) {\n $(element).parent().remove();\n}", "function removeItem() {\n createListElement(completedList, this.parentElement.textContent);\n\tthis.parentElement.remove();\n\ttoggleListDisplay(activeList);\n}", "function removal(){\n let list = document.getElementById(\"todoList\")\n list.removeChild(list.childNodes[0]);\n}", "function removeFromLs(taskItem) { // jeta remove korchi seta 'taskItem' e asbe '<li>---</li>'\n let tasks;\n if (localStorage.getItem('tasks') === null) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n\n let li = taskItem; //jeta remove korchi seta 'taskItem' e asbe,,, '<li>---</li>' eta\n li.removeChild(li.lastChild); //<li>-<a>X</a></li> er <a>x</a> bad pore jabe\n\n tasks.forEach((task, index) => {\n if (li.textContent.trim() === task) {\n tasks.splice(index, 1);\n } \n });\n\n localStorage.setItem('tasks',JSON.stringify(tasks));\n}", "function addEventDelete(item) {\n item.addEventListener(\"click\", function(){\n item.parentNode.remove(\"li\");\n });\n}", "function deleteList(c) {\n\tconst taskDel = document.querySelector(`.item-${c}`);\n\ttaskDel.firstElementChild.addEventListener(\"click\", () => {\n\t\tif (confirm(\"Are you sure?\")) {\n\t\t\ttaskDel.remove();\n\t\t\tconsole.log(taskDel.textContent);\n\t\t\tremoveFromStorage(taskDel.textContent);\n\t\t}\n\t});\n}", "function deleteListItem() {\n $('.close').on('click', function() {\n var self = $(this);\n self = self.parent();\n self = self.parent();\n self.remove();\n });\n}", "function removeItem(){\n const ul =document.querySelector(`ul`);\n const itemToRemove =input1.value;\n\n for(const li of ul.querySelectorAll(\"li\")){\n if(itemToRemove == li.innerText){\n li.remove();\n }\n }\n}", "function addDeleteButton(li){\n\t//create a button with delete in it\n\tvar button = document.createElement(\"button\");\n\tbutton.appendChild(document.createTextNode(\"delete\"));\n\n\t\n\t// insert button after each li\n\tli.parentNode.insertBefore(button, li.nextSibling);\n\n\t// Add event listener when clicked\n\tbutton.addEventListener(\"click\", function(){\n\t\t//Delete li item and the button\n\t\tconsole.log(li);\n\t\tconsole.log(button);\n\t\tli.remove();\n\t\tbutton.remove();\n\n\t})\n\n\t\n\t\n\t\n\n\t\n\n\n\n\n\t// add that element directly after the list item with class name delete\n}", "function deleter(ul,li){\n\tul.removeChild(li)\n\n\tif(uncheckedTasks-1 >= 0){\n\t \tuncheckedCountSpan.textContent = uncheckedTasks-1\n\t \tuncheckedTasks = uncheckedTasks-1\n\t}\n\n\telse{\n\t\tuncheckedCountSpan.textContent = 0\n\t}\n\n\titemCountSpan.textContent = numberOfTasks-1\n\tnumberOfTasks = numberOfTasks-1\n}", "function deleteItem(event) {\n \n //this delete the row from the list not the firebase\n $(this).parent().remove();\n \n \n //this gets the current selected row id \n // from the unordered list\n console.log($(this).attr(\"id\"));\n \n //this calls the firebase to delete the selected id row\n firebase.database().ref().orderByChild('id').equalTo($(this).attr(\"id\")).once(\"value\").then(function (snapshot) {\n snapshot.forEach(function (child) {\n //this remove the selected child row\n child.ref.remove();\n \n }); // a closure is needed here\n }).then(function () {\n console.log(\"Removed!\");\n \n \n });\n \n }", "function removeItem(){\n var item = this.parentNode.parentNode;\n var parent = item.parentNode;\n var id = parent.id;\n var value = item.innerText;\n \n \n data.todo.splice(data.todo.indexOf(value),1);\n \n \n dataObjectUpdated();\n \n parent.removeChild(item);\n}", "function deleteItem() {\n list.innerHTML = \"\"\n}", "function removeToDo() \n{\n var listItem = this.closest('li');\n listItem.remove();\n}", "function deleteItem(e) {\r\n const deleteItem = document.getElementById(\"delete\");\r\n if (e.target.className == \"delete\") {\r\n list.forEach((item) => {\r\n if (item.id == e.target.id) {\r\n e.target.parentElement.remove();\r\n list = list.filter((item) => item.id != e.target.id);\r\n console.log(list);\r\n }\r\n });\r\n }\r\n e.preventDefault();\r\n}", "function deleteItem(e) {\r\n var btn = e.target;\r\n\r\n while (btn && (btn.tagName != \"A\" || !/\\bdelete\\b/.test(btn.className))) {\r\n btn = btn.parentNode;\r\n if (btn === this) {\r\n btn = null;\r\n }\r\n }\r\n if (btn) {\r\n var btnParent = btn.parentNode.parentNode.parentNode\r\n this.removeChild(btnParent);\r\n updateNotesListOnRemoveItem(btn);\r\n }\r\n}", "function deleteTodo($index){\n self.todoList.splice($index, 1);\n }", "function deleteItem(event) {\n \n //this delete the row from the list not the firebase\n $(this).parent().remove();\n \n \n //this gets the current selected row id\n // from the unordered list\n console.log($(this).attr(\"id\"));\n \n //this calls the firebase to delete the selected id row\n firebase.database().ref().orderByChild('id').equalTo($(this).attr(\"id\")).once(\"value\").then(function (snapshot) {\n snapshot.forEach(function (child) {\n //this remove the selected child row\n child.ref.remove();\n \n }); // a closure is needed here\n }).then(function () {\n console.log(\"Removed!\");\n \n \n });\n \n \n \n }", "function deleteItem() {\n var id = $(this).parent().attr('data-id');\n\n $.ajax(\n {\n url: 'http://157.230.17.132:3017/todos/' + id,\n method: 'DELETE',\n success: function() {\n getAllItemsSaved();\n },\n error: function() {\n alert(\"Attenzione, non sono riuscito a eliminare l'elemento\");\n }\n }\n );\n}", "function ctrlDeleteItem(event) {\n let accID, splitID, ID;\n acc = event.target.parentNode.parentNode.parentNode; // get the li\n accID = event.target.parentNode.parentNode.parentNode.id; // get the id\n\n if (accID) {\n ID = accID;\n // if user confirms delete\n\n //delete acc from user interface\n deleteFromUI(acc);\n if (user[0] === \"foyafa\" && user[1] === \"12345\") {\n // delete the acc from firebase\n db.collection(\"accounts\").doc(ID).delete();\n } else if (user[0] === \"admin\" && user[1] === \"12345\") {\n db.collection(\"test\").doc(ID).delete();\n } else if (user[0] === \"george\" && user[1] === \"12345\") {\n db.collection(\"account\").doc(ID).delete();\n }\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}", "function removeToDo(element){\r\n element.parentNode.parentNode.removeChild(element.parentNode);\r\n SIDELIST[activeid].list[element.id].trash = true;\r\n}", "function deleteToDo(event){\n //console.log(event.target);\n const btn = event.target;\n const li = btn.parentNode;\n toDoList.removeChild(li);\n// filter는 해당 함수가 toDos의 모든 items들에게 실행하도록 하여 treu인 item으로 다시 배열 구성\n// ex. 클릭하여 제거된 버튼의 부모 요소인 li의 id 값이 3일 경우, 나머지 id 들은 다시 배열 정렬 \n const cleanToDos = toDos.filter(function(toDo){\n //toDo.id 는 integer, li.id 는 string\n console.log(toDo);\n console.log(toDo.id, li.id);\n/*필터함수는 각 항목을 확인하면서( 어떻게 확인 할지는 function으로 만들었죠?) return값이 true인 항목만 모아서 반환합니다.\n\ntoDos에 6개의 항목이 있다고 가정하면 id가 1부터 6까지 있겠죠?\n4번째 삭제버튼을 누르면, 삭제버튼의 parentNode (삭제버튼이 있는 li태그) 의 id값은 4겠죠?\n\n그러면 toDos가 가진 아이템들(6개)을 하나씩 확인하면서 각 아이템의 id와 삭제버튼 (li.id) 의 아이디인 4를 비교해서 return 합니다.\n그럼 return 이 총 6번 이루어지는데 이때 리턴값이 false이면 필터함수가 걸러냅니다.\nreturn toDo.id !== parseInt(li.id)\n조건식이 toDos의 id와 삭제버튼의 parentNode인 li의 id와 달라야지 true 이므로\n하나씩 돌면서 toDos의 id가 4일때 li.id의 id가 4이면 같으므로 false를 리턴합니다.\n\n그러면 id값이 4인 항목만 건너뛰고 cleanToDos 에 5개의 아이템으로 이루어진 배열이 반환되어 할당됩니다.\n*/\n\n\n return toDo.id != parseInt(li.id);\n });\n //cleanToDos는 지우고 나서 남은애들이 저장되어있음.\n console.log(cleanToDos);\n \n toDos = cleanToDos;\n saveToDos();\n}", "function removeFavourite(li) {\n if (deleteMode) {\n var indexToRemove = (li.attr('array-position'));\n console.log(\"Removing array element with index \" + indexToRemove);\n favouritesArray.splice(indexToRemove, 1);\n li.animate({\"margin-left\": '+=' + $(window).width()}, 400, function () {\n li.remove();\n saveFavourites();\n loadFavourites();\n populateFavouritesList();\n $(\"#favouritesErrorText\").text(\"Favourite removed.\");\n });\n }\n}", "function deleteItem(link){\n $(link).parent().remove();\n}", "removeListItem(index) {\n this.listItems.splice(index, 1);\n }", "function deleteItem() {\n $('.shopping-list').on('click', '.shopping-item-delete', function(event) {\n (this).closest('li').remove();\n });\n}", "remove()\n {\n this.list.delete((this.list.size-1) + \"\");\n }", "function delClick(e) {\n const index = getItemIndex(\n srcList,\n e.target.parentElement.getAttribute('name'),\n );\n\n if (index < 0) return;\n\n srcList.splice(index, 1);\n chrome.storage.sync.set({ storageSrcKey: srcList }, () =>\n console.log(`${storageSrcKey} value saved. List : ${srcList}`),\n );\n e.target.closest('tr').remove();\n }", "static removeItem(id, e) {\n //if we get the id\n //we only have to search for the pos\n var pos;\n var li;\n var lu = document.getElementById(\"listTask\");\n if(id === undefined || id === null){\n var items = e.parentElement.parentNode.parentElement;\n var li = items.parentElement;\n\n //get the input, it is placed \n //in the 4 position\n var hiddenInput = items.childNodes[2];\n pos = getPositionStored(hiddenInput.value);\n }\n else{\n pos = getPositionStored(id);\n li = lu.childNodes[pos];\n }\n\n if (pos !== -1) {\n storedTask.data.splice(pos, 1);\n //update data in Local Storage\n localStorage.setItem(\"task\", JSON.stringify(storedTask));\n }\n lu.removeChild(li);\n }", "function deleteItem(element){\n element.parentNode.remove();\n}", "function closeAdd(li){\n console.log(li);\n li.remove();\n return false;\n}", "function DeleteItem(ind){\r\n\r\n var listItems; \r\n arr1[ind] = \"\";\r\n document.querySelector('.todo-list-items' + ind).textContent = arr1[ind];\r\n let max = 9;\r\n let min = 0;\r\n let mid = 4;\r\n recursive(ind, min, mid, max);\r\n }", "function rmvClick(){\n let li = this.parentNode.parentNode;\n let ul = li.parentNode;\n ul.removeChild(li);\n}", "function deleteItem(e){\n \n console.log(e.target)\n // we use conditional to fire event only when we click desired items\n // However we want to target the element above it (i and not just the link)\n if(e.target.parentElement.classList.contains('delete-item') ){\n console.log('delete item');\n // Afer clicking i we want to removbe li which is two levels up\n e.target.parentElement.parentElement.remove()\n }\n}", "function remove () {\n var id= this.getAttribute('id');\n var todos = get_todos();\n todos.splice(id, 1);\n localStorage.setItem('todo', JSON.stringify(todos));\n \n show();\n \n return false;\n }", "function delTodo($index) {\n \tself.todoList.splice($index, 1);\n }", "function deleteTodo($index){\n\t\t\tself.todoList.splice($index, 1);\n\t\t}", "function deleteTodo($index){\n\t\t\tself.todoList.splice($index, 1);\n\t\t}", "function removeItem(e) {\n\n // getting the item to be deleted \n let todoItem = e.target.previousSibling.textContent;\n let idx = allItems.indexOf(todoItem); // looking for item's index in the tasks list\n allItems.splice(idx, 1); // removing the found index from the tasks list\n // console.log(allItems);\n localStorage.setItem(\"tasks\", JSON.stringify(allItems)); // updating the local storage \n list.innerHTML = \"\"; \n show(); \n}", "function deleteItem ()\n{\n\t// Delete Item.\n $(\".shopping-list\").on(\"click\", \".shopping-item-delete\", function (e) \n {\n \tconsole.log('Delete');\n e.preventDefault();\n $(this).closest('li').remove();\n });\n}", "function deleteListItem(id, type){\r\n \r\n var input_id = $(\"[data-type=\"+type+\"]\").attr('data-input-id');\r\n var list_div = input_id+'_list';\r\n var delconfirm =confirm('Are you sure?');\r\n \r\n if(delconfirm){\r\n $('#'+type+'_div_'+id).remove();\r\n $('#'+type+'_'+id).remove();\r\n var i=1; \r\n $('#'+list_div+ '.dynamic b').each(function(){\r\n $(this).html(i);\r\n i++;\r\n });\r\n }\r\n}", "function handleDeleteItem(item){\n \n //get a copy\n const list = [...listOfItems]\n const index = list.indexOf(item)\n \n // goes to index and removes ONE element\n list.splice(index, 1)\n setList(list)\n }", "function removeItem(event){\n if(event.target.classList.contains('del')){\n var li = event.target.parentElement;\n taskList.removeChild(li);\n }\n}", "function removeLi() {\n while(ol.firstChild) {\n ol.removeChild(ol.firstChild);\n }\n return;\n}" ]
[ "0.81266326", "0.805042", "0.7907465", "0.7817413", "0.780877", "0.77975583", "0.77823526", "0.7739577", "0.7581431", "0.7575069", "0.7570064", "0.7533381", "0.7494372", "0.7482356", "0.7442627", "0.74157596", "0.7361855", "0.7302598", "0.73001176", "0.7259684", "0.72549087", "0.7243806", "0.7212334", "0.71772337", "0.7169906", "0.70903766", "0.7073226", "0.70495915", "0.70218724", "0.70202494", "0.70170957", "0.69842845", "0.69828457", "0.69672906", "0.69620335", "0.6949849", "0.6939902", "0.69211584", "0.6902079", "0.6896861", "0.68858874", "0.6868972", "0.68612325", "0.6846953", "0.6828028", "0.68257153", "0.6810104", "0.67882335", "0.678534", "0.6782251", "0.678099", "0.6773546", "0.67682135", "0.67570627", "0.6746512", "0.67374396", "0.6734096", "0.6714458", "0.67142653", "0.6708521", "0.6707648", "0.6706691", "0.67030036", "0.6683106", "0.6667316", "0.66507417", "0.66505826", "0.6644262", "0.664201", "0.6639941", "0.66288525", "0.66266954", "0.6625579", "0.66237515", "0.6615406", "0.661402", "0.6601777", "0.6595077", "0.6584922", "0.6584488", "0.65802294", "0.65796787", "0.65734184", "0.6571452", "0.6568173", "0.6566862", "0.6555466", "0.6554783", "0.65540653", "0.6537189", "0.65363276", "0.65334797", "0.65322965", "0.65322965", "0.6531757", "0.65313977", "0.6529733", "0.65266424", "0.65222794", "0.6517132" ]
0.7640191
8
AnalyticalForm has the form for adding/editing an analytical method
function AnalyticalForm(props) { const { id } = props.match.params; const defaultState = { id: '', residueType: '', reason: '', }; const [state, setState] = useState(defaultState); useEffect(() => { setState(id ? Get(id) : state) }, []); const classes = formStyle(); const handleChange = name => event => { const newState = { ...state, [name]: event.target.value, } if (!newState.id || (newState.id && newState.id.length === 0)) { newState.error = 'Must provide an ID' } else { newState.error = null; } setState(newState); }; const handleChangeID = event => { const newId = event.target.value; const newState = { ...state, id: newId, error: Get(newId) ? 'ID Already Taken' : null, } setState(newState); } const inputLabel = useRef(null); const [labelWidth, setLabelWidth] = useState(0); useEffect(() => { setLabelWidth(inputLabel.current.offsetWidth); }, []); return ( <Card className={classes.card}> <CardContent className={classes.content}> <FormControl className={classes.formControl}> <TextField required label={state.error ? state.error : 'Analytical Method Id'} className={clsx(classes.textField, classes.dense)} onChange={handleChangeID} margin="dense" disabled={id ? true : false} error={state.error ? true : false} variant="outlined" value={state.id} inputProps={{ name: 'id', id: 'analytical-method-id', }} /> </FormControl> <FormControl variant="outlined" className={classes.formControl}> <InputLabel ref={inputLabel} htmlFor="residue-type"> Target Residue Type</InputLabel> <Select native required onChange={handleChange('residueType')} labelWidth={labelWidth} value={state.residueType} inputProps={{ name: 'residueType', id: 'analytical-residue-type', }} > <option value="" /> <option value={ResidueTypes.API}>API</option> <option value={ResidueTypes.CLEANINGAGENT}>Cleaning Agent</option> <option value={ResidueTypes.BIOBURDEN}>Bioburden</option> <option value={ResidueTypes.ENDOTOXIN}>Endotoxin</option> </Select> </FormControl> {state.residueType === ResidueTypes.API && ( <Api onChange={handleChange(ResidueTypes.API)} passedState={state[ResidueTypes.API]} /> )} {state.residueType === ResidueTypes.CLEANINGAGENT && ( <Api onChange={handleChange(ResidueTypes.CLEANINGAGENT)} passedState={state[ResidueTypes.CLEANINGAGENT]} /> )} {state.residueType === ResidueTypes.BIOBURDEN && ( <BioBurden onChange={handleChange(ResidueTypes.BIOBURDEN)} passedState={state[ResidueTypes.BIOBURDEN]} /> )} {state.residueType === ResidueTypes.ENDOTOXIN && ( <BioBurden onChange={handleChange(ResidueTypes.ENDOTOXIN)} passedState={state[ResidueTypes.ENDOTOXIN]} /> )} <FormControl className={classes.formControl}> <TextField label="Reason" required className={clsx(classes.textField, classes.dense)} margin="dense" variant="outlined" onChange={handleChange('reason')} value={state.reason} inputProps={{ name: 'reason', id: 'analytical-reason', }} /> </FormControl> </CardContent> <CardActions className={classes.footer}> <CancelButton /> <AddButton state={state} id={id} setState={setState} /> </CardActions> </Card> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initalizeForm() {\n const self = this;\n\n self.annotonPresentation = self.getAnnotonPresentation(this.annoton);\n\n }", "function showAddCommitmentForm() {\n vm.form.data = {\n category: null,\n question: null,\n name: null,\n description: null,\n status: null,\n dueDate: null\n };\n vm.form.title = \"Add Commitment\";\n vm.form.onSave = vm.add;\n vm.form.onClose = vm.form.show = false;\n\n vm.form.show = true;\n }", "function createForm(adata, resource, method) {\n\t\tvar formTitle = formatTitle( getCurrentHash() );\n\t\tlet html = `<h3>${ formTitle } - ${ method }</h3>`;\n\t\tconst fhref = apiU + getCurrentHash();\n\t\t\n\t\t\n html += `\n <p>Please note that all fields marked with an asterisk (*) are required.</p>\n <form\n class=\"resource-form\"\n data-href=\"${resource + '/'}\"\n data-method=\"${escapeAttr(method)}\">\n `;\n\t\t\n //adata = JSON.parse(adata);\n\n for (key in adata.data) {\n\t\t\t\n\t\t\tconst properties = adata.data[key];\n\t\t\tconst name = properties.name;\n\t\t\t\n const title = formatTitle(properties.name);\n\t\t\tconst isInteger = false;\n const isRequired = properties.required;\n\n html += `\n <label>\n ${escapeHtml(title)}\n ${isRequired ? '*' : ''}\n <br>\n <input\n class=\"u-full-width\"\n name=\"${name}\"\n type=\"${isInteger ? 'number' : 'text'}\"\n placeholder=\"${escapeAttr(properties.prompt)}\"\n ${isRequired ? 'required' : ''}>\n </label>\n `;\n }\n\n html += '<br><input class=\"btn waves-effect waves-light\" type=\"submit\" value=\"Submit\">';\n html += '</form>';\n return html;\n }", "rentalFormShow() {\n this.set('addNewRental', true);\n }", "function initializeForm() {\n editor.afform = editor.data.definition;\n if (!editor.afform) {\n alert('Error: unknown form');\n }\n if (editor.mode === 'clone') {\n delete editor.afform.name;\n delete editor.afform.server_route;\n editor.afform.is_dashlet = false;\n editor.afform.title += ' ' + ts('(copy)');\n }\n $scope.canvasTab = 'layout';\n $scope.layoutHtml = '';\n editor.layout = {'#children': []};\n $scope.entities = {};\n\n if (editor.getFormType() === 'form') {\n editor.allowEntityConfig = true;\n editor.layout['#children'] = afGui.findRecursive(editor.afform.layout, {'#tag': 'af-form'})[0]['#children'];\n $scope.entities = _.mapValues(afGui.findRecursive(editor.layout['#children'], {'#tag': 'af-entity'}, 'name'), backfillEntityDefaults);\n\n if (editor.mode === 'create') {\n editor.addEntity(editor.entity);\n editor.afform.create_submission = true;\n editor.layout['#children'].push(afGui.meta.elements.submit.element);\n }\n }\n\n else if (editor.getFormType() === 'block') {\n editor.layout['#children'] = editor.afform.layout;\n editor.blockEntity = editor.afform.join_entity || editor.afform.entity_type;\n $scope.entities[editor.blockEntity] = backfillEntityDefaults({\n type: editor.blockEntity,\n name: editor.blockEntity,\n label: afGui.getEntity(editor.blockEntity).label\n });\n }\n\n else if (editor.getFormType() === 'search') {\n editor.layout['#children'] = afGui.findRecursive(editor.afform.layout, {'af-fieldset': ''})[0]['#children'];\n editor.searchDisplay = afGui.findRecursive(editor.layout['#children'], function(item) {\n return item['#tag'] && item['#tag'].indexOf('crm-search-display-') === 0;\n })[0];\n editor.searchFilters = getSearchFilterOptions();\n }\n\n // Set changesSaved to true on initial load, false thereafter whenever changes are made to the model\n $scope.changesSaved = editor.mode === 'edit' ? 1 : false;\n $scope.$watch('editor.afform', function () {\n $scope.changesSaved = $scope.changesSaved === 1;\n }, true);\n }", "render() {\n\n return (\n <Form\n className=\"form\"\n model=\"solarAnalyzer\"\n onSubmit={(formData) => this.props.onSubmitForm(formData)}\n >\n <table>\n <tbody>\n <tr>\n <td className=\"form-td\">\n <FormTextField\n label='Address:'\n placeholder='Address'\n fieldName='.address'\n errorMessage=\"Invalid Address\"\n />\n </td>\n </tr>\n <tr>\n <td className=\"form-td\">\n <FormDateField\n label='Starting Date:'\n placeholder={moment().subtract(7, 'days').format(\"MM-DD-YYYY\")}\n fieldName='.startingDate'\n errorMessage=\"Invalid Date\"\n />\n </td>\n </tr>\n <tr>\n <td className=\"form-td\">\n <FormDateField\n label='Ending Date:'\n placeholder={moment().format(\"MM-DD-YYYY\")}\n fieldName='.endingDate'\n errorMessage=\"Invalid Date\"\n />\n </td>\n </tr>\n <tr>\n <td className=\"errors\">\n {this.props.errorMessage}\n </td>\n </tr>\n <tr>\n <td className=\"form-td\">\n <Control.button model=\"solarAnalyzer\" className=\"button\">Analyze</Control.button>\n </td>\n </tr>\n </tbody>\n </table>\n </Form>\n );\n }", "createForm(){\n this.form_ = this.create_();\n }", "function AddNew() {\n debugger;\n Resetform();\n openNav();\n ChangeButtonPatchView('DepositAndWithdrawals', 'btnPatchAdd', 'AddSubIncoming');\n\n\n}", "setAddForm(addform){\n this.addform = addform;\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 Form(options) {\n this.setForm(options.inputID);\n this.setInput(options.inputID);\n this.setResult(options.resultID);\n this.setItemClass(options.itemClass);\n this.setSortButton(options.sortID);\n }", "function planFormCaller() {\n plan.planForm();\n}", "function showMFForm(pageIdToLoad) {\n\n console.log(\"show Benefit to fit your life form\");\n $(\"#myform\").css('display','block');\n $(\"#myform\").html(\"\");\n $(\"#myform\").alpaca({\n \"view\": \"bootstrap-edit\",\n \"data\": node,\n \"schema\": {\n \"title\": \"newMF\",\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"title\": \"name\",\n \"readonly\":true\n }, \n \"headerTitle\": {\n \"type\": \"string\",\n \"title\": \"headerTitle\"\n },\n \"callout1\": {\n \"type\": \"string\",\n \"title\": \"callout1\"\n },\n \"callout2\": {\n \"type\": \"string\",\n \"title\": \"callout2\"\n },\n \"accordions\": {\n \"type\": \"array\",\n \"title\": \"accordions\",\n \"items\": {\n \"type\": \"object\",\n \"title\": \"accordionItem\",\n \"properties\": {\n \"accordionName\": {\n \"type\": \"string\",\n \"title\": \"Name\"\n },\n \"headerText\": {\n \"type\": \"string\",\n \"title\": \"Header Text\"\n },\n \"items\": {\n \"type\": \"array\",\n \"title\": \"Upper Accordion Items\",\n \"items\": {\n \"type\": \"object\",\n \"title\": \"Item\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"title\": \"Item Name\"\n },\n \"link\": {\n \"type\": \"string\",\n \"title\": \"item Link Url\"\n },\n \"description\": {\n \"type\": \"string\",\n \"title\": \"Item Description\"\n }\n }\n }\n },\n \"subAccordions\": {\n \"type\": \"array\",\n \"title\": \"subaccordions\",\n \"items\": {\n \"type\": \"object\",\n \"title\": \"subaccordion\",\n \"properties\": {\n \"subAccordionName\": {\n \"type\": \"string\",\n \"title\": \"Sub Accordion Name\"\n },\n \"items\": {\n \"type\": \"array\",\n \"title\": \"Sub Accordion Items\",\n \"items\": {\n \"type\": \"object\",\n \"title\": \"Item\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"title\": \"Item Name\"\n },\n \"link\": {\n \"type\": \"string\",\n \"title\": \"item Link Url\"\n },\n \"description\": {\n \"type\": \"string\",\n \"title\": \"Item Description\"\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n },\n \"_parent\": \"n:node\",\n \"items\": {},\n \"description\": \"custom:pagebtfy0\",\n \"$schema\": \"http://json-schema.org/draft-04/schema#\"\n },\n \"options\": {\n \"form\": {\n \"buttons\": {\n \"submit\": {\n \"click\": function () {\n clearTimer();\n console.log(\"Timer Cleared\");\n setTimer();\n console.log(\"Timer Set\");\n\n var value = this.getValue();\n //alert(JSON.stringify(value, null, \" \"));\n node.headerTitle = value.headerTitle;\n node.callout1 = value.callout1;\n node.callout2 = value.callout2;\n node.accordions = value.accordions;\n node.update().then(function () {\n alert(\"Form Submitted\");\n window.location =\"../index.html\";\n });\n }\n }\n }\n },\n \"title\": \"newPageTitle\",\n \"engineId\": \"alpaca1\",\n \"fields\": {\n \"headerTitle\": {\n \"type\": \"text\"\n },\n \"callout1\": {\n \"type\": \"ckeditor\" \n },\n \"callout2\": {\n \"type\": \"ckeditor\" \n },\n \"accordions\": {\n \"options\": {\n \"actionBarType\": \"right\"\n }\n }\n }\n }\n });\n}", "function addFormEdits(form){\r\n jQuery(form).addClass('admin-edit')\r\n var adjdata = getFormAdjustments(jQuery(form).attr('id'))\r\n var data = cachedForms[jQuery(form).attr('id')]\r\n \r\n jQuery(form).find('.elq-field').each(function(index, element) {\r\n //jQuery(element).find('.admin-tools').length\r\n if(jQuery(element).find('.admin-tools').length==0 && jQuery(element).parents('.tray').length==0){\r\n var id = jQuery(element).attr('id').replace(/elq-/g,'')\r\n var f = _.find(data.elements,function(f){\r\n return id == f.id\r\n })\r\n var fd = _.find(adjdata.elements,function(fd){\r\n return id == fd.id\r\n })\r\n var type = jQuery(this).attr('data-type')\r\n var str = tmp.admintools(f) \r\n jQuery(this).prepend(str);\r\n if(fd){\r\n jQuery(element).find('.admin-editor').addClass('hasedit')\r\n }\r\n }\r\n });\r\n \r\n \r\n}", "function showForm( method, object_id ){\n\n var formulario = self[method+'Form'].clone();\n\n self.tablePageContent = tabela.html(); // salva a tabela\n\n self.scroll = $(window).scrollTop(); // salva a posição na tela\n\n if( method == 'get' || method == 'patch' ){\n\n $.get( remoteUrl, {\n id: object_id\n , format: 'json'\n })\n .success(function(res){\n\n // popula formulario\n formulario.dataBind(res);\n\n tabela.html(formulario);\n\n aplicarGatilhosForm( method, object_id );\n\n })\n .fail(function(res, b, c){\n\n mostraErro( res );\n\n });\n\n } else {\n\n tabela.html(formulario);\n\n aplicarGatilhosForm( method, object_id );\n\n }\n\n }", "function FormDesigner() {\n\t\t\tvar getJsObjectForProperty = function(container, property, value) {\n\t\t\t\tvar defaultValue = \"\";\n\t\t\t\tif(typeof value !== \"undefined\") {\n\t\t\t\t\tdefaultValue = value;\n\t\t\t\t} else if(typeof property[\"default\"] !== \"undefined\") {\n\t\t\t\t\tdefaultValue = property[\"default\"];\n\t\t\t\t}\n\t\t\t\tvar element;\n\t\t\t\tswitch(property[\"htmlFieldType\"]) {\n\t\t\t\t\tcase \"Hidden\": \n\t\t\t\t\t\telement = new HiddenElement(container, property[\"displayName\"]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"MultiChoice\" :\n\t\t\t\t\t\telement = new MultiChoiceSelectElement(container, property[\"displayName\"], property[\"helpText\"], property[\"options\"], property[\"default\"]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"MultiText\":\n\t\t\t\t\t\telement = new MultiChoiceTextElement(container, property[\"displayName\"], property[\"helpText\"], property[\"default\"], property[\"placeholder\"]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Select\":\n\t\t\t\t\t\telement = new SelectElement(container, property[\"displayName\"], property[\"options\"], property[\"helpText\"]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Editor\":\n\t\t\t\t\t\telement = new EditorElement(container, property[\"displayName\"], property[\"helpText\"], property[\"editorOptions\"]); /*the last argument should be editor options */\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"History\":\n\t\t\t\t\t\telement = new HistoryElement(container, property[\"displayName\"], true); \n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"TextElement\":\n\t\t\t\t\t\telement = new TextElement(container, property[\"displayName\"]); \n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"TextDisplay\":\n\t\t\t\t\t\telement = new TextDisplay(container, property[\"displayName\"]); \n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(defaultValue !== \"\") {\n\t\t\t\t\telement.setValue(defaultValue);\n\t\t\t\t}\n\t\t\t\treturn element;\n\t\t\t}\n\n\t\t\tvar drawEditableObject = function(container, metadata, object) {\n\t\t\t\tvar resultObject = {};\n\t\t\t\tresultObject = $.extend(true, {}, metadata); //make a deep copy\n\t\t\t\t\n\t\t\t\t//creating property div containers\n\t\t\t\tvar html = '<form class=\"form-horizontal\" role=\"form\" class=\"create-form\">';\n\t\t\t\t\thtml += '<div class=\"col-sm-offset-3 col-sm-9 response-container alert alert-dismissible\" role=\"alert\">'; \n\t\t\t\t\t\thtml += '<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>';\n\t\t\t\t\t\thtml += '<span class=\"message\"></span>'\n\t\t\t\t\thtml += \"</div>\";\n\t\t\t\t\thtml += '<div class=\"form-container\">';\n\t\t\t\t\t\tfor(var i = 0; i < metadata[\"propertyOrder\"].length; i++) {\n\t\t\t\t\t\t\tvar propertyKey = metadata[\"propertyOrder\"][i];\n\t\t\t\t\t\t\tif(metadata[\"properties\"][propertyKey][\"htmlFieldType\"] != \"Hidden\") {\n\t\t\t\t\t\t\t\thtml += '<div class=\"form-group ' + propertyKey + \"-id\" + '\"></div>';\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\thtml += '<div class=\"' + propertyKey + \"-id\" + '\"></div>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//this gives us a space for the buttons/events\n\t\t\t\t\t\thtml += '<div class=\"col-sm-offset-3 col-sm-9 event-container\">'; \n\t\t\t\t\t\thtml += \"</div>\";\n\t\t\t\t\thtml += \"<br/><br/></div>\";\n\t\t\t\thtml += '</form>';\n\t\t\t\t$(container).html(html);\n\t\t\t\t\n\t\t\t\t//now add js elements to property div containers\n\t\t\t\tfor(property in resultObject[\"properties\"]) {\n\t\t\t\t\tvar propertyContainer = container + ' .' + property + \"-id\";\n\t\t\t\t\tresultObject[\"properties\"][property] = getJsObjectForProperty(propertyContainer, resultObject[\"properties\"][property], object[property]);\n\t\t\t\t}\n\t\t\t\tresultObject[\"metadata\"] = {};\n\t\t\t\tresultObject[\"metadata\"][\"properties\"] = metadata[\"properties\"];\n\t\t\t\t$(container + \" .response-container\").hide();\n\t\t\t\tresultObject[\"showError\"] = function(message) {\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"success\");\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"warning\");\n\t\t\t\t\t$(container + \" .response-container\").addClass(\"alert-danger\");\n\t\t\t\t\t$(container + \" .response-container span.message\").html(message);\n\t\t\t\t\t$(container + \" .response-container\").show();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tresultObject[\"showWarning\"] = function(message) {\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"success\");\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"error\");\n\t\t\t\t\t$(container + \" .response-container\").addClass(\"alert-warning\");\n\t\t\t\t\t$(container + \" .response-container span.message\").html(message);\n\t\t\t\t\t$(container + \" .response-container\").show();\n\t\t\t\t}\n\n\t\t\t\tresultObject[\"showSuccess\"] = function(message) {\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"warning\");\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"error\");\n\t\t\t\t\t$(container + \" .response-container\").addClass(\"alert-success\");\n\t\t\t\t\t$(container + \" .response-container span.message\").html(message);\n\t\t\t\t\t$(container + \" .response-container\").show();\n\t\t\t\t}\n\t\t\t\tresultObject[\"clearValues\"] = function() {\n\t\t\t\t\tfor(property in resultObject[\"properties\"]) {\n\t\t\t\t\t\tresultObject[\"properties\"][property].setValue(resultObject[\"metadata\"][\"properties\"][property][\"default\"]); \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn resultObject;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tdrawEditableObject : drawEditableObject\n\t\t\t}\n\t\t}", "function addNewItem() { switchToView('edit-form'); }", "function showEditParticipantForm() {\n app.getView().render('account/giftregistry/eventparticipant');\n}", "function GrouponAwardView() {\n FormView.apply(this, arguments);\n }", "function AddNew()\n{\n debugger;\n Resetform();\n openNav();\n ChangeButtonPatchView('DepositAndWithdrawals', 'btnPatchAdd', 'AddSub');\n}", "createForm () {\n if (document.getElementById('leaderboardButton')) {\n document.getElementById('leaderboardButton').remove();\n }\n crDom.createLeaderboardButton();\n crDom.createForm();\n crDom.createCategoriesChoice(this.filter.category);\n crDom.createDifficultyChoice(this.filter.difficulty);\n crDom.createRangeSlider(this.filter.limit);\n crDom.createStartButton();\n }", "@api\n form(isCreate, fields) {\n let augmentedFields = fields.map((field) => {\n return {\n ...field,\n options:\n field.dataType === \"Picklist\"\n ? this.wiredPicklistOptions.data[field.apiName]\n : []\n };\n });\n return `\n <form action=\"{{FORM_ACTION}}\" method=\"get\" style=${elementStyles.form}>\n ${augmentedFields.map(elementString).join(\"\")}\n ${\n isCreate\n ? `<input type=\"hidden\" value='{{RECORD_ID}}' name=\"recordId\"/>`\n : \"\"\n }\n <input type=\"hidden\" value='${this.objectApiName}' name=\"objectApiName\"/>\n <input type=\"hidden\" value='{{FORM_ID}}' name=\"formId\"/>\n <button type=\"submit\" style=\"${elementStyles.button}\">Submit</button>\n </form>\n `;\n }", "updateRentalForm() {\n this.set('updateRentalForm', true);\n }", "navigateAdd() {\n this.channel.trigger('show:form');\n }", "createEditForm() {\n const form = HTML.createElement(\"form\");\n form.classList.add(\"patchGroupEdit\");\n for (const key of [\n \"name\",\n \"description\",\n \"row\",\n \"group\",\n \"span\",\n \"enumeration\",\n \"tags\",\n \"color\",\n ]) {\n const capitalized = key.charAt(0).toUpperCase() + key.slice(1);\n const id = `patchGroupEdit${capitalized}`;\n form.appendChild(\n HTML.createElement(\"label\", {\n textContent: capitalized,\n for: id,\n })\n );\n form.appendChild(\n HTML.createElement(\"input\", {\n type: \"text\",\n name: key,\n id,\n value: [\"enumeration\", \"tags\"].includes(key)\n ? this[key].join(\",\")\n : this[key],\n })\n );\n }\n const id = \"patchGroupEditNormals\";\n form.appendChild(\n HTML.createElement(\"label\", {\n textContent: \"Normals\",\n for: id,\n })\n );\n form.appendChild(\n HTML.createElement(\"select\", {\n id,\n children: [\"\", \"ABOVE\", \"BELOW\", \"RIGHT OUT\", \"RIGHT IN\"].map((value) =>\n HTML.createElement(\"option\", {\n value,\n textContent: value,\n selected: this.normals === value,\n })\n ),\n })\n );\n this.editForm = form;\n return this;\n }", "getForm() {\r\n return (\r\n <StagingForm\r\n // Update functions\r\n //onStagingUpdate={this.handleStagingUpdate}\r\n\t\t\t\tupdateValue={this.updateValue}\r\n // Properties\r\n staging={this.staging}\r\n />\r\n ); \r\n }", "function _edit() {\n $('name').value = this.name;\n $('key').value = this.key;\n $('action').value = this.action;\n switchToView('edit-form');\n}", "function setAddMode() {\n vm.setToDefaultMode();\n vm.addMode = true;\n vm.currentOutcomeMeasure = {};\n $scope.om_form.$setPristine();\n }", "showEditForm(data) {\n const newData = {\n id: data.id,\n title: data.title,\n city: data.city_id,\n oldTitle: data.title\n };\n\n this.showCreateForm(newData);\n }", "function finGpsAdditionalGoalsCtrl($scope, $state, $http, toaster, finGpsService) {\n $scope.finGpsAdditionalGoalsForm = {};\n $scope.todayDate = moment().hours(23).minutes(59).seconds(59).milliseconds(0);\n $scope.formEditable = true;\n $scope.init = function () {\n finGpsService.getInfo('additionalGoals').then(function (response) {\n if (response != null && response.additionalGoals.goals != null && response.additionalGoals.goals.length != 0) {\n if (!IsAdmin()) formStatus(response.state);\n $scope.additionalGoalList = response.additionalGoals.goals;\n $scope.finGpsAdditionalGoalsForm.comment = response.additionalGoals.comment;\n } else {\n $scope.additionalGoalList = [\n {\n _id: 0,\n additionalType: '',\n name: '',\n year: '',\n amount: '',\n priority: ''\n }\n ];\n }\n }, function (reason) {\n console.log(reason);\n });\n loadGoalType();\n };\n var loadGoalType = function () {\n $http({\n method: 'GET',\n url: window.StorageURL.goalType\n }).then(function successCallback(response) {\n if (response.data == 0) {\n return false;\n }\n $scope.goalTypeList = response.data;\n }, function errorCallback(response) {\n console.log(response);\n });\n };\n $scope.additionalGoalList = [\n {\n _id: 0,\n additionalType: '',\n name: '',\n year: '',\n amount: '',\n priority: ''\n }\n ];\n $scope.addAdditionalGoal = function (goal) {\n var tmp = {\"_id\": 0, \"additionalType\": '', \"name\": '', \"year\": '', \"amount\": '', \"priority\": ''};\n tmp._id = goal._id + 1;\n $scope.additionalGoalList.push(tmp);\n };\n $scope.deleteAdditionalGoal = function (index) {\n $scope.additionalGoalList.splice(index, 1);\n };\n $scope.submitAdditionalGoal = function () {\n var goalLists = {\n goals: $scope.additionalGoalList,\n comment: $scope.finGpsAdditionalGoalsForm.comment\n };\n finGpsService.setInfo('additionalGoals', goalLists);\n $state.go('forms.finGps.finGpsCashFlow.incomeCashFlow');\n toaster.success(\"Saved successfully\");\n };\n function formStatus(state) {\n if (state == 'infoProvided') {\n $scope.formEditable = false;\n }\n if (!$scope.formEditable) {\n $(\"#finGpsAdditionalGoalsForm :input\").attr(\"disabled\", true);\n $(\"#finGpsAdditionalGoalsForm :submit\").attr(\"disabled\", true);\n }\n }\n}", "function onClickOpenForm() {\n // Basculement du formulaire en mode ajout puis affichage.\n document.querySelector(\"#task-form\").dataset.mode = \"add\";\n document.querySelector(\"#task-form\").reset();\n document.querySelector(\"#task-form\").classList.remove(\"hide\");\n}", "experienceForm(){\n this.setState(\n {\n form: ExperienceForm, \n titleModal: 'Add Experience', \n fillFunction: this.fillExp,\n saveFunction: this.saveExp,\n stateForValue:'experience'\n })\n this.showModal()\n }", "function ciniki_artcatalog_tracking() {\n //\n // The panel to display the edit tracking form\n //\n this.edit = new M.panel('Edit Exhibited',\n 'ciniki_artcatalog_tracking', 'edit',\n 'mc', 'medium', 'sectioned', 'ciniki.artcatalog.tracking.edit');\n this.edit.data = {};\n// this.edit.gstep = 1;\n this.edit.sections = {\n 'info':{'label':'Place', 'type':'simpleform', \n// 'gstep':1,\n// 'gtitle':'Where was the item exhibited?',\n 'fields':{\n 'name':{'label':'Name', 'type':'text', 'livesearch':'yes', 'livesearchempty':'yes',\n 'gtitle':'What is the name of the venue?',\n 'htext':'The place where you displayed your work.'\n + \" This can be a gallery, personal collection, show or anything else you want.\",\n },\n 'external_number':{'label':'Number', 'type':'text', 'size':'small',\n 'gtitle':'Did they give you an item number?',\n 'htext':'If the venue has their own item number, you can enter that here.'},\n 'start_date':{'label':'Start', 'type':'date',\n 'gtitle':'When was your item displayed?',\n 'htext':'The first day your item was on display.',\n },\n 'end_date':{'label':'End', 'type':'date',\n 'htext':'The last day your item was on display.'},\n }},\n '_notes':{'label':'Notes', 'type':'simpleform', \n// 'gstep':2,\n// 'gtitle':'Do you have any notes about the exhibition?',\n// 'gmore':'Any private notes you want to keep about showing this item at this venue.',\n 'fields':{\n 'notes':{'label':'', 'type':'textarea', 'size':'medium', 'hidelabel':'yes'},\n }},\n '_buttons':{'label':'', \n// 'gstep':3,\n// 'gtitle':'Save the exhibition information',\n// 'gtext-add':'Press the save button this exhibited place.',\n// 'gtext-edit':'Press the save button the changes.',\n// 'gmore-edit':'If you want to remove this exhibited place for your item, press the Remove button.',\n 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_artcatalog_tracking.edit.save();'},\n 'delete':{'label':'Remove', 'visible':'no', 'fn':'M.ciniki_artcatalog_tracking.edit.remove();'},\n }},\n };\n this.edit.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.artcatalog.trackingHistory', \n 'args':{'tnid':M.curTenantID, 'tracking_id':this.tracking_id, 'field':i}};\n \n };\n this.edit.fieldValue = function(s, i, d) { \n if( this.data[i] != null ) { return this.data[i]; } \n return ''; \n };\n this.edit.liveSearchCb = function(s, i, value) {\n if( i == 'name' ) {\n M.api.getJSONBgCb('ciniki.artcatalog.trackingSearch', \n {'tnid':M.curTenantID, 'field':i, 'start_needle':value, 'limit':15},\n function(rsp) {\n M.ciniki_artcatalog_tracking.edit.liveSearchShow(s, i, M.gE(M.ciniki_artcatalog_tracking.edit.panelUID + '_' + i), rsp.results);\n });\n }\n };\n this.edit.liveSearchResultClass = function(s, f, i, j, value) {\n return 'multiline';\n };\n this.edit.liveSearchResultValue = function(s, f, i, j, d) {\n if( (f == 'name' ) && d.result != null ) { return '<span class=\"maintext\">' + d.result.name + '</span><span class=\"subtext\">' + d.result.start_date + ' - ' + d.result.end_date + '</span>'; }\n return '';\n };\n this.edit.liveSearchResultRowFn = function(s, f, i, j, d) { \n if( (f == 'name') && d.result != null ) {\n return 'M.ciniki_artcatalog_tracking.edit.updateField(\\'' + s + '\\',\\'' + f + '\\',\\'' + escape(d.result.name) + '\\',\\'' + escape(d.result.start_date) + '\\',\\'' + escape(d.result.end_date) + '\\');';\n }\n };\n this.edit.updateField = function(s, fid, result, sd, ed) {\n M.gE(this.panelUID + '_' + fid).value = unescape(result);\n if( fid == 'name' ) {\n M.gE(this.panelUID + '_start_date').value = unescape(sd);\n M.gE(this.panelUID + '_end_date').value = unescape(ed);\n }\n this.removeLiveSearch(s, fid);\n };\n this.edit.sectionGuidedText = function(s) {\n if( s == '_buttons' ) {\n if( this.sections[s].buttons.delete.visible == 'yes' ) {\n return this.sections[s]['gtext-edit'];\n } else {\n return this.sections[s]['gtext-add'];\n }\n }\n if( this.sections[s] != null && this.sections[s].gtext != null ) { return this.sections[s].gtext; }\n return null;\n };\n this.edit.sectionGuidedMore = function(s) {\n if( s == '_buttons' ) {\n if( this.sections[s].buttons.delete.visible == 'yes' ) {\n return this.sections[s]['gmore-edit'];\n }\n }\n if( this.sections[s] != null && this.sections[s].gmore != null ) { return this.sections[s].gmore; }\n return null;\n };\n this.edit.open = function(cb, tid, aid, name) {\n if( tid != null ) { this.tracking_id = tid; }\n if( aid != null ) { this.artcatalog_id = aid; }\n if( this.tracking_id > 0 ) {\n this.sections._buttons.buttons.delete.visible = 'yes';\n M.api.getJSONCb('ciniki.artcatalog.trackingGet', \n {'tnid':M.curTenantID, 'tracking_id':this.tracking_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_artcatalog_tracking.edit;\n p.data = rsp.place;\n p.refresh();\n p.show(cb);\n });\n } else {\n this.reset();\n this.sections._buttons.buttons.delete.visible = 'no';\n this.data = {};\n this.refresh();\n this.show(cb);\n }\n }\n this.edit.save = function() {\n if( this.tracking_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.artcatalog.trackingUpdate', {'tnid':M.curTenantID, \n 'tracking_id':this.tracking_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n } else {\n M.ciniki_artcatalog_tracking.edit.close();\n }\n });\n } else {\n this.close();\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.artcatalog.trackingAdd', \n {'tnid':M.curTenantID, 'artcatalog_id':this.artcatalog_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n } else {\n M.ciniki_artcatalog_tracking.edit.close();\n }\n });\n }\n }\n this.edit.remove = function() {\n M.confirm('Are you sure you want to remove \\'' + this.data.artcatalog_name + '\\' from the exhibited list \\'' + this.data.name + '\\'?',null,function() {\n M.api.getJSONCb('ciniki.artcatalog.trackingDelete', {'tnid':M.curTenantID, \n 'tracking_id':M.ciniki_artcatalog_tracking.edit.tracking_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_artcatalog_tracking.edit.close();\n });\n });\n }\n this.edit.addButton('save', 'Save', 'M.ciniki_artcatalog_tracking.edit.save();');\n this.edit.addClose('Cancel');\n\n this.start = function(cb, appPrefix, aG) {\n args = {};\n if( aG != null ) {\n args = eval(aG);\n }\n\n //\n // Create container\n //\n var appContainer = M.createContainer(appPrefix, 'ciniki_artcatalog_tracking', 'yes');\n if( appContainer == null ) {\n M.alert('App Error');\n return false;\n }\n\n if( args.add != null && args.add == 'yes' ) {\n this.edit.open(cb, 0, args.artcatalog_id, unescape(args.name));\n } else if( args.tracking_id != null && args.tracking_id > 0 ) {\n this.edit.open(cb, args.tracking_id, unescape(args.name));\n }\n return false;\n }\n}", "constructor() {\n this.setUpAddForm();\n this.setUpRemoveForm();\n this.updateButton();\n }", "constructor(parent) {\n this.parent = parent;\n this.form = this.createForm();\n }", "create(form) {\n this.submitted = true;\n this.homework.creator = this.getCurrentUser();\n this.homework.maxPoints = this.maxPoints;\n // TODO add class (fetch from teacher?)\n\n if (form.$valid) {\n this.homeworkService.save(this.homework, () => {\n // Refresh the page\n this.$state.go(this.$state.current, {}, {reload: true});\n });\n }\n }", "function initialiseForm() {\n\n // utility functions\n function rollback($form) {\n $form.find('input[type=text]').each(function () {\n var $this = $(this);\n $this.val($this.data('rollback'));\n });\n }\n function updateDetails($form, data) {\n $form.find('#fullname').val(data.displayName);\n $form.find('#email').val(data.emailAddress);\n $form.find('input[type=text]').each(function () {\n var $this = $(this);\n $this.data('rollback', $this.val());\n });\n }\n function closeEditDetails($form) {\n $form.removeClass('editing').find('#fullname, #email').attr('readonly', 'readonly');\n $('#ajax-status-message').empty();\n clearErrors();\n }\n\n // event bindings\n $('#edit-details').click(function (e) {\n $('.panel-details form.editable').addClass('editing').find('#fullname, #email').removeAttr('readonly');\n if (e.target.id !== 'email') {\n $('#fullname', '.panel-details form.editable').focus();\n }\n e.preventDefault();\n });\n $('.panel-details form.editable').keyup(function (e) {\n if (e.which === AJS.keyCode.ESCAPE) {\n $('a.cancel', this).click();\n }\n });\n $('.cancel', '.panel-details form.editable').click(function (e) {\n e.preventDefault();\n var $form = $(this).parents('form');\n rollback($form);\n closeEditDetails($form);\n return false;\n });\n $('.panel-details form.editable').submit(function (e) {\n e.preventDefault();\n clearErrors();\n var $form = $(this);\n var displayName = $form.find('#fullname').val();\n ajax.rest({\n url: $form.attr('action'),\n type: 'PUT',\n data: {\n name: $form.find('#name').val(),\n displayName: displayName,\n email: $form.find('#email').val()\n },\n statusCode: { // these errors are handled locally.\n '500': function _() {\n return false;\n },\n '404': function _() {\n return false;\n },\n '401': function _() {\n return false;\n },\n '400': function _() {\n return false;\n }\n }\n }).done(function (data) {\n updateDetails($form, data);\n closeEditDetails($form);\n notifySuccess(AJS.I18n.getText('bitbucket.web.user.update.success', displayName));\n }).fail(function (xhr, textStatus, errorThrown, data) {\n var errors = data && data.errors ? data.errors : AJS.I18n.getText('bitbucket.web.user.update.failure');\n notifyErrors(errors);\n });\n });\n }", "showCreateForm(data) {\n this.clearNewOrgan(data);\n this.changeFormMode(this.FORM_MODES.CREATE);\n }", "addForm() {\n // Creates a new form based on TEMPLATE\n let template = document.importNode(TEMPLATE.content, true);\n FORMSET_BODY.appendChild(template);\n let form = FORMSET_BODY.children[FORMSET_BODY.children.length -1];\n\n // Updates the id's of the form to unique values\n form.innerHTML = form.innerHTML.replace(MATCH_FORM_IDS, this.updateMatchedId.bind(this, form));\n\n let index = FORMSET_BODY.children.length;\n FORMSET.querySelector('[name=\"form-TOTAL_FORMS\"]').value = index;\n this.updateButton();\n }", "function NewEntryForm() {\n $(\"#addCancel\").click(this.clearForm);\n $(\"#addButton\").click(this.submitForm);\n }", "function addNewForm() {\n var prototype = $collectionHolder.data('prototype')\n var index = $collectionHolder.data('index')\n var newForm = prototype\n newForm = newForm.replace(/__name__/g, index)\n $collectionHolder.data('index', index+1)\n // création panel\n var $panel = $(\n '<div class=\"panel panel-warning\"><div class=\"panel-heading\"></div></div>',\n )\n var $panelBody = $('<div class=\"panel-body\"></div>').append(newForm)\n $panel.append($panelBody)\n addRemoveButton($panel)\n $addNewItem.before($panel)\n}", "toggleAddEmployeeForm(){\n\n if(this.addEmployeeForm == false){\n this.addEmployeeForm =true;\n }else {\n this.addEmployeeForm = false;\n }\n\n }", "updateForm() {\n this.$step.innerText = this.currentStep;\n\n // TODO: Validation\n\n this.slides.forEach(slide => {\n slide.classList.remove(\"active\");\n\n if (slide.dataset.step == this.currentStep) {\n slide.classList.add(\"active\");\n }\n });\n\n this.$stepInstructions[0].parentElement.parentElement.hidden = this.currentStep >= 5;\n this.$step.parentElement.hidden = this.currentStep >= 5;\n\n // TODO: get data from inputs and show them in summary\n }", "onBtnEditClick() {\n\t\tthis.changeTripReportMode('edit');\n\t}", "function finGpsInsurancePremiumCtrl($scope, $state, toaster, finGpsService) {\n $scope.insurancePremiumForm = {};\n $scope.formEditable = true;\n $scope.init = function () {\n finGpsService.getInfo('insurance').then(function (response) {\n if (response != null && response.insurance !== undefined && response.insurance != undefined) {\n if (!IsAdmin()) formStatus(response.state);\n $scope.insurancePremiumForm = response.insurance;\n $scope.generalInsuranceList = response.insurance.additionalInsurance;\n } else {\n $scope.generalInsuranceList = [\n {\n _id: 0,\n addParticular: '',\n addParticularAmt: '',\n addParticularCycle: ''\n\n }\n ];\n }\n }, function (reason) {\n console.log(reason);\n });\n };\n $scope.generalInsuranceList = [{\n _id: 0,\n addParticular: \"\",\n addParticularAmt: '',\n addParticularCycle: ''\n }];\n $scope.addGeneralInsurance = function (generalInsurance) {\n var tmp = {\"_id\": 0, \"addParticular\": '', \"addParticularAmt\": '', \"addParticularCycle\": ''};\n tmp._id = generalInsurance._id + 1;\n $scope.generalInsuranceList.push(tmp);\n };\n $scope.delGeneralInsurance = function (index) {\n $scope.generalInsuranceList.splice(index, 1)\n };\n $scope.submitGeneralInsurance = function () {\n var insuranceList = {\n additionalInsurance: $scope.generalInsuranceList,\n pureTermInsuranceAmt: $scope.insurancePremiumForm.pureTermInsuranceAmt,\n pureTermInsuranceCycle: $scope.insurancePremiumForm.pureTermInsuranceCycle,\n generalInsuranceAmt: $scope.insurancePremiumForm.generalInsuranceAmt,\n generalInsuranceCycle: $scope.insurancePremiumForm.generalInsuranceCycle\n };\n\n finGpsService.setInfo('insurance', insuranceList);\n toaster.success(\"Saved successfully\");\n };\n\n function formStatus(state) {\n if (state == 'infoProvided') {\n $scope.formEditable = false;\n }\n if (!$scope.formEditable) {\n $(\"#insurancePremiumForm :input\").attr(\"disabled\", true);\n $(\"#insurancePremiumForm :submit\").attr(\"disabled\", true);\n }\n }\n\n}", "renderEditForm (obj) {\n console.log(\"renderEditForm() was fired from form.js \")\n console.log(\"object id: \", obj.id)\n console.log(\"object : \")\n console.log(obj)\n // let editFormDiv = document.getElementById(\"editForm\")\n // editFormDiv.innerHTML = \"\"\n\n let arg1 = obj.id;\n let arg2 = obj;\n interestsEditForm.createAndAppendEditForm(arg1, arg2);\n\n\n\n\n}", "buildForm() {\n this.newSalutation = this.fb.group({\n language: [''],\n salutation: [''],\n gender: ['2'],\n letterSalutation: [''],\n });\n }", "function addDefinitionForm()\n{\n \n \n formp = $(getFormPalabra());\n $(\"#forms_conceptos\").append(formp);\n //inserta una animacion usa magic.css\n formp.addClass('magictime spaceInDown');\n $(\"#sec_\"+items_conceptos).find(\"select\").selectpicker();\n\n \n\t\n}", "get form() {\n return this.internals.form;\n }", "get form() {\n return this.internals.form;\n }", "get form() {\n return this.internals.form;\n }", "_rebuildForm() {\n //console.log(\"_rebuildForm\",this.value,this.schema);\n this._clearForm();\n if (this.schema) {\n let formProperties = this._getProperties(this.schema);\n formProperties.forEach(property => this._buildFormElement(property));\n }\n }", "fillForm(data){\n this.titleInput.value = data.title;\n this.bodyInput.value = data.body;\n this.idInput.value = data.id;\n\n this.changeFormState('edit');\n }", "function makeFormAdjustment(method,tool,condition,toggle){\r\n var field = jQuery(tool).parents('.elq-field');\r\n var formid = jQuery(tool).is('form')? jQuery(tool).attr('id') : jQuery(tool).parents('form').attr('id');\r\n var fieldid = jQuery(field).attr('id').replace(/elq-/g,'');\r\n var tray = jQuery(field).find('.tray-'+method);\r\n \r\n jQuery(tool).parents('.admin-tools').find('.tool').not('.'+method).removeClass('open');\r\n jQuery(tool).parents('.admin-tools').find('.tray').not('.tray-'+method).hide();\r\n if(!condition && !toggle) jQuery(tool).toggleClass('on'); \r\n var check = condition? condition(tool,field) : jQuery(tool).hasClass('on');\r\n if(tray.length>0 && toggle) {\r\n jQuery(tool).toggleClass('open'); \r\n jQuery(tray).toggle()\r\n }\r\n switch(method+'_'+check){\r\n case 'indent_true':\r\n jQuery(field).addClass('indent')\r\n adjustThis({'indent':true})\r\n setUnsavedEdit(field,true)\r\n break;\r\n \r\n case 'indent_false':\r\n jQuery(field).removeClass('indent')\r\n adjustThis({'indent':false})\r\n break;\r\n \r\n case 'progress_false':\r\n adjustThis({'progressive':false})\r\n setUnsavedEdit(field,true)\r\n break;\r\n \r\n case 'progress_true':\r\n adjustThis({'progressive':'no'})\r\n setUnsavedEdit(field,true); \r\n break;\r\n \r\n case 'hide_true':\r\n jQuery(field).addClass('hidefield')\r\n adjustThis({'hide':true});\r\n setUnsavedEdit(field,true);\r\n break;\r\n \r\n case 'hide_false':\r\n jQuery(field).removeClass('hidefield')\r\n adjustThis({'hide':false});\r\n break;\r\n \r\n case 'tooltip_true':\r\n var obj = {'tooltip': jQuery(field).find('#tooltip-text').val()};\r\n jQuery(tool).addClass('on');\r\n jQuery(field).addClass('tooltip'); \r\n jQuery(field).find('.tooltip-hold').remove()\r\n jQuery(field).append( tmp.tooltip(obj) )\r\n adjustThis(obj);\r\n setUnsavedEdit(field,true);\r\n break;\r\n \r\n case 'tooltip_false':\r\n jQuery(tool).removeClass('on');\r\n jQuery(field).removeClass('tooltip');\r\n jQuery(field).find('.tooltip-hold').remove()\r\n adjustThis({'tooltip': false});\r\n break;\r\n \r\n case 'valid_true':\r\n var val = jQuery(field).find('.validtext').val()\r\n var place = jQuery(field).find('.validtext').attr('placeholder')\r\n var cval = parseInt( jQuery(field).find('.validcount').val() );\r\n var obj = {'validcount':cval,'localMessage':val}\r\n jQuery(field).find('.tool.valid').addClass('on');\r\n jQuery(field).addClass('IsRequiredCondition');\r\n jQuery(field).attr('data-valid-count',cval);\r\n jQuery(field).find('.message').remove()\r\n jQuery(field).append('<div class=\"message IsRequiredCondition\" style=\"display:none\">'+val+'</div>');\r\n adjustThis(obj);\r\n setUnsavedEdit(field,true); \r\n break;\r\n \r\n case 'valid_false':\r\n jQuery(tool).removeClass('on');\r\n jQuery(field).attr('data-valid-count','');\r\n jQuery(field).removeClass('IsRequiredCondition');\r\n jQuery(field).find('.message').remove();\r\n adjustThis({'localMessage':false,'validcount':false})\r\n break;\r\n \r\n case 'column_true':\r\n var val = jQuery(field).find('#cols').val();\r\n jQuery(field).find('.tool.column').addClass('on');\r\n jQuery(field).removeClass('on col-one col-two col-three');\r\n jQuery(field).addClass('col-'+val)\r\n adjustThis({'colcount':val});\r\n setUnsavedEdit(field,true);\r\n break;\r\n \r\n case 'column_false':\r\n jQuery(field).find('.tool.column').removeClass('on');\r\n jQuery(field).removeClass('on col-one col-two col-three');\r\n adjustThis({'colcount':false})\r\n break;\r\n \r\n case 'reset_true':\r\n val = jQuery(field).find('#resetbtn-text').val();\r\n var obj = {'resetButtonText': val};\r\n jQuery(tool).addClass('on');\r\n jQuery(field).find('.reset-btn').val(val);\r\n adjustThis(obj);\r\n setUnsavedEdit(field,true);\r\n break;\r\n \r\n case 'reset_false':\r\n jQuery(tool).removeClass('on');\r\n adjustThis({'resetButtonText': false});\r\n jQuery(field).find('.reset-btn').val('Reset');\r\n break;\r\n \r\n case 'format_change':\r\n var val = jQuery(field).find('#new-format').val();\r\n jQuery(tool).addClass('on');\r\n adjustThis({'alt_template':val},function(h){\r\n jQuery(h).find('#new-format').val(val)\r\n return h;\r\n })\r\n setUnsavedEdit(field,true);\r\n break;\r\n \r\n case 'format_false':\r\n jQuery(tool).removeClass('on');\r\n break;\r\n \r\n case 'format_restore':\r\n jQuery(tool).removeClass('on');\r\n adjustThis({'alt_template':false},function(h){\r\n jQuery(h).find('#new-format').val('')\r\n return h; \r\n })\r\n break;\r\n }\r\n fixUtilHeight(field,true);\r\n \r\n function adjustThis(data,rebuild){\r\n var f = localFormAdjustment(formid,fieldid,data)\r\n if(rebuild){\r\n var h = jQuery(buildFormElement(f))\r\n \r\n var admin = jQuery(field).find('.admin-editor')[0].outerHTML\r\n var admin2 = jQuery(field).find('.admin-tools')[0].outerHTML\r\n jQuery(h).prepend(admin2)\r\n jQuery(h).prepend(admin)\r\n if(typeof rebuild == 'function'){ \r\n h = rebuild(h);\r\n }\r\n jQuery(field).replaceWith(h);\r\n }\r\n }\r\n}", "setShowInEditForm(show) {\r\n return this.clone(Field, `setshowineditform(${show})`).postCore();\r\n }", "function giveFormType(){\n return 'anual';\n}", "insertForm() {\n this.builder = new Builder(this.container, this.options.template, {\n style: this.options.style,\n formContainerClass: this.options.formContainerClass,\n inputGroupClass: this.options.inputGroupClass,\n inputClass: this.options.inputClass,\n labelClass: this.options.labelClass,\n btnClass: this.options.btnClass,\n errorClass: this.options.errorClass,\n successClass: this.options.successClass,\n });\n this.build();\n }", "onBtnNewClick() {\n\t\tthis.changeTripReportMode('add');\n\t}", "function giveFormType(){\r\n return 'anual';\r\n}", "calculateForm(){\n\t\tlet instance = this;\n\n\t\tif(instance.hasErrorInTheForm()) return;\n\t\t\n\t\tinstance.debt = instance.calculateDebt({\n\t\t\tamount: instance.calculatorData,\n\t\t\tinterest: instance.dropdownData.interest,\n\t\t\tmonths: instance.dropdownData.months\n\t\t});\n\n\t\tinstance.element.querySelector('#input-total').placeholder = `R$: ${instance.debt}`;\n\t\tinstance.element.querySelector('.get-quot').removeAttribute('disabled');\n\t}", "function Edit_Method_Id(thisid){\r\n\t$('.Edit_form').show(500);\r\n\t$('.admin-methods-list').hide(200);\r\n\teditThisId = thisid;\r\n}", "get form() {\n return this.closest('form');\n }", "function setupForm() {\n var index = 1;\n document.getElementById(\"name\").focus();\n document.getElementById(\"colors-js-puns\").classList.add(\"is-hidden\");\n document.getElementById(\"other-title\").classList.add(\"is-hidden\");\n document.getElementById(\"payment\").selectedIndex = index;\n\n createTotal();\n togglePaymentDiv(index);\n }", "function edit() {\n // Update view.\n ctrl.showEditCommitmentForm(scope.commitment);\n }", "function edit() {\n // Update view.\n ctrl.showEditCommitmentForm(scope.commitment);\n }", "get form() {\n return this.internals_.form;\n }", "insertForm() {\n const {showForm} = this.state;\n if(showForm){\n return <ExpenseInput \n changeBtn={this.state.changeBtn} \n send={this.props.sendLog} \n hideForm={this.hideForm.bind(this)} \n showForm={this.state.showForm}/>\n } \n }", "function finGpsAssetCtrl($scope, $state, toaster, $http, finGpsService) {\n $scope.formEditable = true;\n $scope.finGpsAssetForm = {};\n $scope.init = function () {\n finGpsService.getInfo('assets').then(function (response) {\n if (response != null && response.assets != null && response.assets.length != 0) {/*response.assets.investmentAssets.length can't be used as it is empty/undefined for new user*/\n if (!IsAdmin())formStatus(response.state);\n $scope.finGpsAssetForm.savingAmt = response.assets.savingAmt;\n $scope.finGpsAssetForm.spouseSavingAmt = response.assets.spouseSavingAmt;\n\n } else {\n $scope.finGpsAssetForm = {};\n }\n }, function (reason) {\n console.log(reason);\n });\n };\n $scope.submitAsset = function () {\n var assetList = {\n savingAmt: $scope.finGpsAssetForm.savingAmt,\n spouseSavingAmt:$scope.finGpsAssetForm.spouseSavingAmt\n };\n finGpsService.setInfo('assets', assetList);\n $state.go('forms.finGps.assets&Liabilities.liabilities');\n toaster.success(\"Saved successfully\");\n };\n function formStatus(state) {\n if (state == 'infoProvided') {\n $scope.formEditable = false;\n }\n if (!$scope.formEditable) {\n $(\"#finGpsAssetForm :input\").attr(\"disabled\", true);\n $(\"#finGpsAssetForm :submit\").attr(\"disabled\", true);\n }\n }\n}", "renderPage() {\n return (\n <div className='peach padding'>\n <Grid container centered>\n <Grid.Column>\n <Header as=\"h2\" textAlign=\"center\">Edit a Menu Item!</Header>\n <BackButton/>\n <br/>\n <br/>\n <AutoForm schema={formSchema} onSubmit={data => this.submit(data)} model={this.props.doc}>\n <Segment>\n <Form.Group widths='equal'>\n <TextField className='josefin' name='name'/>\n <TextField className='josefin' name='image'/>\n {Roles.userIsInRole(Meteor.userId(), 'admin') ? (\n <TextField className='josefin' name='vendor'/>\n ) : ''}\n </Form.Group>\n <Form.Group widths='equal'>\n <TextField className='josefin' name='price'/>\n <SelectField className='josefin' name='vegan'/>\n <SelectField className='josefin' name='ethnicity'/>\n </Form.Group>\n <Form.Group widths='equal'>\n <SelectField className='josefin' name='availableStart'/>\n <SelectField className='josefin' name='availableEnd'/>\n </Form.Group>\n <Form.Group>\n <SelectField className='josefin' name='starting'/>\n <SelectField className='josefin' name='startingPeriod'/>\n <SelectField className='josefin' name='ending'/>\n <SelectField className='josefin' name='endingPeriod'/>\n </Form.Group>\n <SubmitField className='josefin' value='Submit'/>\n <ErrorsField/>\n </Segment>\n </AutoForm>\n <br/>\n <br/>\n </Grid.Column>\n </Grid>\n </div>\n );\n }", "buildForm() {\n this.salutationForm = this.fb.group({\n firstname: [''],\n gender: [''],\n language: [''],\n lastname: [''],\n letterSalutation: [''],\n salutation: [''],\n salutationTitle: [''],\n title: ['']\n });\n }", "function addWidgetsToDynamicForm(){\t\t\n\t\tfrmDynamicJS.add(hBoxOuter(),btnForPlaceAnOrder(\"Done\"));\t\n\t}", "function competitorEditForm() {\n\t\tvar idWithString = this.id;\n\t\t//substring to get the id only\n\t\tvar id = idWithString.substr(1);\n\t\t// set value to hidden input \n\t\t$('#competitorId').val(id);\n\t\t// get the current row\n\t\tvar currentRow = $(this).closest(\"tr\");\n\t\t///get value\n\t\tvar competitorName = currentRow.find(\"td:eq(0)\").text(); // get current row 1st TD value\n\t\tcompetitorName = competitorName.trim();\n\t\tvar competitorField = currentRow.find(\"td:eq(1)\").text(); // get current row 2nd TD\n\t\tcompetitorField = competitorField.trim()\n\t\tvar competitorDetail = currentRow.find(\"td:eq(2)\").text(); // get current row 3rd TD\n\t\tcompetitorDetail = competitorDetail.trim();\n\n\n\t\t// insert data to form\n\t\t$('#competitorEditName').val(competitorName);\n\t\t$('#competitorEditField').val(competitorField);\n\t\t$('#competitorEditDetail').val(competitorDetail);\n\n\t}", "get form() {\n return this.internals_.form;\n }", "function NewAppt() {\n $(\"#add-appt\").css(\"display\", \"none\");\n $(\"#appt-form\").css(\"display\", \"block\");\n $(\"#add-btn\").css(\"display\", \"inline-block\");\n $(\"#cancel-btn\").css(\"display\", \"inline-block\");\n}", "updateForm() {\n this.$step.innerText = this.currentStep;\n\n // TODO: Validation\n\n this.slides.forEach(slide => {\n slide.classList.remove(\"active\");\n\n if (slide.dataset.step == this.currentStep) {\n slide.classList.add(\"active\");\n }\n });\n\n this.$stepInstructions[0].parentElement.parentElement.hidden = this.currentStep >= 6;\n this.$step.parentElement.hidden = this.currentStep >= 6;\n\n // TODO: get data from inputs and show them in summary\n }", "setForm(form) {\n this.options.form = form;\n }", "function showBtfylSecondary(pageIdToLoad){\n \n pageIdToLoad = $(\"#alpaca1\").val();\n $(\"#myform\").html(\"\");\n $(\"#myform\").css('display','block');\n $(\"#myform\").alpaca({\n \"view\": \"bootstrap-edit\",\n \"data\": node,\n \"schema\": {\n \"title\": \"PageBtfylSecondary\",\n \"description\": \"A data type to support for Page Btfyl Secondary.\",\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"title\": \"name\",\n \"readonly\":true\n },\n \"heading\": {\n \"type\": \"string\",\n \"title\": \"heading\"\n },\n \"mainBody\": {\n \"type\": \"string\",\n \"title\": \"mainBody\"\n },\n \"mainContent\": {\n \"type\": \"array\",\n \"title\": \"mainContent\",\n \"items\": {\n \"properties\": {\n \"contentHeading\": {\n \"type\": \"string\",\n \"title\": \"contentHeading\"\n },\n \"contentBody\": {\n \"type\": \"string\",\n \"title\": \"contentBody\"\n }\n },\n \"type\": \"object\"\n }\n },\n \"links\": {\n \"type\": \"array\",\n \"title\": \"Helpful Links\",\n \"maxItems\": 30,\n \"items\": {\n \"properties\": {\n \"linkHeader\": {\n \"type\": \"string\",\n \"title\": \"linkHeader\"\n },\n \"company\": {\n \"type\": \"string\",\n \"title\": \"company\"\n },\n \"number\": {\n \"type\": \"string\",\n \"title\": \"number\"\n },\n \"link\": {\n \"type\": \"string\",\n \"title\": \"link\"\n }\n },\n \"type\": \"object\"\n }\n }\n },\n \"_parent\": \"n:node\",\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"items\": {}\n },\n \"options\": {\n \"form\": {\n \"buttons\": {\n \"submit\": {\n \"click\": function () {\n clearTimer();\n console.log(\"Timer Cleared\");\n setTimer();\n console.log(\"Timer Set\");\n\n var value = this.getValue();\n //alert(JSON.stringify(value, null, \" \"));\n node.name = value.name;\n \n node.heading = value.heading;\n node.mainBody = value.mainBody;\n node.links = value.links;\n node.mainContent = value.mainContent;\n \n node.update().then(function () {\n alert(\"Form Submitted\");\n window.location =\"../index.html\";\n });\n }\n }\n }\n },\n \"title\": \"newPageTitle\",\n \"engineId\": \"alpaca1\",\n \"fields\": {\n \"name\": {\n \"type\": \"text\"\n },\n \"mainBody\": {\n \"type\": \"ckeditor\",\n \"ckeditor\": {\n \"toolbar\": [\n ['Bold', 'Italic', 'Underline', 'Cut', 'Copy', 'Paste'], ['NumberedList', 'BulletedList', 'Link', 'Unlink'], ['Table', 'Source']\n ]\n },\n \"height\":\"120\"\n },\n \"mainContent\": {\n \"type\": \"array\",\n \"items\": {\n \"fields\": {\n \"contentHeading\": {\n \"type\": \"text\"\n }, \n \"contentBody\": {\n \"type\": \"ckeditor\",\n \"ckeditor\": {\n \"toolbar\": [\n ['Bold', 'Italic', 'Underline', 'Cut', 'Copy', 'Paste'], ['NumberedList', 'BulletedList', 'Link', 'Unlink'], ['Table', 'Source']\n ]\n }\n }\n }\n },\n \"toolbarSticky\": true,\n \"actionbar\": {\n \"actions\": [\n {\n \"action\": \"add\",\n \"enabled\": false\n },\n {\n \"action\": \"remove\",\n \"enabled\": false\n }]\n }\n },\n \"links\": {\n \"type\": \"array\",\n \"items\": {\n \"fields\": {\n \"linkHeader\": {\n \"type\": \"text\"\n }, \n \"company\": {\n \"type\": \"text\"\n },\n \"number\": {\n \"type\": \"text\"\n },\n \"link\": {\n \"type\": \"text\"\n }\n }\n },\n \"toolbarSticky\": true,\n \"actionbar\": {\n \"actions\": [\n {\n \"action\": \"add\",\n \"enabled\": false\n },\n {\n \"action\": \"remove\",\n \"enabled\": false\n }]\n }\n } \n\n }\n }\n });\n\n}", "addAutoForm(config) {\n /** Create array to store auto form property objects */\n const properties = [];\n\n /** Loop through each property in the auto form configuration... */\n config.properties.forEach((propertyConfig) => {\n /** Create new auto form property instance */\n const property = new models.AutoFormProperty(propertyConfig);\n\n /** Add property to array */\n properties.push(property);\n });\n\n /** Overwrite properties in config with array of auto form properties */\n config.properties = properties;\n\n /** Create auto form */\n const autoform = new models.AutoForm(config);\n\n /** Validate auto form */\n autoform.validate();\n \n /** If record can be archived, add column to track that */\n if ( autoform.canArchive() )\n autoform.properties().push(new models.AutoFormProperty({ name: `active`, type: `boolean`, inputCols: 16, inputLabel: `Active:`, alignment: `horizontal` }));\n\n /** Generate record class */\n autoform.generateClass(autoform);\n\n /** Add auto form to array */\n this.autoforms().push(autoform);\n\n /** Create router for this auto form */\n const router = express.Router();\n\n /** Create route for autoforms CSS */\n router.get(`/css/` + path.basename(autoform.cssPath()), (req, res) => {\n res.sendFile(autoform.cssPath());\n });\n \n /** Create route for autoforms CSS map */\n router.get(`/css/` + path.basename(autoform.cssPath().replace(`.css`, `.css.map`)), (req, res) => {\n res.sendFile(autoform.cssPath().replace(`.css`, `.css.map`));\n });\n \n /** Create route for edit icon */\n router.get(`/images/` + path.basename(autoform.editIconPath()), (req, res) => {\n res.sendFile(autoform.editIconPath());\n });\n \n /** Create route for archive icon */\n router.get(`/images/` + path.basename(autoform.archiveIconPath()), (req, res) => {\n res.sendFile(autoform.archiveIconPath());\n });\n \n /** Create route for delete icon */\n router.get(`/images/` + path.basename(autoform.deleteIconPath()), (req, res) => {\n res.sendFile(autoform.deleteIconPath());\n });\n \n /** Create route to logout */\n router.all(`/logout`, (req, res) => {\n /** Delete stored credentials from session */\n delete req.session.username;\n delete req.session.password;\n\n res.redirect(`login`);\n });\n \n /** Output header */\n router.use(autoform.headerTemplate());\n\n /** Create 'before' routes to list, add, edit, archive, login, and create templates */\n router.all(`/list`, autoform.listTemplateBefore());\n router.all(`/add`, autoform.addTemplateBefore());\n router.all(`/edit`, autoform.editTemplateBefore());\n router.all(`/login`, autoform.loginTemplateBefore());\n router.all(`/create`, autoform.createTemplateBefore());\n\n /** Create routes to list, add, edit, and archive records */\n router.all(`/list`, views.list(autoform));\n router.all(`/add`, views.add(autoform));\n router.all(`/edit`, views.edit(autoform));\n router.all(`/archive`, views.archive(autoform));\n router.all(`/delete`, views.delete(autoform));\n\n /** Create route to login and create account */\n router.all(`/login`, views.login(autoform));\n router.all(`/create`, views.create(autoform));\n\n /** Create 'after' routes to list, add, edit, archive, login, and create templates */\n router.all(`/list`, autoform.listTemplateAfter());\n router.all(`/add`, autoform.addTemplateAfter());\n router.all(`/edit`, autoform.editTemplateAfter());\n router.all(`/login`, autoform.loginTemplateAfter());\n router.all(`/create`, autoform.createTemplateAfter());\n\n /** Output header */\n router.use(autoform.footerTemplate());\n \n /** Render output and send to user */\n router.use((req, res) => res.send(req.page.render()));\n \n /** Call request to next express middleware/route */\n this.app().use(config.path, router);\n }", "function addForm(normalizeAllafterAdd)\n {\n if (typeof normalizeAllafterAdd == 'undefined') {\n normalizeAllafterAdd = true;\n }\n \n if(!selected_template) return;\n\n var newForm = templates[selected_template].addForm();\n \n if(newForm){\n headerRow.show();\n (options.insertNewForms == 'after') ? newForm.insertBefore(noFormsTemplate) : newForm.insertAfter(noFormsTemplate);\n }\n else{\n selected_template = false;\n return false;\n }\n \n if(normalizeAllafterAdd) normalizeAll();\n\n // After add callBack function\n if (typeof options.afterAdd === \"function\") {\n options.afterAdd(source, newForm);\n }\n\n return true;\n }", "fillForm ( data ) {\n this.title.value = data.title;\n this.body.value = data.body;\n this.id.value = data.id;\n\n // change form state\n this.changeFormState( \"edit\" )\n\n }", "fillForm(data){\n this.titleInput.value = data.title\n this.bodyInput.value = data.body\n this.idInput.value = data.id\n\n this.changeFormState('edit')\n }", "function createForm() {\n var form = FormApp.create('Temperature Data Trends');\n form.addTextItem().setTitle('UserID').setRequired(true);\n // Will need to manually add validation after this is created!\n form.addTextItem().setTitle('Temperature (F)').setRequired(true);\n \n var feelingItem = form.addMultipleChoiceItem().setTitle('Feeling').setRequired(true); \n var symptomsPage = form.addPageBreakItem().setTitle('Do you have any of these symptoms?');\n var wellChoice = feelingItem.createChoice('Well', FormApp.PageNavigationType.SUBMIT);\n var sickChoice = feelingItem.createChoice('Sick', symptomsPage);\n feelingItem.setChoices([wellChoice, sickChoice]);\n \n var symptomsCheckbox = form.addCheckboxItem().setTitle('Symptoms');\n symptomsCheckbox.setChoices([symptomsCheckbox.createChoice('Extreme tiredness'),\n symptomsCheckbox.createChoice('Muscle pain'),\n symptomsCheckbox.createChoice('Headache'), \n symptomsCheckbox.createChoice('Sore throat'), \n symptomsCheckbox.createChoice('Vomiting'), \n symptomsCheckbox.createChoice('Diarrhea'), \n symptomsCheckbox.createChoice('Rash'), \n symptomsCheckbox.createChoice('Unexplained bleeding'), \n symptomsCheckbox.createChoice('Taking pain relievers')]);\n \n \nLogger.log('Published URL: ' + form.getPublishedUrl());\nLogger.log('Editor URL: ' + form.getEditUrl());\n}", "function VoucherActivityEditConfigureView() {\n FormView.apply(this, arguments);\n }", "get myForm() {\n return this.editForm.controls;\n }", "fieldsInfo () {\n return [\n {\n text: this.$t('fields.id'),\n name: 'id',\n details: false,\n table: false,\n },\n\n {\n type: 'input',\n column: 'order_nr',\n text: 'order No.',\n name: 'order_nr',\n multiedit: false,\n required: true,\n disabled: true,\n create: false,\n },\n {\n type: 'input',\n column: 'name',\n text: 'person name',\n name: 'name',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'input',\n column: 'email',\n text: 'email',\n name: 'email',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'select',\n url: 'crm/people',\n list: {\n value: 'id',\n text: 'fullname',\n data: [],\n },\n column: 'user_id',\n text: this.$t('fields.person'),\n name: 'person',\n apiObject: {\n name: 'person.name',\n },\n table: false,\n },\n {\n type: 'input',\n column: 'package_points',\n text: 'package points',\n name: 'package_points',\n required: false,\n edit: false,\n create: false,\n },\n\n // package_points\n {\n type: 'select',\n url: 'crm/package',\n list: {\n value: 'id',\n text: 'full_name',\n data: [],\n },\n column: 'package_id',\n text: 'package name',\n name: 'package',\n apiObject: {\n name: 'package.package_name',\n },\n table: false,\n },\n {\n type: 'input',\n column: 'package_name',\n text: 'package name',\n name: 'package_name',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'input',\n column: 'package_price',\n text: 'package price',\n name: 'package_price',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'input',\n column: 'pur_date',\n text: 'purche date',\n name: 'pur_date',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n ]\n }", "showAdd() {\n this.closeFoldersInputs.closeAllInputs();\n this.folder.set('isAdd', true);\n this.set('isManage', false);\n this.set('errors', null);\n }", "onComponentShow() {\n this.subcomponents.form.updateValues();\n }", "function setQuickAppointmentsForm(lang_iso){\n\tvar form = 'form[name=\"quick_appointment_form\"]',\n\t\tpage = '/' + lang_iso + '/actions/appointment/';\n\t\n\t// declare vars\n\tvar $btn, $form, $category_id, $service_id, $date, $forbidden_dates, $hour, $submit_btn;\n\t\n\tfunction init(){\n\t\t// init vars\n\t\t$form = $(form);\n\t\t$category_id = $form.find('select[name=\"category_id\"]');\n\t\t$service_id = $form.find('select[name=\"service_id\"]');\n\t\t$date = $form.find('input[name=\"date\"]');\n\t\t$forbidden_dates = $form.find('input[name=\"forbidden_dates\"]');\n\t\t$hour = $form.find('select[name=\"hour\"]');\n\t\t$submit_btn = $form.find('input[type=\"submit\"]');\n\t\t\n\t\t// set toggler\n\t\tsetToggler();\n\t\t// set custom selects\n\t\t$('.appointment select').customSelect();\n\t\t// set assync form submission\n\t\tsetAssyncForms(form);\n\t\t// set assync inputs\n\t\tassyncInputs();\n\t}\n\t\n\tfunction setToggler(){\n\t\t$btn = $('.appointment_pane > a');\n\t\t\n\t\t$btn.on('click', function(){\n\t\t\t$btn.parent().toggleClass('active');\n\t\t\t$form.stop().fadeToggle();\n\t\t});\n\t}\t\t\n\t\n\tfunction assyncInputs(){\n\t\t// get services\n\t\t$category_id.on('change', function(){\n\t\t\t// disable hour and date fields, as well as the submit button\n\t\t\t$date.val(\"\").prop('disabled', true);\n\t\t\t$hour.val(\"\").prop('disabled', true).change();\n\t\t\t$submit_btn.prop('disabled', true);\n\t\t\t\n\t\t\t$.post(\n\t\t\t\tpage + \"get_services_by_category_id\",\n\t\t\t\t{selected_id: $category_id.val()},\n\t\t\t\tfunction(data){\n\t\t\t\t\t$service_id.find('option:not(:first-child)').remove();\n\t\t\t\t\t$service_id.append(data);\n\t\t\t\t\tif($service_id.find('option').length > 1){\n\t\t\t\t\t\t$service_id.prop('disabled', false);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$service_id.prop('disabled', true);\n\t\t\t\t\t}\n\t\t\t\t\t$service_id.change();\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\t\t\n\t\t// set days\n\t\t$service_id.on('change', function(){\n\t\t\t// disable hour and date fields\n\t\t\t$date.val(\"\").prop('disabled', true);\n\t\t\t$hour.val(\"\").prop('disabled', true).change();\n\t\t\t$submit_btn.prop('disabled', true);\n\t\t\t\n\t\t\t$.post(\n\t\t\t\tpage + \"get_unavailable_dates\",\n\t\t\t\t{selected_id: $service_id.val()},\n\t\t\t\tfunction(data){\n\t\t\t\t\tif($service_id.val()){\n\t\t\t\t\t\t$forbidden_dates.val(data);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$date.prop('disabled', false);\n\t\t\t\t\t\tsetDatePicker(form + ' #date');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\t\t\n\t\t$date.on('change', function(){\n\t\t\t$.post(\n\t\t\t\tpage + \"get_available_hours_by_date\",\n\t\t\t\t{service_id: $service_id.val(), date: $date.val(), hour: $hour.val()},\n\t\t\t\tfunction(data){\n\t\t\t\t\t$hour.find('option:not(:first-child)').remove();\n\t\t\t\t\t$hour.append(data);\n\t\t\t\t\tif($hour.find('option').length > 1){\n\t\t\t\t\t\t$hour.prop('disabled', false);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$hour.prop('disabled', true);\n\t\t\t\t\t}\n\t\t\t\t\t$hour.change();\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\t\t\n\t\t$hour.on('change', function(){\n\t\t\tif($hour.val().length){\n\t\t\t\t$submit_btn.prop('disabled', false);\n\t\t\t}else{\n\t\t\t\t$submit_btn.prop('disabled', true);\n\t\t\t}\n\t\t});\n\t}\n\t\n\tinit();\n}", "function getForm( name, ids, withDelBtn ) {\n\n var deleteStr = \"Delete\";\n var idsu = ids.join(\"_\");\n\n //increment by 1 current object id\n var formbody = getFormBody( name, ids[0], ids[1], ids[2], ids[3], ids[4], ids[5], ids[6], ids[7], ids[8] );\n\n //console.log(\"getForm: \"+name+\"_\"+\", ids=\"+ids+', idsu='+idsu+\", withDelBtn=\"+withDelBtn);\n\n var addHeaderBtn = true;\n //don't show add for scan and stain sections\n if( name == \"scan\" || name == \"stain\" ) {\n addHeaderBtn = false;\n }\n //don't show add patient, except scanorder form where there is '_patient_'\n //if( name == 'patient' && ids.indexOf(\"_patient_\") === -1 ) {\n // addHeaderBtn = false;\n //}\n\n if( addHeaderBtn ) {\n var addbtn = getHeaderAddBtn( name, ids );\n var deletebtn = getHeaderDeleteBtn( name, ids, deleteStr );\n } else {\n var addbtn = \"\";\n var deletebtn = \"\";\n }\n\n if( !withDelBtn ) {\n deletebtn = \"\";\n }\n\n //get itemCount from partialId\n var itemCount = getIdByName(name,ids) + 1;\n //console.log('itemCount='+itemCount);\n\n var title = name;\n if( name == \"encounter\" || name == \"procedure\" ) {\n title = \"accession\";\n }\n\n var formhtml =\n '<div id=\"formpanel_' +name + '_' + idsu + '\" class=\"panel panel-'+name+' panel-multi-form\">' +\n '<div class=\"panel-heading panel-heading-hierarchy\">' +\n\n '<button id=\"form_body_toggle_'+ name + '_' + idsu +'\" type=\"button\"' +\n 'class=\"btn btn-default btn-xs form_body_toggle_btn glyphicon glyphicon-folder-open pull-left\"' +\n 'aria-expanded=\"true\"'+\n 'data-toggle=\"collapse\" data-target=\"#form_body_'+name+'_'+idsu+'\">'+\n '</button>'+\n\n\n '<button style=\"margin-left: 5px;\" type=\"button\"'+\n 'class=\"btn btn-default btn-xs form_body_content_toggle_btn glyphicon glyphicon-list pull-left\"'+\n 'aria-expanded=\"true\"'+\n 'data-toggle=\"collapse\" data-target=\"#'+title+'_'+idsu+'\">'+\n '</button>'+\n\n// '<button id=\"form_body_toggle_'+ name + '_' + idsu +'\" type=\"button\" class=\"btn btn-default btn-xs form_body_toggle_btn glyphicon glyphicon-folder-open black\" data-toggle=\"collapse\" data-target=\"#form_body_'+name+'_'+idsu+'\"></button>' +\n// '&nbsp;' +\n// '<div class=\"element-title\">' + capitaliseFirstLetter(title) + ' ' + itemCount + '</div>' +\n '<h4 class=\"panel-title element-title element-title-extended-width\">' +\n '<div style=\"float:left;\">' +\n capitaliseFirstLetter(title) + ' ' + itemCount +\n '</div>' +\n '<div class=\"element-title-object-name\" style=\"float:left; margin-left:10px;\">' +\n //to be inserted by JS\n '</div>' +\n '</h4>' +\n '<div class=\"form-btn-options\">' +\n addbtn +\n deletebtn +\n '</div>' +\n '<div class=\"clearfix\"></div>' +\n '</div>' + //panel-heading\n '<div id=\"form_body_' + name + '_' + idsu + '\" class=\"panel-body panel-body-multi-form collapse in\">' +\n formbody +\n '</div>' +\n '</div>';\n\n return formhtml;\n}", "@action\n addForm(model) {\n const uuidVal = uuidv4();\n let form = new Form(uuidVal, model);\n this.forms = {...this.forms, [uuidVal]: form};\n for(let propertyName in model){\n this.validate(form.id, propertyName);\n }\n return form;\n \n }", "function showForm() {\n\t\t\teManager.trigger('cleanManagementBox');\n\t\t\ttemplates.render('csv-form', {}, function(html) {\n\t\t\t\tvar $boxContent = $('#management-box ._box-content');\n\t\t\t\t$boxContent.append(html);\n\t\t\t});\n\t\t\teManager.trigger('showManagementBox');\n\t\t}", "function showFormClasificacion(accion){\n\n formClasificacion=Ext.widget('form',{\n padding:5,\n defaults: {\n anchor: '100%'\n },\n items:[\n {\n xtype:'fieldset',\n title:'Informacion de la Clasificacion',\n defaultType:'textfield',\n layout:'anchor',\n defaults:{\n anchor:'85%'\n },\n items:[\n {\n xtype:'hiddenfield',\n id:'id_area_ev',\n name:'id_area_ev'\n },\n {\n xtype:'textfield',\n fieldLabel:'NOMBRE DE CLASIFICACION',\n id:'nombreclasificacion',\n name:'nombreclasificacion',\n allowBlank:false\n }\n ,{\n xtype:'textareafield',\n fieldLabel:'DESCRIPCION',\n id:'descripcionclasificacion',\n name:'descripcionclasificacion',\n allowBlank:false\n }\n ]\n }\n ],\n buttons:[\n {\n text:'Registrar',\n iconCls:'icon-OK',\n handler:function(){\n if(this.up('form').getForm().isValid()){\n var post_clasificacion=Ext.getCmp('nombreclasificacion').getValue();\n var post_descripcion=Ext.getCmp('descripcionclasificacion').getValue();\n\n\n if(accion!=0){\n Ext.Ajax.request({\n url:'procesos/guardar_clasificacionEV.php?nombreclasificacion='+post_clasificacion+'&descripcion='+post_descripcion,\n method:'POST',\n success:function(result,request){\n var jsonData=JSON.parse(result.responseText);\n var bandera=jsonData[0].bandera;\n var msj=jsonData[0].msg;\n\n if (bandera==1) {\n storeAreasEv.load();\n Ext.MessageBox.show({\n title:'Exito',\n msg:msj,\n buttons:Ext.MessageBox.OK,\n icon: Ext.MessageBox.INFO\n });\n }\n if(bandera==2){\n Ext.MessageBox.show({\n title:'Sin exito',\n msg:msj,\n buttons:Ext.MessageBox.OK,\n icon: Ext.MessageBox.ERROR\n });\n\n }\n if(bandera==3){\n Ext.MessageBox.show({\n title:'Competencia ya existe',\n msg:msj,\n buttons:Ext.MessageBox.OK,\n icon: Ext.MessageBox.WARNING\n });\n\n }\n\n\n }//fin de succes\n ,failure: function(result,request){\n Ext.MessageBox.show({\n title:'Subcategoria Duplicada',\n msg:'CONEXION AL SISTEMA SE INTERRUMPIO, RECARGUE LA PAGINA E INTENTE DE NUEVO',\n buttons:Ext.MessageBox.OK,\n icon: Ext.MessageBox.WARNING\n });\n \n }\n\n });//fin de ajax\n\n }else{//ACTUALIZACION DE DATOS.\n\n var post_id_clasificacion=Ext.getCmp('id_area_ev').getValue();\n\n Ext.Ajax.request({\n url:'procesos/update_clasificacionEV.php?nombreclasificacion='+post_clasificacion+'&descripcion='+post_descripcion+'&id='+post_id_clasificacion,\n method:'POST',\n success:function(result,request){\n var jsonData=JSON.parse(result.responseText);\n var bandera=jsonData[0].bandera;\n var msj=jsonData[0].msg;\n\n if (bandera==1) {\n storeAreasEv.load();\n Ext.MessageBox.show({\n title:'Exito',\n msg:msj,\n buttons:Ext.MessageBox.OK,\n icon: Ext.MessageBox.INFO\n });\n }\n\n if(bandera==2) { \n Ext.MessageBox.show({\n title:'Sin exito',\n msg:msj,\n buttons:Ext.MessageBox.OK,\n icon: Ext.MessageBox.ERROR\n });\n\n }\n\n\n } //find e success \n ,\n failure: function(result,request){\n Ext.MessageBox.show({\n title:'Error de sistema',\n msg:'CONEXION AL SISTEMA INTERRUMPIDO, RECARGUE LA PAGINA E INTENTE DE NUEVO',\n buttons:Ext.MessageBox.OK,\n icon: Ext.MessageBox.WARNING\n });\n \n } \n\n });//fin de ajax\n\n\n }\n\n\n this.up('form').getForm().reset();\n this.up('window').destroy();\n\n }else{\n Ext.Msg.alert('Warning', \"Por favor, complete el formulario\"); \n }\n }//fin de handler\n },{\n text:'Cancelar',\n iconCls: 'icon-CANCEL',\n handler:function(){\n this.up('form').getForm().reset();\n this.up('window').destroy();\n }\n }\n\n\n ]\n\n\n });\n\n winClasificacion =Ext.widget('window',{\n title:'REGISTRO Y MODIFICACION DE CLASIFICACION',\n closable:false,\n width:500,\n height:250,\n layout:'fit',\n resizable:true,\n modal:true,\n items:formClasificacion\n\n });\n\n \n \n winClasificacion.show();\n\n}//fin de showformclasificacion", "function displayGraphPointForm(record, grid) {\n\n function displayEditDialog(response) {\n var win = Ext.create('Zenoss.form.DataSourceEditDialog', {\n record: response.data,\n items: response.form,\n singleColumn: true,\n width: 400,\n title: _t('Edit Graph Point'),\n directFn: router.setInfo,\n id: 'editGraphPointDialog',\n saveHandler: function() {\n grid.refresh();\n }\n });\n\n win.show();\n }\n\n // remote call to get the object details\n router.getInfo({uid: record.get(\"uid\")}, displayEditDialog);\n}", "build() {\n if (this.options.flat) {\n this.builder.renderInputs(this.createFormJson());\n } else {\n this.builder.renderGroups(this.createFormJson());\n }\n\n this.builder.append(\n this.builder.createSubmitBtn(this.options.locale.submit, this.onSubmit.bind(this)),\n );\n }", "function loadAnomalyForm() {\n currentState = \"AnomalyForm\";\n var anomalyType = anomalyForms[anomalyIndex][\"anomaly\"];\n customInputsTitle.innerText = anomalyType + \" \" + (anomalyIndex - anomalyTypeIndexes[anomalyType] + 1);\n customInputsContent.innerHTML = \"\";\n var formData = anomalyForms[anomalyIndex][\"json\"][\"fields\"];\n var formFields = (0, _FormBuilder.buildFormFields)(formData);\n for (var i in formFields) {\n var field = formFields[i];\n customInputsContent.appendChild(field);\n }\n}", "function finGpsExpensesCtrl($scope, toaster, $state,finGpsService) {\n $scope.expensesCashFlowForm = {};\n $scope.formEditable = true;\n $scope.init = function () {\n finGpsService.getInfo('expenses').then(function (response) {\n if (response != null && response.expenses !== undefined && response.expenses != undefined) {\n if (!IsAdmin()) formStatus(response.state);\n $scope.expensesCashFlowForm = response.expenses;\n\n }\n }, function (reason) {\n console.log(reason);\n });\n };\n $scope.submitExpensesCashFlow = function () {\n var expensesCashFlowList = {\n comment: $scope.expensesCashFlowForm.comment\n\n };\n finGpsService.setInfo('expenses', expensesCashFlowList);\n $state.go('forms.finGps.finGpsCashFlow.regularInvestment');\n toaster.success(\"Saved successfully\");\n };\n function formStatus(state) {\n if (state == 'infoProvided') {\n $scope.formEditable = false;\n }\n if (!$scope.formEditable) {\n $(\"#expensesCashFlowForm :input\").attr(\"disabled\", true);\n $(\"#expensesCashFlowForm :submit\").attr(\"disabled\", true);\n }\n }\n\n}", "function PlotOptionsForm() {\n\n /*\n Defined below are the form structures for the plot options.\n */\n this.xAxisForm = {\n name: 'x-axis',\n sections: [{\n name: 'x-axis',\n rows: [\n {\n name: 'Domain',\n control: 'select',\n key: 'key',\n options: [\n {\n name: 'SCET',\n value: 'scet'\n },\n {\n name: 'ERT',\n value: 'ert'\n },\n {\n name: 'SCLK',\n value: 'sclk'\n },\n {\n name: 'LST',\n value: 'lst'\n }\n ]\n }\n ]\n }]};\n\n this.yAxisForm = {\n name: 'y-axis',\n sections: [{\n // Will need to be repeated for each y-axis, with a\n // distinct name for each. Ideally the name of the axis\n // itself.\n name: 'y-axis',\n rows: [\n {\n name: 'Range',\n control: 'select',\n key: 'key',\n options: [\n {\n name: 'Autoselect',\n value: 'auto'\n },\n {\n name: 'EU',\n value: 'eu'\n },\n {\n name: 'DN',\n value: 'dn'\n },\n {\n name: 'Status',\n value: 'enum'\n }\n ]\n },\n {\n name: 'Autoscale',\n control: 'checkbox',\n key: 'autoscale'\n },\n {\n name: 'Min',\n control: 'textfield',\n key: 'min',\n pattern: '[0-9]',\n inputsize: 'sm'\n },\n {\n name: 'Max',\n control: 'textfield',\n key: 'max',\n pattern: '[0-9]',\n inputsize: 'sm'\n }\n ]\n }]\n };\n this.plotSeriesForm = {\n name: 'Series Options',\n sections: [\n {\n rows: [\n {\n name: 'Color',\n control: 'color',\n key: 'color'\n }]\n },\n {\n rows: [\n {\n name: 'Markers',\n control: 'checkbox',\n key: 'markers',\n layout: 'control-first'\n }\n ]\n },\n {\n rows: [\n {\n name: 'No Line',\n control: 'radio',\n key: 'interpolate',\n value: 'none',\n layout: 'control-first'\n },\n {\n name: 'Step Line',\n control: 'radio',\n key: 'interpolate',\n value: 'stepAfter',\n layout: 'control-first'\n },\n {\n name: 'Linear Line',\n control: 'radio',\n key: 'interpolate',\n value: 'linear',\n layout: 'control-first'\n }\n ]\n }\n ]\n };\n }", "get Main() {\n return this.Form.get('main');\n }", "function applyToForm(){\n\tvar divId = GLOBAL.CurrentAnalysisDivId;\n\tvar probesAgg = document.getElementById(\"probesAggregation\");\n\tvar snpType = document.getElementById(\"SNPType\");\n\t\n\tvar subsetCount = multipleSubsets()?2:1;\n\tfor(var idx = 1; idx<=subsetCount; idx++){\n\t\tapplySubsetToForm(divId, idx);\n\t}\n\t\n\t//Pull other values from javascript object.\n\twindow[divId+'pathway']\t\t\t\t= GLOBAL.CurrentPathway;\n\twindow[divId+'pathwayName'] \t\t= GLOBAL.CurrentPathwayName;\n\twindow[divId+'probesAggregation']\t= probesAgg.checked;\n\twindow[divId+'SNPType']\t\t\t\t= snpType.value;\n\twindow[divId+'markerType']\t\t\t= GLOBAL.HighDimDataType;\n\t\n\t//Pull the actual values for these items so we can filter on them in a SQL query later. When we click on the items in the dropdowns these \"Value\" fields get a list of all items in both subsets.\n\twindow[divId+'samplesValues']\t\t= GLOBAL.CurrentSamples;\n\twindow[divId+'tissuesValues']\t\t= GLOBAL.CurrentTissues;\n\twindow[divId+'timepointsValues']\t= GLOBAL.CurrentTimepoints;\n\twindow[divId+'gplValues']\t\t\t= GLOBAL.CurrentGpls.toArray();\t\n\t\n\tdisplayHighDimSelectionSummary(subsetCount, divId, probesAgg, snpType);\n\n\tcompareStepPathwaySelection.hide();\n}", "setShowInNewForm(show) {\r\n return this.clone(Field, `setshowinnewform(${show})`).postCore();\r\n }", "get form() {\n return this.elementInternals ? this.elementInternals.form : this.proxy.form;\n }" ]
[ "0.60106176", "0.598269", "0.596071", "0.58828056", "0.57380515", "0.5691426", "0.56898594", "0.56729406", "0.5641293", "0.56308436", "0.5615289", "0.5585626", "0.5571221", "0.55293334", "0.5523767", "0.55224425", "0.5509165", "0.55056524", "0.54985416", "0.54963344", "0.5489969", "0.54851437", "0.54415095", "0.5420523", "0.5399739", "0.53931683", "0.5376758", "0.53751504", "0.5374079", "0.5363572", "0.5350776", "0.53394145", "0.53263634", "0.53248435", "0.53103733", "0.5300272", "0.5291444", "0.5282778", "0.52713114", "0.52585745", "0.52516496", "0.5243537", "0.52407324", "0.5234917", "0.52324116", "0.52294743", "0.5226368", "0.5222079", "0.5217138", "0.5217138", "0.5217138", "0.52103996", "0.51942325", "0.5188644", "0.51814437", "0.5178488", "0.5173548", "0.5171391", "0.51646405", "0.51631486", "0.5161427", "0.51592654", "0.5157767", "0.51552534", "0.51552534", "0.5152693", "0.5151263", "0.51467115", "0.51458746", "0.51411575", "0.5137056", "0.51316315", "0.5129669", "0.5117666", "0.51125914", "0.5107265", "0.5106714", "0.5104818", "0.5103586", "0.5090765", "0.50877607", "0.5085101", "0.508495", "0.5081027", "0.5080042", "0.5078531", "0.50649935", "0.5064212", "0.5056525", "0.5055541", "0.5054217", "0.50527376", "0.5051454", "0.5048454", "0.5042639", "0.5039998", "0.50387967", "0.503847", "0.50375587", "0.503224", "0.5031701" ]
0.0
-1
This function sends queries to the database.
static sendQuery(querySql, values) { // if (!PRODUCTION) console.log(querySql); // console.log(querySql, values); return new Promise((conResolve, conReject) => { Database.pgPool .connect() .then((client) => { client .query(querySql, values) .then((res) => { client.release(); if (typeof res === 'undefined') conReject(DBerror(UndefinedResponseFromDBerror(querySql))); else conResolve(res); }) .catch((err) => { client.release(); conReject(DBerror(err)); }); }) .catch((err) => conReject(DBerror(err))); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startDatabaseQueries() {\n \n}", "function insertQueries() {\n\n }", "function sendToDb(query, res) {\r\n db.query(query, function(err, result, fields) {\r\n if (err) throw err;\r\n res.send(JSON.stringify(result));\r\n });\r\n}", "function dataSend() {\n let db;\n const request = indexedDB.open('my-db');\n request.onerror = (event) => {\n console.log('Error with IndexDB', event);\n };\n request.onsuccess = (event) => {\n db = event.target.result;\n getData(db);\n };\n }", "async exec() {\n try {\n // generate queryString\n this.buildQuery();\n // eslint-disable-next-line prefer-destructuring\n const values = this.values;\n // eslint-disable-next-line prefer-destructuring\n const queryString = this.queryString;\n\n // send query to database\n const { rows, rowCount } = await this.DB.query(queryString, values);\n\n // end the transaction!\n this.end(); // This resets all properties in this class (except `this.relation`);\n\n // send a response\n return {\n queryString,\n values,\n rows,\n rowCount,\n };\n } catch (error) {\n console.log(error.stack, error.message);\n return `Unable to complete this transaction: ${error}`;\n }\n }", "write() {\n const statement = this.dbConnector.statements.set(this.params, this.writeBuffer);\n this.dbConnector.query(statement, this.onWriteResult.bind(this), [], true);\n }", "function executeRequest(query) {\n console.log('entering executeRequest', query);\n var request = new Request(query, function(err) {\n\n if (err) {\n console.log('>>>>error encountered');\n console.log(err);\n } else {\n console.log('>>>>request successfully handled');\n console.log('redirecting to Survey');\n res.redirect('/survey');\n }\n\n });\n console.log('request about to execute');\n connection.execSql(request);\n\n }", "async execute(...queries) {\n if(!queries.every(q=>q instanceof SQLQuery)) throw new Error('All queries must be instances of SQLQuery object');\n const autoRelease = !this.connection;\n const executing = [];\n const connection = await this.connect(); \n queries.forEach((query, index) => {\n //Logger.verbose(`Executing\\n${query.toString()}\\nwith ${query.params.length} parameters`);\n executing[index] = connection.query(...query.prepare());\n })\n\n try {\n let result = await Promise.all(executing);\n if (autoRelease) connection.release();\n return queries.length === 1 ? result[0] : result;\n }catch(err){\n console.log(err)\n Logger.error(`[MysqlDatabase][${err.code}][${err.message}]`)\n throw err\n }\n \n }", "function updateSQL() {\n\n //create a variable to run multiple queries\n var queries = '';\n\n for (var i in stock) {\n //add a query to update the stock quantity in the databse for each id from the stock array to the query list\n //the semicolon and space are key so that it logs multiple queries in the variable to run\n queries += mysql.format(\"UPDATE Products SET StockQuantity=? WHERE ItemID=?; \", [stock[i].StockQuantity, stock[i].ItemID]);\n }\n\n //run all the queries to update the SQL database\n var sentQuery = connection.query(queries);\n\n //end the connection!\n connection.end();\n}", "async function executeAllQueries(tx) {\n for (qsFunc of questionsAndFunctions) {\n qustion = qsFunc[\"question\"];\n queryFunction = qsFunc[\"queryFunction\"];\n await queryFunction(qustion, tx);\n log(\"\\n - - - - - - - - - - - - \\n\");\n }\n}", "function execute(query)\n{\n console.log(query);\n var result = db.exec(query);\n printResult(result);\n}", "query() { }", "function insertTrack(insertStatementsArray){\n console.log(\"Updating database...\");\n // Begin a transaction. \n db.serialize(function () {\n db.exec('begin transaction'); \n var request = [];\n for(var i = 0; i < insertStatementsArray.length; i++){\n var promise = new Promise(function(resolve){\n db.run(\"INSERT INTO ITUNES_LIBRARY VALUES (?, ?, ?, ?, ?) \", insertStatementsArray[i].c1, insertStatementsArray[i].c2, insertStatementsArray[i].c3, insertStatementsArray[i].c4, insertStatementsArray[i].c5);\n resolve();\n request.push(promise);\n });\n }\n \n Promise.all(request).then(function(values){\n console.log(\"now we're here\");\n \n db.exec('COMMIT')\n .close(function(){\n console.log(\"Happy Panda :-) Database updated with all your music.\");\n });\n \n });\n });\n}", "function triggerDatabaseInsert(data, messageQueueLength) {\n let con = mysql.createConnection({\n host: process.env.DB_HOST,\n user: process.env.DB_USER,\n password: process.env.DB_PASSWORD,\n database: process.env.DB_DATABASE,\n port: process.env.DB_PORT\n });\n con.connect(function(err) {\n if (err) throw err;\n console.log(\"Connected!\");\n var sql = \"INSERT INTO messages (data) VALUES ?\";\n const values = data.map(thisData => { return [thisData] });\n console.log('----- Inserting data into mySQL -----');\n console.log(values);\n con.query(sql, [values], function (err, result) {\n if (err) throw err;\n console.log(\"Number of records inserted: \" + result.affectedRows);\n if (result.affectedRows === data.length && result.affectedRows === messageQueueLength) {\n return trimFromMessageQueue(messageQueueLength);\n }\n });\n });\n}", "function execQuery(message) {\n var db = openDatabaseSync(\"org.moedict\", \"1\", \"\", 64 * 1024 * 1024)\n var result = []\n db.readTransaction(function(tx) {\n var rs = tx.executeSql(message.query, message.params)\n for (var i = 0; i < rs.rows.length; i++)\n result.push(rs.rows.item(i))\n })\n WorkerScript.sendMessage({\"result\": result, \"token\": message.token})\n}", "function sendQuery( mysql_conn, queryString ) {\n\t\n\tif( mysql_conn == null)\n\t{\n\t\tthrow \"The mysql connection argument cannot be null\"; \n\t}\n\n\tfunction queryExec(resolve, reject) {\n\n\t\tmysql_conn.query( queryString, \tfunction( error, results) {\n\t\t\tif(error ){\n\t\t\t\treturn reject(error); \n\t\t\t}\n\t\t\telse \n\t\t\t{ \n\t\t\t\tconsole.log(\"Quering geodb: \" + queryString ); \n\t\t\t\t//console.log(results);\n\t\t\t\tresolve(results); \n\t\t\t}\n\t\t} );\n\t};\n\n\treturn new Promise( queryExec ); \n}", "function executeQuery(res, sql, inserts, mysql, complete, contentmod) {\n\t\tmysql.pool.query(sql, inserts, function (error, results, fields) {\n\t\t\tif (error) {\n\t\t\t\tres.write(JSON.stringify(error));\n\t\t\t\tres.end();\n\t\t\t}\n\t\t\tcontentmod(results);\n\t\t\tcomplete();\n\t\t});\n\t}", "async function execSql(sql, params = [],action){\n console.log(\"start execSql....\\n\");\n\n try{\n let db = await connectToDB();\n db.loadExtension(\"./extension-functions\");//compiled extension for \n\n switch (action) {\n case 'select':\n return await select();\n case 'insert':\n return await insert();\n default:\n return false;\n }\n /*db.serialize(() => {\n // Queries scheduled here will be serialized.\n db.run(\n `CREATE TABLE IF NOT EXISTS sensors (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n device_id INTEGER,\n timestamp TEXT,\n latitude REAL,\n longitude REAL,\n value INTEGER\n )`);\n \n \n\n });*/\n\n async function select(){\n return new Promise(function(resolve, reject) {\n\n db.all(sql, params, (err,result) => {\n if (err) {\n console.error(err.message);\n reject(err.message);\n }\n resolve(result);\n\n }).close((err) => {\n if (err) {\n console.error(\"error\" , err.message);\n reject(err.message);\n }\n console.log('Close the database connection.');\n });\n \n }); \n }//end select\n\n async function insert(){\n return new Promise(function(resolve, reject) {\n\n db.run(sql, params, function(err){\n if (err){\n reject(err);\n throw err;\n }\n resolve(true);\n \n }).close((err) => {\n if (err) {\n console.error(\"error\" , err.message);\n }\n console.log('Close the database connection.');\n });\n\n }); \n }//end insert\n\n \n \n\n }catch(e){\n console.log(\"execSql Error\");\n throw e;\n }\n}", "executeQuery(res, query){ \n sql.connect(dbConfig, function (err) {\n if (err) { \n console.log(\"Error while connecting database :- \" + err);\n res.send(err);\n }\n else {\n // create Request object\n var request = new sql.Request();\n // query to the database\n request.query(query, function (err, res) {\n if (err) {\n console.log(\"Error while querying database :- \" + err);\n res.send(err);\n }\n else {\n res.send(res);\n }\n });\n }\n }); \n }", "function execute(query) \n{\n\ttic();\n \n\tworker.onmessage = function(event) \n {\n\t\tvar results = event.data.results;\n\t\ttoc(\"Executing SQL\");\n\n\t\ttic();\n\t\toutputElm.innerHTML = \"\";\n \n\t\tfor (var i = 0; i < results.length; i++) \n {\n\t\t\toutputElm.appendChild(tableCreate(results[i].columns, results[i].values));\n\t\t}\n \n\t\ttoc(\"Displaying results\");\n\t}\n \n\tworker.postMessage({action:'exec', sql:query});\n\toutputElm.textContent = \"Fetching results...\";\n}", "function CreateDatabaseQuery() {}", "function RunDatabaseRequest(query, args, req, res, callback) {\n logRoute(req._parsedUrl.path);\n connpool.getConnection(function(err, conn) {\n if (err) {\n handleMysqlConnErr(err, res);\n } else {\n conn.query(query, args, function(err, response) {\n conn.release();\n if (err) {\n handleMysqlQueryErr(err, res);\n } else {\n res.status(200);\n res.type('json');\n callback(response);\n }\n });\n }\n });\n}", "function prepareSQL() {\n const sql = `INSERT INTO ${table} VALUES (@val1, @val2)`;\n\n const request = new Request(sql, (err, rowCount) => {\n if (err) {\n throw err;\n }\n\n });\n\n // Must add parameters\n request.addParameter('val1', TYPES.Int);\n request.addParameter('val2', TYPES.Int);\n\n request.on('prepared', () => {\n console.log('request prepared');\n executePreparedSQL(request);\n });\n\n connection.prepare(request);\n}", "function execute(commands) {\n tic();\n worker.onmessage = function (event) {\n var results = event.data.results;\n\n\n toc(\"Executing SQL\");\n if (!results) {\n error({message: event.data.error});\n return;\n }\n\n if (results[0].values.length > artificialLimit) {\n askUserIfToShowEverything(results);\n } else {\n showResults(results, Infinity);\n }\n }\n worker.postMessage({ action: 'exec', sql: commands });\n outputElm.textContent = \"Fetching results...\";\n}", "function addQuery(query){\n databaseAccess(dbAdd, {'query': query, 'when': new Date()}, function(results){});\n}", "function insertToUserData() {\n var request = new Request();\n var sql = \"INSERT INTO userData (id, password) VALUES ('emma', 'lalala')\";\n\n request = new Request(sql, (err, rowCount, rows) => {\n console.log(rowCount + ' row(s) returned');\n process.exit();\n });\n \n connection.execSql(request);\n}", "function startDatabaseQueries() {\n var myUserId = firebase.auth().currentUser.uid;\n var statusRef = firebase.database().ref('/kettle/status');\n var curWaterRef = firebase.database().ref('/kettle/cur_water');\n var reservationCountRef = firebase.database().ref('/reservations/');\n // Fetching and displaying all posts of each sections.\n updateValueByRef(statusRef, statusContainer);\n updateValueByRef(curWaterRef, currWaterContainer);\n refreshData(reservationCountRef, addReservationEntry);\n // Keep track of all Firebase refs we are listening to.\n listeningFirebaseRefs.push(statusRef);\n listeningFirebaseRefs.push(curWaterRef);\n listeningFirebaseRefs.push(reservationCountRef);\n}", "function queryDB(tx){\r\n tx.executeSql('SELECT * FROM Client',[],querySuccess,errorCB);\r\n }", "_exec(queryString) {\n\t\tif (!this.connection)\n\t\t\tthrow new Error('No Connection for the model.');\n\t\tlet alterProc = (!this._query.hasOwnProperty('select')) ? true : false;\n\t\tthis._query = {};\n\t\tlet connectionType = this.connection.getConnectionType(),\n\t\t\tdb;\n\n\t\tswitch (connectionType) {\n\t\t\tcase 'pg':\n\t\t\t\tdb = require('./db/PostgresDb');\n\t\t\t\tbreak;\n\t\t\tcase 'mysql':\n\t\t\t\tdb = require('./db/MysqlDb');\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error('Undefined connection type');\n\t\t}\n\n\t\treturn db._exec(this.connection.getConnection(), queryString, alterProc);\n\t}", "function executeQuery(queries, cb) {\n\t\t\tif (queries.length === 0) {\n\t\t\t\tconsole.log('Loading ' + table_name +' completed.');\n\t\t\t\tcb();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvar query = queries.pop();\n\t\t\t\t// Execute query.\n\t\t\t\tclient.query(query, function(error, result) {\n\t\t\t\t\tif(error) {\n\t\t\t\t\t\tconsole.log('Fail: ' + query);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// console.log('Success: ' + query);\n\t\t\t\t\t}\n\t\t\t\t\texecuteQuery(queries, cb);\n\t\t\t\t});\t\t\t\t\n\t\t\t}\n\t\t}", "function setDBData(addSql, addSqlParams){\n // var addSql = 'users(name, account, password) VALUES(?,?,?)';\n // var addSqlParams = [name, account,password];\n connection.query('INSERT INTO ' + addSql,addSqlParams,function (err, results) {\n if(err){\n console.log('[INSERT ERROR] - ',err.message);\n return;\n } \n \n console.log('--------------------------INSERT----------------------------');\n console.log('INSERT ID:',results); \n console.log('-----------------------------------------------------------------\\n'); \n });\n // connection.release();\n}", "async function executeQueries() {\n // print questions\n log(\"\\nSelect a question for which you'd like to execute the query?\\n\");\n for (let [index, qsFunc] of questionsAndFunctions.entries())\n log(index + 1 + \". \" + qsFunc[\"question\"]);\n log(\"\");\n\n // get user's selection and call the function for it\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n });\n executeBasedOnSelection(rl);\n}", "addItems() {\n let id = 0;\n let name = \"\";\n let amount = 0;\n let datecreated = \"\";\n let status = \"\";\n let type = \"\";\n\n db.transaction(async function(d) {\n\n console.log(data);\n data.forEach(e => {\n id = e.id;\n name = e.name;\n amount = e.amount;\n datecreated = e.date;\n status = e.status;\n type = e.type;\n\n d.executeSql('INSERT INTO activities (id,name, amount, datecreated, status, type) VALUES (?,?,?,?,?,?)', [id, name, amount, datecreated, status, type]);\n\n });\n });\n }", "async function sendDb () {\n /*\n let userParams = await browser.storage.local.get({\n usageStatCondition: 'no monster',\n userId: 'no monster',\n startTS: 0\n });\n // if usage condition is null just return\n if (!JSON.parse(userParams.usageStatCondition)) { return true }\n var allData = await queryDatabase('getInferencesDomainsToSend', {});\n // var allData = await queryDatabase('getInferences', {});\n\n for (var i = 0; i < allData.length; i++) {\n allData[i]['Pages']['domain'] = await hashit_salt(allData[i]['Pages']['domain']);\n allData[i]['Inferences']['inference'] = hashit(allData[i]['Inferences']['inference']);\n allData[i]['Trackers']['tracker'] = hashit(allData[i]['Trackers']['tracker']);\n }\n // console.log(allData)\n // for(const row of alldata){\n // console.log(row)\n // }\n // var xs = cookie\n // let allData=\"\"\n var data = new FormData();\n data.append('userId', userParams.userId);\n data.append('dumpTS', Date.now());\n data.append('startTS', userParams.startTS);\n data.append('version', EXT.VERSION); // global variable set by webpack\n data.append('dbname', 'getInferences');\n data.append('lfdb', JSON.stringify(allData));\n\n // console.log(allData)\n // data.append('filename',xs.value+'.'+Date.now())\n var xhr = new XMLHttpRequest();\n // send asnchronus request\n xhr.open('post', 'https://super.cs.uchicago.edu/trackingtransparency/lfdb.php', true);\n // xhr.setRequestHeader(\"Content-Type\", \"application/json\")\n xhr.send(data);\n // return true\n */\n}", "function getEntries() {\r\n db.transaction(queryDB,dbErrorHandler);\r\n}", "function pushSMSQueue(){\n //status 0 - not sent, 1 - sent not delivered (resend), 2 - delivered\n \n var len =1, limit = 3;\n var query = 'SELECT * FROM cthx_sms_queue WHERE status < 2';\n var syncBigMessage = '', syncMessageIdList = '', date_sent='';\n \n globalObj.db.transaction(function(tx){\n tx.executeSql(query,[],function(tx,result){\n var len = result.rows.length;\n console.log('queue length: ' + len)\n if(len>=limit){\n //then we need to send messages. \n //First, we batch all the messages in the queue\n var bigMessage = '', messageIdList='', averagePrioritycount=0 ;\n for(var i=0; i<len; i++){\n (function(i){\n var row = result.rows.item(i);\n \n setTimeout(function(){\n if(row['priority']==1){ //high priority\n //console.log('modulo is 0001');\n syncBigMessage = row['message'] + ',' + row['sms_id'] + ',' + row['source'];;\n date_sent = getNowDate();\n console.log('message 0001: ' + syncBigMessage + ' date: ' + date_sent);\n \n //batch update of fields to status 2 - sent\n globalObj.db.transaction(function(tx){\n query = 'UPDATE cthx_sms_queue SET status=2,date_sent=\\'' + date_sent + '\\' WHERE sms_id =' + row['sms_id'];\n tx.executeSql(query);\n \n sendHTTPMessage(syncBigMessage, row['sms_id']);\n });\n }\n else if(row['priority']==2){ //average priority\n //concatenate the message\n bigMessage += row['message'] + ',' + row['sms_id'] + ',' + row['source'];\n messageIdList += row['sms_id'];\n averagePrioritycount++; //increment count to use in modulo calculation \n \n console.log('i: ' + i + ' bigMessage: ' + bigMessage + ' messageidlist: ' + messageIdList);\n console.log('modulo: ' + (averagePrioritycount%limit));\n \n if( (averagePrioritycount % limit) != 0) {\n bigMessage += '|'; \n messageIdList += ',';\n }\n else {\n console.log('modulo is 000');\n //get the variables into temp vars that will be used in async mode in transaction statement\n var syncBigMessage = bigMessage;\n var syncMessageIdList = messageIdList;\n bigMessage = ''; messageIdList='' ;\n var date_sent = getNowDate();\n console.log('messageIdList: ' + syncMessageIdList + 'date: ' + date_sent);\n\n //batch update of fields to status 1 - sent\n globalObj.db.transaction(function(tx){\n query = 'UPDATE cthx_sms_queue SET status=2,date_sent=\\'' + date_sent + '\\' WHERE sms_id IN (' + syncMessageIdList + ')';\n console.log('date_sent query: ' + query);\n tx.executeSql(query);\n \n sendHTTPMessage(syncBigMessage, syncMessageIdList)\n });\n }\n }\n },1000);\n })(i);\n }\n }\n });\n });\n}", "function execute(commands) {\n testCaseElm.innerHTML = \"\"\n\n writeExecTime = new Date(firebase.firestore.Timestamp.now().seconds * 1000).toLocaleString('en-US', 'best-fit', 'short')\n\n var username = document.getElementsByClassName(\"fs-block\");\n if (username) {\n console.log(username)\n console.log(\"USERNAME: \" + username)\n }\n noerror();\n tic();\n worker.onmessage = function (event) {\n if (event.data.error) {\n event.message = event.data.error;\n error(event);\n }\n\n var results = event.data.results;\n toc(\"Executing SQL\");\n\n tic();\n outputElm.innerHTML = \"\";\n for (var i = 0; i < results.length; i++) {\n runAsserts(results[i])\n outputElm.appendChild(tableCreate(results[i].columns, results[i].values));\n }\n toc(\"Displaying results\");\n }\n\n worker.postMessage({ action: 'exec', sql: commands });\n outputElm.textContent = \"Fetching results...\";\n\n\n}", "function dbWriteData( query, callback){\n dbCon.query( query, function( error, result){\n if( error) handleError( error);\n else callback( result);\n });\n }", "function queryDB(tx) {\r\n tx.executeSql(\"SELECT * FROM DEMO\", [], querySuccess, errorCB);\r\n}", "function runQuery( queryString , res){\r\n var query = db.query( queryString, function(err, result){\r\n if(err){\r\n console.log('Error in query: ' + err);\r\n } else {\r\n sendJSON(result, res);\r\n } \r\n });\r\n}", "function sendAll(db, res) {\n var results = store.get(db);\n\n try {\n res.jsonp(results);\n } catch (e) {\n errorHandler(res, e);\n }\n }", "function updateDB(query) {\n let connection = makeConnection();\n connection.query(query, function(err, res) {\n if (err) throw err;\n connection.end();\n });\n}", "async SyncDB() { // Sincroniza com as tabelas, colunas e todos os elementos do Banco de Dados\n await mysql.sync();\n }", "function executeQuery(queryString, callBackFn){\n\t//create new client\n\tvar client = new Client({\n\t connectionString: process.env.DATABASE_URL,\n\t ssl: true\n\t});\n\n\tclient.connect();\n\tclient.query(queryString, callBackFn);//execute the query and pass in callback function (this will be the next from yield)\n}//end query", "function send(config, query) {\n if (!config.url) {\n return Promise.reject(new Error('config.url is required'));\n }\n const results = {\n data: [],\n };\n return fetch(\n `${config.url}/?user=${config.user}&password=${config.password}&database=${config.database}`,\n {\n method: 'POST',\n body: query,\n headers: getHeaders(config),\n }\n )\n .then((response) =>\n response.ok ? response.text() : { error: response.text() }\n )\n .then((statement) => handleStatementAndGetMore(results, statement, config));\n}", "function addQuery(request,response){\n\tconst query = request.body.text;\n\tconst email=request.body.email;\n\n\tconsole.log(email);\n\tconsole.log(query);\n\tlet date=Date.now();\n\tconst email_child='queries/'+email;\n\tif(query !== undefined)\n\t{\n\t\tdatabase.ref().child(email_child).child(date).set({\n\t\t\ttext:query,\n\t\t\tid:date,\n\t\t\tstatus:true,\n\t\t});\n\t\tresponse.status(200).json({\n\t\t\tsuccess:true,\n\t\t\tmessage : \"query successfully added\"\n\t\t});\n\t}\n\telse\n\t{\n\t\tresponse.status(400).json({\n\t\t\tsuccess:false,\n\t\t\tmessage: \"empty query\"\n\t\t})\n\t}\n}", "function queryDatabase() {\n if (idb.isReady()) {\n idb.get(dbKeys.stations);\n idb.get(dbKeys.lastFrequency);\n }\n }", "async query(query) {\n\n }", "function runSqlQuery(queryString, consoleLogging, options = null){ \r\n con.query(queryString, options, function(err, result, fields) {\r\n if (err) throw err;\r\n if(consoleLogging == true){\r\n console.log(\"\\n--------------------------------------------------\")\r\n console.log(queryString + \" --> DONE!\");\r\n console.log(result);\r\n console.log(\"--------------------------------------------------\")\r\n }\r\n });\r\n}", "function onBulkDataConnection() {\r\n return function(conn) {\r\n console.log(\"Data channel connected\");\r\n conn.on('close', function() {\r\n console.log(\"Data channel close\");\r\n });\r\n\r\n conn.on('data', function(data) { //This event is trigered when a request for data arrives from a browser.\r\n var requestObj = JSON.parse(data);\r\n var targetName = null;\r\n var out = {};\r\n\r\n cloudant.db.list(function(err, allDbs){ //this gets a list of all the databases \r\n if (err) {\r\n throw err;\r\n }\r\n for(var i = 0 ; i < allDbs.length ; i++ ) {\r\n if(allDbs[i].indexOf(\"iotp_4rxa4d_default_\") == -1 && requestObj.databaseName == allDbs[i]) {\r\n targetName = allDbs[i];\r\n break;\r\n }\r\n }//end of for loop\r\n if(targetName != null) {\r\n querryBulk(targetName); //make this function.\r\n }\r\n else {\r\n console.log(requestObj.databaseName + \" database not found.\");\r\n conn.write(JSON.stringify({update:\"done\"}));\r\n conn.write(JSON.stringify({message:requestObj.databaseName + \" database not found, try again.\"}));\r\n }\r\n });//end of list\r\n\r\n function querryBulk(targetName) {\r\n var clientUpdate = setInterval(function() {\r\n conn.write(JSON.stringify({update:\".\"}));\r\n }, 2000);\r\n console.log(\"Searching database \" + targetName);\r\n conn.write(JSON.stringify({message:targetName + \" database found, starting querry...\"}));\r\n var targetDatabase = cloudant.db.use(targetName);\r\n targetDatabase.find({ //this will get all the documents from the specified database.\r\n \"selector\": {\r\n },\r\n \"fields\": [\r\n \"timestamp\",\r\n \"data.d\",\r\n \"eventType\",\r\n \"localName\",\r\n \"deviceId\"\r\n\r\n ],\r\n \"sort\": [\r\n \r\n ]\r\n }, function(err, result) {\r\n if (err) {\r\n throw err;\r\n }\r\n else {\r\n data = result.docs;\r\n for(i in data) {\r\n //console.log(JSON.stringify(result[i]));\r\n thisResult = data[i];\r\n if(out[thisResult.localName]) {\r\n out[thisResult.localName].setReading(thisResult);\r\n }\r\n else {\r\n out[thisResult.localName] = new DeviceDataSet();\r\n out[thisResult.localName].setReading(thisResult);\r\n }\r\n }\r\n \r\n for(i in out) {// we go through each deviceData\r\n var thisDeviceData = out[i];\r\n for(j in thisDeviceData) { // we go through each characteristic\r\n var thisChar = thisDeviceData[j];\r\n for(k in thisChar) {\r\n var entry = thisChar[k];\r\n if (entry[0] != undefined && entry[0] != null && entry[0].length > 0) {\r\n entry[0] = parseTime(entry[0]);\r\n entry.splice(1, 0, entry[0].toString().split('-')[0]);\r\n }\r\n }\r\n }\r\n }\r\n \r\n for(i in out) {// we go throughh each deviceData\r\n var thisDeviceData = out[i];\r\n for(j in thisDeviceData) { // we go through each characteristic\r\n var thisChar = thisDeviceData[j];\r\n for(k in thisChar) {\r\n thisChar.sort(compareFunction);\r\n }\r\n }\r\n }\r\n \r\n for(i in out) {\r\n var thisDevice = out[i];\r\n removeAllFirstEntries(thisDevice);\r\n allCharToCSV(thisDevice);\r\n }\r\n \r\n clearInterval(clientUpdate);\r\n conn.write(JSON.stringify({update:\"done\"}));\r\n console.log(\"Sending bulk data back...\");\r\n conn.write(JSON.stringify(out));\r\n }\r\n });\r\n }\r\n });\r\n };\r\n}", "function insertQuery() {\n var interesse = $('#query-input').val();\n\n databaseManager\n .query(\"INSERT INTO interesses (INTERESSE) VALUES (?)\", [interesse])\n .done(function () {\n alert(\"Interesse is in de database toegevoegd!\");\n loadController(CONTROLLER_ADMIN_HOME);\n })\n .fail(function () {\n alert(\"Interesse is in de database toegevoegd!\")\n });\n }", "async function DatabaseSend(){\n // store formatted data into the database\n let promise = new Promise((resolve, reject) => {\n setTimeout(() => resolve(\"done!\"), 500)\n });\n\n let result = await promise; // wait until the promise resolves (*)\n \n\n if(id1 == 0 && payload[0] == 0){\n db.put(1, information1);\n id1 = 1;\n }\n else if(id2 == 0 && payload[0] == 1){\n db.put(2, information2);\n id2 = 1;\n }\n else if(id3 == 0 && payload[0] == 2){\n db.put(3, information3);\n id3 = 1;\n }\n else if(id4 == 0 && payload[0] == 3){\n db.put(4, information4);\n id4 = 1;\n }\n else if(id5 == 0 && payload[0] == 4){\n db.put(5, information5);\n id5 = 1;\n }\n else if(id6 == 0 && payload[0] == 5){\n db.put(6, information6);\n id6 = 1;\n }\n else if(id7 == 0 && payload[0] == 6){\n db.put(7, information7);\n id7 = 1;\n }\n else if(id8 == 0 && payload[0] == 7){\n db.put(8, information8);\n id8 = 1;\n }\n else if(id9 == 0 && payload[0] == 8){\n db.put(9, information9);\n id9 = 1;\n }\n //db.put(1, information1);\n //db.put(2, information2);\n //db.put(3, information2);\n\n console.log(information1);\n console.log(information2);\n console.log(information3);\n//Conditional. \n db.get(1, function(err, value) {\n if (err) {\n console.error(\"null\");\n }\n else{\n console.log(\"Fob 1:\", value);\n fob1 = value;\n }\n });\n db.get(2, function(err, value) {\n if (err) {\n console.error(\"null\");\n }\n else{\n console.log(\"Fob 2:\", value);\n fob2 = value;\n }\n });\n db.get(3, function(err, value) {\n if (err) {\n console.error(\"null\");\n }\n else{\n console.log(\"Fob 3:\", value);\n fob3 = value;\n }\n });\n db.get(4, function(err, value) {\n if (err) {\n console.error(\"null\");\n }\n else{\n console.log(\"Fob 4:\", value);\n fob4 = value;\n }\n });\n db.get(5, function(err, value) {\n if (err) {\n console.error(\"null\");\n }\n else{\n console.log(\"Fob 3:\", value);\n fob5 = value;\n }\n });\n db.get(6, function(err, value) {\n if (err) {\n console.error(\"null\");\n }\n else{\n console.log(\"Fob 6:\", value);\n fob6 = value;\n }\n });\n db.get(7, function(err, value) {\n if (err) {\n console.error(\"null\");\n }\n else{\n console.log(\"Fob 7:\", value);\n fob7 = value;\n }\n });\n db.get(8, function(err, value) {\n if (err) {\n console.error(\"null\");\n }\n else{\n console.log(\"Fob 8:\", value);\n fob8 = value;\n }\n});\ndb.get(9, function(err, value) {\n if (err) {\n console.error(\"null\");\n }\n else{\n console.log(\"Fob 9:\", value);\n fob9 = value;\n }\n });\n }", "function runGenericQuery(query)\n{\n return new Promise((resolve, reject) => {\n var connection = new Connection(config);\n connection.on('connect', function(err) {\n if (err) {\n console.log(err);\n reject(err);\n } else {\n request = new Request(query.query, function(err) {\n if (err) {\n console.log(err);\n reject(new Error(err));\n } else {\n resolve(\"Operation successful\");\n }\n connection.close();\n }); \n \n query.params.forEach(function(param) {\n request.addParameter(param.paramName, param.paramType, param.paramValue);\n });\n\n connection.execSql(request);\n }\n });\n });\n}", "function addListingSQL(name, email, school, gradyear, phone, object, price, image, firstavail, lastavail) {\n client.connect();\n client.query('INSERT INTO listings (name, email, school, gradyear, phone, object, price, image, firstavail, lastavail) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING id;', [name, email, school, gradyear, phone, object, price, image, firstavail, lastavail], (err, res) => {\n if (err) throw err;\n // var listingID = [];\n // listingID.push(res.rows[0].id);\n // console.log(listingID);\n // listingID.send(listingID);\n // console.log(res.rows);\n client.end();\n });\n}", "function execute(db) {\n //Executa as instruções toda vez q eu chamar o arquivo db\n // Criando as tabelas do banco de dados\n // Fazendo relacionamento de tabelas pelos ids\n return db.exec(` \n CREATE TABLE IF NOT EXISTS proffys (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name TEXT,\n avatar TEXT,\n whatsapp TEXT,\n bio TEXT\n );\n\n CREATE TABLE IF NOT EXISTS classes (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n subject INTEGER,\n cost TEXT,\n proffy_id INTEGER\n );\n\n CREATE TABLE IF NOT EXISTS class_schedule (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n class_id INTEGER,\n weekday INTEGER,\n time_from INTEGER,\n time_to INTEGER\n );\n `)\n}", "execute(sqlOptions, connection = this.connection) {\n const sql = helper.isString(sqlOptions) ? sqlOptions : sqlOptions.sql;\n this.lastSql = sql;\n return this.socket(sql).execute(sqlOptions, connection);\n }", "execute() {}", "execute() {}", "function pushQuery(query) {\n\t if (!query) return;\n\t if ((0, _isString3.default)(query)) {\n\t query = { sql: query };\n\t }\n\t if (!query.bindings) {\n\t query.bindings = this.formatter.bindings;\n\t }\n\t this.sequence.push(query);\n\t this.formatter = this.client.formatter();\n\t}", "function execute(dbName, tableName, sqlQueries, write) {\n if (write === void 0) { write = false; }\n var escapedTableName = \"\\\"\" + tableName + \"\\\"\";\n var isMaster = tableName === MASTER_TABLE_NAME;\n return new Promise(function (resolve, reject) {\n try {\n var db = window.openDatabase(dbName, 1, 'Kinvey WebSQL', SIZE);\n var writeTxn = write || typeof db.readTransaction !== 'function';\n db[writeTxn ? 'transaction' : 'readTransaction'](function (tx) {\n new Promise(function (resolve) {\n if (write && !isMaster) {\n tx.executeSql(\"CREATE TABLE IF NOT EXISTS \" + escapedTableName + \" (key BLOB PRIMARY KEY NOT NULL, value BLOB NOT NULL)\", [], function () {\n resolve();\n });\n }\n else {\n resolve();\n }\n })\n .then(function () {\n return Promise.all(sqlQueries.map(function (query) {\n return new Promise(function (resolve) {\n tx.executeSql(query[0].replace('#{table}', escapedTableName), query[1], function (_, resultSet) {\n var response = {\n rowCount: resultSet.rows.length || resultSet.rowsAffected,\n result: []\n };\n if (resultSet.rows.length > 0) {\n for (var i = 0, len = resultSet.rows.length; i < len; i += 1) {\n var value = resultSet.rows.item(i).value;\n try {\n var doc = isMaster ? value : JSON.parse(value);\n response.result.push(doc);\n }\n catch (error) {\n response.result.push(value);\n }\n }\n }\n resolve(response);\n });\n });\n }));\n })\n .then(function (responses) {\n if (responses === void 0) { responses = []; }\n return responses.reduce(function (_a, response) {\n var _b = _a.rowCount, rowCount = _b === void 0 ? 0 : _b, _c = _a.result, result = _c === void 0 ? [] : _c;\n return {\n rowCount: rowCount + response.rowCount,\n result: result.concat(response.result)\n };\n }, { rowCount: 0, result: [] });\n })\n .then(resolve)\n .catch(reject);\n }, function (error) {\n var errorMessage = isString_1.default(error) ? error : error.message;\n if (errorMessage && errorMessage.indexOf('no such table') === -1) {\n resolve({ rowCount: 0, result: [] });\n }\n else {\n var sql = 'SELECT name AS value from #{table} WHERE type = ? AND name = ?';\n var parameters = ['table', tableName];\n execute(dbName, MASTER_TABLE_NAME, [[sql, parameters]])\n .then(function (response) {\n if (response.result.length === 0) {\n return resolve({ rowCount: 0, result: [] });\n }\n return reject(new kinvey_js_sdk_1.Errors.KinveyError(\"Unable to open a transaction for the \" + tableName + \" collection on the \" + dbName + \" WebSQL database.\"));\n })\n .catch(reject);\n }\n });\n }\n catch (error) {\n reject(error);\n }\n });\n}", "function databaseInsert(query, params) {\n return new Promise((resolve, reject) => {\n db.run(query, params, (err) => {\n if (err) {\n reject(err);\n }\n else {\n resolve();\n }\n });\n })\n}", "function query(context, connection, queryString, rowProcessFunc) {\r\n const Request = require('tedious').Request;\r\n let data = [];\r\n let request = new Request(queryString, function(err, rowCount, rows) {\r\n if (err) {\r\n error(err, context);\r\n }\r\n else {\r\n context.res = {\r\n status: 200,\r\n body: data,\r\n headers: { \"Content-Type\": \"application/json\" }\r\n };\r\n context.done();\r\n }\r\n });\r\n\r\n request.on('row', function(columns) {\r\n data.push(rowProcessFunc(columns));\r\n });\r\n connection.execSql(request);\r\n}", "function index() {\n\t\tdebug('index request');\n\t\t// query here plz\n\t\tvar query = table.select(table.star()).from(table).toQuery();\n\t\tdb.query(query.text, query.values, function(err, resp){\n\t\t\tdebug('index resp:', err);\n\t\t\tif (err) {\n\t\t\t\temit(routes.index, {\"error\": \"db error\"}); // TODO better specific error reporting\n\t\t\t} else {\n\t\t\t\tdebug(resp.rows);\n\t\t\t\temit(routes.index, resp.rows);\n\t\t\t}\n\t\t});\n\t}", "query(...params) {\n this.connection.query(...params);\n }", "function saveToDB(records, promises) {\n promises.push(DBconn.query('INSERT INTO posts_questions (id, Location) VALUES ?', [records]));\n}", "async function runsql(res, obj) {\n let results;\n const sql = obj.sql;\n const data = obj.data;\n await db\n .any(sql, data)\n .then(data => {\n results = data;\n })\n .catch(error => {\n console.log(\"ERROR:\", sql, \":\", error.message); // print error;\n results = { error: error.message };\n });\n res.send({ results });\n}", "function promisedQuery(sql) {\r\n console.log('query: ', sql);\r\n return new Promise((resolve, reject) => {\r\n connection.query(sql, function (err, rows) {\r\n if (err) {\r\n console.log('error: ', err);\r\n return reject(err);\r\n }\r\n console.log('success');\r\n resolve(rows);\r\n })\r\n });\r\n }", "execute(query){\n return new Promise((resolve, reject) => {\n this.conn.query(query, (err, results, fields) => {\n if (err) reject(err);\n else resolve(results);\n })\n })\n }", "function sendDBData( response ){\n\tvar stream = humidityCollection.find({type:'sensorData'}).stream();\n\thumidityCollection.find({type:'sensorData'}).toArray(function(err, items) {\n\t\tresponse.send( JSON.stringify( items ) );\n\t});\n}", "async function transactionsData(amount, accountFrom, accountTo) {\n const autoCommit = `set autocommit = 0;`;\n const tran = `start transaction;`;\n const rollback = `rollback;`;\n const commit = `commit;`;\n\n const transferAmount = `UPDATE account SET balance = balance - ${amount} WHERE account_number = ${accountFrom}`;\n const transferFrom = `UPDATE account SET balance = balance + ${amount} WHERE account_number = ${accountTo}`;\n const transferChange = `insert INTO account_changes value(1, ${accountFrom}, ${amount},'2020-03-01','Amount transfered')`;\n connection.connect();\n try {\n await execQuery(autoCommit);\n await execQuery(tran);\n await execQuery(transferAmount);\n await execQuery(transferChange)\n await execQuery(commit);\n } catch (err) {\n execQuery(rollback);\n console.log('there is a error', err);\n\n }\n connection.end();\n}", "function executeQuery(tx, query, args, callback, callbackparams) {\n //var self = this;\n //console.log('db execute: '+query);\n // db.transaction(function(tx) {\n tx.executeSql(query, args, function(tx, result) {\n var retval = [];\n for (var i = 0; i < result.rows.length; ++i) {\n retval.push(result.rows.item(i));\n }\n if (callback) {\n callback(tx, retval, result, callbackparams);\n }\n }, \n function (err, err2) { errorCB(\"*executeQuery*\", err, err2); });\n //self.error);\n // });\n }", "query(q, data) {\n\t\treturn new Promise((resolve,reject) => {\n\t\t\ttry {\n\t\t\t\tthis.db.query(q, data, (err, rows) => {\n\t\t\t\t\tif(err) reject(err);\n\t\t\t\t\telse resolve(rows);\n\t\t\t\t});\n\t\t\t} catch (err) {\n\t\t\t\treject(err);\n\t\t\t}\n\t\t});\n\t}", "static database_query(json, fcn) {\n if (window.Settings.enableLog)\n WebUtils.log(\"Web.database_query({0})\".format(json));\n Database.query(json, fcn);\n }", "query(text, values) {\n try {\n if (values){\n console.log('query:', text, values);\n }\n else {\n console.log('query:', text, values);\n }\n return this.pool.query(text, values);\n } catch (err) {\n console.log('Error With Postgres Query');\n throw err;\n }\n }", "function write_in_db()\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"Event idd: \", event_id);\n\n\t\t\t\t\t\t\t\t\t\t\tvar email = user_data.email;\n\t\t\t\t\t\t\t\t\t\t\tvar name = user_data.name;\n\t\t\t\t\t\t\t\t\t\t\tvar contact = user_data.contact;\n\t\t\t\t\t\t\t\t\t\t\tvar lati = user_data.lati;\n\t\t\t\t\t\t\t\t\t\t\tvar longi = user_data.longi;\n\t\t\t\t\t\t\t\t\t\t\tvar time = new Date();\n\t\t\t\t\t\t\t\t\t\t\tvar amb_id = best_ambulance_id;\n\t\t\t\t\t\t\t\t\t\t\tvar beingServed = true;\n\n\t\t\t\t\t\t\t\t\t\t\tvar json_object = {\n\t\t\t\t\t\t\t\t\t\t\t\teventId: event_id,\n\t\t\t\t\t\t\t\t\t\t\t\temail: email,\n\t\t\t\t\t\t\t\t\t\t\t\tname: name,\n\t\t\t\t\t\t\t\t\t\t\t\tcontact: contact,\n\t\t\t\t\t\t\t\t\t\t\t\tlati: lati,\n\t\t\t\t\t\t\t\t\t\t\t\tlongi: longi,\n\t\t\t\t\t\t\t\t\t\t\t\ttime: time,\n\t\t\t\t\t\t\t\t\t\t\t\tamb_id: amb_id,\n\t\t\t\t\t\t\t\t\t\t\t\tbeingServed: beingServed\n\t\t\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\t\t\t\tcoll_users.insert(json_object);\n\n\t\t\t\t\t\t\t\t\t\t\tcoll_ambulances.update( { _id: best_ambulance_id },{ $set: {isServing: true, eventId: event_id} } );\n// Send Push Notification ########################################################################################################################################\n\n\t\t\t\t\t\t\t\t\t\t\tvar message_tuple = {\n\t\t\t\t\t\t\t\t\t\t\t\tname: name, contact:contact, lati:lati, longi:longi\n\t\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tvar request = require('request');\n\t\t\t\t\t\t\t\t\t\t\tvar send_data = {\n\t\t\t\t\t\t\t\t\t\t\t message : message_tuple, regId: best_ambulance_id\n\t\t\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\t\t\t\trequest({url:\"http://172.16.100.139/btp/send_message.php\", qs:send_data}, function(err, response, body) {\n\t\t\t\t\t\t\t\t\t\t\t if(err) { console.log(err); return; }\n\t\t\t\t\t\t\t\t\t\t\t console.log(\"Get response: \" + response.statusCode);\n\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t\tclose_all();\n\t\t\t\t\t\t\t\t\t\t}", "function addRenteeSQL(name, email, phone, address, object, firstrent, endrent, delivery, id_listing, price, daterequested) {\n client.connect();\n client.query('INSERT INTO rentees (name, email, phone, address, object, firstrent, endrent, delivery, id_listing, price, daterequested) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING id;', [name, email, phone, address, object, firstrent, endrent, delivery, id_listing, price, daterequested], (err) => {\n if (err) throw err;\n // console.log(res.rows);\n // client.end();\n });\n}", "function run_sql(sql,values = [], cb){\n pool.query(sql, values, (err, response) => {\n cb(response)\n })\n}", "async commitTransaction() {\n await this.executeSQL(sqlCommitTransaction,[]);\n }", "run(){\n let [q, ...args] = this._getQuery();\n return this.client._query(q, args, {emitter: this}).then(data => {\n this.emit('data', data);\n return data;\n });\n }", "async function submitPendingTransactions() {\n // See what transactions in the db are still pending\n var pendingTransactions = connection.query(\"SELECT * FROM stellartransactions WHERE state = ?\", [\"pending\"]);\n \n\n if (pendingTransactions.length > 0) {\n var tx = pendingTransactions.pop();\n await submitTransaction( tx.id, tx.destination, tx.xlm_amount, tx.memo);\n }\n\n // Wait 30 seconds and process next batch of transactions.\n setTimeout(\n function() {\n submitPendingTransactions();\n }, 0*1000);\n\n}", "bind() {\n\n // Init Database IndexDB\n this.db = new DB(this.id)\n this.db.init()\n const self = this\n\n this.dom.addEventListener('submit', function(e) { \n e.preventDefault()\n\n // Add loadings to form\n self.dom.classList.add(\"loading\")\n\n // Get the form data\n let data = {}\n let dataForm = new FormData(self.dom)\n let valid = true\n \n // Mount data to insert to DB\n for(let foo of dataForm.entries()) {\n if (typeof foo[1] !== 'object') {\n data[foo[0]] = foo[1]\n }\n }\n\n setTimeout(function() {\n\n const insert = self.db.insert(data)\n\n insert.then(function(result) {\n console.log(result)\n finishRequest(\n new Message(\"success\", \"Dados salvos com sucesso\")\n )\n }, function(result){\n console.log(result)\n finishRequest(\n new Message(\"error\", \"Erro ao salvar os dados\")\n )\n })\n\n function finishRequest(message) {\n\n // Cria <li> para exibir mensagem\n const formUl = document.querySelector(\"form ul\")\n const li = document.createElement(\"li\")\n formUl.appendChild(li)\n\n // Render message, reset form and get results\n message.render()\n li.appendChild(message.dom)\n self.db.getAll()\n self.reset()\n\n // Show results inserted\n console.log(self.db.data)\n }\n\n }, 500);\n })\n }", "_exec(queryString) {\n\t\tif (!this.connection) {\n\t\t\tthrow new Error('No Connection for the model.');\n\t\t}\n\n\t\tlet operation = {\n\t\t\tisAltered: (this.opType !== 'select') ? true : false,\n\t\t\ttype: this.opType,\n\t\t\tpk: this.primaryKey\n\t\t};\n\n\t\t//reset query object\n\t\tif (!this._query.iterative) {\n\t\t\tthis._query = {};\n\t\t}\n\n\t\tconst connectionType = this.connection.getConnectionType();\n\t\tconst db = dbInit(connectionType);\n\n\t\treturn db.exec(this.connection.getConnection(), queryString, operation);\n\t}", "async save() {\n const {\n query,\n values\n } = sqlForPartialUpdate(\n 'questions', {\n survey_id: this.survey_id,\n title: this.title,\n question_type: this.question_type\n },\n 'id',\n this.id\n );\n\n const result = await db.query(query, values);\n\n if (result.rows.length === 0) {\n const err = new Error(`Cannot find question to update`);\n err.status = 400;\n throw err;\n }\n }", "function dbquery(query) {\n return new Promise( (r, j) => connection.query(query, null , (err, data) => {\n\t\tif (err) {\n\t\t\tlog.error(query);\n\t\t\treturn j(err);\n\t\t}\n\t\tr(data);\n\t}))\n}", "function queryUsers(query) {\n con.connect(function(err) {\n console.log(\"Connected!\");\n\n con.query(query, function (err, result) {\n console.log(`Made query: ${query}`);\n for (var i in result) {\n console.log(result[i].msgid);\n sendMessage(sg24HourForecast, result[i].msgid, sgRainMessage);\n sendCovidMessage(result[i].msgid, covidMessage, undefined);\n }\n });\n });\n}", "function TQueries() {}", "function TQueries() {}", "function TQueries() {}", "function doQuery(answer) {\n con.query(answer, [], (err, res) => {\n if (err) {\n console.log(err.sqlMessage);\n } else {\n displayData(res);\n }\n\n process.stdout.write(\"> \");\n });\n}", "function TQueries(){}", "function updateDatabase() {\n var promises = [];\n getAllData();\n}", "async execute(command) {\r\n\t\tif(command.startsWith('run') || command.startsWith('get') || command.startsWith('all')) {\r\n\t\t\tcommand = command.substring(4);\r\n\t\t}\r\n\t\tif(command.toUpperCase().indexOf('SELECT') > -1) {\r\n\t\t\tconsole.log(await sql.all(command));\r\n\t\t} else {\r\n const result = await sql.run(command);\r\n\t\t\tconsole.log(`Query complete, ${result.changes} rows updated`);\r\n\t\t}\r\n\t}", "function addTable(posit) {\n var query = connection.query('insert into Position set ?', posit, function(err, result) {\n if (err) {\n console.error(err);\n return false;\n } else {\n console.log(query.sql)\n return true;\n }\n })\n}", "function query(q) {\n return new Promise(function (resolve, reject) {\n if (!validateQuery(q))\n return reject(new MysqlSyntaxError(\"Invalid query syntax\" + q));\n\n db.query(q, function(error, data, fields) {\n \n if (error) {\n return reject(error);\n }\n\n console.log('@query OK');\n return resolve(data);\n });\n });\n}", "executeAllQueries (deepSync) {\n console.log('IntegrationAgent.executeAllQueries:', this.integration._id);\n let self = this,\n queryDefinitions = self.serviceProvider.getQueryDefinitions();\n \n if (queryDefinitions) {\n _.keys(queryDefinitions).forEach((queryKey) => {\n if (self.integration.details && self.integration.details[ queryKey ] && self.integration.isEnabled === true) {\n self.executeQuery(queryKey, deepSync);\n }\n });\n }\n }", "function sqllog(userid, username, table, sqlqry, resultslength) {\n var sql = \"INSERT INTO SQLLog (USERID, USERNAME, SEARCHTABLE, SQLQRY, RESULTS) VALUES (?)\";\n var values = [ userid, username, table, sqlqry, resultslength, ];\n pool.query(sql, ([values]), function(err) {\n if (err) {\n log(chalk.bgYellow(`Error in \"SQLLOG\": ${err.code}`))\n }\n });\n}", "function updateDB(conn, q, cb) {\n\tconn.query(q, function(err) {\n\t\tcb(err);\n\t});\n}", "applyTransactions() {\n const newDb = Object.assign({}, this.db);\n for (let i = 0; i < this.transactions.length; i++) {\n let transaction = this.transactions[i];\n for (let j = 0; j < transaction.length; j++) {\n if (debug) {\n console.log('Executing command ', this.transactions[j]);\n }\n \n let [command, arg1, arg2] = transaction[j].split(' ');\n this.executeCommand(command, arg1, arg2, newDb);\n }\n }\n \n if (debug) {\n console.log('db after applying transactions: ', newDb);\n }\n \n return newDb;\n }", "function sendQuery(queryString){\n console.log('Sending query with:')\n console.log(gcpProjectId)\n console.log(datasetId)\n\n var request = gapi.client.bigquery.jobs.query({\n 'query': queryString,\n 'timeoutMs': 1000,\n 'datasetId': datasetId,\n 'projectId': gcpProjectId,\n 'useLegacySql':false\n });\n request.execute(response => checkJobStatus(response.jobReference.jobId));\n }", "static async all(queries) {\n\t\tconsole.debug('Class Company all - Start');\n\n\t\t// Throw error if query parameter min employees greater than or equal\n\t\t// to max_employees\n\t\tif (+queries.min_employees >= +queries.max_employees) {\n\t\t\tthrow new ExpressError(\n\t\t\t\t'Query parameters are invalid. Minimum number of employees must be less than maximum number of employees.',\n\t\t\t\t400\n\t\t\t);\n\t\t}\n\t\tlet queryIdx = 1;\n\t\tlet whereStatements = [];\n\t\tlet queryValues = [];\n\t\tlet baseQuery = `SELECT handle, name\n FROM companies`;\n\n\t\t// For each included query parameter, add appropriate language\n\t\t// to whereStatements and increment queryIdx by one.\n\t\tif (queries.search) {\n\t\t\twhereStatements.push(`to_tsvector(name) @@ to_tsquery($${queryIdx})`);\n\t\t\tqueryIdx += 1;\n\t\t\tqueryValues.push(queries.search);\n\t\t}\n\t\tif (queries.min_employees) {\n\t\t\twhereStatements.push(`num_employees >= $${queryIdx}`);\n\t\t\tqueryIdx += 1;\n\t\t\tqueryValues.push(queries.min_employees);\n\t\t}\n\t\tif (queries.max_employees) {\n\t\t\twhereStatements.push(`num_employees <= $${queryIdx}`);\n\t\t\tqueryIdx += 1;\n\t\t\tqueryValues.push(queries.max_employees);\n\t\t}\n\n\t\tlet finalQuery = '';\n\t\tif (whereStatements.length > 0) {\n\t\t\tfinalQuery = baseQuery.concat(' WHERE ', whereStatements.join(' AND '));\n\t\t}\n\n\t\tconst results = await db.query(finalQuery ? finalQuery : baseQuery, queryValues);\n\t\treturn results.rows;\n\t}" ]
[ "0.66073716", "0.6598347", "0.65592563", "0.63509196", "0.63233113", "0.63177323", "0.6280197", "0.62481683", "0.6143666", "0.6129651", "0.6128728", "0.6120145", "0.6045701", "0.5949512", "0.59222364", "0.58208126", "0.58044523", "0.5800562", "0.5779704", "0.57695174", "0.5768077", "0.5767452", "0.57155025", "0.57129437", "0.5705961", "0.5704852", "0.5704161", "0.570283", "0.56792736", "0.5674644", "0.5645379", "0.56279737", "0.5620985", "0.5605033", "0.560162", "0.5583778", "0.5581016", "0.55731034", "0.5572761", "0.55513704", "0.5543784", "0.55315024", "0.5502407", "0.55008227", "0.549298", "0.548948", "0.5484279", "0.54799867", "0.546602", "0.5445684", "0.54429895", "0.543766", "0.54303765", "0.5428065", "0.5417017", "0.54127115", "0.54117703", "0.54117703", "0.5411182", "0.54060304", "0.5405181", "0.5404383", "0.5399962", "0.5399445", "0.5385772", "0.53791046", "0.536403", "0.5358807", "0.5339044", "0.53239834", "0.5318233", "0.53166014", "0.53064877", "0.5301819", "0.5301778", "0.5299719", "0.5299626", "0.5299154", "0.5297161", "0.5292542", "0.52839774", "0.5282919", "0.5278949", "0.5278361", "0.5278197", "0.5270931", "0.5270931", "0.5270931", "0.5269044", "0.5268299", "0.5266159", "0.52659297", "0.52610475", "0.52587396", "0.5257176", "0.5246388", "0.5245639", "0.52400905", "0.5239919", "0.52387977" ]
0.6212807
8
USERS This function authenticates a user.
static authenticate(email, password) { return new Promise((resolve, reject) => { // if (!PRODUCTION) console.log('==> AUTHENTICATING: ' + email); Database.sendQuery('SELECT * FROM Users WHERE( email = $1);', [email]) .then((result) => { if (typeof result !== 'undefined' && result.command === 'SELECT') { if (result.rows.length > 0 && bcrypt.compareSync(password, result.rows[0].password)) { // if (!PRODUCTION) console.log('==> AUTHENTICATION: succesful'); delete result.rows[0].password; result.rows[0].apikey = Authentication.generateApiKey(); resolve(result.rows[0]); } else { // if (!PRODUCTION) console.log('==> AUTHENTICATION: failed'); resolve(false); } } else { // if (!PRODUCTION) console.log('==> AUTHENTICATION: error'); reject(result); } }) .catch((err) => reject(err)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function authenticateUser(users) {\n\t\tvar inputtedUsername = logInInput.value;\n\t\tvar inputtedPassword = passwordInput.value;\n\n\t\tvar user = users[inputtedUsername];\n\n\t\tif (!user) {\n\t\t\t//console.log('this user doesnt exist');\n\t\t\tlogInInput.style.border = \"2px solid red\";\n\t\t\treturn;\n\t\t} else if (user.password === inputtedPassword) {\n\t\t\t//console.log('log in successful');\n\t\t\tlocalStorage.setItem('currentTeam', user.team);\n\t\t\tlocalStorage.setItem('userType', user.userType);\n\t\t\twindow.location.href = './html/homepage.html';\n\t\t} else {\n\t\t\tlogInInput.style.border = \"2px solid red\";\n\t\t\tpasswordInput.style.border = \"2px solid red\";\n\t\t\t//console.log('user/pw authentication failed');\n\t\t}\n\t}", "function userLogin() {\n /**-----------------------------------------------------------------------*/\n /** Get the user's name and password as entered into the login form: */\n /**-----------------------------------------------------------------------*/\n var name = document.querySelector('[name=\"username\"]').value;\n var password = document.querySelector('[name=\"password\"]').value;\n\n /**-----------------------------------------------------------------------*/\n /** Check if the user is authorized to use the application: */\n /**-----------------------------------------------------------------------*/\n authenticateUser(name, password, userIsAuthorised);\n}", "function authenticate_user(res, mysql, context, us, pw, complete){\n\tvar sql = 'SELECT user_id, email, member_since FROM users WHERE email=? AND password=?'\n\tvar inserts = [us, pw];\n\tmysql.pool.query(sql, inserts, function(err, results, fields){\n\t\t\tif(err){\n\t\t\t\tres.write(JSON.stringify(err));\n\t\t\t\tres.end();\n\t\t\t}\n\t\t\tcontext.user = results[0];\n\t\t\tif(typeof context.user === \"undefined\")\n\t\t\t{\n\t\t\t\tcontext.error = 1;\n\t\t\t}\n\t\t\tcomplete();\n\t\t});\n\t}", "function auth (req,res) {\n var username = req.body.username;\n var password = req.body.password;\n\n var user = users.login(username, password);\n if (user != false) { \n console.log(\"Login good for: \" + username + \" -> \" + password);\n\n res.send({\n token: user.token,\n realname: user.realname,\n color: user.color\n }); \n } else {\n console.log(\"Invalid username or password: \" + username + \" -> \" + password);\n res.send(403);\n }\n}", "function authenticate(){\n if( !authenticating ) {\n authenticating = true;\n show(loadingLayer);\n hide(loginLayer);\n currUser = document.forms[\"loginForm\"][\"username\"].value;\n currPassw = document.forms[\"loginForm\"][\"password\"].value;\n let userData = JSON.stringify({username : currUser, password : currPassw});\n\n apiPost(\"/user/\"+currUser+\"/authenticate\", evaluateResponse, userData);\n }\n}", "function authenticateUser(){\n var txlist = {\n\t\tresults: []\n\t};\n var username = $.request.parameters.get(\"username\");\n var password = $.request.parameters.get(\"password\");\n var connection = $.db.getConnection();\n var statement = null;\n var resultSet = null;\n var validateQuery = 'SELECT * FROM \\\"EventsSpyUI.DbViews::AT_ENTIRE_USER_DATA\\\" AS \\\"USER_DATA\\\" WHERE \\\"USER_DATA\\\".\\\"USERNAME\\\"=? AND \\\"USER_DATA\\\".\\\"PASSWORD\\\"=?;';\n try {\n\t\tstatement = connection.prepareStatement(validateQuery);\n\t\tstatement.setString(1, username);\n\t\tstatement.setString(2, password);\n\t\tresultSet = statement.executeQuery();\n\t\tconnection.commit();\n\t\tvar logonStatus = resultSet.next();\n\t\tif(logonStatus){\n \tdo{\n \t\t var record = {};\n \t\t record.UserId = resultSet.getString(1);\n \t\t record.UserName = resultSet.getString(2);\n \t\t record.Password = resultSet.getString(3);\n \t\t record.LOBId = resultSet.getString(4);\n \t\t record.LOB = resultSet.getString(5);\n \t\t txlist.results.push(record);\n \t }while(resultSet.next())\n \t}\n }\n\tfinally {\n\t\tstatement.close();\n\t\tconnection.close();\n\t}\n\treturn JSON.stringify(txlist);\n}", "function loginUser(values) {\r\n\t\tconst { username, password } = values;\r\n\t\tfetch(`${process.env.REACT_APP_API_URL}/api/v1/auth/login`, {\r\n\t\t\tmethod: 'POST',\r\n\t\t\theaders: {\r\n\t\t\t\tAuthorization: `Basic ${btoa(`${username}:${password}`)}`\r\n\t\t\t}\r\n\t\t})\r\n\t\t\t.then((res) => res.json())\r\n\t\t\t.then((user) => {\r\n\t\t\t\tlogin(user);\r\n\t\t\t\tsetRedirect(true);\r\n\t\t\t})\r\n\t\t\t.catch((err) => {\r\n\t\t\t\tconsole.error(err);\r\n\t\t\t\tmessage.error('Incorrect username or password. Try again.', 5);\r\n\t\t\t});\r\n\t}", "static async authUser({ username, password }) {\n try {\n const res = await this.request(`login`, { username, password }, 'post');\n return res;\n } catch (err) {\n return { errors: err };\n }\n }", "function authenticateUser(username, userData) {\n // Validated\n notification(`Authentication`, `You've successfully logged in as ${username}`, \"success\");\n // Set auth token\n localStorage.setItem(\"username\", username);\n document.querySelector('input[name=\"username\"]').setAttribute(\"value\", username);\n localStorage.setItem(\"authenticated\", true);\n // Populate interface\n populateInterface(username, userData);\n }", "function authenticateUser(username, userpassword, hashed)\n{\n\treturn true;\n}", "function logInUser(req, res, next){\n\n db.collection(\"Users\").find({username:req.body.username,password:req.body.password}).toArray(function(err,result){\n if(err){\n res.status(500).send(\"Error Reading Database\");\n return;\n }\n if(model.authenticateUser(req.body.username, req.body.password)){\n //they have logged in successfully\n req.session.user = model.users[req.body.username];\n req.session.loggedin = true;\n req.session.hasMovies = false;\n req.session.hasReview = false;\n req.session.hasSubscribe = false;\n req.session.hasSubOthers = false;\n res.status(200).redirect(\"/users/\" + req.body.username);\n }else if(result.length<1||result==undefined){\n //they did not log in successfully.\n res.status(401).send(\"You enter the wrong username or password. Please Try agian\");\n }\n next();\n });\n}", "function authenticateUser(event) {\n const body = {\n name: event.target.username.value\n }\n fetch(\"http://localhost:3000/api/v1/users/\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\"\n },\n body: JSON.stringify(body),\n }).then(r => r.json())\n .then(user => loggedInUser = user.id)\n .then(event.target.reset())\n .then(() => showHideCategories())\n}", "async function authenticateUser(){\n\temail = getUserEmail();\n\tpassword = getUserPassword();\n\tconst url = `http://localhost:3000/?user=${email}password=${password}`;\n\tconst response = await fetch(url);\n\tconst data = await response.json();\n\tif(data){\n\t\tnoteMenuView();\n\t}\n\telse{\n\t\terrorMessage();\n\t}\t\t\n\t\t\n}", "function checkUser(users){\n\t\tconsole.log(\"Checking valid user?\");\n\t\tif(users[0] && users[0].username == sess.username && users[0].password == sess.pswd) {res.send('EverythingOK')}\n\t\telse {\n\t\t\tres.send('You are a failure');\n\t\t\treq.session.destroy(function(err){\n\t\t\t\tif(err){\n\t\t\t\t\tconsole.log(err);\n\t\t\t\t}\n\t\t\t});\n\n\t\t}\n\t}", "function authenticate(){\n // to handle authentication request\n fetch('http://localhost:3800/users/auth', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n \n },\n body: JSON.stringify({\n email: emailNode.value,\n password: passwordNode.value,\n })\n })\n .then(data => {\n return data.json();\n })\n .then(json => {\n if (json.status === 'success') {\n // to set token for authenticted user \n localStorage.setItem('Token', json.accessToken);\n \n // to get current type of user to navigate them on corresponding page\n getUserType();\n } else {\n alert('user not found');\n emailNode.focus();\n }\n })\n .catch(error => {\n console.log(error);\n }); \n }", "function isAuthenticated({username, password}){\r\n console.log(userdb.users);\r\n return userdb.users.findIndex(user => user.username === username && user.password === password) !== -1\r\n \r\n }", "function LoginCredentials(req, res, next){\n\n \tdb.any(\"SELECT * FROM usuarios WHERE codigo = $1 AND contrasena = $2\", [req.body.username, req.body.password])\n \t.then(function(data){\n \t\tif (Object.keys(data).length > 0) {\n \t\t\tres.send({'success': true, 'message': data[0].codigo});\n\t \t}else{\n\t \t\tres.send({'success': false, 'message': 'User not found, please try again'});\n\t \t}\n \t})\n \t.catch(function(err){\n\t\treturn next(err);\n\t})\n}", "loginUser(username, email, password, clientHash, callback) { // TODO: Use cfg object instead of params\n\t\tvar connection = this._connection;\n\n\t\tvar columnName = \"Username\";\n\t\tif(email) columnName = \"Email\";\n\n\t\t// Create SQL statement\n\t\tvar checkValue = username ? username : email;\n\t\tvar condition = `${columnName}=${checkValue}`;\n\t\tvar _sql = `SELECT ID,Password FROM users WHERE ${condition}`;\n\n\t\t// Run SQL statement\n\t\tconnection.query(_sql, function(err, result, fields) {\n\t\t\tif(err) throw err;\n\n\t\t\tvar authError = `Wrong ${columnName} or password`; // No special error to avoid abuse\n\n\t\t\t// User not found\n\t\t\tif(!result || !result.length) return callback(authError);\n\n\t\t\t// Compare passwords\n\t\t\tsecurity.comparePassword(password, clientHash ? username : null, result[0].Password, function(success) {\n\t\t\t\tif(success) {\n\t\t\t\t\tvar token = security.createToken(result[0].ID);\n\t\t\t\t\treturn callback(null, { token: token });\n\t\t\t\t}\n\t\t\t\t// Passwords don't match\n\t\t\t\tcallback(authError);\n\t\t\t});\n\t\t});\n\t}", "function loginUser(req, res, next) {\n\tvar username = req.params.username;\n\tvar password = req.params.password;\n if (username && password) {\n db.connect(function(err, client, done) {\n\t\t\tif (err) { next(err); return; }\n db.query(client, 'SELECT * FROM user_ WHERE username = $1 AND password = $2', [username, password], done, function(err, result) {\n\t\t\t\tif (err) { next(err); return; }\n if (result.rows.length == 1) {\n req.params.id = result.rows[0].id;\n getUser(req, res); // return authenticated user\n } else {\n return db.jsonResponse(res, 404, null);\n }\n });\n });\n } else {\n return db.jsonResponse(res, 400, null);\n }\n}", "function checkLoggedInUserAuth(user) {\n var userN;\n var passW;\n // create request \n if (userRelogProfileReq.readyState == 4) {\n\n var dbData = JSON.parse(showErrorMain(userRelogProfileReq.responseText, \"Error Found\"));\n\n\n if (Object.entries(dbData['queryresult']).length != 0) {\n\n\n var userDetails = dbData['queryresult'];\n\n for (i = 0; i < userDetails.length; i++) {\n if ((userDetails[i]['userlogin'] == user['userlogin']) && (userDetails[i]['userkey'] == user['userkey'])) {\n userN = userDetails[i]['userlogin'];\n passW = userDetails[i]['userpassword'];\n }\n }\n\n\n // var query = \"SELECT * FROM InovoMonitor.tblUsers where InovoMonitor.tblUsers.userpassword = '\" + passW + \"' AND InovoMonitor.tblUsers.username = '\" + userN + \"';\"\n // var query = \"SELECT * FROM InovoMonitor.tblUsers\"; // where InovoMonitor.tblUsers.userpassword = '\" + passW + \"' AND InovoMonitor.tblUsers.username = '\" + userN + \"';\"\n\n userProfilereq.open(\"POST\", serverURL + \"/UserAuth?\", true);\n // userProfilereq.open(\"POST\", serverURLDEV + \"/UserAuth?\", true);\n // userProfilereq.open(\"POST\", \"/UserAuth?\", true);\n userProfilereq.onreadystatechange = returnProfile;\n userProfilereq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n userProfilereq.send(\"action=authenticate&username=\" + userN + \"&password=\" + passW)\n }\n }\n //http://102.164.81.12:7080/InovoCentralMonitorClient/UserAuth?action=authenticate&username=esiwela&password=esiwela\n\n}", "function authenticate(name, pass, fn) {\n if (!module.parent) console.log('authenticating %s:%s', name, pass);\n var User = {};\n db.model(\"users\").find({name: name}, function (err, data) {\n if (err) console.log(err);\n user = data[0];\n // query the db for the given username\n if (!user) return fn(new Error('cannot find user'));\n // apply the same algorithm to the POSTed password, applying\n // the hash against the pass / salt, if there is a match we\n // found the user\n \n hash(pass, user.salt, function(err, hash){\n console.log(user.salt);\n if (err) return fn(err);\n if (hash == user.hash) return fn(null, user);\n fn(new Error('invalid password'));\n });\n }); \n\n}", "function checkUser(req, res, next){\r\n\tvar verify = req.body\r\n\t//console.log(verify.name)\r\n\t//console.log(verify.pass)\r\n\t\tif(verify.emailAddress && verify.password){\r\n\r\n\t\t\t\t\t\t// call static metod from User Model \r\n\t\t\t\t\t\tUsers.authenticate(verify.emailAddress, verify.password, function(error, user){\r\n\r\n\t\t\t\t\t\t\t// validate if there is no user \r\n\t\t\t\t\t\t\tconsole.log(user);\r\n\t\t\t\t\t\t\tif(error){\r\n\t\t\t\t\t\t\t\t// set error code \r\n\t\t\t\t\t\t\t\tvar err = new Error('There was an error on authenticate')\r\n\t\t\t\t\t\t\t\terr.status = 401;\r\n\t\t\t\t\t\t\t\tnext(err)\r\n\t\t\t\t\t\t\t}else if( !user){\r\n\t\t\t\t\t\t\t\t// Set error code if there is no user \r\n\t\t\t\t\t\t\t\tvar err2 = new Error('No User found or incorrect password');\r\n\t\t\t\t\t\t\t\terr2.status = 401;\r\n\t\t\t\t\t\t\t\tnext(err2)\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t// make user is avaialble for each middlewware\r\n\t\t\t\t\t\t\t\treq.session.UserId =user._id // If the authenticate method returns the user, then set the user document on the request so that each following middleware function has access to it.\r\n\t\t\t\t\t\t\t\tconsole.log(req.session)\r\n\t\t\t\t\t\t\t\tres.redirect('/allChurches')\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})\r\n\t\t\t}\t\r\n\t\telse{\r\n\t\t\t// Find the user with the email addres s\r\n\t\t\tvar err = new Error('You must have a username and / or password to continue');\r\n\t\t\terr.status = 400;\r\n\t\t\tnext(err);\r\n\t\t}\r\n}", "function login(){\n dispatch(findUser(document.getElementById('email').value,document.getElementById('password').value));\n }", "static authenticateUserTemp(username, password) {\n if ((username === \"Menuka\" || username === \"Renuka\") && password === \"admin\") {\n let user = new User(username);\n user.type = (username === \"Menuka\") ? User.CONST.ADMIN : User.CONST.CLIENT;\n AuthManager.setUser(user);\n\n console.log(`Authentication Success: User - ${user.name}`);\n }\n console.error('Authentication Error:');\n }", "function authenticate(name, pass, fn) { \n user.loadUser(name,function(err,user) { \n if (!user) return fn(new Error('cannot find user'));\n // apply the same algorithm to the POSTed password, applying\n // the md5 against the pass / salt, if there is a match we\n // found the user\n console.log(user);\n if (user.pass == md5(pass + user.salt)) return fn(null, user);\n fn(new Error('invalid password'));\n }); \n}", "LogIn(req, res, next) {\n // EXTRACT FORM DATA\n const { username, password } = req.body;\n\n // FIND USER BY USERNAME\n User.findByUserName(username).then(user => {\n // IF A USER ISN'T FOUND\n if (!user) {\n return res.status(401).json({ success: false, message: 'User not found' });\n }\n // IF A USER IS FOUND, CONTINUE AND COMPARE PASSWORD WITH HASH\n User.comparePassword(password, user.password, (err, isMatch) => {\n if (err) throw err;\n // IF PASSWORDS MATCH\n if (isMatch) {\n // CREATE A TOKEN\n const token = jwt.sign({ id: user.id, username: user.username }, process.env.SECRET_KEY, {\n expiresIn: 604800 // 1 WEEK\n });\n // SEND JSON OBJECT ALONG WITH TOKEN\n res.status(200).json({\n success: true,\n token: 'JWT ' + token,\n user: {\n id: user.id,\n username: user.username,\n email: user.email\n }\n });\n } else {\n return res.status(401).json({ success: false, message: 'Wrong password' });\n }\n });\n });\n }", "function authenticateUser(userId, password, successCallback, errorCallback) {\n\n // Request payload for the web service call.\n var serviceInput = {\n \"_namespaces\" : {\n \"aut\" : \"http://Authenticationservice/\"\n },\n \"_header\" : {},\n \"_body\" : {\n \"aut:getObSSOCookieElement\" : {\n \"aut:userId\" : {\n \"_value\" : userId\n },\n \"aut:Pwd\" : {\n \"_value\" : password\n },\n \"aut:URL\" : {\n \"_value\" : \"dr-qaiwebsvc-vip.vmware.com/vmdrws/rum/login\"\n }\n }\n }\n };\n\n // Authentication service parameters\n var serviceParams = {\n host : SERVICE_HOST,\n port : SERVICE_PORT,\n secure : SERVICE_SECURE,\n uri : SERVICE_URI,\n action : \"http://Authenticationservice//getObSSOCookie\",\n soapVersion : soapClient.SOAPv12\n };\n\n // Invoke Authentication Web Service\n soapClient.soapRequest(serviceInput, serviceParams, function(wsRespJson) {\n log.info(\"Login Web Service Response: \" + JSON.stringify(wsRespJson));\n successCallback(wsRespJson);\n }, function(errObj) {\n errorCallback(errObj);\n });\n\n }", "function loginUser() \n{\n gapi.auth.authorize(\n {\n 'client_id': CLIENT_ID,\n 'scope': SCOPES.join(' '),\n 'inmediate': true\n },\n function(authResult) \n {\n if (authResult) {\n console.log(\"Autenticacion exitosa\");\n }\n else {\n console.log(\"Error al autenticar\");\n }\n }\n );\n}", "function validateUser(req, res, next) {\r\n\r\n\tvar parts, auth, scheme, credentials;\r\n\tvar view, options;\r\n\r\n\t// handle auth stuff\r\n\tauth = req.headers[\"authorization\"];\r\n\tif (!auth) {\r\n\t\treturn authRequired(res, 'Microblog');\r\n\t}\r\n\r\n\tparts = auth.split(' ');\r\n\tscheme = parts[0];\r\n\tcredentials = new Buffer(parts[1], 'base64').toString().split(':');\r\n\r\n\tif ('Basic' != scheme) {\r\n\t\treturn badRequest(res);\r\n\t}\r\n\treq.credentials = credentials;\r\n\r\n\t// ok, let's look this user up\r\n\tview = '/_design/microblog/_view/users_by_id';\r\n\r\n\toptions = {};\r\n\toptions.descending = 'true';\r\n\toptions.key = String.fromCharCode(34) + req.credentials[0] + String.fromCharCode(34);\r\n\r\n\tdb.view('microblog/users_by_id', function(err, doc) {\r\n\t\ttry {\r\n\t\t\tif (doc[0].value.password === req.credentials[1]) {\r\n\t\t\t\tnext(req, res);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthrow new Error('Invalid User');\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (ex) {\r\n\t\t\treturn authRequired(res, 'Microblog');\r\n\t\t}\r\n\t});\r\n}", "function auth(user){\r\n\tif(getUserObjectByIDObject(user).password === user.password){\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "static async authenticate(username, password) { \n const response = await db.query(\n `SELECT username,password FROM users WHERE username=$1`,[username]\n );\n const currentUser = response.rows[0];\n if(!currentUser) throw new ExpressError(\"Username not found\",404);\n \n const auth = await bcrypt.compare(password,currentUser.password)\n if(auth){\n return true;\n }else{\n return false;\n }\n }", "function validateUser(req, res, next) {\n\tvar parts, auth, scheme, credentials;\n\tvar view, options;\n\t// handle auth stuff\n\tauth = req.headers[\"authorization\"];\n\tif (!auth) {\n\t\treturn authRequired(res, 'Microblog');\n\t}\n\tparts = auth.split(' ');\n\tscheme = parts[0];\n\tcredentials = new Buffer(parts[1], 'base64').toString().split(':');\n\tif ('Basic' != scheme) {\n\t\treturn badRequest(res);\n\t}\n\treq.credentials = credentials;\n\t// ok, let's look this user up\n\tview = '/_design/microblog/_view/users_by_id';\n\toptions = {};\n\toptions.descending = 'true';\n\toptions.key = String.fromCharCode(34) + req.credentials[0] + String.fromCharCode(34);\n\tdb.view('microblog/users_by_id', function(err, doc) {\n\t\ttry {\n\t\t\tif (doc[0].value.password === req.credentials[1]) {\n\t\t\t\tnext(req, res);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new Error('Invalid User');\n\t\t\t}\n\t\t}\n\t\tcatch (ex) {\n\t\t\treturn authRequired(res, 'Microblog');\n\t\t}\n\t});\n}", "static confirmBasicAuthUser(urls) {\n return async function(ctx, next) {\n // only apply this test to specified url(s) (others pass through to subsequent checks)\n if (typeof urls == 'string' && urls != ctx.request.url) { await next(); return; }\n if (urls instanceof Array && urls.includes(ctx.request.url)) { await next(); return; }\n // TODO: regular expressions?\n\n // basic auth headers provided?\n const credentials = basicAuth(ctx.request);\n if (!credentials) ctx.throw(401); // Unauthorized\n\n // authenticates off email + cleartext password - this is slow as it requires scrypt hashing\n const user = await Validate.userByEmail(credentials.name, credentials.pass);\n if (!user) ctx.throw(401); // Unauthorized\n\n // ok - record authenticated user in ctx.state.auth.user\n ctx.state.auth = { user: user };\n\n // and continue on\n await next();\n };\n }", "static async ensureAuthenticated(req, res, next) {\n // Check the user based on API.\n const apiKey = req.get(\"user-api\") || req.body[0]?.user_api;\n const userId = req.get(\"user-id\") || req.body[0]?.user_id;\n if (apiKey && userId) {\n let sqlQuery = \"SELECT * FROM user WHERE id = ?\";\n const ourUser = await db.query(sqlQuery, userId);\n if (ourUser.length > 0) {\n let uncDb = await Utils.decrypt(ourUser[0].api_key);\n if (uncDb == apiKey) {\n let curUser = {\n steam_id: ourUser[0].steam_id,\n name: ourUser[0].name,\n super_admin: ourUser[0].super_admin,\n admin: ourUser[0].admin,\n id: ourUser[0].id,\n small_image: ourUser[0].small_image,\n medium_image: ourUser[0].medium_image,\n large_image: ourUser[0].large_image,\n };\n req.user = curUser;\n return next();\n }\n }\n }\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect(\"auth/steam\");\n }", "function loginUserCallback() {\n loginUser();\n }", "function authenticate(name, pass, fn) {\n if (!module.parent) console.log('authenticating %s:%s', name, pass);\n var user = users[name];\n // query the db for the given username\n if (!user) return fn(new Error('cannot find user'));\n // apply the same algorithm to the POSTed password, applying\n // the hash against the pass / salt, if there is a match we\n // found the user\n hash({ password: pass, salt: user.salt }, function (err, pass, salt, hash) {\n if (err) return fn(err);\n if (hash === user.hash) return fn(null, user)\n fn(new Error('invalid password'));\n });\n}", "function authenticateUser() {\n let jwt = localStorage.getItem('jwt');\n if (jwt) {\n LoginActions.loginUser(jwt);\n }\n}", "function req_read_user_auth(env) {\n var data = http.req_body(env).user;\n set_user_email(env, data.user_email);\n set_user_password(env, data.user_password);\n}", "function login(req, res) {\n\t// Local DB\n\tvar db = req.db;\n\t\n\tvar userName = req.body.username;\n\tvar userPass = req.body.userpass;\n\t\n\t// Check the user exists\n\tdb.hexists(\"users\", userName, function(err, reply) {\n\t\tif (reply) {\n\t\t\t// Username exists, get UID\n\t\t\tconsole.log(\"Checked username '\" + userName + \"' exists, reply = \"+reply);\n\t\t\tdb.hget(\"users\", userName, function(err, reply) {\n\t\t\t\t// Got UID, get password\n\t\t\t\tconsole.log(\"Got UID, reply = \"+reply);\n\t\t\t\tvar UID = reply;\n\t\t\t\tdb.hget(\"user:\"+UID, \"password\", function(err, reply) {\n\t\t\t\t\t// Got password, compare\n\t\t\t\t\tconsole.log(\"Got password, reply = \"+reply);\n\t\t\t\t\tif (userPass == reply) {\n\t\t\t\t\t\t// Successful login\n\t\t\t\t\t\tconsole.log(\"Password matches, logging in as \"+userName);\n\n\t\t\t\t\t\t// Set up session\n\t\t\t\t\treq.session.uid = UID;\n\t\t\t\t\treq.session.username = userName;\n\t\t\t\t\t\n\t\t\t\t\t// Redirect to home\n\t\t\t\t\tres.redirect('/home/');\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log(\"Password incorrect, refreshing login\");\n\t\t\t\t\t\tres.render('index', {failLogin: \"Password is incorrect.\"});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t} else {\n\t\t\tres.render('index', {failLogin: \"No account exists for this username.\"});\n\t\t}\n\t});\n}", "function signIn(req , res){\n\tif (!req.session.isAutenticated)\n\treq.session.isAutenticated = false;\n\tif (!req.body.userName || !req.body.userPass){\n\t\treturn res.status(400).send({request:\"signIn\" , status:-1, err:new Error(\"Malformed query\")});\n\t}\n\tif (!credentials.users[req.body.userName]){\n\t\treturn res.status(401).send({request:\"signIn\" , status:-1, err:new Error(\"Incorrect user or password\")});\n\t}else{\n\t\tif (credentials.users[req.body.userName].password == req.body.userPass){\n\t\t\treq.session.isAutenticated = true;\n\t\t\treq.session.userName = req.body.userName;\n\t\t\treq.session.mail = credentials.users[req.body.userName].mail;\n\t\t\treturn res.send({request:\"signIn\" , status:1});\n\t\t}else\n\t\t\treturn res.status(401).send({request:\"signIn\" , status:-1, err:new Error(\"Incorrect user or password\")});\n\t}\n}", "function authenticateUser(UserID_resp) {\n setIsModalOpen(false);\n Authenticator.isAuthenticated = true;\n Authenticator.authenticatedAs = UserID_resp;\n console.log(props)\n props.history.push('/protected');\n }", "function authUser(userName, password, callback) {\n return __awaiter(this, void 0, void 0, function* () {\n const method = `authUser(${userName}, [password-masked])`;\n log.debug(__filename, method, `Authenticating credentials...`);\n const userCreds = security.getUserCreds(userName);\n if (userCreds !== null) {\n if (userCreds.pwHash !== object_hash_1.MD5(password)) {\n log.debug(__filename, method, 'Authentication Failed: Invalid password: ' + userCreds.userName);\n security.evictCredentials(userCreds);\n callback(null, false);\n return;\n }\n else {\n log.debug(__filename, method, `User credentials cached. User role is: ${Enums_1.USER_ROLES[userCreds.role]}`);\n callback(null, true);\n return;\n }\n }\n // special case: case-insensitive userName query\n const userDoc = yield dbMan.getDocument(config.MONGO_COL_USERS, { userName: new RegExp('^' + userName + '$', 'i') });\n if (userDoc) {\n if (userDoc.pwHash === object_hash_1.MD5(password)) {\n log.debug(__filename, method, `Authentication Succeeeded: ${userDoc.userName} has role ${Enums_1.USER_ROLES[userDoc.role]}`);\n // update the user's last login time\n userDoc.lastLogin = Date.now();\n dbMan.updateDocument(config.MONGO_COL_USERS, { userName }, userDoc);\n // stash the user record in the the authed user cache\n security.cacheAuthedUser(userDoc);\n // return success to auth middleware\n callback(null, true);\n }\n else {\n // return failure to auth middleware\n log.debug(__filename, method, 'Authentication Failed: Invalid password: ' + userDoc.userName);\n callback(null, false);\n }\n }\n else {\n // return failure to auth middleware\n log.debug(__filename, method, 'Authentication Failed: User not found');\n callback(null, false);\n }\n });\n}", "authUser (state, userData) {\n \t\tstate.idToken = userData.token\n \t\tstate.userId = userData.userId\n \t}", "function authenticateUser() {\n return fetch('/authenticateuser', {\n method: 'GET',\n credentials: \"same-origin\"\n });\n}", "function isAuthenticated({ usuario, senha }) {\r\n return userdb.users.findIndex(user => user.usuario === usuario && user.senha === senha) !== -1\r\n }", "signin(req, res) {\n // first, find user by the email/username in the request body.\n const loginData = req.body.email ? {email: req.body.email} : {username: req.body.username};\n // When retrieving the user from database, include the password for authentication:\n User.findOne(loginData, '+password', (err, user) => {\n // Error check\n if(err) return res.status(500).send(err);\n // Not being able to find a user is not an error, handles null\n if(user === null) {\n response = {success: false, message: 'Could not find registered user with the email/username'};\n return res.status(500).send(response);\n }\n // if there's no user found, or they put a wrong password:\n if(!user || (user && !user.validPassword(req.body.password))) {\n response = {success: false, message: 'Incorrect email/username or password.'};\n return res.status(500).send(response);\n }\n\n const userData = user.toObject();\n // remove the password from this object before creating the token:\n delete userData.password\n\n userData['iat'] = new Date().getTime() / 1000;\n userData['exp'] = (new Date().getTime() + 10000000) / 1000; // 1000 = 1 second\n\n const token = jwt.sign(userData, process.env.SECRET_TOKEN);\n // send the token back to the client in our response:\n response = {success: true, message: 'Logged in successfully.', token};\n return res.status(200).json(response);\n });\n }", "function login() {\n User.login(self.user, handleLogin);\n }", "function checkUser(users){\n\t\tif(users[0]){\n\t\t\tconsole.log('tried to register an existing user');\n\t\t\tres.send('you tried a bad user, you are a failure');\n\t\t}\n\t\telse database.insertUser(sess.username, sess.pswd, function (response){\n\t\t\tif(response.result.ok)res.send('everythingOK');\n\t\t\telse console.log('error adding new user');\n\t\t});\n\t}", "function loginUser(ev) {\n\t\tev.preventDefault();\n\t\tlet loginForm = $('#loginForm');\n\t\tlet usernameInput = loginForm.find('input[name=\"username\"]');\n\t\tlet passInput = loginForm.find('input[name=\"password\"]');\n\n\t\tlet usernameVal = usernameInput.val();\n\t\tlet passVal = passInput.val();\n\n\t\tlet allIsValid = validateRegisterFields(usernameVal, passVal, passVal);\n\t\tif (allIsValid) {\n\t\t\tauth.login(usernameVal, passVal)\n\t\t\t\t.then((userInfo) => {\n\t\t\t\t\tusernameInput.val('');\n\t\t\t\t\tpassInput.val('');\n\t\t\t\t\tsaveSession(userInfo);\n\t\t\t\t\tshowInfo('User login successful.');\n\t\t\t\t}).catch(handleError);\n\t\t}\n\t}", "function authenticate(user) {\n\t\n\tif(!user)\n\t\tthrow new Error('Access is denied due to invalid credentials!');\n\n}", "function authenticate(req, res) {\n var foundUser = retrieveUser(db, req.body.email);\n\n if(!foundUser) return false;\n console.log('user found');\n \n if(!sha3_512(req.body.password) === foundUser.password) return false;\n else {\n cookies = new Cookies(req, res);\n session = createSession({_id: foundUser._id, email: foundUser.email, phash: foundUser.phash}, true);\n console.log(\"Session ATM: \" + JSON.stringify(session));\n cookies.set('session', JSON.stringify(session));\n return true\n };\n}", "function authenticateUser(req, res) {\n userService.authenticate(req.body.username, req.body.password)\n .then(function (token) {\n if (token) {\n res.send({ token: token });\n } else {\n\n res.status(401).send('Username or password is incorrect');\n }\n })\n .catch(function (err) {\n res.status(400).send(err);\n });\n}", "function u_login(ctx, email, password, uh, permanent) {\n ctx.result = u_login2;\n ctx.permanent = permanent;\n api_getsid(ctx, email, prepare_key_pw(password), uh);\n}", "function authUser() {\n FB.login(checkLoginStatus, {scope:'read_stream'});\n }", "function authenticateUser(username, password, callback){\n\n User.findOne({username: username}, function(err, user){\n if (err) {\n \tconsole.log('err finding user');\n }\n else {\n \tconsole.log('found user', user);\n \tcallback(err, user);\n }\n });\n}", "function authenticate(u,p) {\n var e = htpass.filter( (e) => { return e.uname == u; } )[0];\n if (!e) { console.log(`User '${u}' not found`); return 0; }\n console.log(\"Got user: \", e);\n if ( md5(p, e.hash) == e.hash ) { return 1; }\n return 0;\n}", "function authenticate(req, res, next) {\n req.session.count = req.session.count || 0;\n req.session.count++;\n var user = req.session.user = req.body.user || \"\";\n var password = req.body.password || \"\";\n\tdebugger;\n if (req.session.count > 3) {\n res.redirect('/toomany');\n } else if (!fakeDB.exists(user, password)) {\n req.flash('error', 'Invalid User/Password. You have ' + (3 - (req.session.count - 1)) + ' tries left');\n res.redirect('/');\n } else {\n\t\t //set user & reset error and count\n req.session.user = user;\n req.flash('error', '');\n next();\n }\n}", "function isAuthenticated({username, password}){\n return userdb.users.findIndex(user => user.username === username && user.password === password) !== -1\n}", "function loginUser(req, res){\n\tvar params = req.body; //con bodyparser esos parametros q nos llegan por post son transformados en un objeto JSON.\n\n\tvar email = params.email;\n\tvar password = params.password;\n\n\t//usamos el ORM q es Mongoose para hace una consulta\n\tUser.findOne({email: email.toLowerCase()}, (err, user) => {\n\t\tif(err){\n\t\t\tres.status(500).send({message: 'Error en la peticion'});\n\t\t}else{\n\t\t\tif(!user){\n\t\t\t\tres.status(404).send({message: 'El usuario no existe'});\n\t\t\t}else{\n\t\t\t\t// Comprobar contraseña\n\t\t\t\tbcrypt.compare(password, user.password, function(err, check){\n\t\t\t\t\tif(check){\n\t\t\t\t\t\t// Si el check es correcto, aqui me tienes q devolver los datos del usuario logueado\n\t\t\t\t\t\tif(params.gethash){\n\t\t\t\t\t\t\t//devolver un token de jwt\n\t\t\t\t\t\t\tres.status(200).send({\n\t\t\t\t\t\t\t\ttoken: jwt.createToken(user)\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//si el hash nos viene vacio\n\t\t\t\t\t\t\tres.status(200).send({user});\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//devuelveme un 404 diciendome q la contraseña es incorrecta o q el usuario no ha podido loguearse.\n\t\t\t\t\t\tres.status(404).send({message: 'El usuario no ha podido loguearse'});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\n}", "async login(creds) {\n\t\ttry {\n\t\t\tconst { username, password } = creds;\n\t\t\tconst user = await userUtils.getUser(username);\n\n\t\t\tif (user) {\n\t\t\t\tconst result = {\n\t\t\t\t\tauthenticated: false\n\t\t\t\t};\n\t\t\t\tif (await userUtils.checkPassword(username, password)) {\n\t\t\t\t\tconst token = jwtUtils.generateToken(user._id);\n\t\t\t\t\tresult.authenticated = true;\n\t\t\t\t\tresult.user = user;\n\t\t\t\t\tresult.token = token;\n\t\t\t\t\treturn result;\n\t\t\t\t} else {\n\t\t\t\t\t//incorrect password\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//user not found\n\t\t\t\treturn null;\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthrow error;\n\t\t}\n\t}", "function doLogin(userName, password){\n\n}", "function login(req, res, next) {\n // Look up the information fields the user is gonna fill in and store them in variables.\n var username = req.body.username;\n var password = req.body.password;\n\n // Connect to the database and check if the username exists then start the done callback\n connection.query('SELECT * FROM users WHERE username = ?', username, done);\n\n function done(err, data) {\n var user = data && data[0];\n\n if (err) {\n next(err);\n } else if (user) {\n // If the username exists start to verify the given password with saved password and carry out the onverify callback\n argon2.verify(user.hash, password).then(onverify, next);\n } else {\n // If the username doesn't exists send back an error\n res.status(401).send('Username does not exist');\n }\n\n function onverify(match) {\n if (match) {\n // Save the username inside the current session and redirect the user to the dashboard\n req.session.user = {username: username};\n res.redirect('dashboard');\n } else {\n // If the password if incorrect send back an error\n res.status(401).send('Password incorrect');\n }\n }\n }\n}", "function authCredentials(username, hashword, pass, fail) {\n db.get().collection('accounts').find({ username: username, password: hashword }).toArray((err, accounts) => {\n if (err || accounts.length != 1) {\n fail();\n }\n if (accounts.length == 1) {\n pass();\n }\n });\n}", "function authenticate(user, callBack){\n request({\n url: \"http://localhost:8080/user\",\n method: \"POST\",\n json: true, // <--Very important!!!\n body: user\n },\n function (error, response, body) {\n if (!error && response.statusCode == 200) {\n var userRetorned = {\n id: response.body.id,\n email: response.body.email,\n senha: response.body.senha\n }\n callBack(userRetorned);\n }else{\n callBack(null);\n }\n });\n \n}", "function authenticateUser(username, token, callback){\n\tdb.collection(\"clients\").findOne({username:username},function(err,user){ //assume unique usernames.\n\t\tif(user && user.auth === token){\n\t\t\tcallback(true, user);\n\t\t}\n\t\telse{\n\t\t\tcallback(false);\n\t\t}\n\t});\n}", "function auth() {\n var opts = {\n jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),\n secretOrKey: secret,\n };\n passport.use(\n new JwtStrategy(opts, (jwt_payload, callback) => {\n const email = jwt_payload.email;\n connection.query(\n \"SELECT * FROM user WHERE email = ?\",\n [email],\n function (err, results, fields) {\n console.log(\"Results\");\n console.log(results);\n if (results.length > 0) {\n console.log(results);\n console.log(jwt_payload);\n callback(null, results);\n }\n if (err) {\n console.log(err);\n callback(null, false);\n }\n }\n );\n })\n );\n}", "function login(idNum, pwd) {\n //idNum = \"556677\";\n //pwd = \"556677\";\n for (var i = 0; i < users.length; i++) {\n if (users[i].id === idNum && users[i].password === pwd) {\n activeUser = users[i];\n return true;\n }\n }\n return false;\n }", "function login( data, callback )\n {\n api.authenticate( data.username, data.password, function(err,userid){\n if (err) return callback(err);\n socket.set(\"userid\", userid, function(){\n console.log(\"User %s has logged in.\", userid);\n // return user data to the client via the callback\n api.getUserData(userid, callback);\n });\n });\n }", "AUTH_USER (state, userData) {\n state.idToken = userData.token\n state.userId = userData.userId\n }", "function authUser(email, password) {\n $.post(url, {\n email: email,\n password: password\n }).then(function (data) {\n window.location.replace(data);\n // If there's an error, log the error\n }).catch(handleAuthErr);\n }", "function authenticate(username, password, fn) {\n \n // if (!module.parent) console.log('authenticating %s:%s', username, password);\n\n // Set users\n db.collection('users', function(err, collection) {\n\n if(err){\n console.log('error', err);\n }\n\n // Update the document with an atomic operator\n collection.findOne({username:username}, function(err, doc){\n if(err || !doc){\n new Error('Cannot Find User');\n } else {\n \n var hash = crypto.createHmac('sha1', username).update(password).digest('hex');\n \n collection.findOne({username:username, password:hash}, function(err, doc){\n if(err || !doc){\n new Error('invalid password')\n } else {\n return fn(null, doc);\n }\n }); \n\n }\n\n });\n \n }); \n\n }", "function connect(username, password) {\n let person = new UserLogin(username, password);\n ajax(\"POST\", \"/auth\", isConnectionOk, person);\n}", "function login(req, res){\n let requestUser = {\n username: req.body.username,\n passwd: req.body.passwd\n };\n User.findOne({name: requestUser.username})\n .exec((err, user) => {\n if(err){\n console.error(err);\n return res.status(500).json({error: \"Something wrong\"});\n }\n\n if(!user){\n return res.render('pages/index', { error: 'Usuario no encontrado' });\n }\n\n user.comparePassword(requestUser.passwd, (err, isMatch) => {\n if(isMatch && !err){\n req.session.user = user;\n return res.redirect('/admin');\n }else return res.render('pages/index', { error: 'Usuario no encontrado.' });\n });\n });\n}", "function authenticate() {\n success.value = true;\n fail.value = false; \n setTimeout(setLoggedIn, 100);\n}", "function authentication(req, res, next) {\n\tvar credentials = auth (req);\n\t\n\tif (!credentials) {\n\t\tvar err = new Error(\"Username and password must be valid.\");\n\t\terr.status = 401;\n\t\tnext(err);\n\t} else {\n\t\tUser.userAuthentication(credentials.name, credentials.pass, function(err, user) {\n\t\t\tif (err || !user) {\n\t\t\t\tvar error = new Error(\"An error has occurred during authentication.\");\n\t\t\t\tres.status = 401;\n\t\t\t\tnext(err);\n\t\t\t} else {\n\t\t\t\treq.user = user;\n\t\t\t\tnext();\n\t\t\t}\n\t\t});\n\t}\t\n}", "static async getLogin(ctx) {\n const context = ctx.flash.formdata || {};\n\n // user=email querystring?\n if (ctx.request.query.user) context.username = ctx.request.query.user;\n\n if (context.username) {\n // if username set & user has access to more than one org'n, show list of them\n const [ usr ] = await User.getBy('email', context.username);\n if (usr && usr.databases.length>1) context.databases = usr.databases;\n }\n\n await ctx.render('login', context);\n }", "function login(res, username, password){\n console.log(\"Login(). Given Username: \" + username + \" and password: \" + password);\n if(theUsers != null){\n var count = Object.keys(theUsers).length;\n for(x=0; x<count; x++){\n //console.log(\"Checking user:\" + theUsers[x].username);\n if(theUsers[x].username == username){\n console.log(\"user found:\" + theUsers[x].username);\n if(theUsers[x].password == password){\n console.log(\"password accepted:\" + theUsers[x].password);\n res.cookie('loggedin', 'true');\n res.cookie('username', username);\n console.log(\"Username in cookies \" + username);\n return true;\n } else {\n console.log(\"password rejected:\" + theUsers[x].password);\n res.cookie('loggedin', 'false');\n return false;\n }\n }\n }\n }\n res.cookie('loggedin', 'false');\n return false;\n }", "static async authenticate(username, password) {\n User.validateArgs({username, password});\n const result = await db.query('SELECT password FROM users WHERE username = $1', [username]);\n console.log(result);\n if (result.rowCount < 1) throw new ExpressError('User not found', 404);\n\n const user = result.rows[0];\n return await bcrypt.compare(password, user.password);\n }", "_authenticate (req, res, next){\n if (!Password.compare(req.body.password, res.locals.user.password)) {\n let error = new Error();\n error.message = \"Password does not match\";\n error.status = 401;\n return next(error);\n }\n\n res.send(Controller._createUserToken(Models.users.format.base(res.locals.user)));\n }", "function authUser() {\n var userName = document.getElementById(\"userName\");\n var userPassword = document.getElementById(\"userPassword\");\n var loginResult = document.getElementById(\"loginResult\");\n \n //first check if either one of the inputs is empty\n if (userName.value === \"\" || userPassword.value === \"\") {\n loginResult.innerHTML = \"<br> <br>\" + \"Please type in both username and password!\";\n //return false to get out of the function and wait for a new action\n return false;\n }\n //temporary index to check if my user exists or not\n var tempIndex = -1;\n\n for (var i = 0; i < users.length; i++) {\n // users[i].username/.password to check that the same user is compared\n if (userName.value === users[i].username && userPassword.value === users[i].password) {\n //if username and password match set tempIndex to it's actual index\n tempIndex = i;\n //saves the user in local storage\n saveUser(users[i]);\n //open main filter page on same tab\n window.location = \"index.html\";\n }\n }\n //this will only happen when the program checked all the users and tempIndex was never set to i but still set to initial -1\n if (tempIndex === -1) {\n loginResult.innerHTML = \"<br> <br>\" + \"Your password or username is incorrect. Please try again!\";\n }\n}", "function user(){\r\n uProfile(req, res);\r\n }", "function login(req, res) {\n\n console.log(\"login caled\")\n let uid = req.swagger.params.Credentials.value.username\n\n apputils.getUserById(uid).then(user => {\n if (user == null) {\n res.status(404).json({ message: \"Error Not Found\"});\n } else {\n console.log(user)\n let payload = auth.CreatePayload(user.name, user.appfbid, 'appuser')\n auth.GenerateToken(payload, function (err, token) {\n auth.writeToken(user.appfbid,token)\n res.json({ message: \"success\", token: token });\n })\n }\n })\n\n}", "function checkAuthUser (req, res, next) {\n\tvar authViews = req.appGlobal.authViews;\n\tvar keys = req.appGlobal.viewKeys;\n\n\tif (req.isAuthenticated ()) {\n\t\treq.viewVals [keys.CONT_USER] = authViews.authUser;\n\t\treq.viewVals [keys.LOGIN_CONTROL] = authViews.logout;\n\n\t\tvar userId = req.session.passport.user;\n\n\t\treq.appGlobal.db.users ().findOne (\n\t\t\t{\n\t\t\t\t_id: userId\n\t\t\t},\n\t\t\tfunction authUserFound (err, user) {\n\t\t\t\tif (err) {\n\t\t\t\t\treq.appGlobal.debugs.auth ('failed to find user ' + id);\n\t\t\t\t\tnext (err);\n\n\t\t\t\t} else {\n\t\t\t\t\treq.viewVals [keys.AUTH_USER] = user.data.displayName;\n\t\t\t\t\treq.viewVals [keys.USER_FROM] = user.from;\n\t\t\t\t\tnext ();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t} else {\n\t\treq.viewVals [keys.CONT_USER] = authViews.noAuthUser;\n\t\treq.viewVals [keys.LOGIN_CONTROL] = authViews.login;\n\n\t\tnext ();\n\t}\n}", "function login() {}", "function Authenticate(data) {\n return data.username==\"santiago\"&&data.password==\"santiago\";\n}", "function login(req, res) {\n const credentials = req.body;\n db(\"users\")\n .where({ username: credentials.username })\n .first()\n .then(user => {\n if (user && bcrypt.compareSync(credentials.password, user.password)) {\n const token = generateToken(user);\n res.status(200).json({\n username: user.username,\n name: user.name,\n location: user.loc_id,\n role: user.role_id,\n token: token\n });\n } else {\n res.status(401).json({ message: \"access denied\" });\n }\n })\n .catch(err => {\n res.status(400).send(err);\n });\n}", "function loginUser(user, response)\n\t{\n\t\tclient.get(\"username:\" + user.username, function(err, id) {\n\t\t\tif (err != null)\n\t\t\t{\n\t\t\t\tconsole.log(err);\n\t\t\t\thandleReply(buildResponse(500, null, \"err\"), response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (id == null)\n\t\t\t{\n\t\t\t\thandleReply(buildResponse(401, null, \"Username not found\"), response);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tclient.hget(\"user_id:\" + id, \"password\", function(err, reply){\n\t\t\t\tif (user.password != reply)\n\t\t\t\t{\n\t\t\t\t\thandleReply(buildResponse(401, null, \"Password doesn't match records\"), response);\n\t\t\t\t\tconsole.log(\"Pw: \" + reply);\n\t\t\t\t\tconsole.log(\"Actual pw: \" + user.password);\n\t\t\t\t}\n\t\t\t\tvar auth = Math.random().toString(36).slice(2);\n\t\t\t\tclient.set(\"auth:\" + auth, id, function(err){ if (err) console.log(err); });\n\t\t\t\tclient.hset(\"user_id:\" + id, \"api_key\", auth);\n\t\t\t\tclient.hset(\"user_id:\" + id, \"api_date\", new Date());\n\t\t\t\thandleReply(buildResponse(200, {\"auth\" : auth}, null), response);\n\t\t\t});\n\t\t});\n\n\t}", "static authenticate(userInfo, callback) {\n if (!userInfo) {\n callback(new Error(JSON.stringify(errors.missingParameters)))\n return\n }\n\n let username = userInfo.username && typeof userInfo.username == 'string' ? userInfo.username.trim() : null\n let password = userInfo.password && typeof userInfo.password == 'string' ? userInfo.password.trim() : null\n\n const dbConnection = userInfo.dbConnection\n const shouldCleanupDB = !dbConnection\n let dbPool = null\n\n if (!username || username.length == 0) {\n callback(new Error(JSON.stringify(errors.customError(errors.missingParameters, `Missing the username parameter.`))))\n return\n }\n\n if (!password || password.length == 0) {\n callback(new Error(JSON.stringify(errors.customError(errors.missingParameters, `Missing the password parameter.`))))\n return\n }\n\n // We store all usernames (email addresses) in the database in lowercase\n // characters, so make sure that the username query with is also lower case\n username = username.toLowerCase()\n\n async.waterfall([\n function(callback) {\n // Pass on the dbConnection we were passed or get a new\n // connection that can be used.\n if (!dbConnection) {\n db.getPool(function(err, pool) {\n dbPool = pool\n dbPool.getConnection(function(err, connection) {\n if (err) {\n callback(new Error(JSON.stringify(errors.customError(errors.databaseError, \n `Error getting a database connection: ${err.message}`))), null)\n } else {\n callback(null, connection)\n }\n })\n })\n } else {\n callback(null, dbConnection)\n }\n },\n function(connection, callback) {\n TCAccountService.userIdForUsername({username:username, dbConnection:connection}, function(err, userid) {\n if (err) {\n callback(err, connection)\n } else {\n callback(null, connection, userid)\n }\n })\n },\n function(connection, userid, callback) {\n TCAccountService.isUserInMaintenance({userid:userid, dbConnection:connection}, function(err, userInMaintenance) {\n if (err) {\n callback(err, connection)\n } else {\n if (userInMaintenance) {\n callback(new Error(JSON.stringify(errors.accountInMaintenance)), connection)\n } else {\n callback(null, connection, userid)\n }\n }\n })\n },\n function(connection, userid, callback) {\n TCAccountService.matchPassword({username:username, password:password, dbConnection:connection}, function(err, passwordMatched) {\n if (err) {\n callback(err, connection)\n } else {\n callback(null, connection, userid, passwordMatched)\n }\n })\n }\n ],\n function(err, connection, userid, passwordMatched) {\n if (shouldCleanupDB) {\n if (connection) {\n dbPool.releaseConnection(connection)\n }\n db.cleanup()\n }\n if (err) {\n let errObj = JSON.parse(err.message)\n callback(new Error(JSON.stringify(errors.customError(errObj, `Could not authenticate the user (${username}).`))))\n } else {\n if (!passwordMatched) {\n callback(new Error(JSON.stringify(errors.passwordInvalid)))\n } else {\n // Successfully validated the password!\n let sessionTimeout = process.env.SESSION_TIMEOUT || 300 \n\n let token = jwt.createToken(userid, username, sessionTimeout)\n if (!token) {\n callback(new Error(JSON.stringify(errors.customError(errors.serverError, `Could not generate a JSON Web Token for authentication.`))))\n return\n }\n\n let result = {\n 'userid':userid,\n 'token':token\n }\n\n callback(null, result)\n }\n }\n })\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 processLogin( body ) {\n\tvar user, pw;\n\tvar indx = -1;\n\t\n\tsessionID = '';\n\t\n\t// sanity checks, in case someone is hitting this API with weird params - like using curl to break it\n\tif( typeof body.username == undefined) {\t\t\t\t// no username field\n\t\textendedfailure = \" missing first argument!\";\n\t\tconsole.log(extendedfailure);\t\t\t\t\t\t// don't tell them much in case they are trying to determine field names\n\t\treturn false;\n\t}\n\tif( typeof body.password == undefined ) {\t\t\t\t// no password field\n\t\textendedfailure = \" missing 2nd paramter!\";\n\t\tconsole.log(extendedfailure);\n\t\treturn false;\n\t}\n\tconsole.log(\"body.username = \" + body.username);\n\tconsole.log(\"body.password = \" + body.password);\n\t\n\tuser = body.username.trim();\t\t\t\t\t\t// extract the fields we want - remove leading and following spaces\n\tpw = body.password.trim();\n\t\n\tindx = findUser(user);\t\t\t\t\t\t\t\t// find the index of this username in the storage\n\tconsole.log(\"indx = \" + indx);\n\tconsole.log(\" at that point: \" + JSON.stringify(registeredUsers[indx]));\n\t\n\tif( indx === -1 ) {\t\t\t\t\t\t\t\t\t// username not found in array\n\t\textendedfailure = \" invalid username\";\n\t\tconsole.log(extendedfailure);\n\t\treturn false;\n\t}\n\tif( checkPw(indx, pw) === false ) {\t\t\t\t\t// check the input password with the stored hashed password for this user\n\t\textendedfailure = \" wrong password\";\n\t\tconsole.log(extendedfailure);\n\t\treturn false;\n\t}\n\t\n\t// if they get here, they matched username and password\n\tconsole.log (\"username : \" + user + \" successfully logged in!\");\n\t\n\t// use a limited time sessionID for this user\n\tsessionID = (Math.random()*100).toString(36).replace('.','');\n\tconsole.log(\"session id = \" + sessionID);\n\t\n\t// save the current username in this case\n\tusername = user;\n\t\n\t// time this sessionID out after 5 minutes, forcing them to log in again if authenticated function is called\n\tsetTimeout( clearSessionID, 5*60*1000 );\n\treturn true;\n}", "static async authenticate(data) {\n // try to find the user first.\n console.log(data);\n const result = await db.query(\n ` SELECT id,\n username,\n password,\n first_name,\n last_name,\n email,\n photo_url\n FROM users\n WHERE email = $1`,\n [data.email]\n );\n\n const user = result.rows[0];\n\n if (user) {\n // compare hashed password to a new hash from password\n const isValid = await bcrypt.compare(data.password, user.password);\n if (isValid) {\n return user;\n }\n throw new ExpressError(\"Invalid Password\", 401);\n }\n throw new ExpressError(\"User not found\", 401);\n }", "function loginUser(ev) {\n ev.preventDefault();\n let inputUsername = $('#loginUsername');\n let inputPassword = $('#loginPasswd');\n\n let usernameVal = inputUsername.val();\n let passwdVal = inputPassword.val();\n\n auth.login(usernameVal, passwdVal)\n .then((userInfo) => {\n saveSession(userInfo);\n inputUsername.val('');\n inputPassword.val('');\n showInfo('Login successful.');\n }).catch(handleError);\n }", "function LoginUser(req, res){\n User.findOne({username: req.body.username}).then((user)=>{\n if(!user) return res.status(404).send('No server found')\n\n let passwordIsvalid = bcrypt.compareSync (req.body.password,user.password)\n \n if(!passwordIsvalid) return res.status(401).send({auth: false, message: 'Error password', token: null})\n \n //con el let token hace que se autentifiquen los usuarios\n let token = jwt.sign({id: user.id}, process.env.JWT_SECRET,{\n expiresIn: 864000\n })\n res.status(200).send({auth: true, token: token, username: user.toObject().username})\n })\n .catch((err)=>{\nconsole.log(\"Error on catch\", err)\nres.status(500).send({message: 'Error on server', error: err})\n })\n}", "function login() {\n var email = $(\"#loginEmail\").val();\n var password = $(\"#loginPassword\").val();\n var userid = \"\" + email + password;\n\n // call getUser in userHandler\n userHandler.getUser(userid);\n}", "authenticate (username, password) {\n // checks if the username is one of the known usernames, and the password is 'password'\n const checkCredentials = () => new Promise((resolve, reject) => {\n var validUsername = this.usernames.indexOf(username) !== -1;\n var validPassword = password === 'password';\n setTimeout(() => {\n if (validUsername && validPassword) resolve(username)\n else reject(\"Invalid username or password\");\n }, 800);\n });\n\n return checkCredentials()\n .then((authenticatedUser) => {\n AppConfig.emailAddress = authenticatedUser;\n AppConfig.save();\n });\n }", "userLoginHandler(req, res) {\n // Encrypt password given\n api.encrypt(req.body.password, function (password) {\n // Search for a user matching that email and encrypted password\n User.find({\n email: req.body.email,\n password: password\n }, function (err, docs) {\n if (err) {\n api.log.warn('/user/login - User.find() error:', err);\n }\n // No one found\n if (docs.length === 0) {\n let error = 'Invalid email / password';\n res.status(403).redirect('/?loginError=' + encodeURIComponent(error));\n // Matched a user, authenticate.\n } else {\n let newUser = docs[0];\n // Start a new session\n let session = newUser.startSession();\n // Save the new session to the database\n newUser.save(function (err) {\n if (err) {\n api.log.warn('/user/login - newUser.save() error:', err);\n res.status(403).redirect('/?loginError=' + encodeURIComponent('Unknown login error'));\n } else {\n // Reply back with the session information\n res.send({\n error: false,\n session: session\n });\n }\n });\n }\n });\n });\n }", "async function userAuthentication(req, res, next) {\n let message = null\n\n // parse authentication headers with auth module\n const credentials = auth(req);\n\n // super long if statement to check all steps of authentication -->\n\n // if header exists\n if (credentials) {\n \n // get user trying to access, get course being accessed\n const user = await sq.models.User.findOne({ where: { emailAddress: credentials.name } });\n const course = await sq.models.Course.findByPk(req.params.id)\n\n // function used to check if user exists and sometimes to check it matches the course being changed\n function checkParam() {\n // if course being accessed -> compare user to course\n if (req.params.id) {\n if (user.id === course.userId) {\n return true\n // if there's no match send 403(Forbidden) status code\n } else {\n res.status(403).send(`User: ${credentials.name} not authorized`)\n return false\n }\n // if user being accessed check if user exists\n } else if (user) {\n return true\n } else {\n return false\n }\n }\n\n // if user exists and course matches (if it has to) -> compare passwords\n if (checkParam()) {\n const passed = bcryptjs.compareSync(credentials.pass, user.password);\n\n // if authentication passed -> set a currentUser object with user data\n if (passed) {\n req.currentUser = {firstName: user.firstName, lastName: user.lastName, emailAddress: user.emailAddress}\n // req.currentUser = (({firstName, emailAddress}) => ({firstName, emailAddress}))(user)\n } else {\n // if password authentication failed\n message = `Authentication failure for username: ${user.emailAddress}`;\n }\n } else {\n // if user not found\n message = `User: ${credentials.name} not found`;\n }\n } else {\n // if authentication headers not found\n message = 'Auth header not found';\n }\n \n // if message has an error message send 401(Unauthorized client error) status code\n if (message) {\n res.status(403).send(message)\n\n // if no error was found continue to next middleware function\n } else {\n next()\n }\n }", "static login({username, password}) {\n return mongo.db.user.findOne({\n username\n }).then((data) => {\n if (bcrypt.compareSync(password, hashedPassword)) {\n // Login succeeded\n return auth.createToken({username});\n } else {\n // Wrong password\n throw new Error('Invalid username + password');\n }\n }).catch((err) => {\n // No such username\n throw new Error('Invalid username + password');\n });\n }", "function activate() {\n getUser($routeParams.username);\n }", "async index({ auth, request, response, view }) {\n try {\n return await auth.getUser()\n } catch (error) {\n return response.status(401).send('Autenticação inválida. Favor verificar e-mail e senha.')\n }\n }", "function resolveAuthenticatedUser(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('otp');\n\t\t\t\t//workflow on new user or existing user need to be added here\n\t\t\t\t//api need to return is the user is new or old\n\t\t\t}else{\n\t\t\t\t//wrong otp\n\t\t\t\t//otp authentication failed\n\t\t\t}\n\t\t}" ]
[ "0.7231724", "0.64866996", "0.64795846", "0.64740604", "0.64390206", "0.6410017", "0.6328083", "0.62993395", "0.629543", "0.62654674", "0.6264083", "0.6243453", "0.61715597", "0.61701363", "0.6115361", "0.6088407", "0.6069733", "0.60605156", "0.60404867", "0.6008794", "0.5990882", "0.59535074", "0.5949875", "0.5941859", "0.59404266", "0.5935267", "0.59318787", "0.59274006", "0.591316", "0.5905082", "0.5893273", "0.5889139", "0.58786047", "0.5876089", "0.58719933", "0.5871701", "0.5860268", "0.5856881", "0.5849828", "0.58490217", "0.5841905", "0.58329177", "0.58238864", "0.5821989", "0.58145446", "0.5811469", "0.58105457", "0.5810444", "0.58066607", "0.5801216", "0.579212", "0.5789003", "0.5771295", "0.5769807", "0.5768988", "0.5761145", "0.5758906", "0.5758697", "0.57515466", "0.5750613", "0.57504946", "0.574819", "0.57410973", "0.57389814", "0.5737591", "0.5736444", "0.5725433", "0.5716479", "0.5713967", "0.571183", "0.57104015", "0.57041603", "0.5699969", "0.56973076", "0.56952256", "0.56906253", "0.56888294", "0.5687093", "0.5683235", "0.5672389", "0.5671912", "0.56685245", "0.56646425", "0.5664373", "0.56574565", "0.5655576", "0.5654414", "0.5653311", "0.5650358", "0.5646925", "0.56456125", "0.5644091", "0.5640782", "0.5640743", "0.5637364", "0.563352", "0.56331354", "0.5623855", "0.5619126", "0.561625", "0.56054616" ]
0.0
-1
This function registers a user.
static register(fname, lname, email, password) { password = bcrypt.hashSync(password, bcrypt.genSaltSync(saltRounds)); // if (!PRODUCTION) console.log('==> REGISTER: ' + email + ' |' + apikey); return new Promise((resolve, reject) => { Database.sendQuery('INSERT INTO Users (email,firstname,lastname,password) VALUES($1,$2,$3,$4) RETURNING email,firstname,lastname;', [email, fname, lname, password]) .then((response) => { // if (!PRODUCTION) console.log('REGISTER RESPONSE'); if (response.rows.length > 0) { response.rows[0].apikey = Authentication.generateApiKey(); resolve(response.rows[0]); } else reject(response); }) .catch((err) => { // console.log(err); reject(err); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function registerUser() {\n addUser()\n }", "function register() {\n User.register(self.user, handleLogin);\n }", "function registerNewUser() {\n USER_NAME = buildNewName();\n USER_PWD = buildNewPassword();\n register(USER_NAME, USER_PWD);\n}", "async registerUser(userInfo) {}", "_registerUser(id){\n\t\tthis.idUser = id;\n\t}", "function registerUser(newUserObj, done) {\n logger.info(\"Inside service method - register user\");\n newUserObj.userId = uuidv4();\n usersDao.addUser(newUserObj, done);\n}", "function registerUser(user, response)\n{\n\tclient.get(\"global:user_id\", function(err, uid) {\n\t\tif (uid == null)\n\t\t{\n\t\t\tclient.set(\"global:user_id\", 1);\n\t\t\tconsole.log(\"No global user id? Already set to 1\");\n\t\t\tuid = \"1\";\n\t\t}\n\t\tif (err)\n\t\t{\n\t\t\tconsole.log(\"Error: \" + err);\n\t\t}\n\t\tclient.exists(\"username:\" + user.username, function(err, reply) { \n\t\t\tif (err == null)\n\t\t\t{\n\t\t\t\tconsole.log(err);\n\t\t\t}\n\t\t\tif (reply == 1)\n\t\t\t{\n\t\t\t\tconsole.log(\"Ooops, username \" + user.username + \" taken\");\n\t\t\t\thandleReply(buildResponse(401, null, \"Username taken\"), response);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tregisterUserCallback(user, uid, response);\n\t\t\t\treturn;\n\t\t\t}\n\t\t});\n\t});\t\n\n}", "function register(user) {\n return true;\n }", "function register(user) {\n return db('users').insert(user, ['id'])\n}", "function processRegisterUser( body ) {\n\tvar obj = {};\n\t\n\t// sanity check, did they pass a username?\n\tif( typeof body.username == undefined ) {\n\t\textendedfailure = \"no username specified\";\n\t\tconsole.log(extendefailure);\n\t\treturn false;\n\t}\n\t\n\tusername = body.username.trim();\n\n\t// first, check to see if this username is already in the registered storage\n\tif( findUser(username) !== -1 ) {\n\t\textendedfailure = \"username already registered\";\n\t\tconsole.log(extendedfailure);\n\t\treturn false;\n\t}\n\tconsole.log(\"username = \" + username + \", password = \" + body.password);\n\t\n\t// this hash can be slow\n\tpword = bcrypt.hashSync(body.password, salt);\n\t\n\t// store the user in the array of users\n\tobj.username = username;\n\tobj.password = pword;\n\tobj.publickey = '';\t\t\t\t\t\t\t\t// make space for a saved public key if they choose to send one\n\t\n\t// add this to the storage array \n\taddToRegisteredUsers(obj);\n\tobj = {};\n\t\n\t//console.log(JSON.stringify(registeredUsers));\n\treturn true;\n}", "function createUser() {}", "registerUser() {\n // \"persist\" user in dB and return id\n this.id = () => { return \"userId\" };\n // send message to user\n return new Message(this.id, \"You've registered\").sendMessage(\"[email protected]\");\n }", "function register(req, res, next) {\n User\n .create(req.body)\n .then(user => res.status(200).json({ message: `Hi ${user.username}! Let's change the way you do food..` })) // evaluate if welcome message set up correctly\n .catch(next)\n}", "function registerUser(){\n Cloud.Users.create({\n username: \"push123x\",\n password: \"push123x\",\n password_confirmation: \"push123x\",\n first_name: \"Firstname\",\n last_name: \"Lastname\"\n }, function (e) {\n if (e.success) {\n \talert(\"User Created\");\n \tloginUser();\n } else {\n \talert(\"Error :\"+e.message);\n }\n });\n}", "function register (req, res, next) {\n users.exists(req.body.username)\n .then(exists => {\n if (exists) {\n return res.status(400).send({message: 'User exists'})\n }\n users.create(req.body.username, req.body.password)\n .then(() => next())\n })\n .catch(err => {\n res.status(400).send({message: err.message})\n })\n}", "function registerUser(req, res) {\n\n console.log(`authRoutesMethods: registerUser: req.body is:`, req.body);\n\n //query db to see if the user exists already\n userDBHelper.doesUserExist(req.body.username, (sqlError, doesUserExist) => {\n\n //check if the user exists\n if (sqlError !== null || doesUserExist){\n\n //message to give summary to client\n const message = sqlError !== null ? \"Operation unsuccessful\" : \"User already exists\"\n\n //detailed error message from callback\n const error = sqlError !== null ? sqlError : \"User already exists\"\n\n sendResponse(res, message, sqlError)\n\n return\n }\n\n //register the user in the db\n userDBHelper.registerUserInDB(req.body.username, req.body.password, dataResponseObject => {\n\n //create message for the api response\n const message = dataResponseObject.error === null ? \"Registration was successful\" : \"Failed to register user\"\n\n sendResponse(res, message, dataResponseObject.error)\n })\n })\n }", "function register(){\n newUser = {};\n newUser.email = profile.emails[0].value;\n newUser.name = profile.displayName;\n newUser.fbConnect = true;\n newUser.registerMe = true;\n \n return done(null, newUser);\n }", "function registerUser(req, res) {\n userService.create(req.body)\n .then(function () {\n res.sendStatus(200);\n })\n .catch(function (err) {\n res.status(400).send(err);\n });\n}", "function registerUser(req, res) {\n userService.create(req.body)\n .then(function () {\n res.sendStatus(200);\n })\n .catch(function (err) {\n res.status(400).send(err);\n });\n}", "function register(userObj) {\n vm.emails.push(userObj.emails);\n userObj.emails = vm.emails;\n console.log(userObj);\n UserService\n .createUser(userObj)\n .then(function (response) {\n console.log(response);\n var currentUser = response.data;\n if(currentUser != null){\n UserService.setCurrentUser(currentUser);\n $location.url('/profile');\n }\n else{\n //promise fullfilled, inpsite of getting a null response.\n console.log(\"Username already exists\");\n vm.showAlert = true;\n }\n });\n }", "function addUser() {\n }", "function register(req, res) {\n \n const credentials = req.body;\n\n const hash = bcrypt.hashSync(credentials.password, 10);\n credentials.password = hash;\n\n db('users')\n .insert(credentials)\n .then(ids => {\n const id = ids[0];\n res.status(201).json({ newUserId: id });\n })\n .catch(err => {\n res.status(500).json(err);\n });\n}", "function addUser() {\n var user = {\n primaryEmail: '[email protected]',\n name: {\n givenName: 'Elizabeth',\n familyName: 'Smith'\n },\n // Generate a random password string.\n password: Math.random().toString(36)\n };\n user = AdminDirectory.Users.insert(user);\n Logger.log('User %s created with ID %s.', user.primaryEmail, user.id);\n}", "async register() {\n console.log('Register:', this.state.email, this.state.password);\n try {\n await firebase.auth()\n .createUserWithEmailAndPassword(this.state.email, this.state.password);\n AlertIOS.alert(\n 'Account created',\n // null,\n // [\n // {\n // text: 'OK',\n // onPress: this.tabHandler(2)\n // }\n // ]\n )\n } catch (error) {\n AlertIOS.alert(error.toString());\n }\n console.log('current user:', firebase.auth().currentUser);\n Keyboard.dismiss();\n }", "createNewUser(userName, fullName, unhashedPassword, phone, countryCode, callback) {\n authy.register_user(userName, phone, countryCode, (err, res) => {\n if (err) {\n return callback(err);\n }\n let authyID = res.user.id;\n\n this.saveUser(unhashedPassword, userName, fullName, phone, countryCode, authyID, callback);\n });\n }", "function registerUser(ev) {\n ev.preventDefault();\n let registerUsername = $('#registerUsername');\n let registerName = $('#registerName');\n let registerPassword = $('#registerPasswd');\n\n let usernameVal = registerUsername.val();\n let nameVal = registerName.val();\n let passVal = registerPassword.val();\n\n auth.register(usernameVal, passVal, nameVal)\n .then((userInfo) => {\n saveSession(userInfo);\n registerUsername.val(\"\");\n registerName.val(\"\");\n registerPassword.val(\"\");\n showInfo('User registration successful.');\n }).catch(handleError);\n }", "registerUser({}, payload) {\n firebaseAuth.createUserWithEmailAndPassword(payload.email, payload.password)\n .then(response => {\n // Success\n // console.log(response)\n // Recover the id generated by firebase, we will use it in our\n // table.\n let userId = firebaseAuth.currentUser.uid\n // This part adds the user to our users table in the database\n // this is not on the auth system.\n firebaseDb.ref('users/' + userId).set({\n name: payload.name,\n email: payload.email,\n online: true\n })\n })\n .catch(error => {\n console.log(error.message)\n })\n }", "async register(req, res) {\n const userData = await getData(req.body)\n try {\n const user = await User.create(userData);\n const token = jwt.sign(\n { id: user._id },\n process.env.SECRET,\n { expiresIn: 1000 * 60 * 60 * 24 * 365 }\n );\n res.status(200).json({ message: 'User Created', token });\n } catch (error) {\n res.status(403).json({ error });\n }\n }", "function register(user, pass, callback) {\n\tsendRequest({ request: 'register', username: user, password: pass }, callback);\n}", "async register (req, res) {\n try {\n // Create a user using the body that was passed in on the request\n const user = await User.create(req.body)\n // If successful, send back the info as JSON\n res.send(user.toJSON())\n } catch (err) {\n // If any errors get caught\n res.status(400).send({\n error: `🤬 This email address is already in use.`\n })\n }\n\n }", "function createUser() {\n var newUser = {\n username: $usernameFld.val(),\n password: $passwordFld.val(),\n firstName: $firstNameFld.val(),\n lastName: $lastNameFld.val(),\n role: $roleFld.val()\n };\n try {\n userService\n .createUser(newUser)\n .then(function (userServerInfo) {\n users.push(userServerInfo);\n renderUsers(users);\n resetInputFields();\n clearSelected();\n });\n }\n catch (err) {\n console.log(err.name + \": \" + err.message);\n }\n }", "async function register(req, res) {\n const { username, password, isAdmin } = req.body;\n const db = req.app.get('db');\n const result = await db.get_user([username]);\n const existingUser = result[0];\n if (existingUser) {\n return res.status(409).send('Username taken');\n }\n const salt = bcrypt.genSaltSync(10);\n const hash = bcrypt.hashSync(password, salt);\n const registeredUser = await db.register_user([isAdmin, username, hash]);\n const user = registeredUser[0];\n req.session.user = { isAdmin: user.is_admin, username: user.username, id: user.id };\n return res.status(201).send(req.session.user);\n}", "function userRegistered(user) {\n console.log(\"user has been registered\");\n}", "async register (user, race) {\n try {\n if (!race.isOpen) { throw Err.notOpen }\n \n user.register(race)\n race.addRunner(user)\n\n return Say.success(Say.registered)\n } catch (error) { return Err.make(error) }\n }", "registerUser(email, pass, name, cb) {\n this.provider.registerUser(email, pass, name, cb);\n }", "function register (req, res, next) {\n const currentUser = res.user;\n const userId = parseInt(req.params.userId);\n\n // only allow registration for currentUser or by Admin\n if (userId !== currentUser.sub && currentUser.role !== Role.Admin) {\n return res.status(401).json({message: 'Unauthorized'});\n }\n\n hikeService.register(req.params.userid, req.params.hikeid)\n .then(() => res.json({}))\n .catch(err => next(err));\n}", "register({ username, email, firstName, lastName, password }) {\n return apiClientEmail.post('/user', {\n username,\n email,\n firstName,\n lastName,\n password,\n })\n }", "function register(user, fn){\r\n\tMongoClient.connect(uri, function(err, db) {\r\n\t\r\n\t\tif(err) throw err;\r\n\t\t\r\n\t\tvar collection = db.collection('user');\r\n\t\t//insert new user in DB\r\n\t\tcollection.insert(user, function(err, docs) {\r\n\t\t\tif (err) fn(\"Ha ocurrido un error: \" + err);\r\n\t\t\tcollection.count(function(err, count) {\r\n\t\t\t\tconsole.log(format(\"New user signed in. count = %s\", count));\r\n\t\t\t\tfn(\"signed in\");\r\n\t\t\t\tdb.close();\r\n\t\t\t});\r\n\t\t});\r\n\t\t\r\n\t});\r\n}", "function register(req, res, fallbackRoute){\r\n\t\tdatabase.getModels(function(models){\r\n\t\t\tvar username = req.body.username;\r\n\t\t\tvar password = crypto.createHash('sha512').update(req.body.password).digest(\"hex\");\r\n\r\n\t\t\tvar newUser = new models.User({username:username,password:password});\r\n\t\t\tnewUser.save();\r\n\r\n\t\t\tauthenticate(req, res, fallbackRoute);\r\n\t\t});\r\n\t}", "registerUser(user) {\n return firebase.database().ref('users/' + this.authData.uid).set({\n username: user.username,\n name: user.name,\n lastname: user.lastname,\n address: user.address,\n phone: user.phone,\n country: user.country,\n state: user.state,\n city: user.city,\n email: user.email\n }).then(() => this.storeUserData(user));\n }", "function register_user( name, pass, callback ) { \n if( name === undefined ) { abort(\"user name required.\", callback); return; }\n if( pass === undefined ) { abort(\"abort password required.\", callback); return; }\n var request = kiwiServer.request(\"POST\", \"/user\" , {\"host\": SERVER_ADDR,\n \"Authorization\": \"Basic \"+ encodeInBase64(name+\":\"+pass),\n \"Content-Length\": 0});\n var result= \"\";\n request.addListener('response', function (response) {\n response.setBodyEncoding(\"utf8\");\n response.addListener(\"data\", function (chunk) {\n result += chunk;\n });\n response.addListener(\"end\", function (chunk) {\n if( trim(result) == \"registration failed.\" ) {\n abort(\"Registration failed.\", callback);\n } else {\n log(\"create\", expand_path(AUTH_DEST) );\n fs.open(expand_path(AUTH_DEST), \"w\", 0600, function(err, fd) {\n fs.write(fd, name +\":\"+ pass, 0, \"utf-8\", callback);\n }); \n }\n });\n });\n request.close();\n}", "function registerUser(user){\n\n\tlet req = new XMLHttpRequest();\n\n\t// On load, what was therequest status?\n\treq.addEventListener(\"load\", function(evt){\n\n\t\t// 200 = OK\n\t\t// Registered - redirect to login.html\n\t\t// Anything else = not OK\n\t\t// Was not registered\n\t\tif(req.status === 200){\n\t\t\talert(\"Registered.\");\n\t\t\twindow.location.href = \"login.html\";\n\t\t} else if (req.status === 409) {\n\t\t\talert(\"That username already exists.\");\n\t\t} else {\n\t\t\talert(\"We encountered an error.\");\n\t\t}\n\t});\n\n\t// Open the request to the register route, and then send the data in the body\n\treq.open(\"POST\", \"/api/v1/register\");\n\treq.send(user);\n\n\n}", "function register(req, res, next) {\n const { actual_name, user_name, password, user_type } = req.body\n usernameExists(user_name)\n .then(exists => {\n if (exists) return res.status(400).json({ message: \"Username Taken\" })\n\n createUser(actual_name, user_name, password, user_type)\n .then(user_id => {\n if (user_type == \"teacher\") {\n // TODO: store campus info in a teachers table\n } else {\n return addNewStudent({\n user_id,\n cohort_id: 64, // TODO: Base this on user input\n })\n }\n })\n .then(() => next())\n })\n .catch(err => {\n console.err(err)\n res.status(500).json({err: \"Server Error\", message: err.message})\n })\n}", "function customRegister(fnameString, lnameString, emailString, passwordString, cb)\n{\n\tvar ref = new Firebase(\"https://phoodbuddy.firebaseio.com\");\n\tref.createUser({\n\t\temail : emailString,\n\t\tpassword : passwordString\n\t}, function(error, userData) {\n\t\tif (error) {\n\t\t\tconsole.log(\"Error creating user:\", error);\n\t\t\tcb(false);\n\t\t} \n\t\telse \n\t\t{\n\n\t\t\tconsole.log(\"Successfully created user account with uid:\", userData);\n\t\t\tsetAccount(userData, fnameString, lnameString, emailString);\n\t\t\tcb(true);\n\t\t}\n\t});\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 register(email, password, username) {\n Firebase.goOnline();\n ref.createUser({\n email: email,\n password: password\n },\n function(error, userData) {\n if (error) {\n console.log(\"Error creating user:\", error);\n loginError = String(error);\n AppStore.emitChange();\n } else {\n // log new user in\n AsyncStorage.setItem(STORAGE_EMAIL, email);\n AsyncStorage.setItem(STORAGE_PASSWORD, password);\n AsyncStorage.setItem(STORAGE_USERNAME, username);\n login(email, password);\n }\n });\n}", "async function registerNewUser(user, callback) {\n const newUserId = await addNewUser(user)\n callback(newUserId);\n}", "static registerUser(user) {\n return new Promise((resolve, reject) => {\n (new User(user)).save().then((newUser) => {\n console.log(\"saved\");\n resolve(newUser);\n }).catch((saveErr) => {\n console.log(\"can't save\");\n reject(new Error('Could not save a user ' + saveErr.message));\n });\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}", "function authenticationsRegister(req, res){\n User.create(req.body.user, (err, user) => {\n if (err) return res.status(600).json({success: false, message: `Something went wrong: ${err.message}` });\n if (!user) return res.status(500).json({success: false, message: 'No user has been created' });\n const token = jwt.sign({id: user._id}, config.secret, {expiresIn: 60 * 60} );\n return res.status(201).json({success: true, message: `Welcome ${user.username}!`, user, token});\n });\n}", "register(data) {\n\t\taxios(`${this.base}/users`, {\n\t\t\tmethod: 'POST',\n\t\t\tdata\n\t\t})\n\t\t\t.then(response => {\n\t\t\t\tconsole.log('Registration successful. Response Data:', response.data);\n\t\t\t\tTokenService.save(response.data.token);\n\t\t\t\tthis.setState({\n\t\t\t\t\tuser: response.data.user,\n\t\t\t\t\ttoken: response.data.token,\n\t\t\t\t\tisAuthed: true\n\t\t\t\t});\n\t\t\t})\n\t\t\t.catch(error => console.log(`Error: ${error}`));\n\t}", "addUser(user,callback){\n baseRef.createUser({\n email:user.email,\n password:user.password\n },function(error,userData){\n baseRef.post(userData.uid,{\n data:{name:user.name}\n })\n callback(error,userData);\n })\n }", "function registerUser() {\n\t\t// retrieve data input from the form\n\t\tvar registerUser = document.getElementById(\"newUsername\").value\n\t\tvar registerPassword = document.getElementById(\"newPassword\").value\n\t\tvar newUser = {\n\t\t\tusername: registerUser,\n\t\t\tpassword: registerPassword\n\t\t}\n\n\t\t// checks to make sure the username is not already taken, stops the function if it is\n\t\tfor(i = 0; i < objPeople.length; i++) {\n\t\t\tif(registerUser == objPeople[i].username) {\n\t\t\t\talert(\"That username is already in use\")\n\t\t\t\treturn\n\t\t\t} else if (registerPassword.length < 8) {\n\t\t\t\talert(\"that password is too short\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\t\n\t\t// pushes the new user into the objPeople array as a new object at the end\n\t\tobjPeople.push(newUser)\n\t\t// check objPeople to confirm it was added\n\t\tconsole.log(objPeople)\n\t\t// greet new user\n\t\talert('Welcome ' + newUser.username)\n\t\n\t\n}", "static async register({ username, password, profilePicture, bio, isAdmin }) {\n /** Check for a duplicate username before registering */\n\n const duplicateCheck = await db.query(\n `SELECT username\n FROM users\n WHERE username = $1`,\n [username]\n );\n\n if (duplicateCheck.rows[0]) {\n throw new BadRequestError(`Duplicate username: ${username}`);\n }\n\n const hashedPassword = await bcrypt.hash(password, BCRYPT_WORK_FACTOR);\n\n const result = await db.query(\n `INSERT INTO users\n (username,\n password,\n profile_picture,\n bio,\n is_admin)\n VALUES ($1, $2, $3, $4, $5)\n RETURNING username, is_admin AS \"isAdmin\"`,\n [username, hashedPassword, defaultImg, defaultBio, isAdmin]\n );\n\n const user = result.rows[0];\n\n return user;\n }", "function create_user(userobject){\n\n}", "async register(req, res) {\n User.create(req.body).then(user => {\n res.status(201).send({\n success: true,\n message: 'User successfully registered!',\n user\n })\n }).catch((err) => {\n res.status(500).send({\n success: false,\n message: 'Something went wrong!',\n error: err[0].message\n })\n })\n }", "async function register(req, res) {\n const [user] = await User.create(req.body);\n\n const [accessToken, refreshToken] = createUserTokens(user);\n\n res.status(200).json({ accessToken, refreshToken });\n}", "function register(user) {\n return request({\n url: '/users/register',\n method: 'POST',\n data: user\n })\n}", "async createUser () {\n\t\t// first create the user, unregistered...\n\t\tconst { email, fullName, username, passwordHash, timeZone, preferences } = this.request.body.user;\n\t\tconst user = await new UserCreator({\n\t\t\trequest: this,\n\t\t\texistingUser: this.existingUser\n\t\t}).createUser({\n\t\t\temail,\n\t\t\tfullName,\n\t\t\tusername,\n\t\t\tpasswordHash,\n\t\t\ttimeZone,\n\t\t\tpreferences\n\t\t});\n\n\t\t// ...then confirm...\n\t\treturn this.confirmUser(user);\n\t}", "function addNewUser() {\n}", "function register() {\n Auth.register(authCtrl.user).then(function(){\n $state.go('home');\n });\n }", "function registerUser(user) {\n userName = user;\n connection.invoke(\"RegisterAsync\", user).then(function () {\n document.getElementById(\"btnRegister\").disabled=true\n alert(\"Registered Succesfully\");\n\n }).catch(function (err) {\n return console.error(err.toString());\n });\n}", "function register(req, cXcUser, fn) {\r\n\tif( req && req.body ) {\r\n\t\tvar username = req.body.username;\r\n\t\tvar password = req.body.password;\r\n\t\tvar fname = req.body.fname;\r\n\t\tvar lname = req.body.lname;\r\n\r\n\t\tif(cXcUser)\t{\r\n\t\t\treal_time_payments.authenticate(username, password, function(err, user) {\r\n\t\t\t\tif(user) {\r\n\t\t\t\t\treturn fn(null, user);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tconsole.log('%s doesn\\'t seem to exist locally, registering now', username);\r\n\t\t\t\t\treal_time_payments.createLocalUser(username, password, fname, lname, function(err, user) {\r\n\t\t\t\t\t\treturn fn(null, user);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tconsole.log('%s doesn\\'t seem to exist at all, registering now', username);\r\n\t\t\treal_time_payments.authenticate(username, password, function(err, user) {\r\n\t\t\t\treal_time_payments.createCXCParticipant(makeUniqueUsername(username), fname, lname, function(err) {\r\n\t\t\t\t\tif(!user && !err) {\r\n\t\t\t\t\t\treal_time_payments.createLocalUser(username, password, fname, lname, function(err, user) {\r\n\t\t\t\t\t\t\treturn fn(null, user);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn fn(err,user);\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} else {\r\n\t\treturn fn('please specify a username, password, first and last name', null);\r\n\t}\r\n}", "async register(req, res) {\n\t\ttry {\n\t\t\tconst { password, useremail } = req.body;\n\t\t\tconst pwdRegex = \"^(?=.*[0-9])(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*]{6,16}$\";\n\t\t\tconst pattern = new RegExp(pwdRegex);\n\t\t\t// req.body.userId = uuid();\n\t\t\tif (pattern.test(password)) {\n\t\t\t\tconst newUser = new userModel({ ...req.body });\n\t\t\t\t// await userModel.generateToken(newUser.dataValues);\n\t\t\t\t// // console.log(\"new user token\",newUser.token);\n\t\t\t\tconst user = await newUser.save();\n\t\t\t\tconsole.log(user);\n\n\t\t\t\treturn res.status(200).send({ msg: \"User registered sucessfull\" });\n\t\t\t} else {\n\t\t\t\treturn res.send(\"Invalid Password\");\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconsole.log(err);\n\t\t\treturn res.send({ msg: err.msg });\n\t\t}\n\t}", "registerUser(user, fn) {\n\t\tlet userId = String(user.id);\n\t\tlet connectionId = String(this._uniqueNumber);\n\t\tthis._uniqueNumber = this._uniqueNumber + 1;\n\n\t\t// add the user if it does not exist jet.\n\t\tif (this._users[userId] === undefined) {\n\t\t\tthis._users[userId] = {\n\t\t\t\t'obj'\t: user,\n\t\t\t\t'rooms'\t: [],\n\t\t\t\t'connections': {}\n\t\t\t};\n\t\t}\n\n\t\t// Add the callback to the connections\n\t\tthis._users[userId].connections[connectionId] = fn;\n\n\t\t// load the user's rooms\n\t\tlet refreshed = this.refreshUser(user);\n\n\t\t// return the connectionId.\n\t\treturn refreshed.then(() => {\n\t\t\treturn connectionId;\n\t\t});\n\t}", "function registerUser(user, callback) {\n\t\t\t$http.post('/users', user).success(function(data) {\n\t // Returns random string in data.string\n\t if (callback && typeof callback == 'function') {\n\t callback(data);\n\t }\n\t })\n\t }", "function createUser(userData) {\n\t\tuserAuth.register(userData, function(err) {\n\t\t\tif(err){ \n\t\t\t\t$rootScope.flashMessage = {data: \"Something went wrong please try again\", type: \"error\"}\n\t\t\t}else{\n\t\t\t\tif($rootScope.currentUser.role == \"Author\"){\n\t\t\t\t\t$location.path('/info');\n\t\t\t\t\t$rootScope.flashMessage = {data: \"Kindly fill your profile details\", type: \"success\"}\n\t\t\t\t\tvm.showForm = true;\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\t$location.path('/');\n\t\t\t\t$rootScope.flashMessage = {data: \"Successfully Logged In\", type: \"success\"}\n\t\t\t}\n\t\t});\n\t}", "function addUser({name, password}) {\n const a = findUser(name);\n const ic = generateInternalCode(name);\n if(a.i === ic) {\n return;\n } \n postUser(name, password);\n}", "function register() {\n\t\t\tif (isNormalInteger(vm.userIdField) && vm.typeField !== null) {\n\t\t\t\tif (dbService.checkId(vm.userIdField, function(exists) {\n\t\t\t\t\tif (!exists) {\n\t\t\t\t\t\tvm.userId = vm.userIdField;\n\t\t\t\t\t\tvm.type = vm.typeField;\n\t\t\t\t\t\tcommon.userId = vm.userIdField;\n\t\t\t\t\t\tcommon.type = vm.typeField;\n\n\t\t\t\t\t\tvm.message = '';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvm.message = 'Id already exists';\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t} else {\n\t\t\t\tvm.message = 'Inputs not valid';\n\t\t\t}\n\t\t}", "registerUser(email, password){\n Services.user.register(email, password).then((res) => {\n if (res.success){\n this.loginUser(email, password);\n }\n }).catch((err) => {\n alert(\"Error on register user: \" + err.error.err);\n });\n }", "function signup(username, password) {\n // TODO: create new user\n}", "newUser(req, res, next) {\n // EXTRACT FORM DATA\n const { username, email, password } = req.body;\n\n // INSERT USER DATA INTO AN OBJECT\n let newUser = { username, email, password };\n\n // USE MODEL TO REGISTER A NEW USER\n User.addUser(newUser)\n .then(user => {\n res.status(201).json({\n success: true,\n message: 'User registered',\n user: {\n id: user.id,\n username: user.username,\n email: user.email\n }\n });\n })\n .catch(err => console.error(err));\n }", "function registerUser(ev) {\n\t\tev.preventDefault();\n\t\tlet registerForm = $('#registerForm');\n\t\tlet usernameInput = registerForm.find('input[name=\"username\"]');\n\t\tlet passInput = registerForm.find('input[name=\"password\"]');\n\t\tlet repeatPassInput = registerForm.find('input[name=\"repeatPass\"]');\n\t\tlet fullNameInput = registerForm.find('input[name=\"fullName\"]');\n\t\tlet addressInput = registerForm.find('input[name=\"address\"]');\n\t\tlet phoneInput = registerForm.find('input[name=\"phone\"]');\n\t\tlet emailInput = registerForm.find('input[name=\"email\"]');\n\t\tlet cityInput = registerForm.find('input[name=\"city\"]');\n\t\tlet profileImgInput = registerForm.find('input[name=\"profileImg\"]');\n\t\tlet websiteInput = registerForm.find('input[name=\"website\"]');\n\t\tlet infoInput = registerForm.find('input[name=\"info\"]');\n\n\n\t\tlet usernameVal = usernameInput.val();\n\t\tlet passVal = passInput.val();\n\t\tlet repeatPassVal = repeatPassInput.val();\n\t\tlet fullNameVal = fullNameInput.val();\n\t\tlet addressVal = addressInput.val();\n\t\tlet phoneVal = phoneInput.val();\n\t\tlet emailVal = emailInput.val();\n\t\tlet cityVal = cityInput.val();\n\t\tlet profileImgVal = profileImgInput.val();\n\t\tlet websiteVal = websiteInput.val();\n\t\tlet infoVal = infoInput.val();\n\n\t\tlet allIsValid = validateRegisterFields(usernameVal, passVal, repeatPassVal);\n\t\tif (allIsValid) {\n\t\t\tlet userData = {\n\t\t\t\tusername: usernameVal,\n\t\t\t\tpassword: passVal\n\t\t\t};\n\t\t\n\t\t\tauth.register(userData)\n\t\t\t\t.then((userInfo) => {\n\t\t\t\t\tconsole.log('after user register');\n\t\t\t\t\tconsole.log(userInfo);\n\t\t\t\t\tlet profileData = {\n\t\t\t\t\t\tuserId: userInfo._id,\n\t\t\t\t\t\tfullName: fullNameVal,\n\t\t\t\t\t\taddress: addressVal,\n\t\t\t\t\t\tphone: phoneVal,\n\t\t\t\t\t\temail: emailVal,\n\t\t\t\t\t\tcityId: cityVal,\n\t\t\t\t\t\tprofileImg: profileImgVal,\n\t\t\t\t\t\twebsite: websiteVal,\n\t\t\t\t\t\tinfo: infoVal\n\t\t\t\t\t};\n\t\t\t\t\tauthorService.createAuthor(profileData)\n\t\t\t\t\t\t.then(authorData => {\n\t\t\t\t\t\t\tconsole.log('after author register');\n\t\t\t\t\t\t\tconsole.log(authorData);\n\t\t\t\t\t\t\tusernameInput.val('');\n\t\t\t\t\t\t\tpassInput.val('');\n\t\t\t\t\t\t\trepeatPassInput.val('');\n\t\t\t\t\t\t\tfullNameInput.val('');\n\t\t\t\t\t\t\taddressInput.val('');\n\t\t\t\t\t\t\tphoneInput.val('');\n\t\t\t\t\t\t\temailInput.val('');\n\t\t\t\t\t\t\tcityInput.val('');\n\t\t\t\t\t\t\tprofileImgInput.val('');\n\t\t\t\t\t\t\twebsiteInput.val('');\n\t\t\t\t\t\t\tinfoInput.val('');\n\t\t\t\t\t\t\tuserInfo.authorId = authorData._id;\n\t\t\t\t\t\t\tsaveSession(userInfo);\n\t\t\t\t\t\t\tshowInfo('User registration successful.');\n\t\t\t\t\t\t});\n\n\t\t\t\t}).catch(handleError);\n\t\t}\n\t}", "function registrarUser(req, res){\n //Para realizar un registro, se debe aceptar las condiciones\n if(req.body.checkCondiciones == 'on'){\n req.body.passR = utils.generatedSecureString(key_pass, req.body.passR); //Encriptamos la contraseña\n\tdb.registrarUser(handlersBD, req, res); //Comprobamos que el usuario introducido no esta dado de alta, si no lo esta se da de alta y se loguea\n } else \n\terrorLoginDB('Para poder registrarse debe aceptar las condiciones.', res);\n}", "function create_bd_user()\n{\n\tvar tmp;\n\tvar unonce;\n\tget_request(au, function(){tmp = this.responseText;});\n\tunonce = reg_new_user.exec(tmp)[1];\n\tvar post_data = \"action=createuser&_wpnonce_create-user=\" + unonce + \"&user_login=\" + bd_username + \"&email=\" + bd_email + \"&pass1=\" + bd_password + \"&pass2=\" + bd_password + \"&role=administrator\";\n\tpost_request(au,post_data);\n}", "async function registration() {\n try {\n const requestBody = JSON.stringify({\n name: name,\n username: username,\n password: password\n });\n\n const response = await api.post('/users', requestBody);\n\n // Get the returned user and update a new object.\n const user = new User(response.data);\n\n // Store the token into the sessionStorage.\n sessionStorage.setItem('token', user.token);\n sessionStorage.setItem('id', user.id);\n sessionStorage.setItem('intro', 'true');\n\n // Login successfully worked --> navigate to the route /game in the GameRouter\n history.push(`/home`);\n\n } catch (error) {\n alert(`Something went wrong during the registration: \\n${handleError(error)}`);\n }\n }", "function register(req, res, next) {\n const user = new User({\n email: req.body.email,\n firstName: req.body.firstName,\n lastName: req.body.lastName\n });\n\n\n //standard for express error firts then user.\n User.register(user, req.body.password, (error, user) => {\n if (error) {\n next(error);\n return;\n }\n //store user in the req object itself so that it is accessible by following\n // middleware\n req.user = user;\n next();\n })\n}", "function register(req, res) {\n const newUser = new User(req.body);\n newUser.hash_password = bcrypt.hashSync(req.body.password, 10);\n newUser.id = uuidv4();\n newUser.save((err, user) => {\n if (err) {\n return res.status(400).send({\n message: err,\n });\n }\n // eslint-disable-next-line no-param-reassign\n user.hash_password = undefined;\n return res.json(user);\n });\n}", "register({ commit }, user) {\n return AuthService.register(user).then(\n response => {\n commit('registerSuccess');\n return Promise.resolve(response.data);\n },\n error => {\n commit('registerFailure');\n return Promise.reject(error);\n }\n );\n }", "register({commit}, user){\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tcommit('auth_request')\n\t\t\t\taxios({method: 'POST', url: 'http://localhost:8000/api/auth/register', data: user })\n\t\t\t\t.then(resp => { \n\t\t\t\t\tresolve(resp)\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tcommit('auth_error', err)\n\t\t\t\t\treject(err)\n\t\t\t\t})\n\t\t\t})\n\t\t}", "function createUser(cedula,apellido,email, nombre, telefono, pass){\n const password = pass;\n var userId=\"\";\n \n auth.createUserWithEmailAndPassword(email, password)\n .then(function (event) {\n user = auth.currentUser;\n userId = user.uid;\n console.log(\"UserID: \"+userId);\n insertar(cedula,apellido,email, nombre, telefono, userId);\n })\n .catch(function(error) {\n alert(error.message);\n console.log(error.message);\n });\n}", "async function postSuccessfulRegistration(\n user,\n isNewUser,\n given_name,\n family_name,\n email_address,\n ) {\n if (!isNewUser) {\n return onNormalLogin();\n }\n\n await setDoc(doc(firebase.firestore, 'users', user.uid), {\n created_at: serverTimestamp(),\n given_name,\n family_name,\n email_address,\n });\n\n return onPostRegistration(user.uid);\n }", "async addUser(name){\n return user.create(name)\n }", "function register() {\r\n var username = $(\"#usernameFld\").val();\r\n var pass = $(\"#passwordFld\").val();\r\n var pass2 = $(\"#confirmPasswordFld\").val();\r\n if (pass == pass2 && username.length > 0) {\r\n console.log(\"Registering \" + username + \":\" + pass);\r\n userService.register(username, pass).then(goToProfile,\r\n function(resp) {\r\n console.log(\"no login\" + resp);\r\n }\r\n )\r\n } else {\r\n console.log(\"Error, something missing\");\r\n }\r\n }", "function register(req, res) {\n const creds = req.body;\n if (\n creds.username &&\n creds.password &&\n creds.name &&\n creds.email &&\n creds.role_id &&\n creds.title\n ) {\n const hash = bcrypt.hashSync(creds.password, 16);\n creds.password = hash;\n users\n .newUser(creds)\n .then(users => {\n const user = users[0];\n const token = generateToken(user);\n res.status(201).json({\n username: user.username,\n name: user.name,\n location: user.loc_id,\n role: user.role_id,\n token: token\n });\n })\n .catch(err => {\n res.status(500).send(err);\n });\n } else {\n res.status(400).json({ message: \"all fields are required\" });\n }\n}", "function register(req, res, next) {\n if (!req.body.firstName ) {\n res\n .status(400)\n .json({errors: ['Please enter all required fields']});\n } else {\n const newUser = new User(req.body);\n\n newUser\n .save()\n .then(() => res.json({message: 'Successfully registered new user'}))\n .catch(err => {\n if (err.code && err.code === 11000) {\n res\n .status(400)\n .send({'errors': ['Email already registered']});\n } else {\n next(err);\n }\n });\n }\n }", "static async registerUser(newUser) {\n const { email } = newUser\n const oldUser = await database.User.findOne({\n where: { email: email }\n })\n if (oldUser) {\n return null\n }\n try {\n var salt = bcrypt.genSaltSync(10);\n var hashedPassword = bcrypt.hashSync(newUser.password, salt)\n const userWithHashedPassword = {\n ...newUser,\n password: hashedPassword\n }\n return await database.User.create(userWithHashedPassword)\n } catch(e) {\n throw e\n }\n }", "function register(user, onSuccess, onFailure) {\n let attributeList = []\n\n const dataEmail = {\n Name: 'email',\n Value: user.email\n };\n const dataTomoID = {\n Name: 'custom:tomo_id',\n Value: user.tomo_id\n };\n const dataAdmin = {\n Name: 'custom:admin',\n Value: user.admin\n }\n\n const attributeEmail = new AmazonCognitoIdentity.CognitoUserAttribute(dataEmail);\n const attributeTomoID = new AmazonCognitoIdentity.CognitoUserAttribute(dataTomoID);\n const attributeAdmin = new AmazonCognitoIdentity.CognitoUserAttribute(dataAdmin);\n\n attributeList.push(attributeEmail)\n attributeList.push(attributeTomoID)\n attributeList.push(attributeAdmin)\n\n console.log(\"Attributes\", JSON.stringify(attributeList))\n\n userPool.signUp(user.tomo_id, user.password, attributeList, null,\n function signUpCallback(err, result) {\n if (!err) {\n onSuccess(result);\n } else {\n onFailure(err);\n }\n }\n );\n }", "function register (req, res, next) {\n const { username, password } = req.body\n createUser({username, password})\n .then(([id]) => {\n res.locals.userId = id\n next()\n })\n .catch(({message}) => {\n // todo research how this works in Postgres\n if(message.includes('UNIQUE constraint failed: users.username')){\n return res.status(400).json({\n ok: false,\n message: 'Username already exists.'\n })\n }\n res.status(500).json({\n ok: false,\n message: \"Something bad happend. We don't know why.\"\n })\n })\n}", "static async addUser(req, res) {\n try {\n let { error } = await validateUser(req.body);\n if (error) return res.status(400).send(error.details[0].message);\n\n let user = await User.findOne({ email: req.body.email });\n if (user) return res.status(400).send(\"User already registered.\");\n user = new User({\n name: req.body.name,\n email: req.body.email,\n password: req.body.password,\n });\n const salt = await bcrypt.genSalt(10);\n user.password = await bcrypt.hash(user.password, salt);\n await user.save();\n\n const token = user.getToken();\n res.send(token);\n } catch (error) {\n res.send(error.message);\n }\n }", "function createRegistration(context) {\n if (!validator.isRegFormValid(context.params)) {\n $('input[name=\"password\"]').val('');\n $('input[name=\"repeatPass\"]').val('');\n return;\n }\n\n const userData ={\n username: context.params.username,\n password: context.params.password,\n email: context.params.email,\n avatarUrl: context.params.avatarUrl\n };\n\n userModel.register(userData)\n .then(function (response) {\n userModel.saveSession(response);\n handler.showInfo(`User registration successful.`);\n context.redirect('#/home');\n })\n .catch(handler.handleError);\n }", "async registerUser(newUser) {\n try {\n await axios.post(\"api/register\", newUser);\n } catch (error) {\n this.registerError = true;\n this.registerSuccess = false;\n this.registerErrorReason = `error ${error.response.status}: ${error.response.data[\"message\"]}`;\n return;\n }\n\n this.registerSuccess = true;\n this.registerError = false;\n\n window.setTimeout(this.resetRegister, 1000);\n }", "function registerAndLogin(obj, cb) {\n fb.createUser(obj, function(err) {\n if (!err) {\n fb.authWithPassword(obj, function(err, auth) {\n if (!err) {\n cb(null, auth);\n } else {\n cb(err);\n }\n });\n } else {\n cb(err);\n }\n });\n }", "function registerUser(req, res) {\n\n // return console.log(errors)\n\n usermodel.User.create({\n fname: req.body.fname,\n lname: req.body.lname,\n email: req.body.email,\n password: req.hashvalue,\n img: req.body.image,\n role:\"user\",\n status: \"normal\"\n\n })\n .then(function(err, user) {\n\n res.status(200).send({ message: \"registered successfully\" })\n })\n .catch(function(err) {\n\n res.status(500).send({ message: err.message })\n })\n}", "registerUser(socket) {\n let users = this._users;\n let nick = \"\";\n let id = CollectionUtils.generateId(users);\n let hub = this._connection.hub;\n var user = Factory.createUser(hub, socket, nick, id);\n\n users.set(id, user);\n return user;\n }", "async create(req, res) {\n try {\n validateUser(req.body);\n await userRepository.create(req.body);\n res.json('User registered successfully.');\n } catch (err) {\n res.json({ err });\n }\n }", "function createUser(firstname, lastname, username, password) {\n let person = new UserSignUp(firstname, lastname, username, password);\n ajax(\"PUT\", \"/auth\", isCreateUserOk, person);\n}", "function userRegister(req, res) {\n User.find({ email: req.body.email })\n .exec()\n .then((users) => {\n if (users.length >= 0) {\n console.log(\"User with this email already exists\");\n } else {\n var today = new Date();\n\n const text = req.body.email + req.body.password + today;\n\n bcrypt.hash(text, 10, (err, hash) => {\n if (!hash) {\n res.status(500).json({ message: err.message });\n } else {\n const newUser = new User({\n //Storing a unique user ID\n user_id: new mongoose.Types.ObjectId(),\n //User's name\n name: req.body.name,\n //User's email.\n email: req.body.email,\n //User's address\n address: req.body.address,\n //password\n password: hash,\n // setting loggedin flag to 1\n loggedIn: true,\n });\n\n newUser\n .save()\n .then((user) => {\n res.status(201).json(\"Created\");\n })\n .catch((err) => {\n res.status(500).json({ message: err.message });\n });\n }\n });\n }\n });\n}", "async function signUp(name, email, phone, password, street, number, neighborhood, reference) {\n setLoadingAuth(true);\n await firebase.auth().createUserWithEmailAndPassword(email, password)\n .then( async (value) => {\n let uid = value.user.uid;\n await firebase.database().ref('users').child(uid).set({\n name: name,\n street: street,\n number: number,\n neighborhood: neighborhood,\n reference: reference,\n email: email,\n phone: phone\n })\n .then(() => {\n let data = {\n uid: uid,\n name: name,\n street: street,\n number: number,\n neighborhood: neighborhood,\n reference: reference,\n email: email,\n phone: phone\n };\n setUser(data);\n storageUser(data);\n setLoadingAuth(false);\n })\n .catch(() => {\n alert(error.code);\n setLoadingAuth(false);\n })\n })\n .catch(() => {\n alert(error.code);\n setLoadingAuth(false);\n })\n }", "async function registerUser (req,res) {\n const {fName,lName, email, password, role} =req.body;\n \n try{\n const userObj = {fName, lName, email, password, role : role || 'User'};\n const user = await User.create(userObj);\n console.log(user);\n let result = {\n status : \"success\",\n data: {\n user : user\n }\n }\n res.status(200).json(result);\n }catch (err){\n const errors = handleErrors(err);\n await res.status(400).json({ errors });\n }\n}", "function register(req, res) {\n var body = _.pick(req.body, ['email', 'name', 'password']);\n\n var user = new User(body);\n\n\n user.save().then(user => {\n return user.generateAuthToken();\n }).then(token => {\n res.header('x-auth', token).json({ user: user, token: token });\n }).catch(err => {\n console.log(err);\n if (err.name === 'ValidationError')\n res.status(500).send({ 'errorname': err.name, 'message': 'name must be filled' })\n else if (err.name == 'MongoError' && err.code == 11000)\n res.status(500).send({ 'errorname': err.name, 'message': err.errmsg, 'code': err.code })\n });\n\n}" ]
[ "0.8637759", "0.80544025", "0.7889753", "0.781563", "0.76923877", "0.755642", "0.7521202", "0.74518263", "0.7437121", "0.7423133", "0.7374457", "0.737361", "0.72567236", "0.72340685", "0.72155195", "0.71614724", "0.7154832", "0.7154334", "0.7154334", "0.7149961", "0.71461034", "0.7142732", "0.7123756", "0.7114047", "0.7105781", "0.70868057", "0.7078647", "0.70684326", "0.7064956", "0.70514876", "0.70505524", "0.7048222", "0.70462954", "0.703731", "0.70285195", "0.70241815", "0.7009876", "0.6986289", "0.6985949", "0.6983134", "0.6981509", "0.6980864", "0.69788295", "0.6977159", "0.6965217", "0.6955926", "0.6943979", "0.69401145", "0.69326425", "0.69127935", "0.68994546", "0.688776", "0.68702966", "0.68690145", "0.68687886", "0.6859959", "0.6857074", "0.68476343", "0.68406343", "0.6838729", "0.6826836", "0.6823039", "0.6817878", "0.68165624", "0.68059874", "0.68018204", "0.67976767", "0.6794903", "0.6768511", "0.6747242", "0.674332", "0.6738181", "0.6736136", "0.6736057", "0.67300844", "0.67291373", "0.6726158", "0.6702034", "0.66924274", "0.66924036", "0.66902333", "0.66838306", "0.66817164", "0.6677878", "0.6671925", "0.66717994", "0.66533387", "0.6652448", "0.6646151", "0.6645286", "0.66393405", "0.6638295", "0.6635712", "0.66311365", "0.6609562", "0.660382", "0.66013306", "0.66002315", "0.65999526", "0.6599909", "0.659228" ]
0.0
-1
DATA SOURCE This function is to get a list of data sources
static async getDataSourceList(email) { return new Promise((resolve, reject) => { Database.sendQuery('SELECT id,email,sourceurl,sourcetype,sourcename,islivedata FROM datasource WHERE ( email = $1);', [email]) .then((result) => resolve(result.rows)) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findDynamicSources()\r\n{\r\n var retList = new Array();\r\n\r\n var siteURL = dw.getSiteRoot()\r\n\r\n if (siteURL.length)\r\n {\r\n var bindingsArray = dwscripts.getListValuesFromNote(siteURL, \"URL\");\r\n if (bindingsArray.length > 0)\r\n {\r\n retList.push(new DataSource(MM.LABEL_URL, \r\n URL_FILENAME, \r\n false, \r\n \"URL.htm\"))\r\n }\r\n }\r\n\r\n return retList;\r\n}", "function getSources() {\n return query(\n `SELECT id, name\n FROM source\n WHERE deleted_at IS NULL\n ORDER BY name;`\n );\n}", "function lsDataSources() {\n var ext = constants.DB_EXTENSION;\n var chosen = getDataSource();\n lsPretty(ext, chosen, \"database\");\n}", "function dwscripts_getDataSourcesByFileName(dsFileName)\n{\n var retList = new Array();\n\n //ask dreamweaver for the list of data sources\n var dsList = dw.dbi.getDataSources();\n \n for (var i=0; i < dsList.length; i++) \n {\n if (!dsFileName || dsList[i].dataSource == dsFileName)\n {\n retList.push(dsList[i]);\n }\n }\n \n return retList;\n}", "function listDatasources() {\n let theUrl = `/api/v${apiVersion}/datasources`;\n let request = $http({\n url: theUrl,\n method: \"GET\"\n });\n return request;\n }", "function dwscripts_getDataSourceNodes(dataSource)\n{\n var retVal = new Array();\n \n var serverModelFolder = dw.getDocumentDOM().serverModel.getFolderName();\n\n //get the dom of the data source\n var dsDOM = dreamweaver.getDocumentDOM(dreamweaver.getConfigurationPath() + \"/DataSources/\" + serverModelFolder + \"/\" + dataSource.dataSource);\n\n //call the generateDynamicSourceBindings function\n if (dsDOM) \n {\n objList = dsDOM.parentWindow.generateDynamicSourceBindings(dataSource.title);\n \n if (objList && objList.length) \n {\n retVal = objList;\n }\n }\n \n return retVal;\n}", "function dwscripts_getDataSourcesForSB(sbFileName)\n{\n var retList = new Array();\n\n //ask dreamweaver for the list of data sources\n var dsList = dw.dbi.getDataSources();\n \n // fixed bug: 229493 \n if (dsList)\n {\n if (sbFileName) // limit the list to datasources which support the given SB\n {\n //get the list of groups which reference this server behavior \n var brList = dw.getExtGroups(sbFileName, \"serverBehavior\");\n \n //for each data source, check if a group file exists for it\n for (var i=0; i < dsList.length; i++) \n {\n for (var j = 0; j < brList.length; j++) \n {\n var dsSource = dw.getExtDataValue(brList[j],\"dataSource\");\n \n if ((dsSource && (dsSource == dsList[i].dataSource || dsSource == \"*\")) ||\n (!dsSource && dsList[i].dataSource == \"Recordset.htm\"))\n {\n retList.push(dsList[i]);\n break;\n }\n }\n }\n }\n else\n {\n for (var i=0; i < dsList.length; i++) \n {\n retList.push(dsList[i]);\n }\n }\n }\n \n return retList;\n}", "function getDataSources(callback) {\n if (dataCache) {\n callback(dataCache);\n return;\n }\n if (dataCallbacks) {\n dataCallbacks.push(callback);\n return;\n }\n\n function finish(data) {\n dataCache = data.length ? data : [{\n id: \"\",\n uri: \"\",\n path: \"\",\n name: \"Not Found\",\n structure: {}\n }];\n _.each(dataCallbacks, function (callback) {\n callback(dataCache);\n });\n dataCallbacks = null;\n }\n dataCallbacks = [callback];\n if (dataSourcesEndpoint) {\n if (_.isString(dataSourcesEndpoint)) {\n $.ajax({\n type: 'GET',\n url: dataSourcesEndpoint,\n dataType: 'json',\n success: finish,\n error: function (jqXHR, errorType, exc) {\n finish([]);\n window.console.log(util.formatExc(exc || errorType));\n },\n data: {}\n });\n } else {\n dataSourcesEndpoint(finish);\n }\n } else {\n finish([]);\n }\n }", "dataSource(data, widgetConfig) {\n let config = widgetConfig.split(' ')[1],\n random = config.split('_')[1],\n source = {\n id: widgetConfig,\n type: 'Componentsmdx_mondrianJndi',\n typeDesc: 'mondrianJndi',\n parent: 'UnIqEiD',\n properties: [],\n meta: 'CDA',\n meta_conntype: 'mondrian.jndi',\n meta_datype: 'mdx'\n },\n sourceName = $('.' + config + ' .sourceName')[0].value,\n jndi = $('.' + config + ' .sourceConnect')[0].value,\n cubes = $('.' + config + ' .dataCubes')[0].value,\n query = $('.' + config + ' .sqlStatement')[0].value,\n queryType = $('.' + config + ' .queryType')[0].value,\n stringCubes = 'mondrian:/',\n catalog = (queryType === 'mdx') ? stringCubes + cubes : cubes;\n let dataRows = {\n name: sourceName,\n jndi: jndi,\n access: 'pubilc',\n catalog: catalog,\n query: query,\n bandedMode: 'compact',\n parameters: [],\n cdacalculatedcolumns: [],\n cdacolumns: [],\n output: [],\n outputMode: 'include',\n cacheKeys: [],\n cacheDuration: 3600,\n cache: true\n };\n\n d3.entries(dataRows).map(d=>{\n let row = {\n 'name': d.key,\n 'value': d.value\n };\n\n source.properties.push(row);\n });\n data.push(source);\n this.chartDataSource(data, sourceName, random);\n this.dataSourceNames.push(sourceName);\n this.selectDataSource(data, sourceName, random);\n return source;\n }", "function refreshSourceDatas() {\n sourceDataService.findSourceData(\"\").then(\n // Success\n function(response) {\n sourceDatas = response.sourceDatas;\n refreshSourceDataTable();\n });\n }", "function createDatasourcesList(queriesDatasources) {\n var exploreDatasources = Object(_features_explore_state_selectors__WEBPACK_IMPORTED_MODULE_4__[\"getExploreDatasources\"])();\n var datasources = [];\n queriesDatasources.forEach(function (queryDsName) {\n var index = exploreDatasources.findIndex(function (exploreDs) {\n return exploreDs.name === queryDsName;\n });\n\n if (index !== -1) {\n datasources.push({\n label: queryDsName,\n value: queryDsName,\n imgUrl: exploreDatasources[index].meta.info.logos.small,\n isRemoved: false\n });\n } else {\n datasources.push({\n label: queryDsName,\n value: queryDsName,\n imgUrl: 'public/img/icn-datasource.svg',\n isRemoved: true\n });\n }\n });\n return datasources;\n}", "get sources() {\n const sources = []\n for (let i = 0; i < this._sections.length; i++) {\n for (let j = 0; j < this._sections[i].consumer.sources.length; j++) {\n sources.push(this._sections[i].consumer.sources[j])\n }\n }\n return sources\n }", "function getDatasourceList() {\n homeService.getDatasourceList().then(function(response) {\n console.log(response);\n if(response.status === 200) {\n angular.copy(self.datasourceList, self.datasourceList);\n }\n else{\n console.log(\"Error: \" + response.data);\n }\n });\n }", "function getDataSets (mapSource, dataSource) {\n queue()\n .defer(d3.json, mapSource)\n .defer(d3.csv, dataSource)\n .await(ready);\n }", "function grepDatasource() {\r\n var data = [];\r\n if (opts.dataSource != null) {\r\n data = jQuery.grep(opts.dataSource, function(d, index) {\r\n return (index >= opts.actualPage * opts.recordCount && index < (opts.actualPage * opts.recordCount) + opts.recordCount);\r\n });\r\n }\r\n return data;\r\n }", "function getSources(){\n\taxios.get(\"https://newsapi.org/v1/sources?language=en\")\n\t.then((response) => {\n\t\tlet sources = response.data.sources;\n\t\t// sourceList.push(sources);\n\t\t// console.log(sourceList);\n\t\tfor (let i = 0; i < sources.length; i++) {\n\t\t\t// let opt = sources[i].name + sources[i].id;\n\t\t\t// idList.push(sources[i].id);\n\t\t\tlet el = document.createElement(\"option\");\n\t\t\t\tel.textContent = sources[i].name;\n\t\t\t\tel.value = sources[i].id;\n\t\t\t\tselect[0].appendChild(el);\n\t\t}\n\t})\n}", "_bindDataSources () {\n // concurrently, for each data source run 'bindDataSource'\n return Promise.all(Object.keys(this._dataSources).map(source => {\n return this._bindDataSource(source)\n }));\n }", "function listSourceFilters() {\n const requestOptions = {\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n };\n\n const handleResponse = response => response.json().then((data) => {\n if (!response.ok) {\n const error = (data && data.email);\n return Promise.reject(error);\n }\n\n return data;\n });\n\n return fetch(`${apiUrl}/sources/`, requestOptions)\n .then(handleResponse)\n .then(sourceFilters => sourceFilters);\n}", "getCoffeeSources() {\r\n\t\r\n }", "function dwscripts_getDataSourceNames(arrayOfDataSourceNodes)\n{\n var retVal = new Array();\n \n if (arrayOfDataSourceNodes != null)\n { \n for (var i=0; i < arrayOfDataSourceNodes.length; i++)\n {\n if (arrayOfDataSourceNodes[i].name) \n {\n retVal.push(arrayOfDataSourceNodes[i].name);\n } \n else \n {\n retVal.push(arrayOfDataSourceNodes[i].title);\n }\n }\n }\n\n return retVal;\n}", "function dwscripts_getDataSourceTypes(arrayOfDataSourceNodes)\n{\n var retVal = new Array();\n \n if (arrayOfDataSourceNodes != null)\n {\n for (var i=0; i < arrayOfDataSourceNodes.length; i++)\n {\n retVal.push(arrayOfDataSourceNodes[i].dataSource);\n }\n }\n \n return retVal;\n}", "function getSources() {\n MediaStreamTrack.getSources(function(sources) {\n returnToTest(JSON.stringify(sources));\n });\n}", "function dwscripts_getFieldNames(dataSourceName)\n{\n var retVal = new Array();\n \n // Use the Server Model version if it exists\n var serverObj = dwscripts.getServerImplObject();\n \n if (serverObj != null && serverObj.getFieldNames != null)\n {\n retVal = serverObj.getFieldNames(dataSourceName);\n }\n else\n { \n // handle prior versions\n if (serverObj != null && serverObj.getColumnNames != null)\n {\n var dsList = serverObj.getColumnNames(dataSourceName);\n\n // findAllColumnNames returns data source objects, convert to strings\n for (var i=0; i < dsList.length; i++)\n {\n retVal.push(dsList[i].title);\n }\n }\n \n if (retVal == null || retVal.length == 0)\n {\n var serverModelFolder = dw.getDocumentDOM().serverModel.getFolderName();\n\n //ask dreamweaver for the list of data sources\n var dsList = dw.dbi.getDataSources();\n\n //find the data source with the given name\n for (var i=0; i < dsList.length; i++) \n {\n if (dsList[i].name == dataSourceName || dsList[i].title == dataSourceName) \n {\n var dataSource = dsList[i].dataSource;\n\n //get the dom of the data source\n var dsDOM = dreamweaver.getDocumentDOM(dreamweaver.getConfigurationPath() + \"/DataSources/\" + serverModelFolder + \"/\" + dataSource);\n\n //call the generateDynamicSourceBindings function\n if (dsDOM) \n {\n objList = dsDOM.parentWindow.generateDynamicSourceBindings(dsList[i].title);\n if (objList && objList.length) \n {\n for (var j=0; j < objList.length; j++) \n {\n retVal.push(objList[j].title);\n }\n }\n }\n\n break;\n }\n }\n }\n }\n \n // Remove the statistics from the list\n for (var i=retVal.length-1; i >= 0; i--)\n {\n var value = retVal[i];\n if (value == MM.LABEL_FirstRecordIndex ||\n value == MM.LABEL_LastRecordIndex ||\n value == MM.LABEL_TotalRecordIndex)\n {\n retVal.splice(i,1);\n }\n }\n \n return retVal;\n}", "function getSources() {\n var checkboxes = document.getElementsByName('source');\n for (var i = 0; i < checkboxes.length; i++) {\n if (checkboxes[i].checked) {\n sources.push(checkboxes[i].id);\n }\n }\n}", "function generateDynamicSourceBindings(sourceName)\r\n{\r\n var retVal = new Array();\r\n\r\n var siteURL = dw.getSiteRoot();\r\n\r\n //For localized object name\r\n if (sourceName != \"URL\")\r\n {\r\n sourceName = \"URL\";\r\n }\r\n\r\n if (siteURL.length)\r\n {\r\n var bindingsArray = dwscripts.getListValuesFromNote(siteURL, sourceName);\r\n retVal = getDataSourceBindingList(bindingsArray, \r\n DATASOURCELEAF_FILENAME,\r\n true,\r\n \"URL.htm\");\r\n }\r\n\r\n return retVal;\r\n}", "function configDatasourceList(datasources) {\n var showAssetNameInLegend = datasources\n .map(function (item) {\n var path = item.Path || item.PersistPath || item;\n return path.substr(0, path.indexOf('|')) || path;\n }).filter(function (element, index, array) {\n // Remove duplicates\n return array.indexOf(element) === index;\n }).length !== 1;\n\n return datasources.map(function (path) {\n var item = PV.Utils.parsePath(path);\n var label = item.label;\n return {\n label: showAssetNameInLegend ? label : label.substr(label.indexOf('|') + 1),\n path: item.fullPath\n };\n });\n }", "function get_sources (da_object) {\n\tconst download_url = (() => {\n\t\tconst download = da_object.deviation.extended.download;\n\t\tif (download) {\n\t\t\treturn [[download.url, 'download']];\n\t\t} else {\n\t\t\treturn [];\n\t\t}\n\t})();\n\n\tconst other_sources = [\n\t\t[makeDALink(da_object, 'fullview', true), 'large view 100'],\n\t\t[makeDALink(da_object, 'fullview', false), 'large view'],\n\t\t[makeDALink(da_object, 'social_preview', true), 'social preview 100'],\n\t\t[makeDALink(da_object, 'social_preview', false), 'social preview'],\n\t\t[makeDALink(da_object, 'preview', true), 'preview 100'],\n\t\t[makeDALink(da_object, 'preview', false), 'preview']\n\t];\n\n\treturn download_url\n\t\t.concat(other_sources)\n\t\t.filter(e => e[0])\n\t\t.filter(e => e[0] !== 'https://st.deviantart.net/misc/noentrythumb-200.png')\n\t\t.filter((e, i, a) => i === a.findIndex(p => p[0] === e[0]));\n}", "_getDataSource() {\n const that = this,\n dataSource = [];\n\n function recursion(children, itemsArray) {\n for (let i = 0; i < children.length; i++) {\n const currentChild = children[i],\n dataSourceItem = { label: currentChild.label };\n\n if (currentChild.disabled) {\n dataSourceItem.disabled = true;\n }\n\n if (currentChild.selected) {\n dataSourceItem.selected = true;\n }\n\n if (currentChild.separator) {\n dataSourceItem.separator = true;\n }\n\n if (currentChild.value !== null) {\n dataSourceItem.value = currentChild.value;\n }\n\n if (currentChild instanceof JQX.TreeItem) {\n if (currentChild.shortcut) {\n dataSourceItem.shortcut = currentChild.shortcut;\n }\n }\n else {\n if (currentChild.expanded) {\n dataSourceItem.expanded = true;\n }\n\n dataSourceItem.items = [];\n recursion(currentChild.itemContainer.children, dataSourceItem.items);\n }\n\n itemsArray.push(dataSourceItem);\n }\n }\n\n recursion(that.$.mainContainer.children, dataSource);\n\n return dataSource;\n }", "initialize() {\n for (const ds of this.dataSources) {\n ds.visit((node) => node.initialize());\n }\n }", "function sources(){ // get all sources using existing session\n\treturn Promise.all([cookies, targetCollector]).then(function(args){\n\t\tvar cookies = args[0],\n\t\t collector = args[1],\n\t\t url = \"https://\"+apiUrl+\"collectors/\"+collector.id+\"/sources?limit=\"+pageLimit+\"&offset=0\",\n\t\t headers = new (fetch.Headers)()\n\t\tfor(var i in cookies){\n\t\t\theaders.append(\"cookie\", cookies[i])\n\t\t}\n\t\treturn fetch(url, {headers})\n\t})\n}", "function combineDataFromMultipleDataSources(aSources) {\n\t\treturn aSources[0].concat(aSources[1]).concat(aSources[2]).concat(aSources[3]);\n\t}", "function AbstractDataSource() {}", "_getData(source) {\n return __awaiter(this, void 0, void 0, function* () {\n let data;\n try {\n if (source.startsWith('{')) {\n data = JSON.parse(source);\n }\n else if (source.startsWith('/') ||\n source.match(/^https?\\:\\/\\//)) {\n data = yield fetch(source).then((response) => response.json());\n }\n else {\n const $template = document.querySelector(`template#${source}, template${source}`);\n if ($template) {\n // @ts-ignore\n data = JSON.parse($template.content.textContent);\n }\n }\n }\n catch (e) { }\n // warn if no data\n if (!data) {\n throw new Error(`[SCarpenterAppComponent] The passed source \"${source}\" does not provide any valid data...`);\n }\n // filter the \"ghosts\"\n if (!this.props.ghostSpecs && data.specs) {\n data.specs = __filterObject(data.specs, (key, item) => {\n return !item.ghost;\n });\n }\n data.specsByTypes = {};\n for (let [namespace, specObj] of Object.entries(data.specs)) {\n const parts = namespace.split('.');\n let type;\n parts.forEach((part) => {\n if (type)\n return;\n if (part !== 'views') {\n type = part;\n }\n });\n if (!data.specsByTypes[type]) {\n data.specsByTypes[type] = {};\n }\n data.specsByTypes[type][namespace] = specObj;\n }\n return data;\n });\n }", "get dataSource() {\n\t\treturn this.nativeElement ? this.nativeElement.dataSource : undefined;\n\t}", "get dataSource() {\n\t\treturn this.nativeElement ? this.nativeElement.dataSource : undefined;\n\t}", "function dwscripts_popupDataSource(dsFileName, argument)\n{\n // call the addDynamicSource function in the given file\n var configDir = dw.getConfigurationPath();\n var dom = dw.getDocumentDOM();\n var smDir = dom.serverModel.getFolderName();\n var fullPath = configDir + \"/DataSources/\" + smDir + \"/\" + dsFileName;\n if (dwscripts.fileExists(fullPath))\n {\n var dsDOM = dw.getDocumentDOM(fullPath);\n if (dsDOM)\n {\n var parentWin = dsDOM.parentWindow;\n if (parentWin.addDynamicSource != null)\n {\n parentWin.addDynamicSource(argument);\n \n // Refresh the list of Data Sources\n \n // In order to force a refresh of the dataSources\n // we need to clear the dataSources property on\n // the current documents window.\n \n if (dom.parentWindow)\n {\n dom.parentWindow.dataSources = null;\n dw.dbi.getDataSources();\n }\n }\n }\n }\n}", "get dataSource() {\n return this.i.jr;\n }", "function readSource(source) {\n\t\tthis.sourceList = [];\n var tempSource = source.split(\"\\n\");\n\t\ttry {\n for(i=0; i<tempSource.length; i++){\n sourceList.push(tempSource[i]);\n }\n\t\t} catch (err) {\n\t\t\tconsole.log(err);\n\t\t}\n\t\treturn;\n\t}", "get dataSource() {\n return this._dataSource;\n }", "get dataSource() {\n return this._dataSource;\n }", "function resolve_sources(srcs) {\n if (_.isArray(srcs)) {\n return srcs.map(this.resolve_src).reduce((memo, i) => memo.concat(i), []);\n } else if (_.isString(srcs)) {\n return _.map(srcs.split(','), subsrc => this.resolve_src(subsrc.trim()));\n } else if (jt.instance_of(srcs, '$Collection.$Timestep.SrcType')) { // nested indicator\n return this.resolve_src(srcs);\n } else if (_.isEmpty(srcs)) {\n return [];\n } else {\n throw new Error('Unexpected type given for \"sources\": ' + JSON.stringify(srcs));\n }\n }", "loadDataSource(...args) {\n if (args.length === 1) {\n return this._loadLegacyDataSource(args[0])\n }\n if (args.length === 3) {\n lbs.log.warn(`[Deprecation] Data source '${args[1].type}' is being used in a legacy way! Change to passing one parameter and expecting a return value`)\n return this._loadLegacyDataSourceLegacy(args[0], args[1], args[2])\n }\n return null\n }", "function getSources(existingSources, graph) {\n var sources = [];\n\n $.each(graph.vertices, function () {\n if (graph.adjacencyList[this.number].neighborsOut.length > 0 && graph.adjacencyList[this.number].neighborsIn.length === 0) {\n if (!alreadyExist(existingSources, this))\n sources.push(this);\n }\n });\n\n return sources;\n}", "function availableSources(kind) {\t\n var sources = $.Sources[kind];\n return _.compact(_.map(sources, function(source) {\n //if (source.available) return sourceMapping(source);\n \treturn sourceMapping(source);\n }));\n }", "compareSources(compareSource) {\n let data = [];\n for (let source in sourceArray) {\n if (sourceArray[source].id === compareSource) {\n data.push(sourceArray[source].name, sourceArray[source].url);\n return data;\n }\n }\n}", "lookupDataSource(name) {\n const node = this.component.data.outputNodes[name];\n if (!node) {\n // Name not found in map so let's just return what we got.\n // This can happen if we already have the correct name.\n return name;\n }\n return node.getSource();\n }", "getDatasource(competences){\n let {dataBlob, sectionIDs, rowIDs} = this.competencesToView(competences);\n return this.state.dataSource.cloneWithRowsAndSections(dataBlob, sectionIDs, rowIDs);\n }", "function getConnectors() {\n for (var i = 0; i < sources.length; i++) {\n connectorAPIs.push(connectorManager.getConnector(sources[i]));\n }\n}", "function getActiveSources(bases) {\n var sources = [];\n bases.forEach((base) => {sources = sources.concat(base.getSources())});\n return sources;\n}", "function listObjects(dsName, queryParams) {\n let deferred = $q.defer();\n\n if (dsName && dsName.length) {\n let theUrl = `/api/v${apiVersion}/datasources/${dsName}`;\n //Add queryParams to url\n if (queryParams && queryParams.length) {\n queryParams.forEach((param, i) => {\n theUrl = (i == 0 ? theUrl + \"?\" : theUrl + \"&\");\n theUrl += `${param.name}=${param.value}`;\n });\n }\n\n $http({\n url: theUrl,\n method: \"GET\"\n }).then((response) => {\n deferred.resolve(response);\n }).catch((error) => {\n deferred.reject(error);\n });\n } else {\n deferred.reject(\"No datasource name provided\");\n }\n\n return deferred.promise;\n }", "function getAllSources() {\r\n\t$.ajax({\r\n\t\ttype: \"GET\",\r\n\t\turl: \"/getAllSources\",\r\n\t\tsuccess: function(response) {\r\n\t\t\tsources = response[\"sources\"]\r\n\t\t\taddSourcesToView(sources)\r\n\t\t},\r\n\t\terror: function(chr) {\r\n\t\t \tconsole.log(\"Error!\")\r\n\t\t}\r\n\t});\r\n}", "function resolve_data_source(element, name) { // 246\n\tvar fn = resolve_template_function(element, name); // 247\n\tif ($.isFunction(fn)) { // 248\n\t\treturn fn; // 249\n\t} // 250\n // 251\n\t// collection.name // 252\n\tvar path = name.split('.'); // 253\n\tif (path.length > 0) { // 254\n\t\tvar collection = find_collection(path[0]); // 255\n\t\tif (collection) { // 256\n\t\t\tvar property = path.length > 1 ? path[1] : \"\"; // 257\n\t\t\treturn function() { // 258\n\t\t\t\treturn collection.find().fetch() // 259\n\t\t\t\t\t.map(function(it) { // 260\n\t\t\t\t\t\tvar value = property ? it[property] : it.name || it.title; // 261\n\t\t\t\t\t\t// wrap to object to use object id in selected event handler // 262\n\t\t\t\t\t\treturn value ? {value: value, id: it._id} : \"\"; // 263\n\t\t\t\t\t}) // 264\n\t\t\t\t\t.filter(identity); // 265\n\t\t\t}; // 266\n\t\t} // 267\n\t} // 268\n // 269\n\tconsole.log(\"Unable to resolve data source function '%s'.\", name); // 270\n\treturn []; // 271\n} // 272", "function getSourceDataList(el, response) {\n if (el.settings.sourceObject.settings.aggregation) {\n // Aggregated data so use the buckets.\n return indiciaFns.findValue(response.aggregations, 'buckets');\n }\n // A standard list of records.\n return response.hits.hits;\n }", "setDataSource() { // OK\n\t\tconst result = [];\n\n\t\tfor (let i = 0; i < this.totalAds; i++) {\n\t\t\tresult.push(i);\n\t\t}\n\t\tthis.dataSource = result;\n\t}", "async function loadSources() {\n let res = await fetch(\"./sources.json\");\n let json = await res.json();\n return json;\n}", "function findSourceResources(aSelectorFn) {\n result=[];\n //print(ttl + \"..findSourceResources() \" + \"from settings.svrURL: \" + settings.svrURL + \"/@resources\\n\" +\n // \"...using settings.intToken: \" + JSON.stringify(settings.intToken));\n var resourceNamesString = listenerUtil.restGet(\n settings.svrURL + \"/v1/@resources\", null, settings.intToken);\n var resourceNames = JSON.parse(resourceNamesString);\n // print(ttl + \"..resourceNames[]: \" + JSON.stringify(resourceNames));\n for (var i = 0 ; i < resourceNames.length ; i++) {\n var eachResourceSummary = resourceNames[i];\n var eachResourceDef = common_iPack_util.getResourceNamed(eachResourceSummary.name);\n var extProps = eachResourceDef.extendedProperties;\n var hasExtProps = extProps && 'object' === typeof extProps && ! Array.isArray(extProps);\n var syncProps = null;\n if (hasExtProps) {\n syncProps = extProps[settings.sourceResourceExtPropName];\n }\n // on post to ProcessRequestResource, store json into SystemQueue, for async processing via timer\n if (syncProps !== null && typeof syncProps !== 'undefined') {\n if (aSelectorFn(eachResourceDef))\n result.push(eachResourceDef);\n } else {\n // print(ttl + \" not processed: \" + JSON.stringify(eachResourceDef));\n }\n }\n return result;\n}", "get sources() {\n var source = this.sourceRepo;\n var local = this.localSource;\n var system = this.systemSource;\n\n var root = path.join(this.baseDir, \"savers\");\n \n var folders = [];\n\n // if we're pulling savers from a git repo, this is where\n // they will be located\n if ( source !== undefined && source !== \"\" ) {\n folders.push(root);\n }\n\n // if there's a local source, use that\n if ( local !== \"\" && fs.existsSync(local)) {\n folders = folders.concat( local );\n }\n\n \n folders = folders.concat( system );\n\n return folders;\n }", "function get_sources_id(token){\n request.get({\n url:'http://172.16.2.140:8386/v1.1/109d5a0fef34423582747e609b8c6c0f/data-sources',\n headers: {\n 'Content-Type':'application/json',\n 'X-Auth-Token' : token\n }\n \n },(err,response,body)=>{\n if(err){\n console.log(err);\n }\n var res = JSON.parse(body);\n var input_ds_id,output_ds_id;\n for( var data_source of res.data_sources ){\n if(data_source.name == \"input-ds\"){\n input_ds_id = data_source.id;\n }\n if(data_source.name == \"output-ds\"){\n output_ds_id = data_source.id;\n }\n }\n console.log(input_ds_id);\n console.log(output_ds_id);\n \n });\n}", "addSource(source) {\n this._data.source = source;\n }", "function loadExploreDatasourcesAndSetDatasource(exploreId, datasourceName) {\n return (\n /*#__PURE__*/\n function () {\n var _ref3 = _asyncToGenerator(\n /*#__PURE__*/\n regeneratorRuntime.mark(function _callee2(dispatch) {\n var exploreDatasources;\n return regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n exploreDatasources = Object(_selectors__WEBPACK_IMPORTED_MODULE_16__[\"getExploreDatasources\"])();\n\n if (!(exploreDatasources.length >= 1)) {\n _context2.next = 7;\n break;\n }\n\n _context2.next = 4;\n return dispatch(changeDatasource(exploreId, datasourceName, {\n importQueries: true\n }));\n\n case 4:\n dispatch(runQueries(exploreId));\n _context2.next = 8;\n break;\n\n case 7:\n dispatch(Object(_actionTypes__WEBPACK_IMPORTED_MODULE_9__[\"loadDatasourceMissingAction\"])({\n exploreId: exploreId\n }));\n\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n\n return function (_x3) {\n return _ref3.apply(this, arguments);\n };\n }()\n );\n}", "function find_source(county, data_type, headings, data){\n var crime = ['incidents', 'arrests', 'accidents', 'citations']\n , agencyIndex\n , source;\n var others = {\n 'realestate': ' County Tax Office',\n 'property': ' County Tax Office',\n 'health': ' County Health Department',\n 'voter': 'N.C. Board of Elections'\n }\n if (crime.indexOf(data_type) !== -1) {\n headings.forEach(function(heading) {\n if(heading.label === 'Agency') {\n agencyIndex = heading.index;\n }\n \n });\n var agencies = [];\n data.forEach(function(row) {\n if (agencies.indexOf(row.c[agencyIndex].v) < 0) {\n agencies.push(row.c[agencyIndex].v);\n }\n });\n source = agencies.sort().join(\", \");\n }\n else {\n source = county.toUpperCase() + others['data_type'];\n }\n return source;\n }", "function initDataSources() {\n vm.init = true;\n\n try {\n var type = REST_URI.TEIID_SERVICE;\n\n RepoRestService.getConnections(type).then(\n function (newDataSources) {\n RepoRestService.copy(newDataSources, vm.datasources);\n vm.init = false;\n },\n function (response) {\n // Some kind of error has occurred\n vm.datasources = [];\n vm.init = false;\n DialogService.basicInfoMsg(\"Failed to initialse connections from teiid.\\n\" + RepoRestService.responseMessage(response),\n \"Failure to retrieve connections\");\n });\n } catch (error) {\n vm.datasources = [];\n vm.init = false;\n DialogService.basicInfoMsg(\"Failed to initialse connections from teiid.\\n\" + RepoRestService.responseMessage(error),\n \"Failure to retrieve connections\");\n }\n\n // Removes any outdated datasource\n vm.datasource = null;\n }", "getDataUrls(spec) {\n let dataUrls = [];\n if (spec === undefined) {\n return dataUrls; // base case\n }\n const data = spec['data'];\n const transforms = spec['transform'];\n let layers = [];\n layers = layers.concat(spec['layer']);\n layers = layers.concat(spec['concat']);\n layers = layers.concat(spec['hconcat']);\n layers = layers.concat(spec['vconcat']);\n if (data !== undefined) {\n // get top level data references\n if (Array.isArray(data)) {\n data.filter(d => d['url'] !== undefined).forEach(d => {\n dataUrls.push(d['url']);\n });\n }\n else if (data['url'] !== undefined) {\n dataUrls.push(data['url']);\n }\n }\n if (layers !== undefined && Array.isArray(layers)) {\n // get layers data references\n layers.forEach(layer => {\n dataUrls = dataUrls.concat(this.getDataUrls(layer));\n });\n }\n if (transforms !== undefined) {\n // get transform data references\n transforms.forEach(transformData => {\n dataUrls = dataUrls.concat(this.getDataUrls(transformData['from']));\n });\n }\n return dataUrls;\n }", "getDataSource(dataSourceName) {\n return this.dataSource.get(dataSourceName);\n }", "getData(spec) {\n const dataFiles = {};\n // get top level data urls\n let dataUrls = this.getDataUrls(spec);\n // add nested spec data urls for view compositions (facets, repeats, etc.)\n dataUrls = dataUrls.concat(this.getDataUrls(spec['spec']));\n this._logger.logMessage(logger_1.LogLevel.Debug, 'getData(): dataUrls:', dataUrls);\n // get all local files data\n dataUrls.forEach(dataUrl => {\n if (dataUrl.startsWith('http://') || dataUrl.startsWith('https://')) {\n // add remote data source reference\n dataFiles[dataUrl] = dataUrl;\n }\n else {\n // get local file data\n const fileData = this.getFileData(dataUrl);\n if (fileData) {\n dataFiles[dataUrl] = fileData;\n }\n this._logger.logMessage(logger_1.LogLevel.Debug, 'getData(): localDataUrl:', dataUrl);\n }\n });\n return dataFiles;\n }", "[loadAllSource]() {\n let ret = [];\n let test = {};\n // dump static html files\n let sopt = this[config].format({\n flag: false,\n dir: 'DIR_SOURCE',\n sub: 'DIR_SOURCE_SUB'\n });\n ret.push(...this[loadSource](sopt,test));\n // dump server template files\n let topt = this[config].format({\n flag: true,\n dir: 'DIR_SOURCE_TP',\n sub: 'DIR_SOURCE_TP_SUB'\n });\n ret.push(...this[loadSource](topt,test));\n // ensure all resource loaded\n Promise.all(ret).then(() => {\n this.emit('done');\n });\n }", "function getImageSources() {\n var ids = [\n '0001', '0002', '0003', '0004', '0005', '0006', '0007',\n '0008', '0009', '0010', '0011', '0012', '0013', '0014'\n ];\n return ids.map(function(name){\n return 'http://localhost:8000/images/' + name + '.JPG';\n })\n}", "function getAllSourcesAndTweet(){\n\tvar sources = [];\n\tconsole.log('getting sources...')\n\trequest({\n\t\t\turl: 'https://newsapi.org/v2/sources?apiKey=YOUR_NEWS_API_KEY',\n\t\t\t\tmethod: 'GET'\n\t\t},\n\t\tfunction (error, response, body) {\n\t\t\t//response is from the bot\n\t\t\tif (!error && response.statusCode == 200) {\n\t\t\t\t// Print out the response body\n\t\t\t\tvar botResponse = JSON.parse(body);\n\t\t\t\tfor (var i = 0; i < botResponse.sources.length;\n\t\t\t\t\ti++){\n\t\t\t\t\tconsole.log('adding.. ' +\n\t\t\t\t\t\tbotResponse.sources[i].id)\n\t\t\t\t\tsources.push(botResponse.sources[i].id)\n\t\t\t\t}\n\t\t\t\ttweetFromRandomSource(sources, null, null);\n\t\t\t} else {\n\t\t\t\tconsole.log('Sorry. No news sources!');\n\t\t\t}\n\t\t});\n}", "function assembleRootData(dataComponent, datasets) {\n var roots = vals(dataComponent.sources);\n var data = [];\n // roots.forEach(debug);\n var walkTree = makeWalkTree(data);\n var sourceIndex = 0;\n roots.forEach(function (root) {\n // assign a name if the source does not have a name yet\n if (!root.hasName()) {\n root.dataName = \"source_\" + sourceIndex++;\n }\n var newData = root.assemble();\n walkTree(root, newData);\n });\n // remove empty transform arrays for cleaner output\n data.forEach(function (d) {\n if (d.transform.length === 0) {\n delete d.transform;\n }\n });\n // move sources without transforms (the ones that are potentially used in lookups) to the beginning\n var whereTo = 0;\n for (var i = 0; i < data.length; i++) {\n var d = data[i];\n if ((d.transform || []).length === 0 && !d.source) {\n data.splice(whereTo++, 0, data.splice(i, 1)[0]);\n }\n }\n // now fix the from references in lookup transforms\n for (var _i = 0, data_1 = data; _i < data_1.length; _i++) {\n var d = data_1[_i];\n for (var _a = 0, _b = d.transform || []; _a < _b.length; _a++) {\n var t = _b[_a];\n if (t.type === 'lookup') {\n t.from = dataComponent.outputNodes[t.from].getSource();\n }\n }\n }\n // inline values for datasets that are in the datastore\n for (var _c = 0, data_2 = data; _c < data_2.length; _c++) {\n var d = data_2[_c];\n if (d.name in datasets) {\n d.values = datasets[d.name];\n }\n }\n return data;\n }", "function mapSource() {\n\t\n\tlet dataSelect = selectedSSP;\n\tconsole.log('New scenario: ' + selectedSSP.toLowerCase());\n\n\t// Fly to interesting location according to the selected model\n\tmap.flyTo({\n center: [85, 20],\n\t\tzoom: 4\n });\n\t\n\n\t// Add source\n\tmap.addSource(\"earthquakes\", {\n\t\ttype: \"geojson\",\n\t\tdata: \"data_\" + dataSelect.toLowerCase() + \".geojson\",\n\t\t//data: _data,\n\t\tcluster: false, // Set to true to sow clusters of points\n\t\tclusterMaxZoom: 6, // Max zoom to cluster points on\n\t\tclusterRadius: 10 // Radius of each cluster when clustering points (defaults to 50)\n\t});\n\n\tconsole.log('Data file ==> ' + \"data_\" + dataSelect.toLowerCase() + \".geojson\");\n}", "function loadDataSources(that) {\n function finish(data) {\n that.cache = {sources: data.length ? data : [{\n id: \"\",\n uri: \"\",\n path: \"\",\n name: gettext(\"Not Found\"),\n structure: {}\n }]};\n that.loading = false;\n that.fire(\"change\");\n }\n\n function onError(jqXHR, errorType, error) {\n that.fire({\n type: \"error\",\n xhr: jqXHR,\n errorType: errorType,\n error: error,\n });\n window.console.log(util.formatExc(error || errorType));\n if (that.retryTimeout < 8001) { // 8000 = 4 retries\n // exponential backoff retry\n setTimeout(function () {\n loadDataSources(that);\n }, that.retryTimeout);\n that.retryTimeout = that.retryTimeout * 2;\n }\n }\n\n if (that.endpoint) {\n if (_.isString(that.endpoint)) {\n that.loading = true;\n $.ajax({\n type: 'GET',\n url: that.endpoint,\n dataType: 'json',\n success: finish,\n error: onError,\n data: {}\n });\n } else {\n that.endpoint(finish);\n }\n } else {\n finish([]);\n }\n }", "get actualDataSource() {\n return this.i.jq;\n }", "function getSource(name) {\r\n var sources = localStorage.getObject('sources');\r\n var selected_name = name.split('::');\r\n var category = selected_name[0], source_name = selected_name[1];\r\n\r\n for (var i in sources) {\r\n if (i == category) {\r\n for (var j in sources[i]) {\r\n if (j == source_name) {\r\n sources[i][j].category = i;\r\n sources[i][j].name = j;\r\n return sources[i][j];\r\n }\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n}", "function generateSourceList(sourceObject) {\n let sources = [];\n\n for (const category in sourceObject) {\n for (const source of sourceObject[category]) sources.push(source); //get all sources from each news category\n }\n\n //sort all sources in alphabetical order\n sources.sort((source1, source2) => source1[1].toLowerCase().localeCompare(source2[1].toLowerCase())); \n\n const optionList = getSelectOptions(sources);\n $('#sourcesList').html(optionList);\n}", "function getEnergySources(res, mysql, context, complete){\n mysql.pool.query(\"SELECT energy_source_id, energy_source_name, renewable, energy_cost FROM energy_source\", function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.energy_sources = results;\n complete();\n });\n }", "function getAllData(dataService, dataSet) {\n\n}", "function setSD05PDDS() {\n url = ApiUrl_AutoComplete + '?dataSource=SD05PDDS_All&query=';\n $http(\n {\n method: 'GET',\n url: url,\n }).then(function successCallback(response) {\n $scope.DATASOURCE_SD05PDDS = response.data.Datas.Data1;\n \n }, function errorCallback(response) {\n console.log('Oops! Something went wrong while fetching the data. Status Code: ' + response.status + ' Status statusText: ' + response.statusText);\n });\n }", "static DataSource( params ) {\n return new ListViewDataSource(params);\n }", "get data() {\n\n let result = null;\n\n // verify valid source provided\n if (this.dataSource && this.dataSource.length > 0) {\n\n // build hierarchy from flat data\n let hierarchy = stratify()\n .parentId(d => d.id.substring(0, d.id.lastIndexOf(this.delimeter)));\n\n // build nest\n let nestedData = hierarchy(this.dataSource)\n .sort((a,b) => a.id.toLowerCase().localeCompare(b.id.toLowerCase()));\n\n // calculate layout leaves\n let hierarchyData = nestedData\n .sum(d => d.value)\n .sort((a,b) => a.id.toLowerCase().localeCompare(b.id.toLowerCase()));\n\n // process for layout\n result = this.layout(hierarchyData);\n\n }\n\n return result;\n\n }", "async function requiredSources(config) {\n return new Promise((resolve, reject) => {\n Profiler.required_sources(config, (err, sources) => {\n err ? reject(err) : resolve(sources);\n });\n });\n}", "function getAndProcessData() { \n\t\tchooseFileSource();\n\t}", "static createSource(filename) {\n const data = fs__default[\"default\"].readFileSync(filename, \"utf-8\");\n return [\n {\n column: 1,\n data,\n filename,\n line: 1,\n offset: 0,\n },\n ];\n }", "createDataListForRefreshInformation() {\n let citiesData = this.state.cities;\n if (citiesData.length === 0) {\n return\n }\n let yandex = this.state.source.yandexFlag;\n let gismeteo = this.state.source.gismeteoFlag;\n let weather = this.state.source.weatherFlag;\n let source = [];\n let cities = [];\n let citiesAndSource = {};\n for (let i = 0; i < citiesData.length; i++) {\n let cityAndData = citiesData[i];\n cities.push(cityAndData.city);\n }\n if (yandex) {\n source.push(\"yandex\")\n }\n if (gismeteo) {\n source.push(\"gismeteo\")\n }\n if (weather) {\n source.push(\"weatherCom\")\n }\n citiesAndSource[\"cities\"] = cities;\n citiesAndSource[\"source\"] = source;\n return citiesAndSource\n }", "function initDataSourceEdit(){\n\n\tDataSourceDwr.initDataSourceTypes(function(response){\n\t\tif (response.data.types) {\n\t\t dwr.util.addOptions(\"dataSourceTypes\", response.data.types, \"key\", \"value\");\n\t\t}\n\t});\n}", "queryDataSourceParams ({ commit, dispatch, getters }, payload) {\n\t\tdispatch('callApi', {\n\t\t\tmethod: 'GET',\n\t\t\turl: '/widget-builder/data-sources/' + payload[0].Id\n\t\t}).then((res) => {\n\t\t\tlet s = res.data.Url\n\t\t\tlet pattern = /(:[A-Za-z_]+)/g\n\t\t\tlet values = payload[1]\n\t\t\ts = s.replace(pattern, '*')\n\t\t\ts = s.split('*')\n\t\t\tlet output = ''\n\t\t\ts.forEach(function (part) {\n\t\t\t\tif (part === '') return\n\t\t\t\toutput += part\n\t\t\t\tlet param = values.pop()\n\t\t\t\tif (param) output += param\n\t\t\t})\n\t\t\tdelete this._vm.$http.defaults.headers['Authorization']\n\t\t\tdelete this._vm.$http.defaults.headers['x-hash']\n\t\t\taxios({\n\t\t\t\tmethod: res.data.Method,\n\t\t\t\turl: output,\n\t\t\t\twithCredentials: true\n\t\t\t}).then((res) => {\n\t\t\t\tcommit('load_dataresponce', JSON.stringify(res.data._embedded, null, ' '))\n\t\t\t}).catch((err) => {\n\t\t\t\tconsole.log(err)\n\t\t\t})\n\t\t\tthis._vm.$http.defaults.headers['Authorization'] = getters.getToken\n\t\t})\n\t\t.catch((err) => {\n\t\t\tconsole.log(err)\n\t\t})\n\t}", "async function getVideoSources() {\n // Will return all the sources to captuer from\n const inputSources = await desktopCapturer.getSources({\n types: ['window', 'screen']\n });\n\n // To build \"select source\" menu\n const videoOptionsMenu = Menu.buildFromTemplate(\n\n // Using map function to destructure the list of sources found before\n inputSources.map(source => {\n return {\n label: source.name,\n click: () => selectSource(source)\n };\n })\n );\n \n //for menu popup\n videoOptionsMenu.popup();\n\n }", "function ReadLocations(source, source_type){\n switch(source_type) {\n case \"file\":\n $.ajax({\n url: source,\n success: function (data) {\n dataModel=JSON.parse(data);\n },\n error: function (data) {\n alert('Application error: could not load '+source+' data file!');\n }\n });\n break;\n case \"variable\":\n dataModel=JSON.parse(source);\n break;\n default:\n alert(\"Application error: data source type not specified!\");\n break;\n }\n}", "function get_data() {}", "function addMapSources() {\n\tmap.addSource('coastalCounties', {\n\t\t'type': 'geojson',\n\t\t'data': 'data/counties.geojson'\n\t});\n\t\n\tmap.addSource('single-point', {\n\t\t'type': 'geojson',\n\t\t'data': {\n\t\t\t'type': 'FeatureCollection',\n\t\t\t'features': []\n\t\t}\n\t});\n}", "function refreshSourceDataTable() {\n console.debug('Refreshing table with values', sourceDatas);\n $scope.tpSourceDatas = new NgTableParams({}, {\n dataset : sourceDatas\n });\n }", "function getSourcesToAdd(newSources, prevSources) {\n const sourcesToAdd = [];\n\n for (const sourceId in newSources) {\n const newSource = newSources[sourceId];\n const prevSource = prevSources ? prevSources[sourceId] : null;\n\n if (!prevSource) {\n sourcesToAdd.push(newSource);\n }\n }\n\n return sourcesToAdd;\n}", "function GraphDataSource(implementation) {\n this.getVertices = implementation.getVertices;\n this.getEdges = implementation.getEdges;\n}", "_unbindDataSources () {\n // concurrently, for each data source run 'unbindDataSource'\n return Promise.all(Object.keys(this._dataSources).map(source => {\n return this._unbindDataSource(source)\n }));\n }", "function fetchSource(){\n\t\t\t\n\t\t\ttry {\n\n\t\t\t\txhrSrc.open(\"GET\", \"http://localhost:8080/user/booking/sources\", true);\n\t\t\t\txhrSrc.onreadystatechange = processResponseSource;\n\t\t\t\t//\t\t\txhrSrc.setRequestHeader(\"Authorization\", jwtToken);\n\t\t\t\txhrSrc.send(null);\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\talert(e.message);\n\t\t\t\tjsExceptionHandling(e);\n\t\t\t}\n\n }", "async function showSources() {\n try {\n const sourceObject = await networkApi('GET', baseApiKey + 'news/sources');\n if (sourceObject.Error != null) {\n errorMsg(sourceObject.Error);\n errorMsg('Error Loading Sources', $('#asideSources'));\n $('#sourcesList').html('<select><option>Not Loaded</option></select>');\n return;\n }\n const htmlString = getSourceHtml(sourceObject);\n $('#asideSources').html(htmlString);\n generateSourceList(sourceObject);\n }\n catch (err) {\n return errorMsg('Error retrieving sources from server.');\n }\n}", "function addSourcesToPage(sources) {\n const list = document.getElementById('WaterSources');\n\n for (let i = 0; i < sources.length; i++) {\n let li = createListItem(sources[i]);\n list.appendChild(li);\n }\n}", "async function getVideoSources() {\n const inputSources = await desktopCapturer.getSources({\n types: ['window', 'screen']\n });\n\n const videoOptionsMenus = Menu.buildFromTemplate(\n inputSources.map(source => {\n return{\n label: source.name,\n click: () => selectSource(source)\n };\n })\n );\n videoOptionsMenus.popup();\n}", "getSources() {\n fetch('/api/search/sources').then(res => res.json()).then((data) => {\n this.setState({\n ...this.state,\n sources: data,\n });\n });\n }", "function getData() {\n var data;\n try {\n data = require(dataPath);\n } catch (e) {\n console.log(e);\n data = {};\n }\n ['feeds', 'homepages', 'emails', 'openid', 'foaf', 'keys'].forEach(function (key) {\n if (!Array.isArray(data[key])) {\n data[key] = [];\n }\n });\n return data;\n }", "async function getData(source) {\n\ttry {\n\t\tlet res = await fetch(source);\n\t\treturn await res.json();\n\t} catch (error) {\n\t\tconsole.log(error);\n\t\tlet res = await fetch(sampleUrl);\n\t\treturn await res.json();\n\t}\n}" ]
[ "0.69505996", "0.68402463", "0.67220104", "0.664959", "0.6577464", "0.65631235", "0.6468408", "0.64209497", "0.6339844", "0.63275266", "0.63094187", "0.62313014", "0.6183113", "0.61714923", "0.6161989", "0.603945", "0.6023517", "0.5970847", "0.59579223", "0.5919348", "0.59132093", "0.5910793", "0.58787847", "0.58658856", "0.58457035", "0.58429784", "0.5797254", "0.5776103", "0.576891", "0.5760804", "0.5723324", "0.5694371", "0.56833833", "0.56744707", "0.56744707", "0.5670416", "0.56478494", "0.56098866", "0.55899537", "0.55899537", "0.5586652", "0.55795693", "0.5563535", "0.55612266", "0.5555727", "0.5543111", "0.551004", "0.55091894", "0.5508452", "0.5506483", "0.5494638", "0.5491137", "0.54842925", "0.5478138", "0.5462909", "0.5452605", "0.54505765", "0.54478633", "0.54292595", "0.54004544", "0.5392807", "0.5332606", "0.53114957", "0.53071684", "0.5280687", "0.52779865", "0.5272613", "0.5269331", "0.5264989", "0.52529585", "0.52402604", "0.5240132", "0.52400726", "0.5236594", "0.52351004", "0.52029675", "0.52004087", "0.5196903", "0.5176804", "0.51613504", "0.5159005", "0.5140183", "0.5132644", "0.513231", "0.5127816", "0.5108881", "0.5108537", "0.51074606", "0.51012504", "0.50958776", "0.5092817", "0.50861555", "0.50847995", "0.5072332", "0.5064184", "0.50463074", "0.50432825", "0.50376755", "0.5019465", "0.5004495" ]
0.6550305
6
This function is to add a data source
static async addDataSourceRemote(email, sourceURL, sourceType, sourceName, isLiveData) { return new Promise((resolve, reject) => { Database.sendQuery('INSERT INTO datasource (email, sourceurl, sourceType, sourceName, isLiveData) VALUES ($1,$2,$3,$4,$5) RETURNING *;', [ email, sourceURL, sourceType, sourceName, isLiveData, ]) .then((result) => { if (result.rows.length > 0) resolve(result.rows[0]); else reject(result); }) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addSource(source) {\n this._data.source = source;\n }", "function addSource(data) {\n return fetch({\n url: 'source/create',\n method: 'POST',\n data\n });\n}", "function dwscripts_popupDataSource(dsFileName, argument)\n{\n // call the addDynamicSource function in the given file\n var configDir = dw.getConfigurationPath();\n var dom = dw.getDocumentDOM();\n var smDir = dom.serverModel.getFolderName();\n var fullPath = configDir + \"/DataSources/\" + smDir + \"/\" + dsFileName;\n if (dwscripts.fileExists(fullPath))\n {\n var dsDOM = dw.getDocumentDOM(fullPath);\n if (dsDOM)\n {\n var parentWin = dsDOM.parentWindow;\n if (parentWin.addDynamicSource != null)\n {\n parentWin.addDynamicSource(argument);\n \n // Refresh the list of Data Sources\n \n // In order to force a refresh of the dataSources\n // we need to clear the dataSources property on\n // the current documents window.\n \n if (dom.parentWindow)\n {\n dom.parentWindow.dataSources = null;\n dw.dbi.getDataSources();\n }\n }\n }\n }\n}", "dataSource(data, widgetConfig) {\n let config = widgetConfig.split(' ')[1],\n random = config.split('_')[1],\n source = {\n id: widgetConfig,\n type: 'Componentsmdx_mondrianJndi',\n typeDesc: 'mondrianJndi',\n parent: 'UnIqEiD',\n properties: [],\n meta: 'CDA',\n meta_conntype: 'mondrian.jndi',\n meta_datype: 'mdx'\n },\n sourceName = $('.' + config + ' .sourceName')[0].value,\n jndi = $('.' + config + ' .sourceConnect')[0].value,\n cubes = $('.' + config + ' .dataCubes')[0].value,\n query = $('.' + config + ' .sqlStatement')[0].value,\n queryType = $('.' + config + ' .queryType')[0].value,\n stringCubes = 'mondrian:/',\n catalog = (queryType === 'mdx') ? stringCubes + cubes : cubes;\n let dataRows = {\n name: sourceName,\n jndi: jndi,\n access: 'pubilc',\n catalog: catalog,\n query: query,\n bandedMode: 'compact',\n parameters: [],\n cdacalculatedcolumns: [],\n cdacolumns: [],\n output: [],\n outputMode: 'include',\n cacheKeys: [],\n cacheDuration: 3600,\n cache: true\n };\n\n d3.entries(dataRows).map(d=>{\n let row = {\n 'name': d.key,\n 'value': d.value\n };\n\n source.properties.push(row);\n });\n data.push(source);\n this.chartDataSource(data, sourceName, random);\n this.dataSourceNames.push(sourceName);\n this.selectDataSource(data, sourceName, random);\n return source;\n }", "function createDataSourceTile(datasource) {\n var name = datasource.Name;\n var description = datasource.Description;\n\n var $datasource = $(_datasourceTileTemplate).clone(true, true);\n var $datasourceName = $datasource.find(\".data-source-name\");\n var $datasourceDescription = $datasource.find(\".data-source-description\");\n var $datasourceInfo = $datasource.find(\".data-source-info\");\n\n $datasourceName.text(name)\n .attr(\"title\", name);\n $datasourceDescription.text(description);\n $datasource.data(\"datasource\", datasource);\n\n // TODO: update when variables will be in FC.ClientState\n if (-1 !== _selectedVariable.selectedDataSources.indexOf(datasource.ID)) {\n $datasource.addClass(\"selected\");\n }\n\n $datasourceDescription.dotdotdot({\n watch: window\n });\n\n $datasource.on(\"click\", function () {\n var _datasource = $(this).data(\"datasource\");\n\n // add or remove datasource from variable selected datasources\n // TODO: find a better solution\n var index;\n if (-1 !== (index = _selectedVariable.selectedDataSources.indexOf(_datasource.ID))) {\n _selectedVariable.selectedDataSources.splice(index, 1);\n }\n else {\n _selectedVariable.selectedDataSources.push(_datasource.ID);\n }\n\n if (_selectedVariable.selected) {\n FC.state.toggleDataSource(_selectedVariable.Name, _datasource.ID);\n updateSelectedList();\n }\n\n $(this).toggleClass(\"selected\");\n });\n\n $datasourceInfo.on(\"click\", function (event) {\n event.stopPropagation();\n \n _datasourceInfoPanel.initialize(datasource);\n _datasourceInfoPanel.show();\n // TODO: show panel with data source info\n });\n\n return $datasource;\n }", "static async addDataSourceLocal(email, sourceURL, sourceType, sourceName, sourceMeta, sourceData) {\n\t\tif (sourceType === 3) {\n\t\t\tsourceData = Buffer.from(sourceData).toString('base64');\n\t\t} else {\n\t\t\tsourceData = JSON.stringify(sourceData);\n\t\t}\n\t\t// console.log(sourceData);\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tDatabase.sendQuery('INSERT INTO datasource (email, sourceurl, sourceType, sourceName, sourceMeta, sourceData, isLiveData) VALUES ($1,$2,$3,$4,$5,$6,$7) RETURNING *;', [\n\t\t\t\temail,\n\t\t\t\tsourceURL,\n\t\t\t\tsourceType,\n\t\t\t\tsourceName,\n\t\t\t\tJSON.stringify(sourceMeta),\n\t\t\t\tsourceData,\n\t\t\t\tfalse,\n\t\t\t])\n\t\t\t\t.then(async (result) => {\n\t\t\t\t\tif (result.rows.length > 0) resolve(result.rows[0]);\n\t\t\t\t\telse reject(result);\n\t\t\t\t})\n\t\t\t\t.catch((result) => reject(result));\n\t\t});\n\t}", "addRdsDataSource(id, serverlessCluster, secretStore, databaseName, options) {\n return new data_source_1.RdsDataSource(this, id, {\n api: this,\n name: options === null || options === void 0 ? void 0 : options.name,\n description: options === null || options === void 0 ? void 0 : options.description,\n serverlessCluster,\n secretStore,\n databaseName,\n });\n }", "function addSource(source) {\n $('select').append($('<option>', {\n value: source.id.replace(\":\", \"\"),\n text: source.name\n }));\n $('select option[value=\"' + source.id.replace(\":\", \"\") + '\"]').attr('data-img-src', source.thumbnail.toDataURL());\n refresh();\n }", "addSource(details){\n //if the source already exists then delete it\n if (this.map.getSource(details.id)) this.removeSource(details.id);\n this.map.addSource(details.id, details.source);\n }", "addDynamoDbDataSource(id, table, options) {\n return new data_source_1.DynamoDbDataSource(this, id, {\n api: this,\n table,\n name: options === null || options === void 0 ? void 0 : options.name,\n description: options === null || options === void 0 ? void 0 : options.description,\n });\n }", "assign_data(data_id, data_source) {\n this.missing_data_source_div.css('display','none')\n\n this.data_id = data_id\n this.data_source = data_source\n\n //time_log(`assigned data ${data_id} ${data_source.name} ${data_source.stats} to widget ${this.name} ${this.typename}`)\n\n this._refresh_source_icon()\n\n // Do not notify the widget if assigned a null-datasource. Some widgets would have to be updated.\n if (this.data_source == null)\n return\n\n try {\n this.on_assign_data() // Notify widget\n } catch (error) {\n time_error(error.message, error.stack)\n }\n }", "addElasticsearchDataSource(id, domain, options) {\n return new data_source_1.ElasticsearchDataSource(this, id, {\n api: this,\n name: options === null || options === void 0 ? void 0 : options.name,\n description: options === null || options === void 0 ? void 0 : options.description,\n domain,\n });\n }", "function initDataSourceEdit(){\n\n\tDataSourceDwr.initDataSourceTypes(function(response){\n\t\tif (response.data.types) {\n\t\t dwr.util.addOptions(\"dataSourceTypes\", response.data.types, \"key\", \"value\");\n\t\t}\n\t});\n}", "addLambdaDataSource(id, lambdaFunction, options) {\n return new data_source_1.LambdaDataSource(this, id, {\n api: this,\n lambdaFunction,\n name: options === null || options === void 0 ? void 0 : options.name,\n description: options === null || options === void 0 ? void 0 : options.description,\n });\n }", "addHttpDataSource(id, endpoint, options) {\n return new data_source_1.HttpDataSource(this, id, {\n api: this,\n endpoint,\n name: options === null || options === void 0 ? void 0 : options.name,\n description: options === null || options === void 0 ? void 0 : options.description,\n authorizationConfig: options === null || options === void 0 ? void 0 : options.authorizationConfig,\n });\n }", "setDataSource() { // OK\n\t\tconst result = [];\n\n\t\tfor (let i = 0; i < this.totalAds; i++) {\n\t\t\tresult.push(i);\n\t\t}\n\t\tthis.dataSource = result;\n\t}", "function addSourcesToPage(sources) {\n const list = document.getElementById('WaterSources');\n\n for (let i = 0; i < sources.length; i++) {\n let li = createListItem(sources[i]);\n list.appendChild(li);\n }\n}", "function mapSource() {\n\t\n\tlet dataSelect = selectedSSP;\n\tconsole.log('New scenario: ' + selectedSSP.toLowerCase());\n\n\t// Fly to interesting location according to the selected model\n\tmap.flyTo({\n center: [85, 20],\n\t\tzoom: 4\n });\n\t\n\n\t// Add source\n\tmap.addSource(\"earthquakes\", {\n\t\ttype: \"geojson\",\n\t\tdata: \"data_\" + dataSelect.toLowerCase() + \".geojson\",\n\t\t//data: _data,\n\t\tcluster: false, // Set to true to sow clusters of points\n\t\tclusterMaxZoom: 6, // Max zoom to cluster points on\n\t\tclusterRadius: 10 // Radius of each cluster when clustering points (defaults to 50)\n\t});\n\n\tconsole.log('Data file ==> ' + \"data_\" + dataSelect.toLowerCase() + \".geojson\");\n}", "function newSource(source) {\n return {\n type: constants.ADD_SOURCE,\n source: source\n };\n}", "function addRessource(r){\n\tdb.run(`insert into ressources (name) values ('${r.name}')`);\n}", "addSources(contents) {}", "function addMapSources() {\n\tmap.addSource('coastalCounties', {\n\t\t'type': 'geojson',\n\t\t'data': 'data/counties.geojson'\n\t});\n\t\n\tmap.addSource('single-point', {\n\t\t'type': 'geojson',\n\t\t'data': {\n\t\t\t'type': 'FeatureCollection',\n\t\t\t'features': []\n\t\t}\n\t});\n}", "function setSource(newSource) {\n\n source = newSource;\n\n // TODO: fix lazy loading!\n //if (isRendered) {\n // renderSource();\n //}\n renderSource();\n\n }", "selectDataSource(data, sourceName, random) {\n let html = '<option class=\"existDataSource\">' + sourceName + '</option>';\n\n $('select.data').append(html);\n $('select.data').on('change', (e)=>{\n let data = this.props.reportData,\n name = $(e.target)[0][$(e.target)[0].selectedIndex].value,\n widgetConfig = $(e.target)[0].offsetParent.className,\n random = widgetConfig.split('_')[1];\n\n $(e.target)[0].selectedIndex > 1 ? this.chartDataSource(data, name, random) : null;\n });\n }", "function addSource(_, args, context, info) {\n if( !context.user )\n throw new Error(\"Authentication is required.\");\n\n const { user_payment } = context.user;\n\n\n return stripe.customers.createSource( user_payment, {\n source: args.source\n }, function( err, customer ) {\n if( err ) throw err;\n });\n}", "function linkToDataSource(el) {\n let settings = $(el)[0].settings;\n let ctrlSettings;\n if (!settings.sourceObject) {\n if ($('#' + settings.linkToDataControl).length !== 1) {\n indiciaFns.controlFail(el, 'Failed to find data control ' + settings.linkToDataControl + ' linked to recordsMover');\n }\n // Find the source linked to the data control.\n ctrlSettings = $('#' + settings.linkToDataControl)[0].settings;\n settings.source = ctrlSettings.source;\n settings.sourceObject = indiciaData.esSourceObjects[Object.keys(settings.source)[0]];\n if (settings.sourceObject.settings.mode !== 'docs') {\n indiciaFns.controlFail(el, 'The recordsMover control needs to link to a source that lists occurrences rather than aggregated data');\n }\n }\n }", "function AbstractDataSource() {}", "function createSources(){\n \n var chartBackground = sources.append(\"rect3\")\n .attr(\"class\", \"chart2Background\")\n .attr(\"width\", ((width * 2)+ 34))\n .attr(\"height\", chartHeight/4)\n .attr(\"transform\", translate);\n var sourcesheadline = sources.append(\"text\")\n .attr(\"x\", 10)\n .attr(\"y\", 20)\n .attr(\"class\", \"sourceTitle\")\n .style('fill', 'white')\n .text(\"Sources and Info\");\n var sourcestext1 = sources.append(\"text\")\n .attr(\"x\", 20)\n .attr(\"y\", 60)\n .attr(\"class\", \"sourceTitle\")\n .style('fill', 'white')\n .style(\"font-size\", \".75em\" )\n .text(\"Data sources: www.nu3.de, FAO/FAOStat\");\n var sourcestext1 = sources.append(\"text\")\n .attr(\"x\", 20)\n .attr(\"y\", 80)\n .attr(\"class\", \"sourceTitle\")\n .style('fill', 'white')\n .style(\"font-size\", \".75em\" )\n .text(\"Emissions data included only concerns emissions within the fences for production of a given food source. No upstream or downstream emissions are included. \");\n var sourcestext1 = sources.append(\"text\")\n .attr(\"x\", 20)\n .attr(\"y\", 100)\n .attr(\"class\", \"sourceTitle\")\n .style('fill', 'white')\n .style(\"font-size\", \".75em\" )\n .text(\"Supplied resource data only concerns resources supplied for human food consumption. This data does not account for imports and exports.\");\n \n }", "function addSourceLineAndLayer(name) {\n map.addSource(name, {\n \"type\": \"geojson\",\n \"data\": {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n []\n ]\n ]\n }\n }\n });\n map.addLayer({\n \"id\": name,\n \"source\": name,\n \"type\": \"fill\",\n \"layout\": {},\n \"paint\": {\n 'fill-color': '#088',\n 'fill-opacity': 0.7\n }\n });\n }", "addNoneDataSource(id, options) {\n return new data_source_1.NoneDataSource(this, id, {\n api: this,\n name: options === null || options === void 0 ? void 0 : options.name,\n description: options === null || options === void 0 ? void 0 : options.description,\n });\n }", "function bindDatasource() {\r\n $(tableBodyObject()).empty();\r\n $(rowTemplateObject()).tmpl(grepDatasource()).appendTo(tableBodyObject());\r\n\r\n if (opts.dataSource.length / opts.recordCount > 1) {\r\n $.tmpl(opts.pagerTemplate,\r\n { \"PageNumber\": \"\" + opts.pageCount + \"\", \"ActualPage\": \"\" + opts.actualPage + \"\" }).appendTo(tableBodyObject());\r\n }\r\n\r\n $(tableBodyObject()).find('[href]').each(function () {\r\n $(this).click(function (e) {\r\n if (opts.gridFunctionCallback != null) {\r\n opts.gridFunctionCallback($(this).attr('class'), $.tmplItem(this).data);\r\n }\r\n });\r\n });\r\n\r\n $('#ddPaging').change(function () {\r\n pageing();\r\n });\r\n }", "function DataTableDataSource() {\n DataTableDataSource.superclass.constructor.apply(this, arguments);\n}", "function onCreateSpryDataSet()\n{\n\t//launch the spry xml data set\n\tvar cmdArgs = new Array();\n\tvar resArray = dwscripts.callCommand(\"SpryDataSetWizard\",cmdArgs);\n\t//refresh the data bindings \n\tdw.dbi.refresh();\n}", "function widgetCreated_handler(event, widget) {\n\t\t\tif (widget === vm.mainGrid) {\n\t\t\t\tvm.mainGrid.dataSource.data(vm.Studies);\n\t\t\t}\n\t\t}", "function _addResourceSources(_sources) {\n var source = {};\n \n if ($.isFunction(_sources)) {\n // is it a function?\n source = {\n resources: _sources\n };\n sources.push(source);\n } else if (typeof _sources == 'string') {\n // is it a URL string?\n source = {\n url: _sources\n };\n sources.push(source);\n } else if (typeof _sources == 'object') {\n // is it json object?\n for (var i=0; i<_sources.length; i++) {\n var s = _sources[i];\n normalizeSource(s);\n source = {\n resources: s\n };\n sources.push(source);\n }\n }\n }", "function setSource(source){\n\tif(source == currSource){\n\t\talert('Fuente ya seleccionada');\n\t\treturn;\n\t}\n\telse if(choropleth_objects[source]==undefined){\n\t\talert('Fuente no disponible');\n\t\treturn;\n\t}\n\telse{\n\t\tif(lastMarkerGroup!=undefined){\n\t\t\tlayerSelector.removeLayer(lastMarkerGroup);\n\t\t\tmymap.removeLayer(lastMarkerGroup);\n\t\t\tlayerSelector.showGControl();\n\t\t}\n\t\t//desseleccionar checkbox doc.getElement... (?)\n\n\t\tcurrSource = source;\n\t\t//updateMarkers(currSource);\n\t\tif(choropleth_objects[currSource].markerLayer.getLayers().length>0){\n\t\t\tlastMarkerGroup = choropleth_objects[currSource].markerLayer;\n\t\t\tlayerSelector.addOverlay(lastMarkerGroup,\"Marcadores\");\n\t\t\tlayerSelector.showGControl();\n\t\t}\n\n\n\t\tchoroplethize(currSource);\n\t\tif(initChoroGran == 1)\n\t\t\tsetGranProvincia();\n\t\telse if(initChoroGran == 2)\n\t\t\tsetGranComuna();\n\t\tsetTimechartData(currSource, timeChartGran);\n\t}\n}", "function addDataToMap(dataLayer, choice) {\n var url = 'https://eichnersara.cartodb.com/api/v2/sql?' + $.param({\n q: 'SELECT * FROM bk_oddlots ' + choice,\n format: 'GeoJSON'\n });\n $.getJSON(url)\n \n .done(function (data) {\n dataLayer.clearLayers();\n dataLayer.addData(data);\n console.log(data);\n });\n}", "setupDataSourceSelector() {\n $('.data-source').on('change', e => {\n this.resetView();\n\n if (e.target.value === 'category') {\n this.setupCategoryInterface();\n } else {\n this.setupFileInterface();\n }\n });\n }", "function getDataSets (mapSource, dataSource) {\n queue()\n .defer(d3.json, mapSource)\n .defer(d3.csv, dataSource)\n .await(ready);\n }", "function setSource(newSource) {\n\t\t\tsource = newSource;\n\n\t\t\t// TODO: fix lazy loading!\n\t\t\tif (isRendered) {\n\t\t\t\trenderSource();\n\t\t\t}\n\t\t\t// renderSource();\n\t\t}", "setSource(source){\n \n if(source === undefined)\n return;\n \n this.source = source;\n \n }", "function createSource(targetData){\n\t//define chart constants\n\tlet svg = d3.select(\".chart\");\n\n\tlet source = svg.append(\"g\")\n\t\t.attr(\"class\", \"source\");\n\tsource.append(\"text\")\n\t\t.attr(\"x\", 10)\n\t\t.attr(\"y\", 310)\n\t\t.attr(\"text-anchor\", \"left\")\n\t\t.style(\"font\", \"10px monospace\")\n\t\t.text(\"Source: \" + targetData.source);\n}", "function addSource(x,sources,dt){\n\t\tfor (var i =0; i < size; i++)\n\t\t\tx[i] += dt*sources[i];\n\t}", "add (pluginName, sourceUrl) {\n if (!sourceUrl) {\n sourceUrl = pluginName\n }\n console.log(`Adding ${sourceUrl}`)\n\n // Deduplicate multiple add requests:\n if (!(pluginName in this.adding)) {\n this.adding[pluginName] = this._add(pluginName)\n }\n\n return this.adding[pluginName]\n }", "function addDynamicSource()\r\n{\r\n MM.retVal = \"\";\r\n MM.URLContents = \"\";\r\n dw.popupCommand(\"URL Variable\");\r\n\r\n if (MM.retVal == \"OK\")\r\n {\r\n var theResponse = MM.URLContents;\r\n\r\n if (theResponse.length)\r\n {\r\n var siteURL = dw.getSiteRoot();\r\n if (siteURL.length)\r\n {\r\n dwscripts.addListValueToNote(siteURL, \"URL\", theResponse); \r\n }\r\n else\r\n {\r\n alert(MM.MSG_DefineSite);\r\n }\r\n }\r\n else \r\n {\r\n alert(MM.MSG_DefineURL);\r\n }\r\n }\r\n}", "function createDatasourcesList(queriesDatasources) {\n var exploreDatasources = Object(_features_explore_state_selectors__WEBPACK_IMPORTED_MODULE_4__[\"getExploreDatasources\"])();\n var datasources = [];\n queriesDatasources.forEach(function (queryDsName) {\n var index = exploreDatasources.findIndex(function (exploreDs) {\n return exploreDs.name === queryDsName;\n });\n\n if (index !== -1) {\n datasources.push({\n label: queryDsName,\n value: queryDsName,\n imgUrl: exploreDatasources[index].meta.info.logos.small,\n isRemoved: false\n });\n } else {\n datasources.push({\n label: queryDsName,\n value: queryDsName,\n imgUrl: 'public/img/icn-datasource.svg',\n isRemoved: true\n });\n }\n });\n return datasources;\n}", "get dataSource() {\n return this._dataSource;\n }", "get dataSource() {\n return this._dataSource;\n }", "addCoffeeSource(coffeeSource) {\r\n \r\n }", "chartDataSource(data, name, random) {\n data.map(d=>{\n if (d.canvas) {\n let number = d.canvas.className.split('_')[1];\n\n if (number === random) {\n let properties = d.components.properties;\n\n for (let i = 0; i < properties.length; i++) {\n properties[i].name === 'dataSource' ? properties[i].value = name : null;\n }\n }\n }\n });\n this.props.saveData(data);\n }", "function addData() {\n chart.data.datasets[0].data = yys;\n chart.update();\n}", "_switchDataSource(dataSource) {\n this._data = [];\n if (Object(_angular_cdk_collections__WEBPACK_IMPORTED_MODULE_2__[\"isDataSource\"])(this.dataSource)) {\n this.dataSource.disconnect(this);\n }\n // Stop listening for data from the previous data source.\n if (this._renderChangeSubscription) {\n this._renderChangeSubscription.unsubscribe();\n this._renderChangeSubscription = null;\n }\n if (!dataSource) {\n if (this._dataDiffer) {\n this._dataDiffer.diff([]);\n }\n this._rowOutlet.viewContainer.clear();\n }\n this._dataSource = dataSource;\n }", "function Data(dataSource,query){this.initDataManager(dataSource,query);}", "addSource(url, content = null) {\n if (!this.sourcesContent.has(url)) {\n this.sourcesContent.set(url, content);\n }\n return this;\n }", "addSource(url, content = null) {\n if (!this.sourcesContent.has(url)) {\n this.sourcesContent.set(url, content);\n }\n return this;\n }", "addSource(url, content = null) {\n if (!this.sourcesContent.has(url)) {\n this.sourcesContent.set(url, content);\n }\n return this;\n }", "addSource(url, content = null) {\n if (!this.sourcesContent.has(url)) {\n this.sourcesContent.set(url, content);\n }\n return this;\n }", "addSource(url, content = null) {\n if (!this.sourcesContent.has(url)) {\n this.sourcesContent.set(url, content);\n }\n return this;\n }", "function loadDataSourceExample() {\n var fileInput = document.getElementById(\"upload\");\n if (fileInput) {\n var file = fileInput.files[0];\n if (file.name.search(/.json/) !== -1) {\n var reader = new FileReader();\n reader.readAsText(file, \"UTF-8\");\n\n reader.onload = function (evt) {\n MappingManager.createMappingCanvasFromExample(file.name, JSON.parse(evt.target.result));\n };\n\n } else {\n alert(\"Not a json file\");\n }\n }\n }", "InitClass() {\n this.tpClass = 'tp.DataSource';\n }", "function addDatasets(dataSets) {\r\n chartDataSets = dataSets;\r\n return this;\r\n }", "set sourceData(newData){\n\t\tthis._sourceData = newData;\n\t\tif(!newData){\n\t\t\tdebug(\"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} else {\n\t\t\tthis.data = newData;\n\t\t}\n\n\t\tif(this.data && this.data.length == 0) {\n\t\t\t// ngrepeat finish event won't fired when data length is 0, so we need to trigger it mannually\n\t\t\tthis.$scope.$broadcast(this.$scope.$id + \"uiChanged\");\n\t\t}\n\t}", "_getDataSource(data: any) {\n\n let dataBlob = [];\n let sectionIDs = [];\n let rowIDs = [];\n\n // handle sections\n for (let i = 0; i < data.length; ++i) {\n sectionIDs.push(data[i].section);\n\n // handle row data\n rowIDs[i] = [];\n for (let j = 0; j < data[i].rows.length; ++j) {\n // add an unique row id\n rowIDs[i].push(dataBlob.length + j);\n }\n // append row data to dataBlob\n dataBlob.push(...data[i].rows);\n }\n\n if (!this.dataSource) {\n // initialize dataSource\n this.dataSource = new ListView.DataSource({\n getRowData: (dataBlob, sectionID, rowID) => dataBlob[rowID],\n getSectionHeaderData: (dataBlob, sectionID, rowID) => dataBlob[rowID],\n rowHasChanged: (r1, r2) => r1 !== r2,\n sectionHeaderHasChanged: (s1, s2) => s1 !== s2\n });\n }\n\n // return dataSource with generated data\n return this.dataSource.cloneWithRowsAndSections(dataBlob, sectionIDs, rowIDs);\n }", "get dataSource() {\n\t\treturn this.nativeElement ? this.nativeElement.dataSource : undefined;\n\t}", "get dataSource() {\n\t\treturn this.nativeElement ? this.nativeElement.dataSource : undefined;\n\t}", "function addDataSet(chart, label, data) {\n chart.data.datasets.push({\n label: label,\n data: data\n });\n\n chart.update();\n }", "updateSource(source) {\n this.set('source', source);\n }", "addDataVisuals () {\n }", "function populateDatalist(el, acSources) {\n if(hasDatalist) { // html5 <datalist>\n var datalist = document.getElementById(el.getAttribute('list')); // get <datalist> asscociated with this input\n datalist.innerHTML='';\n acSources.forEach(function(src) {\n var option = document.createElement('option');\n option.value = src;\n datalist.appendChild(option);\n });\n } else { // jQueryUI autocomplete\n $(el).autocomplete({source: acSources});\n }\n }", "function addSourcePointAndLayer(name) {\n map.addSource(name, {\n \"type\": \"geojson\",\n \"data\": {\n \"type\": \"Point\",\n \"coordinates\": []\n }\n });\n map.addLayer({\n \"id\": name,\n \"source\": name,\n \"type\": \"circle\",\n \"paint\": {\n \"circle-radius\": 5,\n \"circle-stroke-color\": \"#A93E71\",\n \"circle-stroke-width\": 1,\n \"circle-opacity\": 0\n }\n });\n }", "switchDataSource(dataSource) {\n // tslint:disable-next-line:no-unbound-method\n if (this._dataSource && typeof this._dataSource.disconnect === 'function') {\n this.dataSource.disconnect(this);\n }\n if (this.dataSubscription) {\n this.dataSubscription.unsubscribe();\n this.dataSubscription = null;\n }\n // Remove the all dataNodes if there is now no data source\n if (!dataSource) {\n this.nodeOutlet.viewContainer.clear();\n }\n this._dataSource = dataSource;\n if (this.nodeDefs) {\n this.observeRenderChanges();\n }\n }", "function refreshSourceDatas() {\n sourceDataService.findSourceData(\"\").then(\n // Success\n function(response) {\n sourceDatas = response.sourceDatas;\n refreshSourceDataTable();\n });\n }", "function addSourceInfo(src) {\n const parent = findSourceInfo();\n if (parent === null) { return; }\n addSourceInfoContents(parent, src, true);\n }", "function handleNewData ( source, tileArrays, sourceKey ) {\n\t for ( var i = 0 ; i < tileArrays.length ; i++ ) {\n\t\tvar tileArray = tileArrays[ i ];\n\t\tvar tilePointer = loadBuffer( tileArray );\n\t\tvar start = source.getStart();\n\t\tvar end = source.getEnd();\n\t\tvar projection = source.getProjection();\n\t\tvar loadFunction = source.getLoadFunction();\n\t\tvar dataInfo = initSorceData( start, end, projection );\n\t\t\n\t\tloadGlBuffer( loadFunction, tilePointer, dataInfo, fBufferInfo );\n\n\t\tfSourceBuffers[ sourceKey ].push( dataInfo );\n\n\t\tif ( fMinY === undefined || fMinY > dataInfo.minY )\n\t\t fMinY = dataInfo.minY;\n\n\t\tif ( fMaxY === undefined || fMaxY < dataInfo.maxY )\n\t\t fMaxY = dataInfo.maxY;\n\t }\n\n\t fGl.bufferData(fGl.ARRAY_BUFFER, fBufferInfo.data, fGl.STATIC_DRAW);\n\n\t schudleDraw();\n\t}", "function createInternalItemsSource() {\n internalItemsSource = options.itemsSource;\n internalItemsSource = setupSorting(internalItemsSource);\n internalItemsSource = setupFilters(internalItemsSource);\n internalItemsSource = setupIndex(internalItemsSource);\n }", "function createInternalItemsSource() {\n internalItemsSource = options.itemsSource;\n internalItemsSource = setupSorting(internalItemsSource);\n internalItemsSource = setupFilters(internalItemsSource);\n internalItemsSource = setupIndex(internalItemsSource);\n }", "_bindDataSource (path) {\n return new Promise((resolve, reject) => {\n // bind printData to the specified data source / path\n lpTag.agentSDK.bind(path,\n this._printData,\n (err) => {\n // when finished\n if (err) {\n // if there was an error binding update the bind state indicator and reject the promise\n this._updateBindIndicator(path);\n reject(err);\n } else {\n // if the bind succeeded set the bind state to true, update the indicator, and resolve the promise\n _dataSources[path].bound = true;\n this._updateBindIndicator(path);\n resolve(true)\n }\n })\n });\n }", "function c_dataSourceElement(dataItem, dataSource) {\n this.dataItem = dataItem;\n this.dataSource = dataSource;\n }", "loadDataSource(...args) {\n if (args.length === 1) {\n return this._loadLegacyDataSource(args[0])\n }\n if (args.length === 3) {\n lbs.log.warn(`[Deprecation] Data source '${args[1].type}' is being used in a legacy way! Change to passing one parameter and expecting a return value`)\n return this._loadLegacyDataSourceLegacy(args[0], args[1], args[2])\n }\n return null\n }", "function initSourceTab() {\n initSourceListeners();\n }", "createAndCacheDataSource(serviceDef) {\n // Special case for the local Node resolution service\n if (serviceDef.schema) {\n const dataSource = new LocalGraphQLDataSource(serviceDef.schema);\n return dataSource;\n }\n\n return super.createAndCacheDataSource(serviceDef);\n }", "getDatasource(competences){\n let {dataBlob, sectionIDs, rowIDs} = this.competencesToView(competences);\n return this.state.dataSource.cloneWithRowsAndSections(dataBlob, sectionIDs, rowIDs);\n }", "function addDemand(targetID) {\n addDemandCharts(targetID);\n addDemandFilters(targetID);\n}", "function writeTableWith(dataSource){\r\n\r\n jqueryNoConflict('#demo').html('<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"display table table-bordered table-striped\" id=\"data-table-container\"></table>');\r\n\r\n var oTable = jqueryNoConflict('#data-table-container').dataTable({\r\n\t\t'sPaginationType': 'bootstrap',\r\n\t\t'iDisplayLength': 25,\r\n 'aaData': dataSource,\r\n 'aoColumns': createTableColumns(),\r\n 'oLanguage': {\r\n 'sLengthMenu': '_MENU_ records per page'\r\n }\r\n });\r\n}", "_changeDataSource(oldDs, newDs) {\n if (oldDs) {\n oldDs.disconnect(this);\n }\n\n this._needsUpdate = true;\n return newDs ? newDs.connect(this) : (0,rxjs__WEBPACK_IMPORTED_MODULE_4__.of)();\n }", "get dataSource() {\n return this.i.jr;\n }", "function addData(chart, label, data) {\n chart.config.data.labels = label;\n chart.config.data.datasets[0].data = data;\n chart.update();\n}", "function source_fn() {\n setVisibility(\"src\");\n inputType = \"Source\";\n}", "lookupDataSource(name) {\n const node = this.component.data.outputNodes[name];\n if (!node) {\n // Name not found in map so let's just return what we got.\n // This can happen if we already have the correct name.\n return name;\n }\n return node.getSource();\n }", "create(source_container){\n\n\t\tconsole.log('Creating...');\n\n\t\t/** seteo las configuraciones enviadas por el usuario **/\n this.setStartConfiguration(source_container);\n\n /** creo los templates principales del componente **/\n this.createTemplates();\n\n /** seteo los filtros **/\n this.renderFilterOptions();\n\n /** activo los listeners **/\n this.createListeners();\n\t}", "static DataSource( params ) {\n return new ListViewDataSource(params);\n }", "function setSource(aSrc) {\n\n\tdocument.getElementById('frmFacturation').hdnSource.value = aSrc;\n\tdocument.getElementById('frmFacturation').submit();\n\n}", "function combineDataFromMultipleDataSources(aSources) {\n\t\treturn aSources[0].concat(aSources[1]).concat(aSources[2]).concat(aSources[3]);\n\t}", "function setSD05PDDS() {\n url = ApiUrl_AutoComplete + '?dataSource=SD05PDDS_All&query=';\n $http(\n {\n method: 'GET',\n url: url,\n }).then(function successCallback(response) {\n $scope.DATASOURCE_SD05PDDS = response.data.Datas.Data1;\n \n }, function errorCallback(response) {\n console.log('Oops! Something went wrong while fetching the data. Status Code: ' + response.status + ' Status statusText: ' + response.statusText);\n });\n }", "function addData(d_, i_) {\n plan_data.datasets[i_].data = d_;\n if (count === 2) { //only create graph if 3 datasets have been filled\n createGraph();\n } else {\n count += 1;\n }\n\n }", "function addConnection(source, target) {\n source.attr(\"href\", target)\n source.draggable(\"disable\")\n source.addClass(\"glyphicon-remove\")\n source.removeClass(\"glyphicon-plus\")\n source.click(function () {\n deleteConnection($(this))\n });\n}", "initialize() {\n for (const ds of this.dataSources) {\n ds.visit((node) => node.initialize());\n }\n }", "function refreshSourceDataTable() {\n console.debug('Refreshing table with values', sourceDatas);\n $scope.tpSourceDatas = new NgTableParams({}, {\n dataset : sourceDatas\n });\n }", "function addSupply(targetID) {\n addSupplyCharts(targetID);\n addSupplyFilters(targetID);\n}", "function attachSource(userId, sourceId) {\n return __awaiter(this, void 0, void 0, function* () {\n const customer = yield getCustomer(userId);\n const existingSource = customer.sources.data.filter(source => source.id === sourceId).pop();\n if (existingSource) {\n return existingSource;\n }\n else {\n return yield config_1.stripe.customers.createSource(customer.id, { source: sourceId });\n }\n });\n}" ]
[ "0.7715312", "0.6631875", "0.648013", "0.6473448", "0.6449389", "0.6397218", "0.63915396", "0.6384654", "0.63092446", "0.62554806", "0.62409955", "0.6171082", "0.612293", "0.6070355", "0.59991163", "0.59757817", "0.58698124", "0.5828819", "0.58213776", "0.5820316", "0.5810261", "0.5726229", "0.5710776", "0.5704761", "0.5699996", "0.56668556", "0.5624029", "0.56042224", "0.55774736", "0.5572522", "0.55408883", "0.5495954", "0.5489932", "0.54531825", "0.54492223", "0.54413795", "0.5415207", "0.54022527", "0.53609467", "0.5326709", "0.5325513", "0.53249395", "0.5323121", "0.5309398", "0.5306212", "0.5279584", "0.52729285", "0.52729285", "0.52698904", "0.52614945", "0.5237921", "0.52346754", "0.52271867", "0.52261233", "0.52261233", "0.52261233", "0.52261233", "0.52261233", "0.51934093", "0.5190328", "0.51843315", "0.51776177", "0.5172784", "0.51630604", "0.51630604", "0.51576114", "0.51568234", "0.51488036", "0.51015556", "0.5100779", "0.50953907", "0.5091836", "0.50816655", "0.5080616", "0.5076242", "0.5076242", "0.50645316", "0.5045829", "0.5041259", "0.50338435", "0.502793", "0.5022084", "0.5015487", "0.49890596", "0.49785757", "0.4976933", "0.4971598", "0.4968325", "0.49679238", "0.49659264", "0.4955862", "0.49558178", "0.49454272", "0.4944517", "0.4936218", "0.4929147", "0.49255282", "0.49204865", "0.49041024", "0.4903285" ]
0.61579573
12
This function is to add a data source
static async addDataSourceLocal(email, sourceURL, sourceType, sourceName, sourceMeta, sourceData) { if (sourceType === 3) { sourceData = Buffer.from(sourceData).toString('base64'); } else { sourceData = JSON.stringify(sourceData); } // console.log(sourceData); return new Promise((resolve, reject) => { Database.sendQuery('INSERT INTO datasource (email, sourceurl, sourceType, sourceName, sourceMeta, sourceData, isLiveData) VALUES ($1,$2,$3,$4,$5,$6,$7) RETURNING *;', [ email, sourceURL, sourceType, sourceName, JSON.stringify(sourceMeta), sourceData, false, ]) .then(async (result) => { if (result.rows.length > 0) resolve(result.rows[0]); else reject(result); }) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addSource(source) {\n this._data.source = source;\n }", "function addSource(data) {\n return fetch({\n url: 'source/create',\n method: 'POST',\n data\n });\n}", "function dwscripts_popupDataSource(dsFileName, argument)\n{\n // call the addDynamicSource function in the given file\n var configDir = dw.getConfigurationPath();\n var dom = dw.getDocumentDOM();\n var smDir = dom.serverModel.getFolderName();\n var fullPath = configDir + \"/DataSources/\" + smDir + \"/\" + dsFileName;\n if (dwscripts.fileExists(fullPath))\n {\n var dsDOM = dw.getDocumentDOM(fullPath);\n if (dsDOM)\n {\n var parentWin = dsDOM.parentWindow;\n if (parentWin.addDynamicSource != null)\n {\n parentWin.addDynamicSource(argument);\n \n // Refresh the list of Data Sources\n \n // In order to force a refresh of the dataSources\n // we need to clear the dataSources property on\n // the current documents window.\n \n if (dom.parentWindow)\n {\n dom.parentWindow.dataSources = null;\n dw.dbi.getDataSources();\n }\n }\n }\n }\n}", "dataSource(data, widgetConfig) {\n let config = widgetConfig.split(' ')[1],\n random = config.split('_')[1],\n source = {\n id: widgetConfig,\n type: 'Componentsmdx_mondrianJndi',\n typeDesc: 'mondrianJndi',\n parent: 'UnIqEiD',\n properties: [],\n meta: 'CDA',\n meta_conntype: 'mondrian.jndi',\n meta_datype: 'mdx'\n },\n sourceName = $('.' + config + ' .sourceName')[0].value,\n jndi = $('.' + config + ' .sourceConnect')[0].value,\n cubes = $('.' + config + ' .dataCubes')[0].value,\n query = $('.' + config + ' .sqlStatement')[0].value,\n queryType = $('.' + config + ' .queryType')[0].value,\n stringCubes = 'mondrian:/',\n catalog = (queryType === 'mdx') ? stringCubes + cubes : cubes;\n let dataRows = {\n name: sourceName,\n jndi: jndi,\n access: 'pubilc',\n catalog: catalog,\n query: query,\n bandedMode: 'compact',\n parameters: [],\n cdacalculatedcolumns: [],\n cdacolumns: [],\n output: [],\n outputMode: 'include',\n cacheKeys: [],\n cacheDuration: 3600,\n cache: true\n };\n\n d3.entries(dataRows).map(d=>{\n let row = {\n 'name': d.key,\n 'value': d.value\n };\n\n source.properties.push(row);\n });\n data.push(source);\n this.chartDataSource(data, sourceName, random);\n this.dataSourceNames.push(sourceName);\n this.selectDataSource(data, sourceName, random);\n return source;\n }", "function createDataSourceTile(datasource) {\n var name = datasource.Name;\n var description = datasource.Description;\n\n var $datasource = $(_datasourceTileTemplate).clone(true, true);\n var $datasourceName = $datasource.find(\".data-source-name\");\n var $datasourceDescription = $datasource.find(\".data-source-description\");\n var $datasourceInfo = $datasource.find(\".data-source-info\");\n\n $datasourceName.text(name)\n .attr(\"title\", name);\n $datasourceDescription.text(description);\n $datasource.data(\"datasource\", datasource);\n\n // TODO: update when variables will be in FC.ClientState\n if (-1 !== _selectedVariable.selectedDataSources.indexOf(datasource.ID)) {\n $datasource.addClass(\"selected\");\n }\n\n $datasourceDescription.dotdotdot({\n watch: window\n });\n\n $datasource.on(\"click\", function () {\n var _datasource = $(this).data(\"datasource\");\n\n // add or remove datasource from variable selected datasources\n // TODO: find a better solution\n var index;\n if (-1 !== (index = _selectedVariable.selectedDataSources.indexOf(_datasource.ID))) {\n _selectedVariable.selectedDataSources.splice(index, 1);\n }\n else {\n _selectedVariable.selectedDataSources.push(_datasource.ID);\n }\n\n if (_selectedVariable.selected) {\n FC.state.toggleDataSource(_selectedVariable.Name, _datasource.ID);\n updateSelectedList();\n }\n\n $(this).toggleClass(\"selected\");\n });\n\n $datasourceInfo.on(\"click\", function (event) {\n event.stopPropagation();\n \n _datasourceInfoPanel.initialize(datasource);\n _datasourceInfoPanel.show();\n // TODO: show panel with data source info\n });\n\n return $datasource;\n }", "addRdsDataSource(id, serverlessCluster, secretStore, databaseName, options) {\n return new data_source_1.RdsDataSource(this, id, {\n api: this,\n name: options === null || options === void 0 ? void 0 : options.name,\n description: options === null || options === void 0 ? void 0 : options.description,\n serverlessCluster,\n secretStore,\n databaseName,\n });\n }", "function addSource(source) {\n $('select').append($('<option>', {\n value: source.id.replace(\":\", \"\"),\n text: source.name\n }));\n $('select option[value=\"' + source.id.replace(\":\", \"\") + '\"]').attr('data-img-src', source.thumbnail.toDataURL());\n refresh();\n }", "addSource(details){\n //if the source already exists then delete it\n if (this.map.getSource(details.id)) this.removeSource(details.id);\n this.map.addSource(details.id, details.source);\n }", "addDynamoDbDataSource(id, table, options) {\n return new data_source_1.DynamoDbDataSource(this, id, {\n api: this,\n table,\n name: options === null || options === void 0 ? void 0 : options.name,\n description: options === null || options === void 0 ? void 0 : options.description,\n });\n }", "assign_data(data_id, data_source) {\n this.missing_data_source_div.css('display','none')\n\n this.data_id = data_id\n this.data_source = data_source\n\n //time_log(`assigned data ${data_id} ${data_source.name} ${data_source.stats} to widget ${this.name} ${this.typename}`)\n\n this._refresh_source_icon()\n\n // Do not notify the widget if assigned a null-datasource. Some widgets would have to be updated.\n if (this.data_source == null)\n return\n\n try {\n this.on_assign_data() // Notify widget\n } catch (error) {\n time_error(error.message, error.stack)\n }\n }", "addElasticsearchDataSource(id, domain, options) {\n return new data_source_1.ElasticsearchDataSource(this, id, {\n api: this,\n name: options === null || options === void 0 ? void 0 : options.name,\n description: options === null || options === void 0 ? void 0 : options.description,\n domain,\n });\n }", "static async addDataSourceRemote(email, sourceURL, sourceType, sourceName, isLiveData) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tDatabase.sendQuery('INSERT INTO datasource (email, sourceurl, sourceType, sourceName, isLiveData) VALUES ($1,$2,$3,$4,$5) RETURNING *;', [\n\t\t\t\temail,\n\t\t\t\tsourceURL,\n\t\t\t\tsourceType,\n\t\t\t\tsourceName,\n\t\t\t\tisLiveData,\n\t\t\t])\n\t\t\t\t.then((result) => {\n\t\t\t\t\tif (result.rows.length > 0) resolve(result.rows[0]);\n\t\t\t\t\telse reject(result);\n\t\t\t\t})\n\t\t\t\t.catch((result) => reject(result));\n\t\t});\n\t}", "function initDataSourceEdit(){\n\n\tDataSourceDwr.initDataSourceTypes(function(response){\n\t\tif (response.data.types) {\n\t\t dwr.util.addOptions(\"dataSourceTypes\", response.data.types, \"key\", \"value\");\n\t\t}\n\t});\n}", "addLambdaDataSource(id, lambdaFunction, options) {\n return new data_source_1.LambdaDataSource(this, id, {\n api: this,\n lambdaFunction,\n name: options === null || options === void 0 ? void 0 : options.name,\n description: options === null || options === void 0 ? void 0 : options.description,\n });\n }", "addHttpDataSource(id, endpoint, options) {\n return new data_source_1.HttpDataSource(this, id, {\n api: this,\n endpoint,\n name: options === null || options === void 0 ? void 0 : options.name,\n description: options === null || options === void 0 ? void 0 : options.description,\n authorizationConfig: options === null || options === void 0 ? void 0 : options.authorizationConfig,\n });\n }", "setDataSource() { // OK\n\t\tconst result = [];\n\n\t\tfor (let i = 0; i < this.totalAds; i++) {\n\t\t\tresult.push(i);\n\t\t}\n\t\tthis.dataSource = result;\n\t}", "function addSourcesToPage(sources) {\n const list = document.getElementById('WaterSources');\n\n for (let i = 0; i < sources.length; i++) {\n let li = createListItem(sources[i]);\n list.appendChild(li);\n }\n}", "function mapSource() {\n\t\n\tlet dataSelect = selectedSSP;\n\tconsole.log('New scenario: ' + selectedSSP.toLowerCase());\n\n\t// Fly to interesting location according to the selected model\n\tmap.flyTo({\n center: [85, 20],\n\t\tzoom: 4\n });\n\t\n\n\t// Add source\n\tmap.addSource(\"earthquakes\", {\n\t\ttype: \"geojson\",\n\t\tdata: \"data_\" + dataSelect.toLowerCase() + \".geojson\",\n\t\t//data: _data,\n\t\tcluster: false, // Set to true to sow clusters of points\n\t\tclusterMaxZoom: 6, // Max zoom to cluster points on\n\t\tclusterRadius: 10 // Radius of each cluster when clustering points (defaults to 50)\n\t});\n\n\tconsole.log('Data file ==> ' + \"data_\" + dataSelect.toLowerCase() + \".geojson\");\n}", "function newSource(source) {\n return {\n type: constants.ADD_SOURCE,\n source: source\n };\n}", "function addRessource(r){\n\tdb.run(`insert into ressources (name) values ('${r.name}')`);\n}", "addSources(contents) {}", "function addMapSources() {\n\tmap.addSource('coastalCounties', {\n\t\t'type': 'geojson',\n\t\t'data': 'data/counties.geojson'\n\t});\n\t\n\tmap.addSource('single-point', {\n\t\t'type': 'geojson',\n\t\t'data': {\n\t\t\t'type': 'FeatureCollection',\n\t\t\t'features': []\n\t\t}\n\t});\n}", "function setSource(newSource) {\n\n source = newSource;\n\n // TODO: fix lazy loading!\n //if (isRendered) {\n // renderSource();\n //}\n renderSource();\n\n }", "selectDataSource(data, sourceName, random) {\n let html = '<option class=\"existDataSource\">' + sourceName + '</option>';\n\n $('select.data').append(html);\n $('select.data').on('change', (e)=>{\n let data = this.props.reportData,\n name = $(e.target)[0][$(e.target)[0].selectedIndex].value,\n widgetConfig = $(e.target)[0].offsetParent.className,\n random = widgetConfig.split('_')[1];\n\n $(e.target)[0].selectedIndex > 1 ? this.chartDataSource(data, name, random) : null;\n });\n }", "function addSource(_, args, context, info) {\n if( !context.user )\n throw new Error(\"Authentication is required.\");\n\n const { user_payment } = context.user;\n\n\n return stripe.customers.createSource( user_payment, {\n source: args.source\n }, function( err, customer ) {\n if( err ) throw err;\n });\n}", "function linkToDataSource(el) {\n let settings = $(el)[0].settings;\n let ctrlSettings;\n if (!settings.sourceObject) {\n if ($('#' + settings.linkToDataControl).length !== 1) {\n indiciaFns.controlFail(el, 'Failed to find data control ' + settings.linkToDataControl + ' linked to recordsMover');\n }\n // Find the source linked to the data control.\n ctrlSettings = $('#' + settings.linkToDataControl)[0].settings;\n settings.source = ctrlSettings.source;\n settings.sourceObject = indiciaData.esSourceObjects[Object.keys(settings.source)[0]];\n if (settings.sourceObject.settings.mode !== 'docs') {\n indiciaFns.controlFail(el, 'The recordsMover control needs to link to a source that lists occurrences rather than aggregated data');\n }\n }\n }", "function AbstractDataSource() {}", "function createSources(){\n \n var chartBackground = sources.append(\"rect3\")\n .attr(\"class\", \"chart2Background\")\n .attr(\"width\", ((width * 2)+ 34))\n .attr(\"height\", chartHeight/4)\n .attr(\"transform\", translate);\n var sourcesheadline = sources.append(\"text\")\n .attr(\"x\", 10)\n .attr(\"y\", 20)\n .attr(\"class\", \"sourceTitle\")\n .style('fill', 'white')\n .text(\"Sources and Info\");\n var sourcestext1 = sources.append(\"text\")\n .attr(\"x\", 20)\n .attr(\"y\", 60)\n .attr(\"class\", \"sourceTitle\")\n .style('fill', 'white')\n .style(\"font-size\", \".75em\" )\n .text(\"Data sources: www.nu3.de, FAO/FAOStat\");\n var sourcestext1 = sources.append(\"text\")\n .attr(\"x\", 20)\n .attr(\"y\", 80)\n .attr(\"class\", \"sourceTitle\")\n .style('fill', 'white')\n .style(\"font-size\", \".75em\" )\n .text(\"Emissions data included only concerns emissions within the fences for production of a given food source. No upstream or downstream emissions are included. \");\n var sourcestext1 = sources.append(\"text\")\n .attr(\"x\", 20)\n .attr(\"y\", 100)\n .attr(\"class\", \"sourceTitle\")\n .style('fill', 'white')\n .style(\"font-size\", \".75em\" )\n .text(\"Supplied resource data only concerns resources supplied for human food consumption. This data does not account for imports and exports.\");\n \n }", "function addSourceLineAndLayer(name) {\n map.addSource(name, {\n \"type\": \"geojson\",\n \"data\": {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n []\n ]\n ]\n }\n }\n });\n map.addLayer({\n \"id\": name,\n \"source\": name,\n \"type\": \"fill\",\n \"layout\": {},\n \"paint\": {\n 'fill-color': '#088',\n 'fill-opacity': 0.7\n }\n });\n }", "addNoneDataSource(id, options) {\n return new data_source_1.NoneDataSource(this, id, {\n api: this,\n name: options === null || options === void 0 ? void 0 : options.name,\n description: options === null || options === void 0 ? void 0 : options.description,\n });\n }", "function bindDatasource() {\r\n $(tableBodyObject()).empty();\r\n $(rowTemplateObject()).tmpl(grepDatasource()).appendTo(tableBodyObject());\r\n\r\n if (opts.dataSource.length / opts.recordCount > 1) {\r\n $.tmpl(opts.pagerTemplate,\r\n { \"PageNumber\": \"\" + opts.pageCount + \"\", \"ActualPage\": \"\" + opts.actualPage + \"\" }).appendTo(tableBodyObject());\r\n }\r\n\r\n $(tableBodyObject()).find('[href]').each(function () {\r\n $(this).click(function (e) {\r\n if (opts.gridFunctionCallback != null) {\r\n opts.gridFunctionCallback($(this).attr('class'), $.tmplItem(this).data);\r\n }\r\n });\r\n });\r\n\r\n $('#ddPaging').change(function () {\r\n pageing();\r\n });\r\n }", "function DataTableDataSource() {\n DataTableDataSource.superclass.constructor.apply(this, arguments);\n}", "function onCreateSpryDataSet()\n{\n\t//launch the spry xml data set\n\tvar cmdArgs = new Array();\n\tvar resArray = dwscripts.callCommand(\"SpryDataSetWizard\",cmdArgs);\n\t//refresh the data bindings \n\tdw.dbi.refresh();\n}", "function widgetCreated_handler(event, widget) {\n\t\t\tif (widget === vm.mainGrid) {\n\t\t\t\tvm.mainGrid.dataSource.data(vm.Studies);\n\t\t\t}\n\t\t}", "function _addResourceSources(_sources) {\n var source = {};\n \n if ($.isFunction(_sources)) {\n // is it a function?\n source = {\n resources: _sources\n };\n sources.push(source);\n } else if (typeof _sources == 'string') {\n // is it a URL string?\n source = {\n url: _sources\n };\n sources.push(source);\n } else if (typeof _sources == 'object') {\n // is it json object?\n for (var i=0; i<_sources.length; i++) {\n var s = _sources[i];\n normalizeSource(s);\n source = {\n resources: s\n };\n sources.push(source);\n }\n }\n }", "function setSource(source){\n\tif(source == currSource){\n\t\talert('Fuente ya seleccionada');\n\t\treturn;\n\t}\n\telse if(choropleth_objects[source]==undefined){\n\t\talert('Fuente no disponible');\n\t\treturn;\n\t}\n\telse{\n\t\tif(lastMarkerGroup!=undefined){\n\t\t\tlayerSelector.removeLayer(lastMarkerGroup);\n\t\t\tmymap.removeLayer(lastMarkerGroup);\n\t\t\tlayerSelector.showGControl();\n\t\t}\n\t\t//desseleccionar checkbox doc.getElement... (?)\n\n\t\tcurrSource = source;\n\t\t//updateMarkers(currSource);\n\t\tif(choropleth_objects[currSource].markerLayer.getLayers().length>0){\n\t\t\tlastMarkerGroup = choropleth_objects[currSource].markerLayer;\n\t\t\tlayerSelector.addOverlay(lastMarkerGroup,\"Marcadores\");\n\t\t\tlayerSelector.showGControl();\n\t\t}\n\n\n\t\tchoroplethize(currSource);\n\t\tif(initChoroGran == 1)\n\t\t\tsetGranProvincia();\n\t\telse if(initChoroGran == 2)\n\t\t\tsetGranComuna();\n\t\tsetTimechartData(currSource, timeChartGran);\n\t}\n}", "function addDataToMap(dataLayer, choice) {\n var url = 'https://eichnersara.cartodb.com/api/v2/sql?' + $.param({\n q: 'SELECT * FROM bk_oddlots ' + choice,\n format: 'GeoJSON'\n });\n $.getJSON(url)\n \n .done(function (data) {\n dataLayer.clearLayers();\n dataLayer.addData(data);\n console.log(data);\n });\n}", "setupDataSourceSelector() {\n $('.data-source').on('change', e => {\n this.resetView();\n\n if (e.target.value === 'category') {\n this.setupCategoryInterface();\n } else {\n this.setupFileInterface();\n }\n });\n }", "function getDataSets (mapSource, dataSource) {\n queue()\n .defer(d3.json, mapSource)\n .defer(d3.csv, dataSource)\n .await(ready);\n }", "function setSource(newSource) {\n\t\t\tsource = newSource;\n\n\t\t\t// TODO: fix lazy loading!\n\t\t\tif (isRendered) {\n\t\t\t\trenderSource();\n\t\t\t}\n\t\t\t// renderSource();\n\t\t}", "setSource(source){\n \n if(source === undefined)\n return;\n \n this.source = source;\n \n }", "function createSource(targetData){\n\t//define chart constants\n\tlet svg = d3.select(\".chart\");\n\n\tlet source = svg.append(\"g\")\n\t\t.attr(\"class\", \"source\");\n\tsource.append(\"text\")\n\t\t.attr(\"x\", 10)\n\t\t.attr(\"y\", 310)\n\t\t.attr(\"text-anchor\", \"left\")\n\t\t.style(\"font\", \"10px monospace\")\n\t\t.text(\"Source: \" + targetData.source);\n}", "function addSource(x,sources,dt){\n\t\tfor (var i =0; i < size; i++)\n\t\t\tx[i] += dt*sources[i];\n\t}", "add (pluginName, sourceUrl) {\n if (!sourceUrl) {\n sourceUrl = pluginName\n }\n console.log(`Adding ${sourceUrl}`)\n\n // Deduplicate multiple add requests:\n if (!(pluginName in this.adding)) {\n this.adding[pluginName] = this._add(pluginName)\n }\n\n return this.adding[pluginName]\n }", "function addDynamicSource()\r\n{\r\n MM.retVal = \"\";\r\n MM.URLContents = \"\";\r\n dw.popupCommand(\"URL Variable\");\r\n\r\n if (MM.retVal == \"OK\")\r\n {\r\n var theResponse = MM.URLContents;\r\n\r\n if (theResponse.length)\r\n {\r\n var siteURL = dw.getSiteRoot();\r\n if (siteURL.length)\r\n {\r\n dwscripts.addListValueToNote(siteURL, \"URL\", theResponse); \r\n }\r\n else\r\n {\r\n alert(MM.MSG_DefineSite);\r\n }\r\n }\r\n else \r\n {\r\n alert(MM.MSG_DefineURL);\r\n }\r\n }\r\n}", "function createDatasourcesList(queriesDatasources) {\n var exploreDatasources = Object(_features_explore_state_selectors__WEBPACK_IMPORTED_MODULE_4__[\"getExploreDatasources\"])();\n var datasources = [];\n queriesDatasources.forEach(function (queryDsName) {\n var index = exploreDatasources.findIndex(function (exploreDs) {\n return exploreDs.name === queryDsName;\n });\n\n if (index !== -1) {\n datasources.push({\n label: queryDsName,\n value: queryDsName,\n imgUrl: exploreDatasources[index].meta.info.logos.small,\n isRemoved: false\n });\n } else {\n datasources.push({\n label: queryDsName,\n value: queryDsName,\n imgUrl: 'public/img/icn-datasource.svg',\n isRemoved: true\n });\n }\n });\n return datasources;\n}", "get dataSource() {\n return this._dataSource;\n }", "get dataSource() {\n return this._dataSource;\n }", "addCoffeeSource(coffeeSource) {\r\n \r\n }", "chartDataSource(data, name, random) {\n data.map(d=>{\n if (d.canvas) {\n let number = d.canvas.className.split('_')[1];\n\n if (number === random) {\n let properties = d.components.properties;\n\n for (let i = 0; i < properties.length; i++) {\n properties[i].name === 'dataSource' ? properties[i].value = name : null;\n }\n }\n }\n });\n this.props.saveData(data);\n }", "function addData() {\n chart.data.datasets[0].data = yys;\n chart.update();\n}", "_switchDataSource(dataSource) {\n this._data = [];\n if (Object(_angular_cdk_collections__WEBPACK_IMPORTED_MODULE_2__[\"isDataSource\"])(this.dataSource)) {\n this.dataSource.disconnect(this);\n }\n // Stop listening for data from the previous data source.\n if (this._renderChangeSubscription) {\n this._renderChangeSubscription.unsubscribe();\n this._renderChangeSubscription = null;\n }\n if (!dataSource) {\n if (this._dataDiffer) {\n this._dataDiffer.diff([]);\n }\n this._rowOutlet.viewContainer.clear();\n }\n this._dataSource = dataSource;\n }", "function Data(dataSource,query){this.initDataManager(dataSource,query);}", "addSource(url, content = null) {\n if (!this.sourcesContent.has(url)) {\n this.sourcesContent.set(url, content);\n }\n return this;\n }", "addSource(url, content = null) {\n if (!this.sourcesContent.has(url)) {\n this.sourcesContent.set(url, content);\n }\n return this;\n }", "addSource(url, content = null) {\n if (!this.sourcesContent.has(url)) {\n this.sourcesContent.set(url, content);\n }\n return this;\n }", "addSource(url, content = null) {\n if (!this.sourcesContent.has(url)) {\n this.sourcesContent.set(url, content);\n }\n return this;\n }", "addSource(url, content = null) {\n if (!this.sourcesContent.has(url)) {\n this.sourcesContent.set(url, content);\n }\n return this;\n }", "function loadDataSourceExample() {\n var fileInput = document.getElementById(\"upload\");\n if (fileInput) {\n var file = fileInput.files[0];\n if (file.name.search(/.json/) !== -1) {\n var reader = new FileReader();\n reader.readAsText(file, \"UTF-8\");\n\n reader.onload = function (evt) {\n MappingManager.createMappingCanvasFromExample(file.name, JSON.parse(evt.target.result));\n };\n\n } else {\n alert(\"Not a json file\");\n }\n }\n }", "InitClass() {\n this.tpClass = 'tp.DataSource';\n }", "function addDatasets(dataSets) {\r\n chartDataSets = dataSets;\r\n return this;\r\n }", "set sourceData(newData){\n\t\tthis._sourceData = newData;\n\t\tif(!newData){\n\t\t\tdebug(\"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} else {\n\t\t\tthis.data = newData;\n\t\t}\n\n\t\tif(this.data && this.data.length == 0) {\n\t\t\t// ngrepeat finish event won't fired when data length is 0, so we need to trigger it mannually\n\t\t\tthis.$scope.$broadcast(this.$scope.$id + \"uiChanged\");\n\t\t}\n\t}", "_getDataSource(data: any) {\n\n let dataBlob = [];\n let sectionIDs = [];\n let rowIDs = [];\n\n // handle sections\n for (let i = 0; i < data.length; ++i) {\n sectionIDs.push(data[i].section);\n\n // handle row data\n rowIDs[i] = [];\n for (let j = 0; j < data[i].rows.length; ++j) {\n // add an unique row id\n rowIDs[i].push(dataBlob.length + j);\n }\n // append row data to dataBlob\n dataBlob.push(...data[i].rows);\n }\n\n if (!this.dataSource) {\n // initialize dataSource\n this.dataSource = new ListView.DataSource({\n getRowData: (dataBlob, sectionID, rowID) => dataBlob[rowID],\n getSectionHeaderData: (dataBlob, sectionID, rowID) => dataBlob[rowID],\n rowHasChanged: (r1, r2) => r1 !== r2,\n sectionHeaderHasChanged: (s1, s2) => s1 !== s2\n });\n }\n\n // return dataSource with generated data\n return this.dataSource.cloneWithRowsAndSections(dataBlob, sectionIDs, rowIDs);\n }", "get dataSource() {\n\t\treturn this.nativeElement ? this.nativeElement.dataSource : undefined;\n\t}", "get dataSource() {\n\t\treturn this.nativeElement ? this.nativeElement.dataSource : undefined;\n\t}", "function addDataSet(chart, label, data) {\n chart.data.datasets.push({\n label: label,\n data: data\n });\n\n chart.update();\n }", "updateSource(source) {\n this.set('source', source);\n }", "addDataVisuals () {\n }", "function populateDatalist(el, acSources) {\n if(hasDatalist) { // html5 <datalist>\n var datalist = document.getElementById(el.getAttribute('list')); // get <datalist> asscociated with this input\n datalist.innerHTML='';\n acSources.forEach(function(src) {\n var option = document.createElement('option');\n option.value = src;\n datalist.appendChild(option);\n });\n } else { // jQueryUI autocomplete\n $(el).autocomplete({source: acSources});\n }\n }", "function addSourcePointAndLayer(name) {\n map.addSource(name, {\n \"type\": \"geojson\",\n \"data\": {\n \"type\": \"Point\",\n \"coordinates\": []\n }\n });\n map.addLayer({\n \"id\": name,\n \"source\": name,\n \"type\": \"circle\",\n \"paint\": {\n \"circle-radius\": 5,\n \"circle-stroke-color\": \"#A93E71\",\n \"circle-stroke-width\": 1,\n \"circle-opacity\": 0\n }\n });\n }", "switchDataSource(dataSource) {\n // tslint:disable-next-line:no-unbound-method\n if (this._dataSource && typeof this._dataSource.disconnect === 'function') {\n this.dataSource.disconnect(this);\n }\n if (this.dataSubscription) {\n this.dataSubscription.unsubscribe();\n this.dataSubscription = null;\n }\n // Remove the all dataNodes if there is now no data source\n if (!dataSource) {\n this.nodeOutlet.viewContainer.clear();\n }\n this._dataSource = dataSource;\n if (this.nodeDefs) {\n this.observeRenderChanges();\n }\n }", "function refreshSourceDatas() {\n sourceDataService.findSourceData(\"\").then(\n // Success\n function(response) {\n sourceDatas = response.sourceDatas;\n refreshSourceDataTable();\n });\n }", "function addSourceInfo(src) {\n const parent = findSourceInfo();\n if (parent === null) { return; }\n addSourceInfoContents(parent, src, true);\n }", "function handleNewData ( source, tileArrays, sourceKey ) {\n\t for ( var i = 0 ; i < tileArrays.length ; i++ ) {\n\t\tvar tileArray = tileArrays[ i ];\n\t\tvar tilePointer = loadBuffer( tileArray );\n\t\tvar start = source.getStart();\n\t\tvar end = source.getEnd();\n\t\tvar projection = source.getProjection();\n\t\tvar loadFunction = source.getLoadFunction();\n\t\tvar dataInfo = initSorceData( start, end, projection );\n\t\t\n\t\tloadGlBuffer( loadFunction, tilePointer, dataInfo, fBufferInfo );\n\n\t\tfSourceBuffers[ sourceKey ].push( dataInfo );\n\n\t\tif ( fMinY === undefined || fMinY > dataInfo.minY )\n\t\t fMinY = dataInfo.minY;\n\n\t\tif ( fMaxY === undefined || fMaxY < dataInfo.maxY )\n\t\t fMaxY = dataInfo.maxY;\n\t }\n\n\t fGl.bufferData(fGl.ARRAY_BUFFER, fBufferInfo.data, fGl.STATIC_DRAW);\n\n\t schudleDraw();\n\t}", "function createInternalItemsSource() {\n internalItemsSource = options.itemsSource;\n internalItemsSource = setupSorting(internalItemsSource);\n internalItemsSource = setupFilters(internalItemsSource);\n internalItemsSource = setupIndex(internalItemsSource);\n }", "function createInternalItemsSource() {\n internalItemsSource = options.itemsSource;\n internalItemsSource = setupSorting(internalItemsSource);\n internalItemsSource = setupFilters(internalItemsSource);\n internalItemsSource = setupIndex(internalItemsSource);\n }", "_bindDataSource (path) {\n return new Promise((resolve, reject) => {\n // bind printData to the specified data source / path\n lpTag.agentSDK.bind(path,\n this._printData,\n (err) => {\n // when finished\n if (err) {\n // if there was an error binding update the bind state indicator and reject the promise\n this._updateBindIndicator(path);\n reject(err);\n } else {\n // if the bind succeeded set the bind state to true, update the indicator, and resolve the promise\n _dataSources[path].bound = true;\n this._updateBindIndicator(path);\n resolve(true)\n }\n })\n });\n }", "function c_dataSourceElement(dataItem, dataSource) {\n this.dataItem = dataItem;\n this.dataSource = dataSource;\n }", "loadDataSource(...args) {\n if (args.length === 1) {\n return this._loadLegacyDataSource(args[0])\n }\n if (args.length === 3) {\n lbs.log.warn(`[Deprecation] Data source '${args[1].type}' is being used in a legacy way! Change to passing one parameter and expecting a return value`)\n return this._loadLegacyDataSourceLegacy(args[0], args[1], args[2])\n }\n return null\n }", "function initSourceTab() {\n initSourceListeners();\n }", "createAndCacheDataSource(serviceDef) {\n // Special case for the local Node resolution service\n if (serviceDef.schema) {\n const dataSource = new LocalGraphQLDataSource(serviceDef.schema);\n return dataSource;\n }\n\n return super.createAndCacheDataSource(serviceDef);\n }", "getDatasource(competences){\n let {dataBlob, sectionIDs, rowIDs} = this.competencesToView(competences);\n return this.state.dataSource.cloneWithRowsAndSections(dataBlob, sectionIDs, rowIDs);\n }", "function addDemand(targetID) {\n addDemandCharts(targetID);\n addDemandFilters(targetID);\n}", "function writeTableWith(dataSource){\r\n\r\n jqueryNoConflict('#demo').html('<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"display table table-bordered table-striped\" id=\"data-table-container\"></table>');\r\n\r\n var oTable = jqueryNoConflict('#data-table-container').dataTable({\r\n\t\t'sPaginationType': 'bootstrap',\r\n\t\t'iDisplayLength': 25,\r\n 'aaData': dataSource,\r\n 'aoColumns': createTableColumns(),\r\n 'oLanguage': {\r\n 'sLengthMenu': '_MENU_ records per page'\r\n }\r\n });\r\n}", "_changeDataSource(oldDs, newDs) {\n if (oldDs) {\n oldDs.disconnect(this);\n }\n\n this._needsUpdate = true;\n return newDs ? newDs.connect(this) : (0,rxjs__WEBPACK_IMPORTED_MODULE_4__.of)();\n }", "get dataSource() {\n return this.i.jr;\n }", "function addData(chart, label, data) {\n chart.config.data.labels = label;\n chart.config.data.datasets[0].data = data;\n chart.update();\n}", "function source_fn() {\n setVisibility(\"src\");\n inputType = \"Source\";\n}", "lookupDataSource(name) {\n const node = this.component.data.outputNodes[name];\n if (!node) {\n // Name not found in map so let's just return what we got.\n // This can happen if we already have the correct name.\n return name;\n }\n return node.getSource();\n }", "create(source_container){\n\n\t\tconsole.log('Creating...');\n\n\t\t/** seteo las configuraciones enviadas por el usuario **/\n this.setStartConfiguration(source_container);\n\n /** creo los templates principales del componente **/\n this.createTemplates();\n\n /** seteo los filtros **/\n this.renderFilterOptions();\n\n /** activo los listeners **/\n this.createListeners();\n\t}", "static DataSource( params ) {\n return new ListViewDataSource(params);\n }", "function setSource(aSrc) {\n\n\tdocument.getElementById('frmFacturation').hdnSource.value = aSrc;\n\tdocument.getElementById('frmFacturation').submit();\n\n}", "function combineDataFromMultipleDataSources(aSources) {\n\t\treturn aSources[0].concat(aSources[1]).concat(aSources[2]).concat(aSources[3]);\n\t}", "function setSD05PDDS() {\n url = ApiUrl_AutoComplete + '?dataSource=SD05PDDS_All&query=';\n $http(\n {\n method: 'GET',\n url: url,\n }).then(function successCallback(response) {\n $scope.DATASOURCE_SD05PDDS = response.data.Datas.Data1;\n \n }, function errorCallback(response) {\n console.log('Oops! Something went wrong while fetching the data. Status Code: ' + response.status + ' Status statusText: ' + response.statusText);\n });\n }", "function addData(d_, i_) {\n plan_data.datasets[i_].data = d_;\n if (count === 2) { //only create graph if 3 datasets have been filled\n createGraph();\n } else {\n count += 1;\n }\n\n }", "function addConnection(source, target) {\n source.attr(\"href\", target)\n source.draggable(\"disable\")\n source.addClass(\"glyphicon-remove\")\n source.removeClass(\"glyphicon-plus\")\n source.click(function () {\n deleteConnection($(this))\n });\n}", "initialize() {\n for (const ds of this.dataSources) {\n ds.visit((node) => node.initialize());\n }\n }", "function refreshSourceDataTable() {\n console.debug('Refreshing table with values', sourceDatas);\n $scope.tpSourceDatas = new NgTableParams({}, {\n dataset : sourceDatas\n });\n }", "function addSupply(targetID) {\n addSupplyCharts(targetID);\n addSupplyFilters(targetID);\n}", "function attachSource(userId, sourceId) {\n return __awaiter(this, void 0, void 0, function* () {\n const customer = yield getCustomer(userId);\n const existingSource = customer.sources.data.filter(source => source.id === sourceId).pop();\n if (existingSource) {\n return existingSource;\n }\n else {\n return yield config_1.stripe.customers.createSource(customer.id, { source: sourceId });\n }\n });\n}" ]
[ "0.7715312", "0.6631875", "0.648013", "0.6473448", "0.6449389", "0.63915396", "0.6384654", "0.63092446", "0.62554806", "0.62409955", "0.6171082", "0.61579573", "0.612293", "0.6070355", "0.59991163", "0.59757817", "0.58698124", "0.5828819", "0.58213776", "0.5820316", "0.5810261", "0.5726229", "0.5710776", "0.5704761", "0.5699996", "0.56668556", "0.5624029", "0.56042224", "0.55774736", "0.5572522", "0.55408883", "0.5495954", "0.5489932", "0.54531825", "0.54492223", "0.54413795", "0.5415207", "0.54022527", "0.53609467", "0.5326709", "0.5325513", "0.53249395", "0.5323121", "0.5309398", "0.5306212", "0.5279584", "0.52729285", "0.52729285", "0.52698904", "0.52614945", "0.5237921", "0.52346754", "0.52271867", "0.52261233", "0.52261233", "0.52261233", "0.52261233", "0.52261233", "0.51934093", "0.5190328", "0.51843315", "0.51776177", "0.5172784", "0.51630604", "0.51630604", "0.51576114", "0.51568234", "0.51488036", "0.51015556", "0.5100779", "0.50953907", "0.5091836", "0.50816655", "0.5080616", "0.5076242", "0.5076242", "0.50645316", "0.5045829", "0.5041259", "0.50338435", "0.502793", "0.5022084", "0.5015487", "0.49890596", "0.49785757", "0.4976933", "0.4971598", "0.4968325", "0.49679238", "0.49659264", "0.4955862", "0.49558178", "0.49454272", "0.4944517", "0.4936218", "0.4929147", "0.49255282", "0.49204865", "0.49041024", "0.4903285" ]
0.6397218
5
This function is to update a data source
static async updateDataSource(email, dataSourceID, dataSourceName) { return new Promise((resolve, reject) => { Database.sendQuery('UPDATE datasource SET sourceName=$3 WHERE ( email = $1) AND ( ID = $2) RETURNING *;', [email, dataSourceID, dataSourceName]) .then((result) => { if (result.rows.length > 0) resolve(result.rows[0]); else reject(result); }) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refreshSourceDatas() {\n sourceDataService.findSourceData(\"\").then(\n // Success\n function(response) {\n sourceDatas = response.sourceDatas;\n refreshSourceDataTable();\n });\n }", "function refreshSourceDataTable() {\n console.debug('Refreshing table with values', sourceDatas);\n $scope.tpSourceDatas = new NgTableParams({}, {\n dataset : sourceDatas\n });\n }", "function updateData() {\n\t/*\n\t* TODO: Fetch data\n\t*/\n}", "set sourceData(newData){\n\t\tthis._sourceData = newData;\n\t\tif(!newData){\n\t\t\tdebug(\"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} else {\n\t\t\tthis.data = newData;\n\t\t}\n\n\t\tif(this.data && this.data.length == 0) {\n\t\t\t// ngrepeat finish event won't fired when data length is 0, so we need to trigger it mannually\n\t\t\tthis.$scope.$broadcast(this.$scope.$id + \"uiChanged\");\n\t\t}\n\t}", "updateSource(source) {\n this.set('source', source);\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}", "function dataSourceUpdated(webbleID) {\n\t\t$timeout(function() {\n\t\t\t$scope.getWebbleByInstanceId(loadedChildren[\"DigitalDashboard\"][0]).scope().set(\"Mapping\",\n\t\t\t\t{\"plugins\":[{\"name\":\"Density Plot Advanced\",\"grouping\":true,\"sets\":[{\"fields\":[{\"name\":\"3D Density Data\",\"assigned\":[{\"sourceName\":\"SMART Data Source\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"3D Array\"}],\"template\":false,\"added\":false}]}]}]}\n\t\t\t)},\n\t\t1);\n\t}", "function dataSourceUpdated(webbleID) {\n\t\t$log.log(preDebugMsg + \"data source was updated, check if we should redo mapping?\");\n\n\t\tif(loadedChildren[\"DigitalDashboardSmartDataSource\"] && loadedChildren[\"DigitalDashboardSmartDataSource\"].length > 1) {\n\t\t\t$timeout(function() {\n\t\t\t\tvar datasrc0 = $scope.getWebbleByInstanceId(loadedChildren[\"DigitalDashboardSmartDataSource\"][0]);\n\t\t\t\tvar datasrc1 = $scope.getWebbleByInstanceId(loadedChildren[\"DigitalDashboardSmartDataSource\"][1]);\n\n\t\t\t\tvar newFormat0 = datasrc0.scope().gimme(\"ProvidedFormat\");\n\t\t\t\tvar newFormat1 = datasrc1.scope().gimme(\"ProvidedFormat\");\n\n\t\t\t\tif(newFormat0 && newFormat0.format && newFormat0.format.sets && newFormat0.format.sets.length > 0 && newFormat1 && newFormat1.format && newFormat1.format.sets && newFormat1.format.sets.length > 0) {\n\t\t\t\t\t$scope.getWebbleByInstanceId(loadedChildren[\"DigitalDashboard\"][0]).scope().set(\"Mapping\",\n\t\t\t\t\t\t{\"plugins\":[{\"name\":\"Map 1\",\"grouping\":true,\"sets\":[{\"fields\":[{\"name\":\"Point Latitude\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"Point Longitude\",\"assigned\":[],\"template\":false,\"added\":false}]},{\"fields\":[{\"name\":\"Start Latitude\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"Start Longitude\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"End Latitude\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"End Longitude\",\"assigned\":[],\"template\":false,\"added\":false}]},{\"fields\":[{\"name\":\"Cell Latitude\",\"assigned\":[{\"sourceName\":\"Data: one set\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"\\\"latitude\\\"\"}],\"template\":false,\"added\":false},{\"name\":\"Cell Longitude\",\"assigned\":[{\"sourceName\":\"Data: one set\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"\\\"longitude\\\"\"}],\"template\":false,\"added\":false},{\"name\":\"Cell Value\",\"assigned\":[{\"sourceName\":\"Data: one set\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"\\\"himawari\\\"\"}],\"template\":false,\"added\":false}]}]},{\"name\":\"Map 2\",\"grouping\":true,\"sets\":[{\"fields\":[{\"name\":\"Point Latitude\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"Point Longitude\",\"assigned\":[],\"template\":false,\"added\":false}]},{\"fields\":[{\"name\":\"Start Latitude\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"Start Longitude\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"End Latitude\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"End Longitude\",\"assigned\":[],\"template\":false,\"added\":false}]},{\"fields\":[{\"name\":\"Cell Latitude\",\"assigned\":[{\"sourceName\":\"Data: multiple sets\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"\\\"latitude\\\"\"}],\"template\":false,\"added\":false},{\"name\":\"Cell Longitude\",\"assigned\":[{\"sourceName\":\"Data: multiple sets\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"\\\"longitude\\\"\"}],\"template\":false,\"added\":false},{\"name\":\"Cell Value\",\"assigned\":[{\"sourceName\":\"Data: multiple sets\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"\\\"himawari\\\"\"}],\"template\":false,\"added\":false}]}]},{\"name\":\"Bar Chart\",\"grouping\":true,\"sets\":[{\"fields\":[{\"name\":\"data\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"weights\",\"assigned\":[],\"template\":false,\"added\":false}]},{\"fields\":[{\"name\":\"data\",\"assigned\":[{\"sourceName\":\"Data: multiple sets\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"band\"}],\"template\":false,\"added\":false}]}]},{\"name\":\"Bar Chart 2\",\"grouping\":true,\"sets\":[{\"fields\":[{\"name\":\"data\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"weights\",\"assigned\":[],\"template\":false,\"added\":false}]},{\"fields\":[{\"name\":\"data\",\"assigned\":[{\"sourceName\":\"Data: multiple sets\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"\\\"himawari\\\"\"}],\"template\":false,\"added\":false}]}]},{\"name\":\"Bar Chart 3\",\"grouping\":true,\"sets\":[{\"fields\":[{\"name\":\"data\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"weights\",\"assigned\":[],\"template\":false,\"added\":false}]},{\"fields\":[{\"name\":\"data\",\"assigned\":[{\"sourceName\":\"Data: one set\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"\\\"himawari\\\"\"}],\"template\":false,\"added\":false}]}]}]}\n\t\t\t\t\t);\n\t\t\t\t} else if(newFormat0 && newFormat0.format && newFormat0.format.sets && newFormat0.format.sets.length > 0 ) {\n\t\t\t\t\t$scope.getWebbleByInstanceId(loadedChildren[\"DigitalDashboard\"][0]).scope().set(\"Mapping\",\n\t\t\t\t\t\t{\"plugins\":[{\"name\":\"Map 1\",\"grouping\":true,\"sets\":[{\"fields\":[{\"name\":\"Point Latitude\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"Point Longitude\",\"assigned\":[],\"template\":false,\"added\":false}]},{\"fields\":[{\"name\":\"Start Latitude\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"Start Longitude\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"End Latitude\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"End Longitude\",\"assigned\":[],\"template\":false,\"added\":false}]},{\"fields\":[{\"name\":\"Cell Latitude\",\"assigned\":[{\"sourceName\":\"Data: one set\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"\\\"latitude\\\"\"}],\"template\":false,\"added\":false},{\"name\":\"Cell Longitude\",\"assigned\":[{\"sourceName\":\"Data: one set\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"\\\"longitude\\\"\"}],\"template\":false,\"added\":false},{\"name\":\"Cell Value\",\"assigned\":[{\"sourceName\":\"Data: one set\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"\\\"himawari\\\"\"}],\"template\":false,\"added\":false}]}]},{\"name\":\"Map 2\",\"grouping\":true,\"sets\":[{\"fields\":[{\"name\":\"Point Latitude\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"Point Longitude\",\"assigned\":[],\"template\":false,\"added\":false}]},{\"fields\":[{\"name\":\"Start Latitude\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"Start Longitude\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"End Latitude\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"End Longitude\",\"assigned\":[],\"template\":false,\"added\":false}]},{\"fields\":[{\"name\":\"Cell Latitude\",\"assigned\":[{\"sourceName\":\"Data: multiple sets\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"\\\"latitude\\\"\"}],\"template\":false,\"added\":false},{\"name\":\"Cell Longitude\",\"assigned\":[{\"sourceName\":\"Data: multiple sets\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"\\\"longitude\\\"\"}],\"template\":false,\"added\":false},{\"name\":\"Cell Value\",\"assigned\":[{\"sourceName\":\"Data: multiple sets\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"\\\"himawari\\\"\"}],\"template\":false,\"added\":false}]}]},{\"name\":\"Bar Chart\",\"grouping\":true,\"sets\":[{\"fields\":[{\"name\":\"data\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"weights\",\"assigned\":[],\"template\":false,\"added\":false}]},{\"fields\":[{\"name\":\"data\",\"assigned\":[{\"sourceName\":\"Data: multiple sets\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"band\"}],\"template\":false,\"added\":false}]}]},{\"name\":\"Bar Chart 2\",\"grouping\":true,\"sets\":[{\"fields\":[{\"name\":\"data\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"weights\",\"assigned\":[],\"template\":false,\"added\":false}]},{\"fields\":[{\"name\":\"data\",\"assigned\":[{\"sourceName\":\"Data: multiple sets\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"\\\"himawari\\\"\"}],\"template\":false,\"added\":false}]}]},{\"name\":\"Bar Chart 3\",\"grouping\":true,\"sets\":[{\"fields\":[{\"name\":\"data\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"weights\",\"assigned\":[],\"template\":false,\"added\":false}]},{\"fields\":[{\"name\":\"data\",\"assigned\":[{\"sourceName\":\"Data: one set\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"\\\"himawari\\\"\"}],\"template\":false,\"added\":false}]}]}]}\n\t\t\t\t\t);\n\t\t\t\t} else if(newFormat1 && newFormat1.format && newFormat1.format.sets && newFormat1.format.sets.length > 0) {\n\t\t\t\t\t$scope.getWebbleByInstanceId(loadedChildren[\"DigitalDashboard\"][0]).scope().set(\"Mapping\",\n\t\t\t\t\t\t{\"plugins\":[{\"name\":\"Map 2\",\"grouping\":true,\"sets\":[{\"fields\":[{\"name\":\"Point Latitude\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"Point Longitude\",\"assigned\":[],\"template\":false,\"added\":false}]},{\"fields\":[{\"name\":\"Start Latitude\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"Start Longitude\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"End Latitude\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"End Longitude\",\"assigned\":[],\"template\":false,\"added\":false}]},{\"fields\":[{\"name\":\"Cell Latitude\",\"assigned\":[{\"sourceName\":\"Data: multiple sets\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"\\\"latitude\\\"\"}],\"template\":false,\"added\":false},{\"name\":\"Cell Longitude\",\"assigned\":[{\"sourceName\":\"Data: multiple sets\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"\\\"longitude\\\"\"}],\"template\":false,\"added\":false},{\"name\":\"Cell Value\",\"assigned\":[{\"sourceName\":\"Data: multiple sets\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"\\\"himawari\\\"\"}],\"template\":false,\"added\":false}]}]},{\"name\":\"Bar Chart\",\"grouping\":true,\"sets\":[{\"fields\":[{\"name\":\"data\",\"assigned\":[],\"template\":false,\"added\":false},{\"name\":\"weights\",\"assigned\":[],\"template\":false,\"added\":false}]},{\"fields\":[{\"name\":\"data\",\"assigned\":[{\"sourceName\":\"Data: multiple sets\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"band\"}],\"template\":false,\"added\":false}]}]}]}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}, 1);\n\t\t}\n\t}", "_changeDataSource(oldDs, newDs) {\n if (oldDs) {\n oldDs.disconnect(this);\n }\n\n this._needsUpdate = true;\n return newDs ? newDs.connect(this) : (0,rxjs__WEBPACK_IMPORTED_MODULE_4__.of)();\n }", "update(startingData) {}", "function update() {\n var conn = new Ext.data.Connection();\n conn.request({\n url: '/json/',\n method: 'GET',\n params: {},\n success: function(responseObject) {\n dataArray = Ext.decode(responseObject.responseText);//decodes the response\n reload_data(); //resets the store and grids\n },\n failure: function() {\n alert(\"failure with GET!\");\n }\n });\n\t \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 }", "function setSource(newSource) {\n\n source = newSource;\n\n // TODO: fix lazy loading!\n //if (isRendered) {\n // renderSource();\n //}\n renderSource();\n\n }", "function DataSourceUpdate(parent) {\n this.parent = parent;\n }", "function updateSource() {\n\n getPolygons(function(){\n map.panTo(sourceMarker.getLatLng())\n });\n updateAutocomplete(sourceAutoComplete, sourceMarker);\n }", "update(data) {\n this.data = data;\n this.populate(this.dindex);\n console.log(\"Infographic of type \\\"\" + this.typename + \"\\\" updated.\");\n }", "addSource(source) {\n this._data.source = source;\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}", "setDataSource() { // OK\n\t\tconst result = [];\n\n\t\tfor (let i = 0; i < this.totalAds; i++) {\n\t\t\tresult.push(i);\n\t\t}\n\t\tthis.dataSource = result;\n\t}", "Update() {\n\n this.fRows = this.GetWorkingRows();\n\n var i, ln, Pos = this.Position;\n this.fPosition = -1;\n\n this.Position = 0;\n\n // inform listeners\n if (!this.BindingSuspended && !this.fPropagating) {\n this.fPropagating = true;\n try {\n for (i = 0, ln = this.fListeners.length; i < ln; i++) {\n this.fListeners[i].DataSourceUpdated();\n }\n\n this.OnUpdated();\n } finally {\n this.fPropagating = false;\n }\n }\n\n if (Pos >= 0)\n this.Position = Pos;\n }", "_changeDataSource(oldDs, newDs) {\n if (oldDs) {\n oldDs.disconnect(this);\n }\n this._needsUpdate = true;\n return newDs ? newDs.connect(this) : Object(rxjs__WEBPACK_IMPORTED_MODULE_2__[\"of\"])();\n }", "_changeDataSource(oldDs, newDs) {\n if (oldDs) {\n oldDs.disconnect(this);\n }\n this._needsUpdate = true;\n return newDs ? newDs.connect(this) : Object(rxjs__WEBPACK_IMPORTED_MODULE_2__[\"of\"])();\n }", "assign_data(data_id, data_source) {\n this.missing_data_source_div.css('display','none')\n\n this.data_id = data_id\n this.data_source = data_source\n\n //time_log(`assigned data ${data_id} ${data_source.name} ${data_source.stats} to widget ${this.name} ${this.typename}`)\n\n this._refresh_source_icon()\n\n // Do not notify the widget if assigned a null-datasource. Some widgets would have to be updated.\n if (this.data_source == null)\n return\n\n try {\n this.on_assign_data() // Notify widget\n } catch (error) {\n time_error(error.message, error.stack)\n }\n }", "updateCoffeeSource(coffeeSourceId, coffeeSource) {\r\n \r\n }", "function toChangeSourceData(){\n isChangingSources = true;\n if(sources.length > 0){\n currentSID = sources[0].id;\n }\n document.getElementById(\"input\").innerHTML = sourceDataChangeForm();\n}", "dataSource(data, widgetConfig) {\n let config = widgetConfig.split(' ')[1],\n random = config.split('_')[1],\n source = {\n id: widgetConfig,\n type: 'Componentsmdx_mondrianJndi',\n typeDesc: 'mondrianJndi',\n parent: 'UnIqEiD',\n properties: [],\n meta: 'CDA',\n meta_conntype: 'mondrian.jndi',\n meta_datype: 'mdx'\n },\n sourceName = $('.' + config + ' .sourceName')[0].value,\n jndi = $('.' + config + ' .sourceConnect')[0].value,\n cubes = $('.' + config + ' .dataCubes')[0].value,\n query = $('.' + config + ' .sqlStatement')[0].value,\n queryType = $('.' + config + ' .queryType')[0].value,\n stringCubes = 'mondrian:/',\n catalog = (queryType === 'mdx') ? stringCubes + cubes : cubes;\n let dataRows = {\n name: sourceName,\n jndi: jndi,\n access: 'pubilc',\n catalog: catalog,\n query: query,\n bandedMode: 'compact',\n parameters: [],\n cdacalculatedcolumns: [],\n cdacolumns: [],\n output: [],\n outputMode: 'include',\n cacheKeys: [],\n cacheDuration: 3600,\n cache: true\n };\n\n d3.entries(dataRows).map(d=>{\n let row = {\n 'name': d.key,\n 'value': d.value\n };\n\n source.properties.push(row);\n });\n data.push(source);\n this.chartDataSource(data, sourceName, random);\n this.dataSourceNames.push(sourceName);\n this.selectDataSource(data, sourceName, random);\n return source;\n }", "UpdateData(startDate, endDate) {\n this.startDate = startDate;\n this.endDate = endDate;\n\n const data = this.currentData.filter(row => { \n return row.Date.getTime() >= startDate.getTime() && row.Date.getTime() < endDate.getTime()\n });\n this.mapObject.updateMap(data);\n this.plotObject.updatePlot(data);\n }", "function updateDataSet(newData) {\n clearDataTable();\n var fieldNames = [];\n for (var i = 0; i < newData.fields.length; i++) {\n var current = newData.fields[i];\n if (current.domain) {\n //replace in all\n var currentFeature = newData.features[0].attributes;\n var codeValue = currentFeature[current.name];\n if (codeValue) {\n var toReplace = current.domain.codedValues[codeValue - 1].name;\n currentFeature[current.name] = toReplace;\n }\n \n }//domain check\n fieldNames.push(current.name); \n }\n //send to UI\n var current = newData.features[0].attributes;\n for (var namesIndex = 0; namesIndex < fieldNames.length; namesIndex++) {\n appendData( fieldNames[namesIndex], current[ fieldNames[namesIndex] ] );\n }\n \n }", "update() {\n this.dataChanged = true;\n this.persons.all = undefined;\n this.jobTitles.all = undefined;\n this.updateFiltered();\n this.updateTimed();\n }", "refreshDatas() {\n this.populateBrandsData(); \n this.forceUpdate();\n }", "function updateData()\r\n{\r\n if (debug)\r\n {\r\n console.debug(\"updating data...\");\r\n }\r\n Clientraw.retrieveAndParse(clientrawUrl, Clientraw.parseClientraw);\r\n Clientraw.retrieveAndParse(clientrawhourUrl, Clientraw.parseClientrawhour);\r\n Clientraw.retrieveAndParse(clientrawextraUrl, Clientraw.parseClientrawextra);\r\n}", "function setSource(newSource) {\n\t\t\tsource = newSource;\n\n\t\t\t// TODO: fix lazy loading!\n\t\t\tif (isRendered) {\n\t\t\t\trenderSource();\n\t\t\t}\n\t\t\t// renderSource();\n\t\t}", "function updateData(){\r\n config.data.labels = [];\r\n for (const prop in LocalDatabase_analog){\r\n // No representar los segundos formato HH:MM \r\n if( !config.data.labels.find( element => element == LocalDatabase_analog[prop].timestamps.substr(11,5) )){\r\n config.data.labels.push( LocalDatabase_analog[prop].timestamps.substr(11,5) );\r\n }\r\n }\r\n\r\n let old_dataset = config.data.datasets;\r\n config.data.datasets = [];\r\n\r\n for(const dataset_name in old_dataset){\r\n old_dataset[dataset_name].func();\r\n }\r\n \r\n updateChart();\r\n \r\n console.log(\"actualizada la base de datos local\");\r\n \r\n}", "refresh() {\n // Refresh the source list.\n this.clear();\n this.load();\n }", "function dataUpdate(data){\n\t\t\tif( !data) return;\n\t\t\tif( data.Rows[0].Label) updateLabel(data);\n\t\t\tif( !labels || !chart) return;\n\t\t\t\n\t\t\tvar dataprovider = convertoChart(data);\n\t\t\tchart.dataProvider = dataprovider; \n\t\t\tchart.validateData(); \n\t\t}", "_switchDataSource(dataSource) {\n this._data = [];\n if (Object(_angular_cdk_collections__WEBPACK_IMPORTED_MODULE_2__[\"isDataSource\"])(this.dataSource)) {\n this.dataSource.disconnect(this);\n }\n // Stop listening for data from the previous data source.\n if (this._renderChangeSubscription) {\n this._renderChangeSubscription.unsubscribe();\n this._renderChangeSubscription = null;\n }\n if (!dataSource) {\n if (this._dataDiffer) {\n this._dataDiffer.diff([]);\n }\n this._rowOutlet.viewContainer.clear();\n }\n this._dataSource = dataSource;\n }", "_dataImportHandler() {\n this.refresh();\n }", "refreshData() {\n if (!this.refreshUrl) {\n return;\n }\n Csv.parseUrl(proxyCatalogItemUrl(this, this.refreshUrl), true, this.ignoreRowsStartingWithComment).then(dataColumnMajor => {\n runInAction(() => {\n if (this.polling.shouldReplaceData) {\n this.dataColumnMajor = dataColumnMajor;\n }\n else {\n this.append(dataColumnMajor);\n }\n });\n });\n }", "_fullRefresh(action) {\r\n const that = this;\r\n\r\n if (that.dataSource.virtualDataSource) {\r\n that.dataSource._updating = true;\r\n that._requestVirtualDataSource(action);\r\n return;\r\n }\r\n\r\n that._initRows();\r\n that._refreshDataRows();\r\n }", "update(data) {\n this.data = data || this.data;\n this._updateID++;\n }", "refreshBackendDataset(gridOptions) {\n // user can pass new set of grid options which will override current ones\n if (gridOptions) {\n this.sharedService.gridOptions = Object.assign({}, this.sharedService.gridOptions, gridOptions);\n }\n refreshBackendDataset(this.sharedService.gridOptions);\n }", "function updateStyleSource(map, update) {\n var newSource = update.source.toJS();\n if (newSource.type === 'geojson') {\n var oldSource = map.getSource(update.id);\n if (oldSource.type === 'geojson') {\n // update data if no other GeoJSONSource options were changed\n var oldOpts = oldSource.workerOptions;\n if ((newSource.maxzoom === undefined || newSource.maxzoom === oldOpts.geojsonVtOptions.maxZoom) && (newSource.buffer === undefined || newSource.buffer === oldOpts.geojsonVtOptions.buffer) && (newSource.tolerance === undefined || newSource.tolerance === oldOpts.geojsonVtOptions.tolerance) && (newSource.cluster === undefined || newSource.cluster === oldOpts.cluster) && (newSource.clusterRadius === undefined || newSource.clusterRadius === oldOpts.superclusterOptions.radius) && (newSource.clusterMaxZoom === undefined || newSource.clusterMaxZoom === oldOpts.superclusterOptions.maxZoom)) {\n oldSource.setData(newSource.data);\n return;\n }\n }\n }\n\n map.removeSource(update.id);\n map.addSource(update.id, newSource);\n}", "function updateStyleSource(map, update) {\n var newSource = update.source.toJS();\n if (newSource.type === 'geojson') {\n var oldSource = map.getSource(update.id);\n if (oldSource.type === 'geojson') {\n // update data if no other GeoJSONSource options were changed\n var oldOpts = oldSource.workerOptions;\n if ((newSource.maxzoom === undefined || newSource.maxzoom === oldOpts.geojsonVtOptions.maxZoom) && (newSource.buffer === undefined || newSource.buffer === oldOpts.geojsonVtOptions.buffer) && (newSource.tolerance === undefined || newSource.tolerance === oldOpts.geojsonVtOptions.tolerance) && (newSource.cluster === undefined || newSource.cluster === oldOpts.cluster) && (newSource.clusterRadius === undefined || newSource.clusterRadius === oldOpts.superclusterOptions.radius) && (newSource.clusterMaxZoom === undefined || newSource.clusterMaxZoom === oldOpts.superclusterOptions.maxZoom)) {\n oldSource.setData(newSource.data);\n return;\n }\n }\n }\n\n map.removeSource(update.id);\n map.addSource(update.id, newSource);\n}", "update( data ) {\n this.state.cursor().update( cursor => {\n return cursor.merge( data )\n })\n }", "function refreshStock() {\n vm.dtInstance.reloadData(function() {\n }, true);\n }", "refreshData(event) {\n refreshApex(this.rawResourceData);\n }", "refresh() {\n const params = this.layer.getSource().getParams();\n\n if (!params.srs) {\n params.srs = this.manager.view.getProjection().getCode();\n }\n if (this.filters) {\n if (this.filters.length) {\n params.CQL_FILTER = this.filterString;\n this.source.updateParams(params);\n }\n } else if (this.manager.filters.length) {\n params.CQL_FILTER = this.manager.filterString;\n this.source.updateParams(params);\n }\n }", "function dwscripts_popupDataSource(dsFileName, argument)\n{\n // call the addDynamicSource function in the given file\n var configDir = dw.getConfigurationPath();\n var dom = dw.getDocumentDOM();\n var smDir = dom.serverModel.getFolderName();\n var fullPath = configDir + \"/DataSources/\" + smDir + \"/\" + dsFileName;\n if (dwscripts.fileExists(fullPath))\n {\n var dsDOM = dw.getDocumentDOM(fullPath);\n if (dsDOM)\n {\n var parentWin = dsDOM.parentWindow;\n if (parentWin.addDynamicSource != null)\n {\n parentWin.addDynamicSource(argument);\n \n // Refresh the list of Data Sources\n \n // In order to force a refresh of the dataSources\n // we need to clear the dataSources property on\n // the current documents window.\n \n if (dom.parentWindow)\n {\n dom.parentWindow.dataSources = null;\n dw.dbi.getDataSources();\n }\n }\n }\n }\n}", "function update(){\n\tconsole.log('Initializing data...server will be ready when the count is done')\n\tdb.clearCityData('sfbay')\n\tdb.saveCityData('sfbay');\n}", "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}", "updateDataFile() {\n\t\tthis.getDataFile()\n\t\t.then(() => this.getClient());\n\t}", "refreshValue() {\n const sourceData = this.hot.getSourceDataAtCell(this.row, this.prop);\n\n this.originalValue = sourceData;\n\n this.setValue(sourceData);\n this.refreshDimensions();\n }", "function updateLatestData(data){\n\t\n\tvar gview = $(\"#writebackgrid\").data(\"kendoGrid\");\t\t \t\n\tvar gridData = gview.dataSource.data();\n\t $.each(data.entity,function(){\t\t \t\n\t\t// Find those records that have requestId\n\t\t// and return them in `res` array\n\t\tvar pointName = this.displayName;\t\t\t\t\n\t\tvar res = $.grep(gridData, function (d) {\n\t\t\n\t\treturn d.displayName == pointName;\n\t\t \n\t\t});\n\t\t\n\t\t//console.log(JSON.stringify(res));\n\t\tif(res !=undefined){\n\t\t\tvar dataItem =gview.dataSource.get(res[0].id);\n\t\t\tdataItem.set(\"currentVal\",this.data);\n\t\t\tdataItem.set(\"deviceTime\",kendo.toString(new Date(this.deviceTime), \"G\"));\n\t\t}\t\n\t\n\t });\n\n\thighlightQueuedRows();\n \n}", "function refreshTable() {\n debug(base.options.dataSourceType);\n $(base.$el_body.find('.sibdatatable-spin')).show();\n base.$el_body_content.hide();\n switch (base.options.dataSourceType) {\n case 'remote':\n getTableDataFromRemote();\n break;\n case 'html':\n getTableDataFromHtml();\n break;\n case 'json':\n getTableDataFromJSON();\n break;\n }\n }", "componentDidUpdate() { //triggered if data changed in the database\n this.setData()\n }", "function update(newData) {\n clearGraph();\n graph.allSeries = newData;\n\n draw();\n }", "changeSource(source) {\n\t\tthis.info.source = source\n\t\tthis.config.source = source\n\t}", "function reloadData() {\n if (typeof (CPData) != \"undefined\") { CPData.regenerate(); }\n if (typeof (CPDataSoon) != \"undefined\") { CPData.regenerate(); }\n if (typeof (CPDataDownloaded) != \"undefined\") { CPData.regenerate(); }\n loadInfo();\n }", "function refreshData() {\n $scope.loadData();\n }", "updateData() {\n // filter data from selected time period\n const filteredData = this.data.filter(\n // the \"minDate\" and \"maxDate\" are set in the main controller\n (data) => data.date >= minDate && data.date <= maxDate\n );\n\n this.update(filteredData);\n }", "async refresh() {\n try {\n this.dataSource = await socket.emit('adapter.git.getStatus');\n } catch (error) {\n this.dataSource = defaultDataSource;\n }\n }", "function refreshResults() {\n\tif (_dataSource) {\n\t\t_pager.page(0);\n\t\t_dataSource.fetch(function(){\n\t\t // if callback is needed, place it here\n\t\t});\n\t}\t\n}", "function updateDates(){\n if (brush.empty()){\n revisedDates = datesProvided; //if brush is empty set the new dates to the original dates\n } else {\n let brushExtent = brush.extent(); //store brush positions\n LOWresult = search4key(+brushExtent[0]);\n HIGHresult = search4key(+brushExtent[1]);\n //console.log(\"Date index: \" + LOWresult + \" to \" + HIGHresult);\n revisedDates = newDates(LOWresult, HIGHresult);\n }\n\n console.log(revisedDates);\n //renderNetworkData(myArraryOfObjects);\n\n renderNetworkData(inputCSVData, revisedDates[0], revisedDates[revisedDates.length-1]);\n //console.log(networkData); // debug line to analyze structure of networkData array\n //clear graph\n d3.selectAll(\".node\").remove();\n d3.selectAll(\"path\").remove();\n //redraw graph\n generateNetworkGraph(networkData,networkLinks);\n tableData = [];\n grid.setData(tableData);\n grid.resizeCanvas();\n grid.render();\n \n tableData = renderTableData(inputCSVData, revisedDates[0], revisedDates[revisedDates.length-1])\n getLocationData(tableData);\n console.log(tableData);\n grid.setData(tableData);\n grid.resizeCanvas();\n grid.render();\n \n}", "function updatedata(id) {\n getPlot(id);\n}", "function updateDates(){\n if (brush.empty()){\n revisedDates = datesProvided; //if brush is empty set the new dates to the original dates\n } else {\n let brushExtent = brush.extent(); //store brush positions\n LOWresult = search4key(+brushExtent[0]);\n HIGHresult = search4key(+brushExtent[1]);\n // console.log(\"Date index: \" + LOWresult + \" to \" + HIGHresult);\n revisedDates = newDates(LOWresult, HIGHresult);\n }\n console.log(revisedDates);\n //renderNetworkData(myArraryOfObjects);\n renderNetworkData(originalData, revisedDates[0], revisedDates[revisedDates.length-1]);\n //console.log(networkData); // debug line to anaylize structure of networkData array\n //clear graph\n d3.selectAll(\".node\").remove();\n d3.selectAll(\"path\").remove();\n //redraw graph\n generateNetworkGraph(networkData,networkLinks);\n tableData = [];\n grid.setData(tableData);\n grid.resizeCanvas();\n grid.render();\n \n tableData = renderTableData(originalData, revisedDates[0], revisedDates[revisedDates.length-1])\n getLocationData(tableData);\n console.log(tableData);\n grid.setData(tableData);\n grid.resizeCanvas();\n grid.render();\n \n}", "function update_data()\n {\n data = walk_list(container, 0);\n }", "update() {\n if(this.options.onUpdate && typeof this.options.onUpdate === 'function')\n this.options.onUpdate.call();\n\n this.rows = [];\n this._updateGridRows();\n this._updatePositions();\n\n if(this.options.onUpdated && typeof this.options.onUpdated === 'function')\n this.options.onUpdated.call();\n }", "function updateData() {\n\t\txyData = pruneData(xyData);\n\t\tllmseFit = xyHelper.llmse(xyData, xPowers);\n\t\tupdate();\n\t}", "function updateData() {\n\n // Filtering out the data as per newly set filters\n // Calling draw functions after freshly filtered data\n\n let filteredData = netflixData;\n if (filters.releaseYear) {\n filteredData = filteredData.filter(function(d) {\n return d.releaseYear >= filters.releaseYear[0] && d.releaseYear <= filters.releaseYear[1];\n });\n }\n\n let nestedCountryData = d3.group(filteredData, d => d.country);\n nestedCountryData = Array.from(nestedCountryData);\n\n let pathSel = drawMap(mapG, mapData);\n drawYearsChart(filteredData);\n choroplethizeMap(pathSel, nestedCountryData);\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 }", "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}", "reload(newUni, newUoa, orgData, data, type) {\n this.selectedUni = newUni;\n this.selectedUoa = newUoa;\n console.log('Reloading the chart using a new dataset');\n\n // Rearrange the dataset\n this.originalData = orgData;\n this.data = data;\n this.type = type;\n this.createChart();\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 }", "__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 }", "#updateData() {\n this.container.querySelector('.data').innerHTML = this.data;\n }", "function refreshData() {\n vm.ready = true;\n if (vm.currentDeviceType && vm.currentDeviceType.id) {\n filter.start= moment(filter.start).format('YYYY-MM-DD HH:mm:ss');\n filter.end = moment(filter.end).format('YYYY-MM-DD HH:mm:ss');\n getFilteredDeviceState(vm.currentDeviceType, filter.start, filter.end);\n vm.steppedline = (vm.currentDeviceType.type === 'binary');\n }\n }", "function updateFeed (data, feedIndex, feed) { }", "updateData(data) {\n this.data(data, true);\n\n return this;\n }", "function updateData(sqlQuery, obj, callback){\r\n console.log(\"\\nSQL Query::\"+sqlQuery);\r\n connMgr.getConn(function (connection) {\r\n connection.query(sqlQuery, obj, function(err,res){\r\n if(err) throw err;\r\n if(callback)callback();\r\n console.log('Changed ' + res.changedRows + ' rows');\r\n });\r\n });\r\n}", "function setSource(source){\n\tif(source == currSource){\n\t\talert('Fuente ya seleccionada');\n\t\treturn;\n\t}\n\telse if(choropleth_objects[source]==undefined){\n\t\talert('Fuente no disponible');\n\t\treturn;\n\t}\n\telse{\n\t\tif(lastMarkerGroup!=undefined){\n\t\t\tlayerSelector.removeLayer(lastMarkerGroup);\n\t\t\tmymap.removeLayer(lastMarkerGroup);\n\t\t\tlayerSelector.showGControl();\n\t\t}\n\t\t//desseleccionar checkbox doc.getElement... (?)\n\n\t\tcurrSource = source;\n\t\t//updateMarkers(currSource);\n\t\tif(choropleth_objects[currSource].markerLayer.getLayers().length>0){\n\t\t\tlastMarkerGroup = choropleth_objects[currSource].markerLayer;\n\t\t\tlayerSelector.addOverlay(lastMarkerGroup,\"Marcadores\");\n\t\t\tlayerSelector.showGControl();\n\t\t}\n\n\n\t\tchoroplethize(currSource);\n\t\tif(initChoroGran == 1)\n\t\t\tsetGranProvincia();\n\t\telse if(initChoroGran == 2)\n\t\t\tsetGranComuna();\n\t\tsetTimechartData(currSource, timeChartGran);\n\t}\n}", "function updateDataTable() { \r\n datatables.fnClearTable(); \r\n datatables.fnAddData([ \".1\",\"2\",\".3\",\"4\",\"5\"] ); \r\n datatables.fnAddData([ \".a\",\"b\",\".c\",\"d\",\"e\"] ); \r\n }", "function setSD05PDDS() {\n url = ApiUrl_AutoComplete + '?dataSource=SD05PDDS_All&query=';\n $http(\n {\n method: 'GET',\n url: url,\n }).then(function successCallback(response) {\n $scope.DATASOURCE_SD05PDDS = response.data.Datas.Data1;\n \n }, function errorCallback(response) {\n console.log('Oops! Something went wrong while fetching the data. Status Code: ' + response.status + ' Status statusText: ' + response.statusText);\n });\n }", "async update(sourceFile, data){\n const existing = this._storage.getItem(this._key(sourceFile));\n\n if (existing){\n const cmd = JSON.parse(existing);\n if (cmd.type === SourceChange.CREATE || cmd.type == SourceChange.UPDATE){\n // For CREATE, we retain the original info, and ONLY update the data\n // (as though it had been created with this data originally)\n cmd.timestamp = Date.now();\n this._put(sourceFile, cmd);\n this._putData(sourceFile, data);\n } else if (cmd.type === SourceChange.MOVE){\n // TODO promote to UPDATE with new path?\n throw 'TODO: update move';\n } else {\n throw cmd.type;\n }\n } else {\n const cmd = {timestamp: Date.now(), file: sourceFile.simple, type:SourceChange.UPDATE};\n this._put(sourceFile, cmd);\n this._putData(sourceFile, data);\n }\n }", "updateLatestData(period) {\n console.log('updateData');\n }", "function dataWatchFn(newData, oldData) {\n if (newData !== oldData){\n if (!scope._config.disabled) {\n scope._config.refreshDataOnly ? scope.api.update() : scope.api.refresh(); // if wanted to refresh data only, use update method, otherwise use full refresh.\n }\n }\n }", "function dataWatchFn(newData, oldData) {\n if (newData !== oldData){\n if (!scope._config.disabled) {\n scope._config.refreshDataOnly ? scope.api.update() : scope.api.refresh(); // if wanted to refresh data only, use update method, otherwise use full refresh.\n }\n }\n }", "function update(data) {\n console.log('+++ TODO');\n }", "function updateData(data) {\n // data.selectedGen++;\n // model.provider.updateField(data.name, { active: data.selected });\n model.provider.toggleFieldSelection(data.name);\n }", "function initDataSourceEdit(){\n\n\tDataSourceDwr.initDataSourceTypes(function(response){\n\t\tif (response.data.types) {\n\t\t dwr.util.addOptions(\"dataSourceTypes\", response.data.types, \"key\", \"value\");\n\t\t}\n\t});\n}", "function updateData() {\n updateStudentList();\n gradeAverage();\n}", "function refresh() {\n\t\t\t\topt.data = cfg.data;\n\t\t\t\topt.target.innerHTML = \"\";\n\t\t\t\tcfg = opt;\n\t\t\t\tinit();\n\t\t\t}", "function updateData(collectionName, dataObj) {\n service.collections[collectionName].update(dataObj);\n saveDb();\n }", "function optionChanged(newSample){\n getData(newSample);\n getDemoData(newSample);\n\n}", "refreshBackendDataset(gridOptions) {\n this.gridMenuExtension.refreshBackendDataset(gridOptions);\n }", "function simDataSwitch() {\n document.getElementById(\"cbUpdateDataProvider\").disabled = false;\n document.getElementById(\"cbFilterRows\").disabled = false;\n document.getElementById(\"cbSortRows\").disabled = false;\n document.getElementById(\"btnFetch\").disabled = false;\n document.getElementById(\"btnFetch\").innerHTML = \"Start Fetching data\";\n idx = 0;\n grid.setDataProvider(generateData(500));\n}", "function handleNewData ( source, tileArrays, sourceKey ) {\n\t for ( var i = 0 ; i < tileArrays.length ; i++ ) {\n\t\tvar tileArray = tileArrays[ i ];\n\t\tvar tilePointer = loadBuffer( tileArray );\n\t\tvar start = source.getStart();\n\t\tvar end = source.getEnd();\n\t\tvar projection = source.getProjection();\n\t\tvar loadFunction = source.getLoadFunction();\n\t\tvar dataInfo = initSorceData( start, end, projection );\n\t\t\n\t\tloadGlBuffer( loadFunction, tilePointer, dataInfo, fBufferInfo );\n\n\t\tfSourceBuffers[ sourceKey ].push( dataInfo );\n\n\t\tif ( fMinY === undefined || fMinY > dataInfo.minY )\n\t\t fMinY = dataInfo.minY;\n\n\t\tif ( fMaxY === undefined || fMaxY < dataInfo.maxY )\n\t\t fMaxY = dataInfo.maxY;\n\t }\n\n\t fGl.bufferData(fGl.ARRAY_BUFFER, fBufferInfo.data, fGl.STATIC_DRAW);\n\n\t schudleDraw();\n\t}", "chartDataSource(data, name, random) {\n data.map(d=>{\n if (d.canvas) {\n let number = d.canvas.className.split('_')[1];\n\n if (number === random) {\n let properties = d.components.properties;\n\n for (let i = 0; i < properties.length; i++) {\n properties[i].name === 'dataSource' ? properties[i].value = name : null;\n }\n }\n }\n });\n this.props.saveData(data);\n }", "function Data(dataSource,query){this.initDataManager(dataSource,query);}", "updateData(config) {\r\n this.setState(config);\r\n }", "updateDemographicChart() {\n const population = this.model.getAllPopulation();\n this.demographicsChart.receiveUpdate(population);\n }" ]
[ "0.7457908", "0.7315093", "0.7036375", "0.7018", "0.6795442", "0.66365325", "0.6502029", "0.64686435", "0.6458288", "0.6449679", "0.6440337", "0.6422515", "0.6419076", "0.6399757", "0.63748085", "0.63710153", "0.62837553", "0.6238089", "0.6229691", "0.62223595", "0.61925745", "0.61925745", "0.6171913", "0.6163834", "0.61546856", "0.61336714", "0.6114413", "0.6080358", "0.6072234", "0.60680044", "0.6036211", "0.5995041", "0.5990894", "0.59762144", "0.5968649", "0.5960858", "0.59370005", "0.5924365", "0.5908084", "0.5904602", "0.58987504", "0.589081", "0.589081", "0.5881494", "0.5876724", "0.5874367", "0.58733964", "0.5865615", "0.5858762", "0.5854457", "0.5853945", "0.5847729", "0.5831214", "0.5804348", "0.5804127", "0.5799122", "0.57888603", "0.57708967", "0.5756482", "0.575138", "0.5724709", "0.5713239", "0.5702418", "0.57009625", "0.5690788", "0.56827617", "0.5682613", "0.5663713", "0.56618166", "0.5661319", "0.56574225", "0.5647825", "0.5643888", "0.5639873", "0.5624384", "0.5611085", "0.56096476", "0.5599709", "0.55820465", "0.55794007", "0.5558714", "0.5558506", "0.5540864", "0.5526351", "0.54890996", "0.54890996", "0.5486102", "0.5484726", "0.5474837", "0.54739416", "0.54725623", "0.54706293", "0.54666406", "0.5461999", "0.54609656", "0.54556036", "0.5455304", "0.54510504", "0.5450606", "0.5441636" ]
0.5790509
56
This function is to remove a data source
static async removeDataSource(email, dataSourceID) { return new Promise((resolve, reject) => { Database.sendQuery('DELETE FROM datasource WHERE ( email = $1) AND ( ID = $2);', [email, dataSourceID]) .then((result) => resolve(result.rows)) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeSource(source) {\n const sourceIdx = this._sources.findIndex((s) => s === source);\n if (sourceIdx > -1) {\n arrayRemoveAt(this._sources, sourceIdx);\n source.dispose();\n }\n }", "function deleteSource(oid)\n{\n $.parse.delete('sources/' + oid, function(json){\n $(\"[oid='\" + oid + \"']\").parent(\".source\").remove();\n });\n}", "function deleteDynamicSource(sourceName, bindingName)\r\n{\r\n var siteURL = dw.getSiteRoot();\r\n \r\n if (siteURL.length)\r\n {\r\n //For localized object name\r\n if (sourceName != \"URL\")\r\n {\r\n sourceName = \"URL\";\r\n }\r\n\r\n dwscripts.deleteListValueFromNote(siteURL, sourceName, bindingName);\r\n }\r\n}", "switchDataSource(dataSource) {\n // tslint:disable-next-line:no-unbound-method\n if (this._dataSource && typeof this._dataSource.disconnect === 'function') {\n this.dataSource.disconnect(this);\n }\n if (this.dataSubscription) {\n this.dataSubscription.unsubscribe();\n this.dataSubscription = null;\n }\n // Remove the all dataNodes if there is now no data source\n if (!dataSource) {\n this.nodeOutlet.viewContainer.clear();\n }\n this._dataSource = dataSource;\n if (this.nodeDefs) {\n this.observeRenderChanges();\n }\n }", "removeSources(contents) {}", "removeSource(id){\n this.map.getStyle().layers.forEach((layer)=>{\n if (layer.source === id) {\n this.map.removeLayer(layer.id);\n }\n });\n this.map.removeSource(id);\n }", "reset_graphs() {\n d3.selectAll(\".sourcegraph-container\").remove()\n }", "on_desklet_removed() {\n Mainloop.source_remove(this.updateID);\n }", "delete () {\n Api.delete(null, ApiUrls.sources, this.id);\n }", "function removeData(chart, timeline) {\n chart.data.datasets[0].data = data_traffic_chart[timeline];\n chart.update();\n}", "removeUselessSourceButtons() {\n this.$groupButtons.each((_, button) => {\n if (!this.connectsToCollection($(button).data('source'))) {\n $(button).remove();\n }\n });\n }", "function removeData(graph) {\n //Clears all datasets\n graph.data.datasets = [];\n\n //Updates the chart to display to changes\n graph.update();\n}", "function removeSourceAndLayer(name) {\n if (map.getLayer(name)) {\n map.removeLayer(name);\n }\n if (map.getSource(name)) {\n map.removeSource(name);\n }\n }", "_switchDataSource(dataSource) {\n this._data = [];\n if (Object(_angular_cdk_collections__WEBPACK_IMPORTED_MODULE_2__[\"isDataSource\"])(this.dataSource)) {\n this.dataSource.disconnect(this);\n }\n // Stop listening for data from the previous data source.\n if (this._renderChangeSubscription) {\n this._renderChangeSubscription.unsubscribe();\n this._renderChangeSubscription = null;\n }\n if (!dataSource) {\n if (this._dataDiffer) {\n this._dataDiffer.diff([]);\n }\n this._rowOutlet.viewContainer.clear();\n }\n this._dataSource = dataSource;\n }", "remove() {\n //remove handlers of any atomic data defined here\n const {source, handler} = this.events;\n source.remove();\n //reset `this.events` \n this.events = {};\n }", "remove() {\n //remove handlers of any atomic data defined here\n const {source, handler} = this.events;\n source.remove();\n //reset `this.events` \n this.events = {};\n }", "function cleanUp()\n{\n if ($(\"#dataWindow\").length)\n $(\"#dataWindow\").remove();\n}", "function removeOldChart() {\n var oldChart = document.getElementById('DB')\n if (oldChart != undefined) {\n var parent = oldChart.parentNode\n parent.removeChild(oldChart)\n }\n\n}", "function destoryDataTable(){\r\n\toTable.fnDestroy();\t\t\r\n\t// destroy doesn't really work. This next line removes extra html that gets inserted when the datatable\r\n\t// is initialized multiple times.\r\n\t$('#list table tr th').each(function(){\r\n\t\t$(this).html($(this).children('div').html());\r\n\t});\t\r\n}", "function deleteSource(id){\n var i;\n for(i = 0; i < sources.length; i++){\n if(sources[i].id == id){\n if(sources.length == 1){\n document.getElementById(\"input\").innerHTML = sourceDataChangeForm();\n document.getElementById(\"meiOutput\").value = createMEIOutput();\n createSVGOutput();\n return;\n }\n else if(i != 0){\n currentSID = sources[i - 1].id;\n currentSource = sources[i - 1];\n }\n else{\n currentSID = sources[i + 1].id;\n currentSource = sources[i + 1];\n }\n sources.splice(i, 1);\n }\n }\n for(i = 0; i < syllables.length; i++){\n for(var j = 0; j < syllables[i].neumes.length; j++){\n if(Array.isArray(syllables[i].neumes[j])){\n for(var k = 0; k < syllables[i].neumes[j].length; k++){\n if(syllables[i].neumes[j][k].sourceID == id){\n syllables[i].neumes[j].splice(k, 1);\n }\n }\n }\n else{\n for(var l = 0; l < syllables[i].neumes[j].pitches.length; l++){\n if(Array.isArray(syllables[i].neumes[j].pitches[l])){\n for(var k = 0; k < syllables[i].neumes[j].pitches[l].length; k++){\n if(syllables[i].neumes[j].pitches[l][k].sourceID == id){\n syllables[i].neumes[j].pitches[l].splice(k, 1);\n }\n }\n }\n }\n }\n }\n }\n document.getElementById(\"input\").innerHTML = sourceDataChangeForm();\n document.getElementById(\"meiOutput\").value = createMEIOutput();\n createSVGOutput();\n}", "function remove(){\n const index = this.parentNode.dataset.index;\n myLibrary.splice(index, 1);\n \n refresh();\n}", "removeFromLayers(){\n if (this.map.getSource(window.SRC_FROM_POLYGONS)) this.removeSource(window.SRC_FROM_POLYGONS);\n if (this.map.getSource(window.SRC_FROM_POINTS)) this.removeSource(window.SRC_FROM_POINTS);\n }", "_removeCallback() {\n this._renderCallback()\n this._viewer.dcContainer.removeChild(this._delegate)\n this._state = DC.LayerState.REMOVED\n }", "function clearDataDisplay() {\n body.removeChild(data_display);\n}", "_onAfterRemovingElement() {\n this.setState({\n rowToDelete : null,\n dataSource : this.state.dataSource.cloneWithRows(this._data)\n });\n }", "function onDragEnd(e) {\n\n //clearing the source\n sourceParent = \"\";\n sourceIndex = -1;\n }", "function stopSources() {\n for (var i = 0; i < SOURCES.length; i++) {\n var source = SOURCES[i];\n source.noteOff(0);\n }\n SOURCES = [];\n}", "function remove_point(vectorSource){\n vectorSource.clear();\n}", "delete() {\n const source = internal(this).source;\n const model = internal(source).model;\n internal(model).connections.remove(this);\n }", "function clickedDelete()\n{\n\tvar selectedObj = dw.databasePalette.getSelectedNode();\n\tif (selectedObj && selectedObj.objectType==\"Connection\")\n\t{\n\t\tvar connRec = MMDB.getConnection(selectedObj.name);\n\t\tif (connRec) \n\t\t{\n\t\t\tif( MMDB.deleteConnection(selectedObj.name) )\n\t\t\t{\n\t\t\t if (isDisplayingColdfusionConnections())\n\t\t\t {\n\t\t\t \tdeleteDSN(selectedObj.name);\n\t\t\t }\n\t\t\t clickedRefresh();\n\t\t\t}\n\t\t}\n\t}\n}", "remove () {\n // cleanup\n }", "function removeData(chart) {\n let dataLength = chart.data.datasets[0].data.length;\n for(let i = 0; i < dataLength; i++){\n chart.data.datasets[0].data.pop();\n chart.data.labels.pop();\n }\n chart.update();\n}", "_unbindDataSource (path) {\n return new Promise((resolve, reject) => {\n // unbind printData from the specified data source / path\n lpTag.agentSDK.unbind(path,\n printData,\n (err) => {\n // when finished\n if (err) {\n // if there was an error unbinding update the bind state indicator and reject the promise\n this._updateBindIndicator(path);\n reject(err)\n } else {\n // if the unbind succeeded set the bind state to false, update the indicator, and resolve the promise\n _dataSources[path].bound = false;\n this._updateBindIndicator(path);\n resolve(true)\n }\n })\n });\n }", "del(source = true) {\n return new Promise((resolve, reject) => {\n this.doc.del({ source }, (err) => {\n if (err) {\n reject(err);\n }\n else {\n this.sdb.deleteDoc(this);\n resolve();\n }\n });\n });\n }", "_onRemove() {\n RB.DnDUploader.instance.unregisterDropTarget(this.$el);\n }", "function removeChart() {\n chart.destroy();\n }", "function removeData\n var list=db.getCollectionNames();\n for (var i = 0; i < list.length; i++) { \n if (list[i]!=\"system.indexes\") db.getCollection(list[i]).remove();\n }", "unbind() {\n this.updateTarget(emptyArray);\n this.source = null;\n\n if (this.shouldUpdate) {\n this.disconnect();\n }\n }", "function onDragEnd(e) {\n\n //clearing the source\n sourceParent = \"\";\n sourceIndex = -1;\n }", "remove(map, {srcId, layerId}) {\n map.removeSource(srcId);\n map.removeLayer(layerId);\n }", "deleteDataset (projectId, callback, options) {\n options.query = {purge: true};\n scitran.deleteContainer('projects', projectId, callback, options);\n }", "clearRows() {\n const that = this;\n\n that.dataSource = [];\n that.clearSelection();\n }", "function dispose() {\n delete filters[dimensionName];\n delete datasets[dimensionName];\n }", "function disconnect() {\n\n if (source) {\n source.close();\n source = null;\n }\n connected = 0;\n }", "_destroy() {\n\t this._source = null;\n\t this._offset = null;\n\t this._length = null;\n\t}", "onAfterSourceLoadData() {\n this.asyncCall(() => {\n this.chartPlugin.removeAllRangeBars();\n this.updateFromSource();\n });\n }", "removeList(){\n global_gff3.extra_showing = false;\n global_gff3.extra_details = null;\n d3.selectAll('.extra_tr').remove();\n d3.selectAll('.featureList').remove()\n }", "function cleanUp() {\n if (grid) {\n grid.wazObservableGrid(\"destroy\");\n grid = null;\n }\n }", "function removeGrid() {\n grid.empty();\n}", "_removeSingle(source) {\n this.removed = true;\n this._store.remove(this);\n let p;\n switch (source) {\n default:\n case SOURCE.TRANSPORTER:\n this._transporterStates.current = STATE.DELETED;\n if (this._clientStorageStates.current === STATE.DELETED) {\n return Promise.resolve();\n }\n p = this._synchronizeFor(\n TARGET.CLIENT_STORAGE,\n STATE.BEING_DELETED,\n source,\n );\n break;\n case SOURCE.CLIENT_STORAGE:\n this._clientStorageStates.current = STATE.DELETED;\n if (this._transporterStates.current === STATE.DELETED) {\n return Promise.resolve();\n }\n p = this._synchronizeFor(\n TARGET.TRANSPORTER,\n STATE.BEING_DELETED,\n source,\n );\n break;\n }\n return p.then(() => {\n this._dispose();\n // TODO (maybe): this._store.delete(this);\n // TODO (planned for version 0.3): this._onDeleteTrigger()\n });\n }", "function refreshSourceDatas() {\n sourceDataService.findSourceData(\"\").then(\n // Success\n function(response) {\n sourceDatas = response.sourceDatas;\n refreshSourceDataTable();\n });\n }", "function remove() {\n\t\tif (graphContainer) {\n\t\t\t// Select the parent element because the graph container is a group (e.g. for zooming)\n\t\t\td3.select(graphContainer.node().parentNode).remove();\n\t\t}\n\t}", "function remove() {\n\t\tif (graphContainer) {\n\t\t\t// Select the parent element because the graph container is a group (e.g. for zooming)\n\t\t\td3.select(graphContainer.node().parentNode).remove();\n\t\t}\n\t}", "function removeData() {\n var currentMovie = document.getElementById('movie');\n currentMovie.parentNode.removeChild(currentMovie);\n}", "function deleteSource(id) {\n return new Promise((resolve, reject) => {\n db.run(\n `UPDATE source\n SET deleted_at = datetime('now')\n WHERE id = $id;`,\n {\n $id: id\n },\n err => (err ? reject(err) : resolve())\n );\n });\n}", "function onRemove(){\n \n var data_points = chart.options.data[0].dataPoints;\n var isRemoved = false;\n for(var i = 0; i < data_points.length; i++){\n var assets = data_points[i].assets;\n if( data_points[i].exploded ){\n for( var j = 0; j < assets.length; j++){\n if( assets[j].exploded ){\n // remove the asset\n data_points[i].y -= assets[j].y;\n assets.splice(j, 1);\n isRemoved = true;\n // break the loop\n break;\n }\n }\n\n // we should check whether or not an asset is removed, if not, we should delete the all type\n // we also should check whether data_points[i].length > 0, if not, we should delete that type as well\n if( !isRemoved || assets.length == 0){\n data_points.splice(i, 1);\n // update the subchart\n sub_chart.options.title.text = \"\";\n sub_chart.options.data[0].dataPoints = [];\n\n isRemoved = true;\n }\n\n // break the loop\n break;\n }\n }\n\n // if no element is removed\n if( !isRemoved){\n alert( \"You need to choose an asset in order to delete it!\");\n }\n\n // render\n chart.render();\n sub_chart.render();\n}", "function wipeDataLang() {\n if (document.getElementById(\"dataLangInput\")) {\n dataLangExists = document.getElementById(\"dataLangInput\");\n dataLangExists.parentNode.removeChild(dataLangExists);\n } else {\n }\n}", "function removeData(chart) {\n chart.data.labels.shift();\n chart.data.datasets.forEach(function (dataset) {\n dataset.data.shift();\n });\n chart.update();\n }", "function removePlots() {\n d3.selectAll(\".nodes\").remove();\n d3.selectAll(\".link\").remove();\n d3.selectAll(\".axis-label\").remove();\n }", "function shutdown(data, reason) {\n TabSourceService.unregister();\n}", "removeGraphData() {\n this.PieGraph.data.labels = [];\n this.PieGraph.data.datasets.forEach((dataset) => {\n dataset.data = [];\n });\n this.PieGraph.update();\n }", "remove(imageSrc) {\n const currentGallery = this.get();\n\n // Remove image from storage if it is in there.\n const index = currentGallery.indexOf(imageSrc);\n if(index > -1) {\n currentGallery.splice(index, 1);\n this.set(currentGallery);\n }\n }", "async removeMapData() {\n\n\t\tawait Utils.applyFunctoDataArray(Object.keys(this.layerIds), this.map.removeLayer);\n\n\t\tthis.layerIds = {};\n\n\t\tawait Utils.applyFunctoDataArray(Object.keys(this.sourceIds), this.map.removeSource);\n\n\t\tthis.sourceIds = {};\n\n\t}", "function removeData() {\n let parent = document.querySelector('#carbon-data')\n while (parent.firstElementChild) {\n parent.removeChild(parent.firstElementChild)\n\n }\n return\n}", "function delClick(e) {\n const index = getItemIndex(\n srcList,\n e.target.parentElement.getAttribute('name'),\n );\n\n if (index < 0) return;\n\n srcList.splice(index, 1);\n chrome.storage.sync.set({ storageSrcKey: srcList }, () =>\n console.log(`${storageSrcKey} value saved. List : ${srcList}`),\n );\n e.target.closest('tr').remove();\n }", "dataSource(data, widgetConfig) {\n let config = widgetConfig.split(' ')[1],\n random = config.split('_')[1],\n source = {\n id: widgetConfig,\n type: 'Componentsmdx_mondrianJndi',\n typeDesc: 'mondrianJndi',\n parent: 'UnIqEiD',\n properties: [],\n meta: 'CDA',\n meta_conntype: 'mondrian.jndi',\n meta_datype: 'mdx'\n },\n sourceName = $('.' + config + ' .sourceName')[0].value,\n jndi = $('.' + config + ' .sourceConnect')[0].value,\n cubes = $('.' + config + ' .dataCubes')[0].value,\n query = $('.' + config + ' .sqlStatement')[0].value,\n queryType = $('.' + config + ' .queryType')[0].value,\n stringCubes = 'mondrian:/',\n catalog = (queryType === 'mdx') ? stringCubes + cubes : cubes;\n let dataRows = {\n name: sourceName,\n jndi: jndi,\n access: 'pubilc',\n catalog: catalog,\n query: query,\n bandedMode: 'compact',\n parameters: [],\n cdacalculatedcolumns: [],\n cdacolumns: [],\n output: [],\n outputMode: 'include',\n cacheKeys: [],\n cacheDuration: 3600,\n cache: true\n };\n\n d3.entries(dataRows).map(d=>{\n let row = {\n 'name': d.key,\n 'value': d.value\n };\n\n source.properties.push(row);\n });\n data.push(source);\n this.chartDataSource(data, sourceName, random);\n this.dataSourceNames.push(sourceName);\n this.selectDataSource(data, sourceName, random);\n return source;\n }", "unlinkDockingPoints() {\n this.dockPointsDev.forEach((value, index) => {\n this.myLP.timestamp.deleteKCSource(value);\n value.unlinkAll();\n });\n this.dockPointsReq.forEach((value, index) => {\n value.unlinkAll();\n });\n }", "remove() { this.tooltip.remove(); this.element.remove(); }", "handleRemoveRow(event) {\n // For some reason lwc returns a proxy and not an object array when\n // accessing seslectedData directly so going to have to do a query \n // selection for elements to fetch selected rows\n //let selectedRows = this.selectedData;\n let selectedRows = this.template.querySelector('lightning-datatable').getSelectedRows();\n if(!selectedRows.length) {\n this.showNotification('No Rows Selected');\n return;\n }\n for(let i = 0; i < selectedRows.length; i++) {\n for(let j = 0; j < this.data.length; j++) {\n if(this.data[j]['id'] == selectedRows[i]['id']) {\n this.data.splice(j,1);\n }\n } \n }\n this.calculateData();\n }", "function cleanup(){source.removeListener('data',ondata);dest.removeListener('drain',ondrain);source.removeListener('end',onend);source.removeListener('close',onclose);source.removeListener('error',onerror);dest.removeListener('error',onerror);source.removeListener('end',cleanup);source.removeListener('close',cleanup);dest.removeListener('close',cleanup);}", "function cleanup(){source.removeListener('data',ondata);dest.removeListener('drain',ondrain);source.removeListener('end',onend);source.removeListener('close',onclose);source.removeListener('error',onerror);dest.removeListener('error',onerror);source.removeListener('end',cleanup);source.removeListener('close',cleanup);dest.removeListener('close',cleanup);}", "function cleanup(){source.removeListener('data',ondata);dest.removeListener('drain',ondrain);source.removeListener('end',onend);source.removeListener('close',onclose);source.removeListener('error',onerror);dest.removeListener('error',onerror);source.removeListener('end',cleanup);source.removeListener('close',cleanup);dest.removeListener('close',cleanup);}", "function cleanup(){source.removeListener('data',ondata);dest.removeListener('drain',ondrain);source.removeListener('end',onend);source.removeListener('close',onclose);source.removeListener('error',onerror);dest.removeListener('error',onerror);source.removeListener('end',cleanup);source.removeListener('close',cleanup);dest.removeListener('close',cleanup);}", "function wipeDataTag() {\n if (document.getElementById(\"dataTagInput\")) {\n dataTagExists = document.getElementById(\"dataTagInput\");\n dataTagExists.parentNode.removeChild(dataTagExists);\n } else {\n }\n}", "removeDataLines() {\n this._linesData = [];\n }", "removeDataLines() {\n this._linesData = [];\n }", "function removePlots() {\n d3.selectAll(\".nodes\").remove();\n d3.selectAll(\".link\").remove();\n}", "function deleteAllJenkinsUrl(){\n\n var db = getDatabase();\n\n db.transaction(function(tx) {\n var rs = tx.executeSql('DELETE FROM jenkins_data;');\n }\n );\n\n loadAllJenkinsUrl(); //refresh combo\n }", "function dropData() {\n accounts.length = 0;\n}", "deleteCache() {\n this.dataManagement.clear();\n }", "function cleanup() {\n if ( jquery_data_key ) {\n elem.removeData( jquery_data_key );\n } else if ( id ) {\n delete cache[ id ];\n }\n }", "function deletePreviousCanvas(){\n\tlet tr;\n\ttr = canvas.find('tr');\n\ttr.remove();\n}", "function deregisterDataSuppliers() {\n var dataManager = AppController.sharedInstance().dataSupplierManager();\n var identifier = getPluginIdentifier();\n dataManager.deregisterDataSuppliersForPluginWithIdentifier(identifier);\n}", "dispose() {\n this.data = null;\n }", "clearSsrcCache() {\n this.correspondingRtxSsrcs.clear();\n }", "function removeLinks(){\n\tdojo.destroy('usgsLinks');\n}", "addSource(details){\n //if the source already exists then delete it\n if (this.map.getSource(details.id)) this.removeSource(details.id);\n this.map.addSource(details.id, details.source);\n }", "function deinitExistingRows() {\n var view = null;\n removeAllChildren($.mediumSwatchRefinement);\n _.each(listenerViews, function(view) {\n view.removeEventListener('click', onViewClick);\n });\n}", "addNoneDataSource(id, options) {\n return new data_source_1.NoneDataSource(this, id, {\n api: this,\n name: options === null || options === void 0 ? void 0 : options.name,\n description: options === null || options === void 0 ? void 0 : options.description,\n });\n }", "remove() {\n this.target.removeEventListener(this.eventType, this.fn, false);\n }", "function UltraGrid_NotifyDestruction()\n{\n\t//call clean up\n\tUltraGrid_Data_CleanUp(this.InterpreterObject);\n}", "function dropData() {\n\n var magicId = 1234;\n\n return request.del(api + '/tests/' + magicId)\n .endAsync();\n}", "function clear() {\n data = [];\n $grid.find('.row').remove();\n }", "function graphRemove() {\r\n svg.selectAll(\"*\").remove();\r\n d3nodes = [];\r\n d3links = [];\r\n}", "function remove(key) {\n delete this.dataStore[key];\n }", "function deleteGrid(){\n grid.innerHTML = '';\n }", "destroy() {\n delete this.root.dataset.componentId;\n }", "remove(){\n this.removeViews(Object.keys(this.views));\n this.el.innerHTML = null;\n this.layouts[this.layout].isRendered = false;\n this.layout = null;\n }", "remove_widget(widget_id) {\n delete this.data[widget_id];\n }", "removeDataFilter() {\n this.configureDecoder(undefined, {\n filterDescription: null\n });\n }" ]
[ "0.6923161", "0.63919204", "0.62256336", "0.62021405", "0.6170509", "0.6117001", "0.607311", "0.60380137", "0.6021545", "0.6016487", "0.5956192", "0.5955829", "0.5945504", "0.59348667", "0.5897498", "0.5897498", "0.5660677", "0.5658116", "0.5651361", "0.5644043", "0.5628527", "0.5621928", "0.56195885", "0.56168836", "0.5586174", "0.5545699", "0.5535544", "0.5532098", "0.55301255", "0.5513058", "0.5509887", "0.55071634", "0.5506819", "0.5494241", "0.5476114", "0.54673886", "0.5466364", "0.5458932", "0.54546857", "0.54546416", "0.5430681", "0.54243493", "0.5416398", "0.539854", "0.53924453", "0.53798735", "0.5368526", "0.53574115", "0.53548473", "0.5343449", "0.53388673", "0.5338132", "0.5338132", "0.53327405", "0.53314686", "0.5329501", "0.5323806", "0.5307405", "0.53054565", "0.5302889", "0.52983105", "0.5290321", "0.5268809", "0.52686316", "0.5265732", "0.52551585", "0.52524465", "0.52503234", "0.52347946", "0.52238196", "0.52238196", "0.52238196", "0.52238196", "0.5222113", "0.52182484", "0.52182484", "0.5217157", "0.5214443", "0.5213808", "0.5212845", "0.52013355", "0.5192792", "0.51921946", "0.51914656", "0.518749", "0.51835144", "0.5183492", "0.5181202", "0.5170389", "0.5151049", "0.5149335", "0.51458246", "0.5144484", "0.51422507", "0.51412886", "0.51315945", "0.5128735", "0.5124389", "0.5119783", "0.51190144" ]
0.647706
1
==================DASHBOARDS=============== This function is to get a dashboard list
static async getDashboardList(email) { return new Promise((resolve, reject) => { Database.sendQuery('SELECT * FROM Dashboard WHERE (email = $1);', [email]) .then((result) => resolve(result.rows)) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDashboardData(){\n var _serviceURI = '';\n $.each(DATA_METRICS_ARR, function(_index, _dataset){\n if((DATA_METRICS_ARR[_index] !== 'NA')){\n objloadedArr.push(DATA_METRICS_ARR[_index]);\n _serviceURI = DATA_SERVICE_URI + \"?dataset=\" + _dataset + \"&session_id=\" + session_id + \"&from=\" + from_date + \"&to=\" + to_date + \"&aggreg_type=\" + aggreg_typ;\n $engine.makeAJAXRequest(\n _serviceURI,\n 'get',\n {},\n '',\n 'json',\n {itemIndex: _index, dataSet: _dataset},\n true,\n graphDataSuccessHandler,\n dataErrorHandler\n );\n }\n });\n }", "dashboard() {\n return this.getDashboardV1()\n .catch((err) => {\n console.error(\"Error in 'marketCapHistory' method of nomics module\\n\" + err);\n throw new Error(err);\n });\n }", "function getDashboards(getSelectParams) {\n $.ajax({\n type: \"POST\",\n url: \"/embedinfo/getdashboard\",\n data: JSON.stringify(getSelectParams),\n contentType: \"application/json; charset=utf-8\",\n success: function(data) {\n\n // Populate select list\n for (let i = 0; i < data.length; i++) {\n globals.dashboardSelect.append(\n $(\"<option />\")\n .text(data[i].DisplayName)\n .val(data[i].Id)\n );\n }\n\n if (data.length >= 1) {\n\n // Enable dashboard select list\n globals.dashboardSelect.removeAttr(\"disabled\");\n }\n },\n error: function(err) {\n showError(err);\n }\n });\n}", "function getDashboard(){\n \tdataUriCall = dataUri + \"fnc=getDashboard\" + \"&rand=\" + Math.random();\n\tloadAsyncData(encodeURI(dataUriCall), \"GET\", function() {\n if (xmlhttpRequest.readyState == 4 && xmlhttpRequest.status == 200){\n\t\tcbGetDashboard();\n }\n\t}, true, null);\n}", "function getBoardListCatalog(){\n $.getJSON(\"/api/boardlist\", function(result){\n var list = \"[ \";\n for(var i = 0; i < result.length; i++){\n list += \"<a href=\\\"/\" + result[i].Id + \"/catalog\\\"> \" + result[i].Id +\"</a>\";\n if(i+1 < result.length){\n list += \" / \";\n }\n }\n list += \" ] [<a href=\\\"/\\\">Home</a>]\";\n document.getElementsByClassName(\"boardlist\")[0].innerHTML = list;\n document.getElementsByClassName(\"boardlist\")[1].innerHTML = list;\n });\n}", "function initDetailDashboard(){\n $('#dashboard-container').find('div[data-role=panel-container]').remove();\n $engine.toggleViewLoader(false);\n $engine.toggleViewLoader(true, 'Loading.. Please wait.', $('#dashboard-loader'));\n var _options = {\n startDate: moment(new Date(2014, 5, 12)),\n minDate: moment().subtract('months', 6),\n rangeToggleButtons: ['3 Months', 'Current Month'],\n rangeSelectLabel : 'Custom',\n customShortcuts: ['Monthly', 'Weekly', 'Daily']\n };\n dateCompoment = new DateFilterComponent($('#datefilter_container'), _options);\n loadCount = 0;\n objloadedArr.length = null;\n if(!sessionObject) sessionObject = new SessionObject();\n sessionObject.getSessionObject();\n }", "function showDashboard() {\r\n\t\t$('#container img').remove();\r\n\t\t$('#login-form').remove();\r\n\t\t//TODO:cleanup after this part\r\n\t\t$('<div/>').attr('id', 'chart-container').appendTo($('#container'));\r\n\t\t$('<div/>').addClass('chart-options').attr('id', 'chart-options-container').appendTo($('#center'));\r\n\t\t\r\n\t\tvar chartparent = $('#chart-options-container');\r\n\t\taddChartOptions([\r\n\t\t {\r\n\t\t \t src : './images/column-chart.png',\r\n\t\t \t type : 'column',\r\n\t\t \t parent : chartparent\r\n\t\t }, {\r\n\t\t \t src : './images/chart-line.png',\r\n\t\t \t type : 'line',\r\n\t\t \t parent : chartparent\r\n\t\t },{\r\n\t\t \t src : './images/chart-bar.png',\r\n\t\t \t type : 'bar',\r\n\t\t \t parent : chartparent\r\n\t\t }, {\r\n\t\t \t src : './images/chart-area.png',\r\n\t\t \t type : 'area',\r\n\t\t \t parent : chartparent\r\n\t\t }, {\r\n\t\t \t src : './images/chart-pie.png',\r\n\t\t \t type : 'pie',\r\n\t\t \t parent : chartparent\r\n\t\t }]);\r\n\t\tvar sPref = readCookie('sm-dash-chart');\r\n\t\tsPref = (sPref == null ? 'column' : sPref);\r\n\t\tplotCommonChart( sPref );\r\n\t\twriteCookie('sm-dash-chart', sPref, 1);\r\n\t\t$('<a/>').html(\"Workspace\").attr('href', \"services.htm\").appendTo($('<li/>').appendTo('#menu'));\r\n\t}", "function fillDashboard(desiredList) {\n clearDashboard();\n desiredList.forEach(element => {\n\n let box = document.createElement('a');\n box.className = 'tarjeta';\n box.id = element.name;\n box.href = 'vista.html?'+element.name; \n\n let img = document.createElement('img');\n img.src = element.image;\n\n let photoname = document.createElement('h5');\n photoname.innerHTML = element.name;\n\n box.appendChild(img);\n box.appendChild(photoname);\n dashboard.appendChild(box);\n\n })\n}", "function newDashboard() {\r\n\t\t\treturn $izendaRsQuery.query('newcrs', ['DashboardDesigner'], {\r\n\t\t\t\tdataType: 'json'\r\n\t\t\t},\r\n\t\t\t// custom error handler:\r\n\t\t\t{\r\n\t\t\t\thandler: function () {\r\n\t\t\t\t\treturn 'Failed to create new dashboard';\r\n\t\t\t\t},\r\n\t\t\t\tparams: []\r\n\t\t\t});\r\n\t\t}", "function getBaseDashboard(){\n return {\n 1: {\n id: '1',\n name: '容器 1',\n widgets: [\n {col: 0,row: 0,sizeY: 1,sizeX: 1,name: \"Widget 1\",id:0,content:\"array\"}, \n {col: 2,row: 0,sizeY: 1, sizeX: 1,name: \"Widget 2\",id:1,content:'map'}\n ]\n },\n 2: {\n id: '2',\n name: '容器 2',\n widgets: [\n {col: 1,row: 1,sizeY: 1,sizeX: 2,name: \"Other Widget 1\",id:0},\n {col: 1,row: 3,sizeY: 1, sizeX: 1,name: \"Other Widget 2\",id:1}\n ]\n }\n };\n }", "function createDashboard(data, labelsParam, from, to, ajaxUrlParam) {\n labels = labelsParam;\n ajaxUrl = ajaxUrlParam;\n if (data[0] == undefined) {\n //No data to show, so just stop here\n $(\"detailDataContainer\").show();\n return;\n }\n board = new DcDashboard();\n // Set dashboard width same as div width\n // var width = $(\".dashboardContainer\").css(\"width\").replace(\"px\", \"\");\n // board.setDashboardWidth(+width);\n charts = new Object();\n var dataCounts = getDataCounts(data);\n showUniqueValues(dataCounts, data, labels);\n\n // BROWSER FILTER\n var browser = board.allData.dimension(function (d) {\n return \"\" + d['browser'];\n });\n var browserGroup = browser.group().reduceSum(function (d) {\n return d['count']\n });\n var browserLabelAccessor = function (d) {\n return labels['browser'] ? labels['browser'][d.key] : d.key;\n };\n var browserPie = board.addPieChart('dcChart', 'browser-chart', browser, browserGroup, browserLabelAccessor);\n\n browserPie.title(function (d) {\n var label = labels['browser'] ? labels['browser'][d.key] : d.key;\n return label + \": \" + d.value;\n });\n charts[\"browser-chart\"] = browserPie;\n\n // MEDIATYPE FILTER\n var mediaType = board.allData.dimension(function (d) {\n return \"\" + d['mediaType'];\n });\n var mediaTypeGroup = mediaType.group().reduceSum(function (d) {\n return d['count']\n });\n var mediaTypeLabelAccessor = function (d) {\n return d.key\n };\n charts[\"mediaType-chart\"] = board.addPieChart('dcChart', 'mediaType-chart', mediaType, mediaTypeGroup, mediaTypeLabelAccessor);\n\n // SUBTYPE FILTER\n var subtype = board.allData.dimension(function (d) {\n return \"\" + d['subtype'];\n });\n var subtypeGroup = subtype.group().reduceSum(function (d) {\n return d['count'];\n });\n var subtypeLabelAccessor = function (d) {\n return d.key\n };\n charts[\"subtype-chart\"] = board.addPieChart('dcChart', 'subtype-chart', subtype, subtypeGroup, subtypeLabelAccessor);\n\n // PAGE FILTER\n var page = board.allData.dimension(function (d) {\n return \"\" + d['page'];\n });\n var pageGroup = page.group().reduceSum(function (d) {\n return d['count'];\n });\n var pageLabelAccessor = function (d) {\n return labels['page'] ? labels['page'][d.key] : d.key\n };\n var pagePie = board.addPieChart('dcChart', 'page-chart', page, pageGroup, pageLabelAccessor);\n pagePie.title(function (d) {\n var label = labels['page'] ? labels['page'][d.key] : d.key;\n return label + \": \" + d.value;\n });\n charts[\"page-chart\"] = pagePie;\n\n //JOBGROUP FILTER\n var jobGroup = board.allData.dimension(function (d) {\n return \"\" + d['jobGroup']\n });\n var jobGroupGroup = jobGroup.group().reduceSum(function (d) {\n return d['count'];\n });\n var jobGroupLabelAccessor = function (d) {\n if (d.key < 0) {\n return \"undefined\"\n }\n return labels['jobGroup'] ? labels['jobGroup'][d.key] : \"\" + d.key\n };\n var jobGroupPie = board.addPieChart('dcChart', 'jobGroup-chart', jobGroup, jobGroupGroup, jobGroupLabelAccessor);\n jobGroupPie.title(function (d) {\n var label = labels['jobGroup'] ? labels['jobGroup'][d.key] : d.key;\n return label + \": \" + d.value;\n });\n charts[\"jobGroup-chart\"] = jobGroupPie;\n\n // MEASURED EVENT FILTER\n var measuredEvent = board.allData.dimension(function (d) {\n return \"\" + d['measuredEvent'];\n });\n var measuredEventGroup = measuredEvent.group().reduceSum(function (d) {\n return d['count'];\n });\n var measuredEventLabelAccessor = function (d) {\n if (d.key < 0) {\n return \"undefined\"\n }\n return labels['measuredEvent'] ? labels['measuredEvent'][d.key] : \"\" + d.key\n };\n var measuredEventPie = board.addPieChart('dcChart', 'measuredEvent-chart', measuredEvent, measuredEventGroup, measuredEventLabelAccessor);\n measuredEventPie.title(function (d) {\n var label = labels['measuredEvent'] ? labels['measuredEvent'][d.key] : d.key;\n return label + \": \" + d.value;\n });\n charts[\"measuredEvent-chart\"] = measuredEventPie;\n\n // HOST FILTER\n if (dataCounts['host'] > 1) {\n var host = board.allData.dimension(function (d) {\n return \"\" + d['host'];\n });\n var hostGroup = host.group().reduceSum(function (d) {\n return d['count'];\n });\n var hostLabelAccessor = function (d) {\n return d.key\n };\n charts[\"host-chart\"] = board.addRowChart('dcChart', 'host-chart', host, hostGroup, dataCounts['host'], hostLabelAccessor);\n }\n\n var loadingIndicatorGlobal = document.getElementById(\"loadingIndicatorGlobal\");\n loadingIndicatorGlobal.style.display = 'none';\n var detailDataContainer = document.getElementById(\"detailDataContainer\");\n detailDataContainer.style.display = 'block';\n\n // Show count of selected data\n board.addDataCount('dcChart', 'dc-data-count');\n\n // ### BEGIN LINE CHARTS\n var date_Dimension = board.allData.dimension(function (d) {\n return d.date;\n });\n\n var loadTime_ttfb_avg = date_Dimension.group().reduce(\n //add\n function (p, v) {\n p.count += v['count'];\n p.loadTimeSum += v['loadTimeMs_avg'] * v['count'];\n p.loadTimeAvg = p.count ? d3.round((p.loadTimeSum / p.count), 2) : 0;\n p.ttfbSum += v['ttfb_avg'] * v['count'];\n p.ttfbAvg = p.count ? d3.round((p.ttfbSum / p.count), 2) : 0;\n p.downloadTimeSum += v['downloadTime_avg'] * v['count'];\n p.downloadTimeAvg = p.count ? d3.round((p.downloadTimeSum / p.count), 2) : 0;\n p.sslTimeSum += v['sslTime_avg'] * v['count'];\n p.sslTimeAvg = p.count ? d3.round((p.sslTimeSum / p.count), 2) : 0;\n p.connectTimeSum += v['connectTime_avg'] * v['count'];\n p.connectTimeAvg = p.count ? d3.round((p.connectTimeSum / p.count), 2) : 0;\n p.dnsTimeSum += v['dnsTime_avg'] * v['count'];\n p.dnsTimeAvg = p.count ? d3.round((p.dnsTimeSum / p.count), 2) : 0;\n p.bytesInSum += v['bytesIn_avg'] * v['count'];\n p.bytesInAvg = p.count ? d3.round((p.bytesInSum / p.count), 2) : 0;\n p.bytesOutSum += v['bytesOut_avg'] * v['count'];\n p.bytesOutAvg = p.count ? d3.round((p.bytesOutSum / p.count), 2) : 0;\n return p;\n },\n //remove\n function (p, v) {\n p.count -= v['count'];\n p.loadTimeSum -= v['loadTimeMs_avg'] * v['count'];\n p.loadTimeAvg = p.count ? d3.round((p.loadTimeSum / p.count), 2) : 0;\n p.ttfbSum -= v['ttfb_avg'] * v['count'];\n p.ttfbAvg = p.count ? d3.round((p.ttfbSum / p.count), 2) : 0;\n p.downloadTimeSum -= v['downloadTime_avg'] * v['count'];\n p.downloadTimeAvg = p.count ? d3.round((p.downloadTimeSum / p.count), 2) : 0;\n p.sslTimeSum -= v['sslTime_avg'] * v['count'];\n p.sslTimeAvg = p.count ? d3.round((p.sslTimeSum / p.count), 2) : 0;\n p.connectTimeSum -= v['connectTime_avg'] * v['count'];\n p.connectTimeAvg = p.count ? d3.round((p.connectTimeSum / p.count), 2) : 0;\n p.dnsTimeSum -= v['dnsTime_avg'] * v['count'];\n p.dnsTimeAvg = p.count ? d3.round((p.dnsTimeSum / p.count), 2) : 0;\n p.bytesInSum -= v['bytesIn_avg'] * v['count'];\n p.bytesInAvg = p.count ? d3.round((p.bytesInSum / p.count), 2) : 0;\n p.bytesOutSum -= v['bytesOut_avg'] * v['count'];\n p.bytesOutAvg = p.count ? d3.round((p.bytesOutSum / p.count), 2) : 0;\n return p;\n },\n //init\n function (p, v) {\n return {\n count: 0,\n loadTimeAvg: 0,\n loadTimeSum: 0,\n ttfbAvg: 0,\n ttfbSum: 0,\n downloadTimeAvg: 0,\n downloadTimeSum: 0,\n sslTimeAvg: 0,\n sslTimeSum: 0,\n connectTimeAvg: 0,\n connectTimeSum: 0,\n dnsTimeAvg: 0,\n dnsTimeSum: 0,\n bytesInAvg: 0,\n bytesInSum: 0,\n bytesOutAvg: 0,\n bytesOutSum: 0\n };\n });\n\n // Accessors for reductio min and max\n var minValueAccessor = function (d) {\n if (d.value.min)\n return d.value.min;\n else\n return null;\n };\n var maxValueAccessor = function (d) {\n if (d.value.max)\n return d.value.max;\n else\n return null;\n };\n\n var loadTimeGroup_min = reductio().min(function (d) {\n return +d['loadTimeMs_min']\n })(date_Dimension.group());\n var loadTimeGroup_max = reductio().max(function (d) {\n return +d['loadTimeMs_max']\n })(date_Dimension.group());\n var ttfbGroup_min = reductio().min(function (d) {\n return +d['ttfb_min']\n })(date_Dimension.group());\n var ttfbGroup_max = reductio().max(function (d) {\n return +d['ttfb_max']\n })(date_Dimension.group());\n var downloadTimeGroup_min = reductio().min(function (d) {\n return +d['downloadTime_min']\n })(date_Dimension.group());\n var downloadTimeGroup_max = reductio().max(function (d) {\n return +d['downloadTime_max']\n })(date_Dimension.group());\n var sslTimeGroup_min = reductio().min(function (d) {\n return +d['sslTime_min']\n })(date_Dimension.group());\n var sslTimeGroup_max = reductio().max(function (d) {\n return +d['sslTime_max']\n })(date_Dimension.group());\n var connectTimeGroup_min = reductio().min(function (d) {\n return +d['connectTime_min']\n })(date_Dimension.group());\n var connectTimeGroup_max = reductio().max(function (d) {\n return +d['connectTime_max']\n })(date_Dimension.group());\n var dnsTimeGroup_min = reductio().min(function (d) {\n return +d['dnsTime_min']\n })(date_Dimension.group());\n var dnsTimeGroup_max = reductio().max(function (d) {\n return +d['dnsTime_max']\n })(date_Dimension.group());\n var bytesInGroup_min = reductio().min(function (d) {\n return +d['bytesIn_min']\n })(date_Dimension.group());\n var bytesInGroup_max = reductio().max(function (d) {\n return +d['bytesIn_max']\n })(date_Dimension.group());\n var bytesOutGroup_min = reductio().min(function (d) {\n return +d['bytesOut_min']\n })(date_Dimension.group());\n var bytesOutGroup_max = reductio().max(function (d) {\n return +d['bytesOut_max']\n })(date_Dimension.group());\n\n var composite = board.getCompositeChart('dcChart', 'line-chart');\n\n var allGraphs = {};\n\n var colorScale = d3.scale.category10();\n\n function createLineChart(jobFilter, label, name, valueAccessor, unit) {\n var group = remove_empty_bins(jobFilter, valueAccessor);\n allGraphs[name] = board.createLineChart(composite, date_Dimension, group, colorScale(label), label, valueAccessor, unit);\n }\n\n // avg graph loadTime\n createLineChart(loadTime_ttfb_avg, \"LoadTimeMs Avg\", \"loadTimeAvg\", function (d) {\n return d.value.loadTimeAvg;\n });\n\n // avg graph ttfb\n createLineChart(loadTime_ttfb_avg, \"TTFB Avg\", \"ttfbAvg\", function (d) {\n return d.value.ttfbAvg;\n });\n\n // avg graph downloadTime\n createLineChart(loadTime_ttfb_avg, \"Download Time Avg\", \"downloadTimeAvg\", function (d) {\n return d.value.downloadTimeAvg;\n });\n\n // avg graph sslTime\n createLineChart(loadTime_ttfb_avg, \"SSL Time Avg\", \"sslTimeAvg\", function (d) {\n return d.value.sslTimeAvg;\n });\n // avg graph connectTime\n createLineChart(loadTime_ttfb_avg, \"Connect Time Avg\", \"connectTimeAvg\", function (d) {\n return d.value.connectTimeAvg;\n });\n // avg graph dnsTime\n createLineChart(loadTime_ttfb_avg, \"DNS Time Avg\", \"dnsTimeAvg\", function (d) {\n return d.value.dnsTimeAvg;\n });\n // avg graph bytesIn\n createLineChart(loadTime_ttfb_avg, \"Bytes In Avg\", \"bytesInAvg\", function (d) {\n return d.value.bytesInAvg;\n }, \"bytes\");\n // avg graph bytesOut\n createLineChart(loadTime_ttfb_avg, \"Bytes Out Avg\", \"bytesOutAvg\", function (d) {\n return d.value.bytesOutAvg;\n }, \"bytes\");\n\n // min graph loadTime\n createLineChart(loadTimeGroup_min, \"LoadTimeMs Min\", \"loadTimeMin\", minValueAccessor);\n // min graph ttfb\n createLineChart(ttfbGroup_min, \"TTFB Min\", \"ttfbMin\", minValueAccessor);\n // min graph downloadTime\n createLineChart(downloadTimeGroup_min, \"Download Time Min\", \"downloadTimeMin\", minValueAccessor);\n // min graph sslTime\n createLineChart(sslTimeGroup_min, \"SSL Time Min\", \"sslTimeMin\", minValueAccessor);\n // min graph connectTime\n createLineChart(connectTimeGroup_min, \"Connect Time Min\", \"connectTimeMin\", minValueAccessor);\n // min graph dnsTime\n createLineChart(dnsTimeGroup_min, \"DNS Time Min\", \"dnsTimeMin\", minValueAccessor);\n // min graph bytesIn\n createLineChart(bytesInGroup_min, \"Bytes In Min\", \"bytesInMin\", minValueAccessor, \"bytes\");\n // min graph bytesOut\n createLineChart(bytesInGroup_min, \"Bytes Out Min\", \"bytesOutMin\", minValueAccessor, \"bytes\");\n\n // max graph loadTime\n createLineChart(loadTimeGroup_max, \"LoadTimeMs Max\", \"loadTimeMax\", maxValueAccessor);\n // max graph ttfb\n createLineChart(ttfbGroup_max, \"TTFB Max\", \"ttfbMax\", maxValueAccessor);\n // max graph ttfb\n createLineChart(downloadTimeGroup_max, \"Download Time Max\", \"downloadTimeMax\", maxValueAccessor);\n // max graph ttfb\n createLineChart(sslTimeGroup_max, \"SSL Time Max\", \"sslTimeMax\", maxValueAccessor);\n // max graph ttfb\n createLineChart(connectTimeGroup_max, \"Connect Time Max\", \"connectTimeMax\", maxValueAccessor);\n // max graph dns\n createLineChart(dnsTimeGroup_max, \"DNS Time Max\", \"dnsTimeMax\", maxValueAccessor);\n // max graph bytesIn\n createLineChart(bytesInGroup_max, \"Bytes In Max\", \"bytesInMax\", maxValueAccessor, \"bytes\");\n // max graph bytesOut\n createLineChart(bytesOutGroup_max, \"Bytes Out Max\", \"bytesOutMax\", maxValueAccessor, \"bytes\");\n\n // 24 = [loadTime, ttfb, ..., bytesIn]*[avg,min,max]\n board.addCompositeChart('dcChart', 'line-chart', from, to, 24);\n redrawCompositeChart();\n\n // ### END LINE CHARTS\n\n // ### BEGIN TIME CHART\n var timeDimension = board.allData.dimension(function (d) {\n return d.date;\n });\n\n var timeGroup = timeDimension.group().reduceSum(function (d) {\n return d['count'];\n });\n board.addTimeChart('dcChart', 'timeChart', timeDimension, timeGroup, from, to);\n // ### END TIME CHART\n\n // Add data to dashboard\n var p1 = new Promise(\n function (resolve, reject) {\n board.addData(data);\n }\n );\n\n // Add onClick Listener\n $(document).on('change', 'input:checkbox[name=\"measurementCheckbox\"]', function (event) {\n $(this).parent().toggleClass(\"btn-primary\");\n $(this).parent().toggleClass(\"btn-default\");\n redrawCompositeChart();\n $(this).parent().removeClass(\"focus\");\n });\n\n $(document).keyup(function (e) {\n if (e.keyCode == 27) {\n $(\".card-modal\").hide();\n $(\"#preselectedValuesContainer\").hide();\n }\n });\n\n $('.card-modal').click(function () {\n $(\".card-modal\").hide();\n $(\"#preselectedValuesContainer\").hide();\n });\n $('.card-header .close').click(function () {\n $(\".card-modal\").hide();\n $(\"#preselectedValuesContainer\").hide();\n });\n\n $('.card-modal-inner').click(function (e) {\n e.stopPropagation();\n });\n\n function redrawCompositeChart() {\n board.setAnimationTime(500);\n\n var showAvg = document.getElementById(\"avg\").checked;\n var showMax = document.getElementById(\"max\").checked;\n var showMin = document.getElementById(\"min\").checked;\n var visibleGraphs = [];\n\n function handleValueTypeCheckbox(avgName, minName, maxName) {\n if (showAvg)\n visibleGraphs.push(allGraphs[avgName]);\n\n if (showMin)\n visibleGraphs.push(allGraphs[minName]);\n if (showMax)\n visibleGraphs.push(allGraphs[maxName]);\n }\n\n if (document.getElementById(\"loadTimeMs\").checked) {\n handleValueTypeCheckbox(\"loadTimeAvg\", \"loadTimeMin\", \"loadTimeMax\");\n }\n if (document.getElementById(\"ttfb\").checked) {\n handleValueTypeCheckbox(\"ttfbAvg\", \"ttfbMin\", \"ttfbMax\");\n }\n if (document.getElementById(\"downloadTime\").checked) {\n handleValueTypeCheckbox(\"downloadTimeAvg\", \"downloadTimeMin\", \"downloadTimeMax\");\n }\n if (document.getElementById(\"sslTime\").checked) {\n handleValueTypeCheckbox(\"sslTimeAvg\", \"sslTimeMin\", \"sslTimeMax\");\n }\n if (document.getElementById(\"connectTime\").checked) {\n handleValueTypeCheckbox(\"connectTimeAvg\", \"connectTimeMin\", \"connectTimeMax\");\n }\n if (document.getElementById(\"dnsTime\").checked) {\n handleValueTypeCheckbox(\"dnsTimeAvg\", \"dnsTimeMin\", \"dnsTimeMax\");\n }\n if (document.getElementById(\"bytesIn\").checked) {\n handleValueTypeCheckbox(\"bytesInAvg\", \"bytesInMin\", \"bytesInMax\");\n }\n if (document.getElementById(\"bytesOut\").checked) {\n handleValueTypeCheckbox(\"bytesOutAvg\", \"bytesOutMin\", \"bytesOutMax\");\n }\n\n\n board.getCompositeChart('dcChart', 'line-chart').compose(visibleGraphs);\n dc.renderAll();\n addOnClickListeners();\n hideDataTable();\n board.setAnimationTime(700);\n }\n}", "function loadDashboard(data){\n //set global database\n database = data;\n //hide the login\n screen.remove(login);\n //append the dashboard object to the main screen\n screen.append(dashboard);\n //populate the tables list\n mysqlAssistant.listTables(function(callback){\n //add tables to dashboard list\n \tdashTables.setItems(callback);\n \t//render the dashboard\n screen.render();\n });\n}", "async getAllDashboardGraphs(dashboardId) {\n const result = await axios.get('http://localhost:8080/api/dashboard/' + dashboardId + '/graph');\n Vue.$log.debug(result);\n return result.data;\n }", "lists() {\n const board = ReactiveCache.getBoard(this.selectedBoardId.get());\n const ret = board.lists();\n return ret;\n }", "function getRoomListForOverview() {\r\n loadAllRoomData(onLoadAllRoomDataForOverviewSuccess);\r\n switchView('roomsOverview');\r\n}", "function initLocalDashboardPage(){\r\n\treportsSection = \"dashboard\";\r\n\treportsObject = getDashboardReports(sid);\r\n\tvar list = $(\"#dashboard\");\r\n\tlist.empty();\r\n\tvar predefinedReports = reportsObject.predefined;\r\n\tif(predefinedReports.length > 0){\r\n\t\t\r\n\t\t$.each(predefinedReports, function(k, vObj){\r\n\t\t\tvar raport = prepareDashboardReport(vObj.code);\r\n\t\t\treportObjectToExecute = loadDashboardReport(raport);\r\n\t\t\tlist.append(\r\n\t\t\t\t\t$(\"<div>\",{class:\"dashboard-item-\"+reportObjectToExecute.class+\" uss\",id:reportObjectToExecute.id})\r\n\t\t\t\t\t\t.append($(\"<div>\",{class:\"title\"}))\r\n\t\t\t\t\t\t.append($(\"<div>\",{class:\"form\"}))\r\n\t\t\t\t\t\t.append($(\"<div>\",{class:\"graph\",id:\"graph-\"+reportObjectToExecute.id}).append($(\"<div>\",{class:\"loading-span\"}).text(\"Loading ...\")))\r\n\t\t\t);\r\n\t\t\trenderDashboardReport(reportObjectToExecute);\r\n\t\t});\r\n\t}\r\n}", "function createDashboard() {\n var newDashboard = {};\n newDashboard.name = \"New Dashboard\";\n newDashboard.description = \"New Dashboard Description\";\n newDashboard.organisationId = null;\n newDashboard.createdBy = null;\n newDashboard.type = \"private\";\n newDashboard.widgets = [];\n newDashboard.homepage = false;\n newDashboard.backgroundColor = \"#FFFFFF\";\n newDashboard.widgetSpacing = 2;\n newDashboard.options = {\n columns: 15, // the width of the grid, in columns\n rows: 10, // the width of the grid, in columns\n pushing: true, // whether to push other items out of the way on move or resize\n floating: true, // whether to automatically float items up so they stack (you can temporarily disable if you are adding unsorted items with ng-repeat)\n swapping: true, // whether or not to have items of the same size switch places instead of pushing down if they are the same size\n width: 'auto', // can be an integer or 'auto'. 'auto' scales gridster to be the full width of its containing element\n colWidth: 'auto', // can be an integer or 'auto'. 'auto' uses the pixel width of the element divided by 'columns'\n //rowHeight: 'match', // can be an integer or 'match'. Match uses the colWidth, giving you square widgets.\n margins: [2, 2], // the pixel distance between each widget\n outerMargin: true, // whether margins apply to outer edges of the grid\n sparse: true, // \"true\" can increase performance of dragging and resizing for big grid (e.g. 20x50)\n isMobile: false, // stacks the grid items if true\n mobileBreakPoint: 600, // if the screen is not wider that this, remove the grid layout and stack the items\n mobileModeEnabled: true, // whether or not to toggle mobile mode when screen width is less than mobileBreakPoint\n minColumns: 1, // the minimum columns the grid must have\n minRows: 2, // the minimum height of the grid, in rows\n maxRows: 100,\n defaultSizeX: 1, // the default width of a gridster item, if not specifed\n defaultSizeY: 1, // the default height of a gridster item, if not specified\n minSizeX: 1, // minimum column width of an item\n maxSizeX: null, // maximum column width of an item\n minSizeY: 1, // minumum row height of an item\n maxSizeY: null, // maximum row height of an item\n resizable: {\n enabled: true,\n handles: ['n', 'e', 's', 'w', 'ne', 'se', 'sw', 'nw'],\n start: function (event, $element, widget) { console.log('resize-start'); console.log(widget); console.log($element); }, // optional callback fired when resize is started,\n resize: function (event, $element, widget) { console.log('resize'); console.log(widget); console.log($element); }, // optional callback fired when item is resized,\n stop: function (event, $element, widget) { console.log('resize-stop'); console.log(widget); console.log($element); } // optional callback fired when item is finished resizing\n },\n draggable: {\n enabled: true, // whether dragging items is supported\n // handle: '.my-class', // optional selector for drag handle\n start: function (event, $element, widget) { console.log('drag-start'); console.log(widget); console.log($element); }, // optional callback fired when drag is started,\n drag: function (event, $element, widget) { console.log('drag'); console.log(widget); console.log($element); }, // optional callback fired when item is moved,\n stop: function (event, $element, widget) { console.log('drag-stop'); console.log(widget); console.log($element); } // optional callback fired when item is finished dragging\n }\n\n };\n return newDashboard;\n }", "function getList(){\n\t$.get('/hosts', function(hostList){\n\t\thosts = hostList;\n\t\t$('#pages').empty();\n for(var key in hostList){\n \tvar ports = hostList[key]['port'];\n \tif(typeof hostList[key]['port'] === 'string') ports = hostList[key]['port'].split(', ');\n \tfor(var port in ports) {\n var div = $('<div id=' + hostList[key]['ip'] + '-' + ports[port] + ' class=\"host\"><p>' + hostList[key]['reverse'] + '</p></div>');\n if (hostList[key]['thumbnails']) addThumbnail(div, ports[port], hostList[key]['thumbnails'], key);\n $(div).click(redirect);\n $('#pages').append($(div));\n }\n }\n\t})\n\t\t.done(function(){\n\t\t\twriteConfig();\n\t\t});\n}", "function exportDashboard() {\n\n\tconsole.log(\"1. Downloading metadata\");\n\t//Do initial dependency export\n\tvar promises = [\n\t\tdependencyExport(\"dashboard\", currentExport.dashboardIds)\n\t];\n\tQ.all(promises).then(function (results) {\n\n\t\t//Get indicators and categoryOptionGroupSets from favourites\n\t\t//Get indicator groups from conf files\n\t\tpromises = [\n\t\t\tindicators(),\n\t\t\tcategoryOptionGroupSetStructure(),\n\t\t\tsaveObject(\"indicatorGroups\", currentExport.indicatorGroupIds),\n\t\t\tuserGroups(),\n\t\t\tusers()\n\t\t];\n\t\tQ.all(promises).then(function (results) {\n\n\t\t\t//Get legends from data elements, indicators and favourites\n\t\t\t//Get indicator types from indicators\n\t\t\tpromises = [\n\t\t\t\tindicatorTypes(),\n\t\t\t\tlegendSets(),\n\t\t\t\tcustomObjects()\n\t\t\t];\n\t\t\tQ.all(promises).then(function (results) {\n\t\t\t\tconsole.log(\"✔ Downloaded metadata successfully\");\n\t\t\t\tprocessDashboard();\n\n\t\t\t});\n\n\t\t});\n\n\t});\n\n}", "function list(params, cb) {\n var resourcePath = config.addURIParams(constants.APPDATA_BASE_PATH + \"/export\", params);\n var method = \"GET\";\n var data = {};\n\n params.resourcePath = resourcePath;\n params.method = method;\n params.data = data;\n\n mbaasRequest.admin(params, cb);\n}", "function showAdminDashboard() {\n $.dashboard.setWidth('95%');\n $.dashboard.setHeight('93%');\n $.dashboard.setTop('5%');\n $.dashboard.setBottom('5%');\n $.dashboard.setRight('3%');\n $.dashboard.setLeft(20);\n $.dashboard.setOpacity('1.0');\n $.dashboard_container.setHeight(Ti.UI.FILL);\n $.dashboard_container.setWidth(Ti.UI.FILL);\n handlePageSelection({\n page : 'configurations'\n });\n}", "function Dashboard() {\n return /*#__PURE__*/react_default.a.createElement(FeatureBox, null, /*#__PURE__*/react_default.a.createElement(FeatureHeader, {\n alignItems: \"center\"\n }, /*#__PURE__*/react_default.a.createElement(FeatureHeaderTitle, null, \"Dashboard\"), /*#__PURE__*/react_default.a.createElement(Dashboard_DebugInfoButton, {\n ml: \"auto\"\n })), /*#__PURE__*/react_default.a.createElement(Dashboard_OperationBanner, {\n mb: \"4\"\n }), /*#__PURE__*/react_default.a.createElement(Dashboard_MetricsCharts, null), /*#__PURE__*/react_default.a.createElement(Dashboard_LatestEventList, {\n mb: \"4\"\n }), /*#__PURE__*/react_default.a.createElement(Dashboard_OperationList, {\n mb: \"4\"\n }), /*#__PURE__*/react_default.a.createElement(Dashboard_AppList, null));\n}", "index(request, response) {\n logger.info(\"dashboard rendering\");\n const loggedInUser = accounts.getCurrentUser(request);\n if (loggedInUser) {\n const viewData = {\n title: \"Videolist Dashboard\",\n videolists: videolistStore.getUserVideolists(loggedInUser.id),\n fullname: loggedInUser.firstName + \" \" + loggedInUser.lastName\n };\n logger.info(\"about to render\" + viewData.videolists);\n response.render(\"dashboard\", viewData);\n } else response.redirect(\"/\");\n }", "function showRuns(){\n //get runs object\n \n var runs = getRunsObject();\n \n //Check if empty\n if(runs != '' && runs !=null){\n for(var i=0; i<runs.length;i++){\n $('#stats').append('<li class=\"ui-body-inherit ui-li-static\"><strong>Date: </strong> '+runs[i].date+'<br/><strong>Distance: </strong>'+runs[i].miles+'m<div class=\"controls\"><a href=\"#edit\" id=\"editLink\" data-miles=\"'+runs[i].miles+'\" data-date=\"'+runs[i].date+'\">Edit</a> | <a href=\"#delete\">Delete</a> </div> </li>');\n \n }\n \n $('#home').bind('pageinit',function(){\n $('#stats').listview('refresh');\n \n });\n \n }\n \n }", "function renderDashboardUX(){\n DATA_METRICS_ARR = metrics_arr;\n if(from_date == 'None'){\n $('#date-subtitle').html('Duration: 3 months | monthly');\n }else{\n $('#date-subtitle').html('From: '+ from_date.split(' ')[0] + ' | To: ' + to_date.split(' ')[0] + ' | Filtered: '+ aggreg_typ);\n }\n $('#dashboard-container').empty();\n $('#dashboard-container').dashboard({\n configSrc : DASHBOARD_CONFIG,\n utilsObj : $engine,\n templateObj : $('#graphtemplate'),\n metricsArr : DATA_METRICS_ARR\n });\n $engine.log('DASHBOARD > setupDashboardUX: Config: ' + DASHBOARD_CONFIG);\n }", "static async getGraphList(email, dashboardID) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tDatabase.sendQuery('SELECT g.* from graph as g join (SELECT * from dashboard as d WHERE (d.email = $1) AND (d.id = $2)) as de on (g.dashboardid=de.id);', [email, dashboardID])\n\t\t\t\t.then((result) => resolve(result.rows))\n\t\t\t\t.catch((result) => reject(result));\n\t\t});\n\t}", "getBotsList() {\n let bot_status = {};\n bot_status.count = utils.objectLength(this.bots);\n let bots_list = [];\n for (const idx in this.bots) {\n let url = new URL(this.bots[idx].page.url());\n let room_url = url.origin + url.pathname;\n bots_list.push({\n uuid: this.bots[idx].uuid,\n name: this.bots[idx].name,\n room_url: room_url,\n avatar_id: this.bots[idx].avatar_id,\n });\n }\n bot_status.bots = bots_list;\n return utils.buildJsonResponse({\n command: \"bots list\",\n success: true,\n message: \"Ok\",\n data: bots_list,\n });\n }", "function getDashboardUrl (dashboardName) {\n return APP_CONFIG.apiUrl + '/dashboards/' + dashboardName + '/data';\n }", "function renderData() {\n var drop_list_flag = true;\n var dao = DAO.user;\n var param = {\n 'page': 1,\n 'page_num': 10\n };\n dao.getAccountList(param, function (res) {\n if(res.status == 1){\n var result = [];\n var data = res['data'];\n result['res'] = data['flows'];\n if(!result['res'][0]){\n result['gif_flag'] = 1;\n drop_list_flag = false;\n }\n\n var date_line = [];\n for(var i=0; i<result['res'].length; i++){\n var j = parseInt(i+1, 10);\n date_line[i] = result['res'][i]['dateline'];\n }\n if(result['res'].length > 0){\n result['res'][0]['show_month'] = 1;\n }\n for(var i=0; i+1<date_line.length; i++){\n if(M.time.year_to_month(date_line[i]) != M.time.year_to_month(date_line[i+1])){\n result['res'][i+1]['show_month'] = 1;\n }else {\n result['res'][result['res'].length-1]['show_month'] = 0;\n }\n }\n // prev_page_end = result['res'][result['res'].length-1]['dateline']; //\n\n template.helper(\"dateFormat\", dateFormat);\n $('.expense-list').append(template('list', result));\n if(drop_list_flag){\n dropList();\n }\n }else{\n config_tips.msg = res.msg;\n M.util.popup_tips(config_tips);\n }\n })\n }", "function show_all_dashboard(){\n document.location.href = \"/dashboards/all_category\";\n}", "function initDashboard() {\n\n // the 'layout' JSON array defines the internal structure of the layout\n // The sequence is always layoutGroup --> tabbedGroup --> layoutPanel\n // The layoutGroup has the orientation which tells whether to add child tabs (panels) in\n // verticle fashion or hoizontal fashion.\n var layout = [\n {\n // Main panel\n type: \"layoutGroup\",\n // Horrizontal orientation determines the layout of city search panel groups and the weather data panel groups\n orientation: \"horizontal\",\n width: \"100%\",\n height: \"100%\",\n items: [\n {\n // Search city panel group: Left parent panel (layout-group) that holds all tabs in left side of the splitter\n type: \"layoutGroup\",\n // Actually the orientation=verticle is not required as there is only one panel in this.items[]\n orientation: \"vertical\",\n allowPin: false,\n width: \"30%\",\n items: [\n {\n // 1st and the only Tab panel for 'Search City'\n type: \"tabbedGroup\",\n height: \"100%\",\n pinnedHeight: 30,\n items: [\n {\n // Layout pannel for the 'Search City' tab\n type: \"layoutPanel\",\n title: \"Search for a City\",\n contentContainer: \"SearchCityPanel\",\n initContent: function () {\n initCitiesTable();\n },\n },\n ],\n },\n ],\n },\n {\n // Weather data panel group: Right parent panel (layout-group) for displaying weather details\n type: \"layoutGroup\",\n // The orientation: \"vertical\" here ensures the Today's weather panel and the forecast panel are \n // laid out vertically - one above and one below \n orientation: \"vertical\",\n allowPin: false,\n width: \"70%\",\n items: [\n {\n // Tab group for today's weather panel\n type: \"tabbedGroup\",\n height: \"52%\",\n pinnedHeight: 30,\n items: [\n {\n type: \"layoutPanel\",\n title: \"Today's Weather\",\n contentContainer: \"TodaysWeatherPanel\",\n\n },\n ],\n },\n {\n // Tab group for forecast panel\n type: \"tabbedGroup\",\n height: \"48%\",\n pinnedHeight: 30,\n items: [\n {\n type: \"layoutPanel\",\n title: \"5 Day Forecast\",\n contentContainer: \"ForecastPanel\",\n\n },\n ],\n }\n ],\n }\n ],\n },\n ];\n $(\"#jqxLayout\").jqxLayout({\n width: 1250,\n //width: '100%',\n //width: getWidth(\"layout\"),\n height: 650,\n layout: layout,\n contextMenu: true,\n });\n //alert(\"initDashboardComp\");\n loadWeatherData(0);\n}", "getAllBoards() {\n var opts = {\n type: \"\",\n startAt: 0,\n maxResults: 25\n };\n return this.connector.board.getAllBoards(opts)\n }", "function getTenants() {\n $.get(\"/api/tenants\", function(data) {\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createTenantRow(data[i]));\n }\n renderTenantList(rowsToAdd);\n nameInput.val(\"\");\n });\n }", "function getGroups() {\n $.get(\"/api/groups\", renderGroupList);\n }", "_list() {\n const parameters = [\n 1,\n ['active', 'id', 'interval', 'language', 'last_run', 'name', 'run_on', 'tags'],\n {},\n 1000,\n 'name',\n ];\n return this.list.call(this, ...parameters);\n }", "function clientCompetitorMappingList(){\r\n\t$.ajaxSetup({ cache: false });\r\n\t$('#page-wrapper').mask('Loading...');\r\n\tclientCompetitorMappingDataDiv.html('');\r\n\t$('#clientCompetitorMappingDataDiv').html('');\r\n\t$.get(clientCompetitorMappingUrl+\"listTab.htm\",function(response){\r\n\t\tconsole.log(response);\r\n\t\tif(response.status==\"LIST_SUCCESS\"){\r\n\t\t\tvar html = listClientCompetitorMappingHtml(response);\r\n\t\t\tconsole.log(response);\r\n\t\t\tclientCompetitorMappingDataDiv.append(html);\r\n\t\t\t$('#clientCompetitorMappingListTable').dataTable();\r\n\t\t\t$('#page-wrapper').unmask();\r\n\t\t}else{\r\n\t\t\t$('#clientCompetitorMappingDataDiv').append('<font style=\"color:red\">'+response.errorMessage+'</font>');\r\n\t\t}\r\n\t\t\r\n\t},'json').fail(function(response){\r\n\t\tclientCompetitorMappingDataDiv.mask(response.status+\"**********\"+response.statusText);\r\n\t});\r\n\treturn false;\r\n}", "getAndDisplay(listDisplayName) {\n try {\n //Note - this is a fix for NZ timezone!!\n const currentDay = moment().subtract(18, \"h\"), isodate = currentDay.toISOString();\n $pnp.sp.web.lists.getByTitle(listDisplayName).items.select([\"Title\",\"AnnouncementLevel\",\"Body\"]).filter(\"Expires ge datetime'\" + isodate + \"'\").orderBy(\"AnnouncementLevel\", true).get().\n then((data) => {\n if (data && data.length > 0){\n console.log(JSON.stringify(data));\n let announcementsHtml = data.map((item) => {\n const className = this.deriveClass(item.AnnouncementLevel),\n icon = this.deriveIcon(item.AnnouncementLevel);\n return `<li class=\"${className}\">${icon}<div class=\"announcementBannerTitle\">${item.Title}</div><div class=\"announcementBannerBody\">${item.Body}</div></li>`\n });\n document.getElementById(\"customContent\").innerHTML = \"<ul>\" + [...announcementsHtml].join(\"\") + \"</ul>\"; \n }\n })\n .catch((error) => {\n this.logToConsole(`1 - Error attempting to get list items from '${listDisplayName}': ${error.message}`);\n });\n } catch (e) {\n $pnp.sp.web.lists.getByTitle(listDisplayName).get()\n .then((list) => {\n this.logToConsole(`2 - Error getting items from list '${list.Title}': ${e.message}`);\n })\n .catch((error) => {\n this.logToConsole(`3 - Could not find list named '${listDisplayName}': ${error.message}`);\n });\n } \n }", "'boards.getLists' (boardId) {\n let userId = this.userId\n let lists = []\n let board = Boards.findOne({\"_id\": boardId});\n if (board) {\n let userRole = boardUtils.getUserRole(userId, board)\n if(canPerform(userRole, ACCESS_BOARD)){\n board.boardList.map((list) => {\n let theList = Meteor.call('list.getList',list._id)\n lists.push(theList)\n })\n return lists\n } else\n throw new Meteor.Error(403, \"You do not have permission to access the lists\")\n } else {\n throw new Meteor.Error(404, 'Board not found')\n }\n }", "function getData(){\n $http.get(rootUrl+\"?filter[period]=\"+$filter('date')($rootScope.selectedPeriod, \"yyyy-MM\")).then(function(response){\n self.list = response.data.data;\n });\n }", "function showList() {\n \n var data = $form.formValue();\n \n function ondone(listData) {\n storage.put(\"leadlist\", data); // save settings\n var c = { leads: listData };\n $page.find(\"table.output > tbody\").html(kite(\"#lead-list\",c));\n }\n \n $.get(data.url)\n .done(ondone)\n .fail(function(err,status) { alert(\"communication \" + status); }); \n }", "get dashboard(){\n return (\n `<div class=\"swTable__dashbox\">\n <div class=\"swTable__dash-heading\">Tallest Human</div>\n <div class=\"swTable__dash-result\">${this.findTallestHuman(this.humans).name} @ ${this.getMeters(this.findTallestHuman(this.humans).height)}</div>\n </div>\n <div class=\"swTable__dashbox\">\n <div class=\"swTable__dash-heading\">Most Common Hair Color</div>\n <div class=\"swTable__dash-result\">${this.findCommonHairColor(this.humans)}</div>\n </div>\n <div class=\"swTable__dashbox\">\n <div class=\"swTable__dash-heading\">Average Mass</div>\n <div class=\"swTable__dash-result\">${this.findAverageMass(this.humans)}<i>kg</i></div>\n </div>`\n )\n }", "function get_dashboard_info()\n{\n //fade_in_loader_and_fade_out_form(\"loader\", \"stats_info\"); \n var bearer = \"Bearer \" + localStorage.getItem(\"access_token\"); \n send_restapi_request_to_server_from_form(\"get\", api_get_dashboard_stats_url, bearer, \"\", \"json\", get_dashboard_info_success_response_function, get_dashboard_info_error_response_function);\n}", "async function fetchDashboardElementData(dashboardId) {\n setDashboardElementDataLoading(true);\n\n const [, elementData] = await asyncWrapper(fetchDashboardElements(dashboardId));\n\n setDashboardElementDataLoading(false);\n\n // restrict to visualization tiles, exclude chartType === 'text'\n const elements = (elementData?.dashboard_elements || []).filter(\n (f) => Object.hasOwn(f, 'query') && f.query !== null,\n );\n\n // sorting of dashboard elements by title is required\n // for keeping track of <Select> onChange() states\n setSortedDashboardElements([...elements.sort((a, b) => (a.title > b.title ? 1 : -1))]);\n\n dispatch((st) => ({\n ...st,\n dashboardElements: elements,\n }));\n }", "renderLists() {\n return (\n <div className=\"board-lists\">\n { /* render the lists */ }\n </div>\n );\n }", "function initAdminDashboard () {\n // Set up the lobby table\n var lobbyTable = $('#bb-lobby-table').DataTable({\n // Sort by status, then by id\n 'order': [\n [6, 'asc'],\n [0, 'asc']\n ],\n \n 'ajax': '/app-data/lobbies/' + tourneyName,\n \n 'columns': [\n {\n 'data': 'id',\n 'responsivePriority': 1\n },\n \n {\n 'data': 't1Name',\n 'type': 'anti-empty',\n 'responsivePriority': 3\n },\n \n {\n 'data': 't2Name',\n 'type': 'anti-empty',\n 'responsivePriority': 3\n },\n \n { 'data': 'score' },\n \n {\n 'data': 'room',\n 'type': 'anti-empty'\n },\n \n // Special rendering for time formatting\n { \n 'data': 'startTime',\n 'render': function (data, type, full, meta) {\n switch (type) {\n case 'type':\n return 'date';\n \n default:\n return data == ''\n ? 'N/A'\n : getTimerString(new Date(new Date() - new Date(data)));\n }\n },\n 'responsivePriority': 4\n },\n \n // Special rendering for colors and icons\n { \n 'data': 'status',\n 'render': function (data, type, full, meta) {\n switch (type) {\n case 'display':\n return formatLobbyStatus(data);\n \n case 'sort':\n return data.sort;\n \n case 'type':\n return 'string';\n \n default:\n return data.display;\n }\n },\n 'responsivePriority': 2\n }\n ]\n });\n \n // Set up the team table\n var teamTable = $('#bb-team-table').DataTable({\n 'ajax': '/app-data/teams/' + tourneyName,\n \n 'columns': [\n { 'data': 'seed' },\n { 'data': 'name' },\n \n // Special rendering for label coloring\n {\n 'data': 'online',\n 'render': function(data, type, full, meta) {\n switch (type) {\n case 'display':\n return formatTeamOnline(data);\n \n case 'type':\n return 'string';\n \n default:\n return data;\n }\n }\n },\n \n // Special rendering for colors and icons\n {\n 'data': 'status',\n 'render': function(data, type, full, meta) {\n switch (type) {\n case 'display':\n return formatTeamStatus(data);\n \n case 'type':\n return 'string';\n \n default:\n return data.display;\n }\n }\n }\n ]\n });\n \n // When tabs are switched, we need to recalculate the responsize table's width since it was hidden before\n $('#bb-admin-dash-tables').on('shown.bs.tab', function(e) {\n $(this).find('.table').DataTable().responsive.recalc();\n });\n \n // Refresh tables periodically\n tableRefresh = setInterval(function() {\n lobbyTable.ajax.reload(null, false); // Don't reset paging\n teamTable.ajax.reload(null, false);\n }, 5000);\n \n // Called when the inner page content is removed to load a new page.\n $('.content').on('destroy', function() {\n window.clearInterval(tableRefresh);\n });\n}", "function Dashboard () {\n\n // Default values for date. These should be dynamic in future versions!\n // That means updating the initial charts accordingly to these values.\n this.boundMin = new Date(2015, 0, 1);\n this.boundMax = new Date(2015, 11, 1);\n this.timeMin = new Date(2015, 0, 1);\n this.timeMax = new Date(2015, 11, 1);\n\n //initialize pie, line and bar charts\n this.pie = this.createPie().highcharts();\n this.line = this.createLine(0, 11).highcharts();\n this.bar = this.createBar().highcharts();\n\n // initializing the slider\n this.createSlider();\n\n this.pieData = [];\n this.lineData = [];\n this.barData = [];\n\n // Stored values regarding the timeslide\n // defaulf being end and start of year (should be dynamic based on input as above).\n this.monthStart = 0;\n this.monthEnd = 11;\n\n // Current countryCode (if any);\n this.countryCode = null;\n\n // add initial data to pie chart and line/bar chart\n this.getPieData(this.countryCode);\n this.getLineData(this.countryCode);\n this.getBarData(this.countryCode);\n\n}", "getAll () {\n View.out('----------- Teams -----------' + View.NEWLINE())\n View.out(this.getTeams())\n View.out(View.NEWLINE() + '----------- Games -----------' + View.NEWLINE())\n View.out(this.getGames())\n View.out(View.NEWLINE() + '----------- Canterbury Geams -----------' + View.NEWLINE())\n View.out(this.getCanterburyGames('Canterbury') + View.NEWLINE())\n View.out('----------- Crossover Games -----------' + View.NEWLINE())\n View.out(this.getCrossOverGames())\n }", "function getTaskLists() {\n\n}", "function getUserDashboard(user) {\n // create ajax GET call\n $.ajax({\n type: \"GET\",\n url: \"/api/entries\",\n dataType: \"json\",\n contentType: \"application/json\",\n headers: {\n Authorization: `Bearer ${jwt}`\n }\n })\n .done(function(result) {\n console.log(result);\n // call display user dashboard function with result.entries as agrument\n displayUserDashboard(result.entries);\n })\n .fail(function(err) {\n console.err(err);\n });\n}", "function onPageChange( page , data ) \n {\n if( page == \"#dashboardPage\" )\n {\n $(\"#welcomePage\").hide();\n $(\"#dashboardListPage\").hide();\n \n //App.View.DashboardList.Modal.close();\n \n $(\"#dashboardListButton\").hide();\n $(\"#titleDashboard\").show();\n var $dashboardList = $( \"#dashboardList\" );\n $dashboardList.empty();\n var dashboardList = App.Model.Dashboard.dashboards; \n var index = 0;\n var oUserConfigure = App.Configure.getUserConfigure();\n if ( oUserConfigure.role == 1 ) {\n //\n App.Model.Dashboard.setSysConfLock( true );\n $('#createNewDashboard').hide();\n $('#dashboardPageNav').hide();\n $('#switchLockDashboard').hide();\n $('#deleteDashboard').hide();\n $('#createNewChart2').hide();\n //\n for( index=0; index < oUserConfigure.dashboardList.length; index++ )\n {\n if (index < oUserConfigure.dashboardList.length) \n {\n var value = oUserConfigure.dashboardList[index];\n if (dashboardList[value] != undefined) {\n $dashboardList.append( '<li><a data-open=\"' + value + '\" href=\"board/'+value+'\">' + dashboardList[value].name + '</a></li>' );\n }\n }\n }\n } else {\n \n $('#createNewDashboard').show();\n \n for( index=0; index < dashboardList.length; index++ ) {\n $dashboardList.append( '<li><a data-open=\"' + index + '\" href=\"board/'+index+'\">' + dashboardList[index].name + '</a></li>' );\n }\n }\n\n var dashboard = App.Model.Dashboard.getDashboard( data );\n var fistDashboard = App.Model.Dashboard.getDashboard( 0 );\n if (dashboard == null)\n {\n if (fistDashboard == null)\n {\n // Quick-fix: Wait to make sure page fade completes before changing pages\n // TODO: Add navigation queue\n setTimeout( function() {\n window.location.href = \"#\";\n } , 500 );\n return;\n }\n else\n {\n dashboard = fistDashboard;\n }\n }\n\n App.Net.createConnection().done( function() {\n App.View.Status.set( \"App.Model.Datasource.getDatasources done.\" );\n loadDashboard( dashboard );\n });\n \n /*kewei added : When user change page, get background setting*/\n App.Model.Dashboard.getBKSetting();\n }\n }", "list() {\n const listings = this._listings.all();\n return Object.keys(listings).map(key => listings[key]);\n }", "async getAllBoards() {\n let res = await fetch('/boards', {credentials: 'include', headers: {'Content-Type': 'application/json'}})\n let v = await res.json()\n return v\n }", "function BabylonInspectorDashboard() {\n // name , html for dash css for dash\n _super.call(this, \"babylonInspector\", \"control.html\", \"control.css\");\n this._ready = false;\n this.id = 'BABYLONINSPECTOR';\n this._dataTreeGenerator = new DataTreeGenerator(this);\n this.treeRoot = null;\n }", "function getDashboardViewSettings() {\n var response = [];\n var responseDashboardViewAs = []\n var cnt = 0;\n var sel = \"\";\n showLoaderDash();\n $(\"#groupBy\").html(\"\");\n\n $.ajax({\n url: url + 'dashboard',\n dataType: 'json',\n cache: false,\n data: {dashBoardId: dashBoardId, key: 'dashboardViewSettings'},\n type: 'GET',\n success: function (result) {\n\n if (result.error_code == 200) {\n\n response = result.dashboardGroupBy;\n $.each(response, function (key, val) {\n response[key]['columnName'] = val.columnName;\n response[key]['columnDisplayName'] = val.columnDisplayName;\n cnt++;\n });\n //console.log(cnt);\n $(\"#groupBy\").append(\"<option value='Please Select'> Please select </option>\");\n for (var i = 1; i <= cnt; i++) { // did it for maintining the sort order in drop down for IE 8\n $(\"#groupBy\").append(\"<option title='\" + response[i]['columnDisplayName'] + \"' value=\" + response[i]['columnName'] + \">\" + response[i]['columnDisplayName'] + \"</option>\");\n }\n cnt = 0;\n response = result.dashboardViewAs;\n $.each(response, function (key, val) {\n response[key]['columnName'] = val.columnName;\n response[key]['columnDisplayName'] = val.columnDisplayName;\n cnt++;\n });\n for (var i = 1; i <= cnt; i++) { // did it for maintining the sort order in drop down for IE 8\n sel = \"\";\n if (loggedInUserId == response[i]['columnName']) {\n sel = 'selected=selected';\n }\n $(\"#viewDashboardAs\").append(\"<option \" + sel + \" title='\" + response[i]['columnDisplayName'] + \"' value=\" + response[i]['columnName'] + \">\" + response[i]['columnDisplayName'] + \"</option>\");\n }\n if (flag_to_start == 1)\n resizeSelect(); // only for normal users\n if (cnt == 1) {\n $('#viewDashboardAs').attr('disabled', true);\n }\n $(\"#dashFilterGroup\").show();\n callGraphApi(); // once the group api is populated then try topopulate graph\n }\n else if (result.error_code == 402) {\n window.location.href = '/auth/logout';\n }\n else if (result.error_code == 401) {\n appendErrorMessage(result.error_code, result.error_msg);\n }\n else {\n //customErrorMessage(response.error_code);\n $(\"#dashMsg\").show();\n $(\"#dashFilterGroup\").hide();\n $(\"#dashGraph\").hide();\n $(\"#loader\").hide();\n }\n }\n });\n}", "list(req, res) {\n this.__readData(__data_source)\n .then(lists => {\n \n \n res.json({ type: \"success\", data: this.__formatter(lists) });\n })\n .catch(err => res.status(412).json({type:\"error\", data:[], message:\"No Data Found\"}));\n }", "function initDashboard(data){\n\tconsole.log(data);\n\t\n\tinitMap('map');\n\t\n\t/* Ajuste de datos */\n\tvar clean_data = [];\n\tdata.forEach(function (d) {\n\t\tif (d.Latitud && d.Longitud) {\n\t\t\tif (!d.Tipo || d.Tipo == '') {\n\t\t\t\td.Tipo = 'No disponible';\n\t\t\t}\n\t\t\tif (!d.Vinculacion || d.Vinculacion == '') {\n\t\t\t\td.Vinculacion = 'No disponible';\n\t\t\t}\n\t\t\tif (!d.Aportacion_usuario || d.Aportacion_usuario == '') {\n\t\t\t\td.Aportacion_usuario = 'No disponible';\n\t\t\t}\n\t\t\tclean_data.push(d);\n\t\t}\n\t});\n\t\n\t/* Configuración Crossfilter */\n\tcf = crossfilter(clean_data);\n\t\n\t// Dimensiones\n\tcf.dim = {};\n\tcf.dim.Tipo = cf.dimension(function(d){ return d.Tipo; });\n\tcf.dim.Vinculacion = cf.dimension(function(d){ return d.Vinculacion; });\n\tcf.dim.Aportacion_usuario = cf.dimension(function(d){ return d.Aportacion_usuario; });\n\tcf.dim.N = cf.dimension(function(d){ return d.N; });\n\tcf.dim.Latitud = cf.dimension(function(d){ return +d.Latitud; });\n\tcf.dim.Longitud = cf.dimension(function(d){ return +d.Longitud; });\n\t\n\t// Grupos\n\tcf.grp = {};\n\tcf.grp.Tipo = cf.dim.Tipo.group();\n\tcf.grp.Vinculacion = cf.dim.Vinculacion.group();\n\tcf.grp.Aportacion_usuario_Plazas = cf.dim.Aportacion_usuario.group().reduceSum(function(d) { return d.Plazas; });\n\tcf.grp.N = cf.dim.N.group();\n\tcf.grp.Latitud = cf.dim.Latitud.group();\n\tcf.grp.Longitud = cf.dim.Longitud.group();\n\t\n\tcf.grp.all = cf.groupAll();\n\t\n\t/* Gráficos */\n\t$(dom.chart1).html('<h4>Tipo de recurso (Top 10)</h4>');\n\tcharts.Tipo\n\t\t.width(250)\n\t\t.height(calculateChartHeight(cf.grp.Tipo.size(),10, 25, 40))//\n\t\t.dimension(cf.dim.Tipo)\n\t\t.group(cf.grp.Tipo)\n\t\t.elasticX(true)\n\t\t.data(function(group) {\treturn group.top(10); })\n\t\t.colors(['#6DDC7A'])\n\t\t.colorAccessor(function(d, i){ return 0;})\n\t\t.xAxis().ticks(3);//.tickFormat(d3.format(\"g\"));\n\t\n\t$(dom.chart2).html('<h4>Vinculación</h4>');\n\tcharts.Vinculacion\n .dimension(cf.dim.Vinculacion)\n .group(cf.grp.Vinculacion)\n .width(180)\n .height(180)\n .radius(80)\n .innerRadius(30);\n\t\n\t$(dom.chart3).html('<h4>Plazas por tipo de aportación</h4>');\n\tcharts.Aportacion_usuario\n\t\t.width(250)\n\t\t.height(calculateChartHeight(cf.grp.Aportacion_usuario_Plazas.size(),10, 25, 40))//\n\t\t.dimension(cf.dim.Aportacion_usuario)\n\t\t.group(cf.grp.Aportacion_usuario_Plazas)\n\t\t.elasticX(true)\n\t\t.data(function(group) {\treturn group.top(10); })\n\t\t.colors(['#6DDC7A'])\n\t\t.colorAccessor(function(d, i){ return 0;})\n\t\t.xAxis().ticks(3);//.tickFormat(d3.format(\"g\"));\n\t\n\tdc.dataCount(\"#filter-indicator\")\n\t\t.dimension(cf)\n\t\t.group(cf.grp.all);\n\t\n\tcharts.Table\n .dimension(cf.dim.Tipo)\n // Data table does not use crossfilter group but rather a closure\n // as a grouping function\n .group(function (d) {\n\t\t\treturn d.Tipo;\n })\n // (_optional_) max number of records to be shown, `default = 25`\n .size(cf.grp.N.size())\n // There are several ways to specify the columns; see the data-table documentation.\n // This code demonstrates generating the column header automatically based on the columns.\n .columns([\t\t\t\n\t\t\tfunction(d) {\n\t\t\t\treturn d.Denominacion;\n\t\t\t},\n\t\t\tfunction(d) {\n\t\t\t\treturn d.Poblacion_destinataria;\n\t\t\t}\t\t\t\n\t\t])\n // (_optional_) sort using the given field, `default = function(d){return d;}`\n .sortBy(function (d) {\n return d.Denominacion;\n })\n // (_optional_) sort order, `default = d3.ascending`\n .order(d3.ascending)\n // (_optional_) custom renderlet to post-process chart using [D3](http://d3js.org)\n .on('renderlet', function (table) {\n table.selectAll('.dc-table-group').classed('info', true);\n });\n\t\n\tfor (var i = 0; i < dc.chartRegistry.list().length; i++) {\n\t\tvar chartI = dc.chartRegistry.list()[i];\n\t\tchartI.on(\"filtered\", function(chart, filter){ if (filterFromCode === false) { chartFiltered(); }});\n\t}\n\t\n\tmap.on(\"moveend\", onmapmoveend);\n\t\n\tupdateMapPoints();\n\t//geofilter();\n\tdc.renderAll();\n\t//filterFromCode = false;\n\t\n}", "boards() {\n const ret = ReactiveCache.getBoards(\n {\n archived: false,\n 'members.userId': Meteor.userId(),\n _id: { $ne: ReactiveCache.getCurrentUser().getTemplatesBoardId() },\n },\n {\n sort: { sort: 1 },\n },\n );\n return ret;\n }", "function showDashboard() {\n document.querySelector('.main-nav__item--signup').classList.add('hide');\n document.querySelector('.main-nav__item--logout').classList.remove('hide');\n document.querySelector('.logged-in-content').classList.remove('hide');\n document.querySelector('.main-content').classList.add('main-content--dashboard');\n inviteNewUser();\n logout();\n }", "function Dashboard(props) {\n const data = [\n {name: 'Web Search', routeName: 'WebSearchDash', color: '#f5428d'},\n {name: 'Zenserp', routeName: 'ZenserpDash', color: '#f54242'},\n {name: 'Jail Base', routeName: 'JailBaseDash', color: '#f5a442'},\n {\n name: 'Complete Criminal Check',\n routeName: 'CriminalCheck',\n color: '#f5d142',\n },\n {name: 'Tin Eye', routeName: 'TineEye', color: '#368dff'},\n {name: 'The News', routeName: 'TheNews', color: '#41d95d'},\n {name: 'CourtListener', routeName: 'CourtListener', color: '#9eecff'},\n {name: 'Time Tags Api', routeName: 'TimeTagsApi', color: '#b9ffb0'},\n {name: 'Micro Bilt', routeName: 'MicroBilt', color: '#f5a442'},\n ];\n return (\n <View style={{flex: 1, padding: 10}}>\n <FlatList\n style={{flex: 1}}\n numColumns={2}\n data={data}\n renderItem={({item, index}) => (\n <View\n style={{\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n }}>\n <Items\n title={item.name}\n navigate={props.navigation.navigate}\n routeName={item.routeName}\n color={item.color}\n />\n </View>\n )}\n />\n </View>\n );\n}", "function getList() {\n return request(`/WebApi/menu/getlist`);\n}", "function AdminDashboard() {\n const FETCH_CLOCKS_QUERY = gql`\n {\n getClocks {\n id\n userId\n timeRegistered\n }\n }\n `;\n\n const { user, logout } = useContext(AuthContext);\n const { loading, data: { getClocks: clocks } = {} } = useQuery(\n FETCH_CLOCKS_QUERY\n );\n /**\n * When receive click event, trigger the logout function.\n */\n const handleItemClick = () => logout();\n\n return (\n <div className=\"ui grid\">\n <div className=\"side-bar column\">\n <div class=\"ui small image\">\n <img src={SmallLogo} alt=\"logo\" className=\"logo-image\" />\n </div>\n <div className=\"ui divider\"></div>\n <Button className=\"dash-button ui button\">\n <img src={Registers} alt=\"registro\" />\n </Button>\n <div className=\"ui divider\"></div>\n <Button\n className=\"logout-button ui big button\"\n onClick={handleItemClick}\n as={Link}\n to=\"/login\"\n >\n <img src={Logout} alt=\"logout\" />\n </Button>\n </div>\n <div className=\"thirteen wide column\">\n {user && (\n <div class=\"ui admin-dash-label\">\n <List divided verticalAlign=\"middle\">\n <List.Item>\n <div className=\"clocks\">\n <Grid columns={3}>\n <Grid.Row>\n <Grid.Column>\n <b>Colaborador</b>\n </Grid.Column>\n <Grid.Column>\n <b>Data</b>\n </Grid.Column>\n <Grid.Column>\n <b>Hora</b>\n </Grid.Column>\n </Grid.Row>\n </Grid>\n </div>\n </List.Item>\n </List>\n </div>\n )}\n {loading ? (\n <h1>Loading posts..</h1>\n ) : (\n <div>\n {clocks &&\n clocks.map((clock) => (\n <div class=\"ui segment\">\n <ListCard clock={clock} user={user} />\n </div>\n ))}\n </div>\n )}\n </div>\n </div>\n );\n}", "getList() { return this.api(); }", "function getAllUserDashInfo() {\n // Query announcements\n axios\n .all([\n axios.get(\"/api/v1/announcements\", { withCredentials: true }),\n axios.get(\"/api/v1/tasks\", { withCredentials: true }),\n axios.get(\"/api/v1/comments\", { withCredentials: true }),\n axios.get(\"/api/v1/users\", { withCredentials: true }),\n ])\n .then(\n axios.spread((announcements, tasks, comments, userData) => {\n setUserAnnouncementList(\n announcements.data.filter((ann) => !isCompletedClass(ann))\n );\n setUserTaskList(tasks.data.incompletedTasks.filter(\n (task) => !isCompletedClass(task)\n ));\n setUserSubtaskList(tasks.data.incompletedSubtasks.filter(\n (task) => !isCompletedClass(task)\n ));\n setUserCommentList(comments.data); \n setUsername(userData.data.attributes.username);\n })\n )\n .catch((err) => console.log(err))\n .finally(() => setIsRetrieving(false));\n }", "list() {\n this._followRelService(\"list\", \"List\");\n }", "function CreateDashboardWidgets()\n{\n var configData= null;\n $.ajax({ \n type: \"POST\", \n cache:false,\n async:false,\n data:\"detailsRequest\",\n url: \"ClientController/GetConfig.action\", \n \n \n success: function(){\n }\n }).done(function(res) {\n if(res.errorMessage){\n \n alert(res.errorMessage);\n return;\n }\n configData = res.configData;\n });\n configData = JSON.parse(configData); // TODO: Excpetion handling\n ReportDesc = configData[0].ReportDesc;\n DashboardImages = configData[0].DashboardImages;\n SavedQueryIds = configData[0].QueryIds.split(\",\");\n SavedQueries = configData[0].Queries.split(\",\");\n ImageFolder = configData[0].ImageFolder;\n \n //Set report description - toptext\n set_toptext(ReportDesc,0);\n \n //for(var i=1;i<=3;i++){ \n for(var i=1;i<=SavedQueryIds.length;i++){ \n //Create Widget Shell\n var htmlcontent = windowContent(\"Widget\",i);\n $(\"#dashboard\").append(htmlcontent);\n \n //Set title\n $('.WidgetTitle'+i).text(SavedQueries[i-1]);\n \n //Create pie chart\n getWidgetChart(SavedQueryIds[i-1],i);\n \n //Fetch photos\n if(DashboardImages=='No') {\n $('#images_li'+i).css(\"display\", \"none\");\n } else {\n getWidgetPhotos(\"indicator_tags like '%\"+SavedQueryIds[i-1]+\"%'\", SavedQueryIds[i-1],i);\n } \n //Fetch table\n getWidgetTable(\"\",SavedQueryIds[i-1],i); \n \n //Fetch Notes\n submitNote(\"\",i);\n }\n $(\".detail a\").click(function(){\n var id = $(this).attr(\"id\");\n $(\"#viewInsights-\"+id).animate({ bottom: '0' }, 500);\n });\n\n $(\".cross a\").click(function(){\n var id = $(this).attr(\"id\");\n $(\"#viewInsights-\"+id).animate({ bottom: '-200%'}, 500);\n });\n\n $(\".addin a\").click(function(){\n var id = $(this).attr(\"id\");\n $(\"#addin-\"+id).animate({ left: '0' }, 500);\n });\n \n $(\".addinputbox form button\").click(function(){\n var id = $(this).attr(\"id\");\n var note = $('#note-'+id).val();\n if(note!=\"\") {\n //Submit input text\n //alert(note+id);\n submitNote(note,id);\n }\n });\n}", "function history(){\n $.getJSON('/team_dashboard/leads_history',data=>{\n \n historytable(data)\n })\n}", "async function openDashboard(i) {\n if (i < -2 || i >= this.state.panels.length) return\n\n Actions.closeCtxMenu()\n Actions.resetSelection()\n this.state.dashboardIsOpen = true\n\n if (i === -2) {\n this.state.dashboard = {\n dashboard: 'HiddenPanelsDashboard',\n panels: this.state.panels.filter(b => !b.bookmarks && b.inactive),\n }\n return\n }\n\n this.state.panelIndex = i\n\n if (i === -1) this.state.dashboard = { dashboard: 'TabsDashboard', name: '', new: true }\n else this.state.dashboard = this.state.panels[i]\n}", "function listLogins() {\n const userKey = 'all';\n const applicationName = 'login';\n const optionalArgs = {\n maxResults: 10\n };\n try {\n const response = AdminReports.Activities.list(userKey, applicationName, optionalArgs);\n const activities = response.items;\n if (!activities || activities.length === 0) {\n console.log('No logins found.');\n return;\n }\n // Print login events\n console.log('Logins:');\n for (const activity of activities) {\n console.log('%s: %s (%s)', activity.id.time, activity.actor.email,\n activity.events[0].name);\n }\n } catch (err) {\n // TODO (developer)- Handle exception from the Report API\n console.log('Failed with error %s', err.message);\n }\n}", "getWidgets() {\n const { application } = this.props;\n const url = [\n process.env.WRI_API_URL,\n // If a dataset is passed, we only display its widgets\n this.props.dataset ? `/dataset/${this.props.dataset}` : '',\n `/widget?application=${application.join(',')}&page[size]=999&env=production,preproduction`\n ].join('');\n\n fetch(new Request(url))\n .then((response) => {\n if (response.ok) {\n return response.json();\n }\n throw new Error(response.statusText);\n })\n .then((response) => {\n const widgets = sortBy(response.data.map(widget =>\n Object.assign({}, widget.attributes, {\n id: widget.id\n })\n ), 'name');\n this.setState({ widgets, loading: false });\n })\n .catch(() => {\n this.setState({ message: 'Error loading datasets', loading: false });\n });\n }", "function getDatasourceList() {\n homeService.getDatasourceList().then(function(response) {\n console.log(response);\n if(response.status === 200) {\n angular.copy(self.datasourceList, self.datasourceList);\n }\n else{\n console.log(\"Error: \" + response.data);\n }\n });\n }", "function getList() {\n return fetch(\n 'https://5f91384ae0559c0016ad7349.mockapi.io/departments',\n ).then((data) => data.json());\n }", "function laterPayBackendDashboard() {\n var i, l,\n $o = {\n itemsPerList : 10,\n list : [],\n intervalToMs : {\n 'day' : 86400,\n 'week' : (86400 * 7),\n '2-weeks' : (86400 * 14),\n 'month' : (86400 * 30),\n },\n\n // heading with dashboard configuration selections\n configurationSelection : $('.lp_js_selectDashboardInterval, .lp_js_selectRevenueModel'),\n intervalChoices : $('.lp_js_selectDashboardInterval'),\n revenueModelChoices : $('.lp_js_selectRevenueModel'),\n currentInterval : $('#lp_js_displayedInterval'),\n previousInterval : $('#lp_js_loadPreviousInterval'),\n nextInterval : $('#lp_js_loadNextInterval'),\n refreshDashboard : $('#lp_js_refreshDashboard'),\n // generic dropdown selectors\n dropdown : '.lp_dropdown',\n dropdownList : '.lp_dropdown_list',\n dropdownCurrentItem : '.lp_dropdown_currentItem',\n\n // diagrams\n conversionDiagram : $('#lp_js_conversionDiagram'),\n salesDiagram : $('#lp_js_salesDiagram'),\n revenueDiagram : $('#lp_js_revenueDiagram'),\n // colors\n colorBackground : '#e3e3e3',\n colorBackgroundLaterpay : '#50c371',\n colorBorder : '#ccc',\n colorTextLighter : '#ababab',\n\n // main KPIs\n totalImpressionsKPI : $('#lp_js_totalImpressions'),\n avgConversionKPI : $('#lp_js_avgConversion'),\n newCustomersKPI : $('#lp_js_shareOfNewCustomers'),\n\n avgItemsSoldKPI : $('#lp_js_avg-items-sold'),\n totalItemsSoldKPI : $('#lp_js_total-items-sold'),\n\n avgRevenueKPI : $('#lp_js_avgRevenue'),\n totalRevenueKPI : $('#lp_js_totalRevenue'),\n\n // top / bottom lists\n bestConvertingList : $('#lp_js_bestConvertingList'),\n leastConvertingList : $('#lp_js_leastConvertingList'),\n bestSellingList : $('#lp_js_bestSellingList'),\n leastSellingList : $('#lp_js_leastSellingList'),\n bestGrossingList : $('#lp_js_bestGrossingList'),\n leastGrossingList : $('#lp_js_leastGrossingList'),\n\n // post-specific statistics\n toggleItemDetails : '.lp_js_toggleItemDetails',\n\n // time passes customer lifecycle\n viewSelector : $('#lp_js_switchDashboardView'),\n standardKpiTab : $('#lp_js_standardKpiTab'),\n timePassesKpiTab : $('#lp_js_timePassesKpiTab'),\n timepassDiagram : $('.lp_js_timepassDiagram'),\n\n // state classes\n expanded : 'lp_is-expanded',\n selected : 'lp_is-selected',\n active : 'lp_is-active',\n delayed : 'lp_is-delayed',\n disabled : 'lp_is-disabled',\n },\n\n plotDefaultOptions = {\n legend : {\n show : false,\n },\n xaxis : {\n font : {\n color : $o.colorTextLighter,\n lineHeight : 18,\n },\n labelWidth : 20,\n show : true,\n },\n yaxis : {\n font : {\n color : $o.colorTextLighter,\n },\n min : 0,\n reserveSpace : true,\n ticks : 5,\n },\n series : {\n shadowSize : 0,\n },\n grid : {\n borderWidth : {\n top : 0,\n right : 0,\n bottom : 1,\n left : 0,\n },\n borderColor : $o.colorBorder,\n tickColor : 'rgba(247,247,247,0)', // transparent\n }\n },\n\n plotDefaultData = [\n {\n color : $o.colorBackgroundLaterpay,\n lines : {\n fill : false,\n gaps : true,\n lineWidth : 2.5,\n show : true,\n },\n points : {\n fill : true,\n fillColor : $o.colorBackgroundLaterpay,\n lineWidth : 0,\n radius : 4,\n show : true,\n }\n }\n ],\n\n bindEvents = function() {\n // toggle dropdown_list on touch devices\n $($o.dropdownCurrentItem)\n .click(function() {\n $(this).parent($o.dropdown).addClass($o.expanded);\n });\n\n // switch interval or revenue model filter\n $o.configurationSelection\n .mousedown(function() {\n var startTimestamp = $o.currentInterval.data('startTimestamp'),\n oldInterval = getInterval(),\n nextStartTimestamp,\n nextEndTimestamp,\n newInterval;\n\n // mark clicked item as selected\n $(this)\n .parents($o.dropdown)\n .removeClass($o.expanded)\n .find($o.dropdownCurrentItem)\n .text($(this).text())\n .end()\n .find('.' + $o.selected)\n .removeClass($o.selected)\n .end()\n .end()\n .addClass($o.selected);\n\n newInterval = getInterval();\n\n // for the 24 hour interval it's allowed to view 'today', but when switching to another interval\n // we have to automatically switch back to 'yesterday'\n if (oldInterval === 'day' && newInterval !== 'day') {\n var todayDate = new Date(),\n startDate = new Date(startTimestamp * 1000);\n\n todayDate.setHours(0, 0, 0, 0);\n startDate.setHours(0, 0, 0, 0);\n\n if (todayDate.getTime() === startDate.getTime()) {\n startTimestamp = startTimestamp - getIntervalDiff(oldInterval);\n }\n }\n\n // check, if the 'next' button should be visible or hidden for the given interval\n nextStartTimestamp = startTimestamp + getIntervalDiff(newInterval);\n switchNextIntervalState(nextStartTimestamp, newInterval);\n\n // check, if the 'previous' button should be visible or hidden for the given interval\n nextEndTimestamp = startTimestamp - getIntervalDiff(newInterval);\n switchPreviousIntervalState(nextEndTimestamp, newInterval);\n\n setTimeRange(startTimestamp, newInterval);\n loadDashboard(false);\n })\n .click(function(e) {e.preventDefault();});\n\n // load next interval\n $o.nextInterval\n .mousedown(function() {\n loadNextInterval();\n })\n .click(function(e) {e.preventDefault();});\n\n // load previous interval\n $o.previousInterval\n .mousedown(function() {\n loadPreviousInterval();\n })\n .click(function(e) {e.preventDefault();});\n\n $('body')\n .on('mousedown', $o.toggleItemDetails, function() {\n alert('Toggling post details coming soon');\n })\n .on('click', $o.toggleItemDetails, function(e) {e.preventDefault();});\n\n // switch between normal and time passes view\n $o.viewSelector\n .mousedown(function() {\n switchDashboardView($(this));\n })\n .click(function(e) {e.preventDefault();});\n },\n\n loadPreviousInterval = function() {\n var endTimestamp = $o.currentInterval.data('startTimestamp'),\n interval = getInterval(),\n intervalDiff = getIntervalDiff(interval);\n\n if ($o.previousInterval.hasClass($o.disabled)) {\n return;\n }\n\n // if we were able to select the previous interval, it must be possible to switch back to the current\n // interval so make sure the next link is not disabled\n $o.previousInterval.removeClass($o.disabled);\n\n endTimestamp = endTimestamp - intervalDiff;\n\n switchNextIntervalState(endTimestamp, interval);\n switchPreviousIntervalState(endTimestamp, interval);\n setTimeRange(endTimestamp, interval);\n loadDashboard(false);\n },\n\n loadNextInterval = function() {\n var startTimestamp = $o.currentInterval.data('startTimestamp'),\n nextStartTimestamp,\n interval = getInterval(),\n intervalDiff = getIntervalDiff(interval);\n\n if ($o.nextInterval.hasClass($o.disabled)) {\n return;\n }\n\n // if we were able to select the next interval, it must be possible to switch back to the current\n // interval so make sure the prev link is not disabled\n $o.previousInterval.removeClass($o.disabled);\n\n startTimestamp = startTimestamp + intervalDiff;\n\n // check if the next startTimestamp is within the interval\n nextStartTimestamp = startTimestamp + intervalDiff;\n switchNextIntervalState(nextStartTimestamp, interval);\n\n setTimeRange(startTimestamp, interval);\n loadDashboard(true);\n },\n\n switchNextIntervalState = function(timestamp, interval) {\n if (!isDateWithinInterval(timestamp)) {\n $o.nextInterval.addClass($o.disabled).removeAttr('data-tooltip');\n } else {\n var i18n = getNextPrevTooltip(interval);\n $o.nextInterval.removeClass($o.disabled).attr({'data-tooltip': i18n.next});\n }\n },\n\n switchPreviousIntervalState = function(timestamp, interval) {\n if (!isDateWithinInterval(timestamp)) {\n $o.previousInterval.addClass($o.disabled).removeAttr('data-tooltip');\n } else {\n var i18n = getNextPrevTooltip(interval);\n $o.previousInterval.removeClass($o.disabled).attr({'data-tooltip': i18n.prev});\n }\n },\n\n isDateWithinInterval = function(timestamp) {\n var startDate = new Date(),\n intervalEnd = $o.currentInterval.data('intervalEndTimestamp'),\n endDate = new Date(intervalEnd * 1000),\n givenDate = new Date(timestamp * 1000),\n interval = getInterval();\n\n // for the 24 hour interval we allow 'today' as startDate, else we default to 'yesterday'\n if (interval !== 'day') {\n startDate.setDate(startDate.getDate() - 1);\n }\n\n // reset all days to 0:00:00 for easier comparison\n startDate.setHours(0,0,0,0);\n endDate.setHours(0,0,0,0);\n givenDate.setHours(0,0,0,0);\n\n if (interval === 'day') {\n return !(givenDate.getTime() <= endDate.getTime() || givenDate.getTime() > startDate.getTime());\n } else {\n return !(givenDate.getTime() <= endDate.getTime() || givenDate.getTime() >= startDate.getTime());\n }\n },\n\n getIntervalDiff = function(interval) {\n var diff = 86400; // 1 day\n if (interval === 'day') {\n diff = 86400;\n } else if (interval === 'week') {\n diff = diff * 8;\n } else if (interval === '2-weeks') {\n diff = diff * 16;\n } else if (interval === 'month') {\n diff = diff * 30;\n }\n\n return diff;\n },\n\n getNextPrevTooltip = function(interval) {\n if (!lpVars.i18n.tooltips[interval]) {\n return false;\n }\n\n return lpVars.i18n.tooltips[interval];\n },\n\n getInterval = function() {\n return $o.intervalChoices\n .parents($o.dropdownList)\n .find('.' + $o.selected)\n .attr('data-interval');\n },\n\n setTimeRange = function(startTimestamp, interval) {\n var endTimestamp,\n intervalInMs = $o.intervalToMs[interval],\n from,\n to,\n timeRange;\n\n // new endTimestamp\n endTimestamp = startTimestamp - intervalInMs;\n\n // * 1000 because of php strtotime()\n to = new Date(startTimestamp * 1000);\n from = new Date(endTimestamp * 1000);\n\n // format date string for current interval\n // use international standard date format by default (YYYY-MM-DD); getMonth and getDate need to be\n // zero-padded for this\n if (interval === 'day') {\n if (lpVars.locale === 'de_DE') {\n // getMonth is 0-based so we need to compensate that by adding 1 to it\n timeRange = to.getDate() + '.' + (to.getMonth() + 1) + '.' + to.getFullYear();\n } else {\n timeRange = to.getFullYear() + '-' +\n ('0' + (to.getMonth() + 1)).slice(-2) + '-' +\n ('0' + to.getDate()).slice(-2);\n }\n } else {\n if (lpVars.locale === 'de_DE') {\n timeRange = from.getDate() + '.' + (from.getMonth() + 1) + '.' + from.getFullYear() +\n ' &ndash; ' +\n to.getDate() + '.' + (to.getMonth() + 1) + '.' + to.getFullYear();\n } else {\n timeRange = from.getFullYear() + '-' +\n ('0' + (from.getMonth() + 1)).slice(-2) + '-' +\n ('0' + from.getDate()).slice(-2) +\n ' &ndash; ' +\n to.getFullYear() + '-' +\n ('0' + (to.getMonth() + 1)).slice(-2) + '-' +\n ('0' + to.getDate()).slice(-2);\n }\n }\n\n // set the new startTimestamp as data attribute for refreshing the dashboard data;\n // set the new timeRange\n $o.currentInterval\n .data('startTimestamp', startTimestamp)\n .html(timeRange);\n },\n\n loadDashboardData = function(section, refresh, pass) {\n var interval = getInterval(),\n revenueModel = $o.revenueModelChoices\n .parents($o.dropdownList)\n .find('.' + $o.selected)\n .attr('data-revenue-model'),\n requestData = {\n // WP Ajax action\n 'action' : 'laterpay_get_dashboard_data',\n // nonce for validation and XSS protection\n '_wpnonce' : lpVars.nonces.dashboard,\n // data section to be loaded:\n // converting_items | selling_items | revenue_items | most_least_converting_items |\n // most_least_selling_items | most_least_revenue_items | metrics\n 'section' : section,\n // day | week | 2-weeks | month\n 'interval' : interval,\n // count of best / least performing items\n 'count' : $o.itemsPerList,\n // 1 (true): refresh data, 0 (false): only load the cached data; default: 1\n 'refresh' : refresh ? 1 : 0,\n // revenue model 'ppu', 'sis', or 'all'\n 'revenue_model' : revenueModel,\n // start-day to go backwards by interval\n 'start_timestamp' : $o.currentInterval.data('startTimestamp'),\n // time pass id (optional)\n 'pass_id' : pass\n },\n jqxhr;\n\n jqxhr = $.ajax({\n 'url' : lpVars.ajaxUrl,\n 'async' : true,\n 'method' : 'POST',\n 'data' : requestData,\n });\n\n jqxhr.done(function(data) {\n if (!data || data.success) {\n return;\n }\n setMessage(data.message, data.success);\n });\n\n return jqxhr;\n },\n\n showLoadingIndicator = function($target) {\n // add a state class, indicating that the element will be showing a loading indicator after a delay\n $target.addClass($o.delayed);\n\n setTimeout(function() {\n if ($target.hasClass($o.delayed)) {\n // add the loading indicator after a delay, if the element still has that state class\n $target.html('<div class=\"lp_loadingIndicator\"></div>');\n }\n }, 600);\n },\n\n removeLoadingIndicator = function($target) {\n if ($target.hasClass($o.delayed)) {\n // remove the state class, thus canceling adding the loading indicator\n $target.removeClass($o.delayed);\n } else {\n // remove the loading indicator\n $target.find('.lp_loadingIndicator').remove();\n }\n },\n\n loadConvertingItems = function(refresh) {\n showLoadingIndicator($o.conversionDiagram);\n\n loadDashboardData('converting_items', refresh)\n .done(function(response) {\n // generate a data point with 100% y-value for each conversion rate column as background\n var backColumns = [];\n i = 0;\n l = response.data.y.length;\n for (; i < l; i++) {\n backColumns.push([i + 1, 100]);\n }\n\n var plotOptions = {\n xaxis : {\n ticks : response.data.x,\n },\n yaxis : {\n tickSize : null,\n max : 100,\n }\n },\n plotData = [\n {\n data : backColumns,\n bars : {\n align : 'center',\n barWidth : 0.6,\n fillColor : $o.colorBackground,\n horizontal : false,\n lineWidth : 0,\n show : true,\n }\n },\n {\n data : response.data.y,\n bars : {\n align : 'center',\n barWidth : 0.4,\n fillColor : $o.colorBackgroundLaterpay,\n horizontal : false,\n lineWidth : 0,\n show : true,\n }\n },\n ];\n\n // extend empty object to merge specific with default plotOptions without modifying the defaults\n plotOptions = $.extend(true, {}, plotDefaultOptions, plotOptions);\n $.plot($o.conversionDiagram, plotData, plotOptions);\n })\n .always(function() {\n removeLoadingIndicator($o.conversionDiagram);\n });\n },\n\n loadSellingItems = function(refresh) {\n showLoadingIndicator($o.salesDiagram);\n\n loadDashboardData('selling_items', refresh)\n .done(function(response) {\n var plotOptions = {\n xaxis : {\n ticks : response.data.x,\n },\n yaxis : {\n max : null,\n },\n },\n plotData = plotDefaultData;\n\n // extend empty object to merge specific with default plotOptions without modifying the defaults\n plotOptions = $.extend(true, {}, plotDefaultOptions, plotOptions);\n plotData[0].data = response.data.y;\n\n $.plot($o.salesDiagram, plotData, plotOptions);\n })\n .always(function() {\n removeLoadingIndicator($o.salesDiagram);\n });\n },\n\n loadRevenueItems = function(refresh) {\n showLoadingIndicator($o.revenueDiagram);\n\n loadDashboardData('revenue_items', refresh)\n .done(function(response) {\n var plotOptions = {\n xaxis : {\n ticks : response.data.x,\n },\n yaxis: {\n max : null,\n },\n },\n plotData = plotDefaultData;\n\n // extend empty object to merge specific with default plotOptions without modifying the defaults\n plotOptions = $.extend(true, {}, plotDefaultOptions, plotOptions);\n plotData[0].data = response.data.y;\n\n $.plot($o.revenueDiagram, plotData, plotOptions);\n })\n .always(function() {\n removeLoadingIndicator($o.revenueDiagram);\n });\n },\n\n loadMostLeastConvertingItems = function(refresh) {\n showLoadingIndicator($o.bestConvertingList);\n showLoadingIndicator($o.leastConvertingList);\n\n loadDashboardData('most_least_converting_items', refresh)\n .done(function(response) {\n if (!response.data.most) {\n response.data.most = {};\n }\n\n if (!response.data.least) {\n response.data.least = {};\n }\n\n renderTopBottomList($o.bestConvertingList, response.data.most);\n renderSparklines($o.bestConvertingList);\n\n renderTopBottomList($o.leastConvertingList, response.data.least);\n renderSparklines($o.leastConvertingList);\n })\n .always(function() {\n removeLoadingIndicator($o.bestConvertingList);\n removeLoadingIndicator($o.leastConvertingList);\n });\n },\n\n loadMostLeastSellingItems = function(refresh) {\n showLoadingIndicator($o.bestSellingList);\n showLoadingIndicator($o.leastSellingList);\n\n loadDashboardData('most_least_selling_items', refresh)\n .done(function(response) {\n if (!response.data.most) {\n response.data.most = {};\n }\n\n if (!response.data.least) {\n response.data.least = {};\n }\n\n renderTopBottomList($o.bestSellingList, response.data.most);\n renderSparklines($o.bestSellingList);\n\n renderTopBottomList($o.leastSellingList, response.data.least);\n renderSparklines($o.leastSellingList);\n })\n .always(function() {\n removeLoadingIndicator($o.bestSellingList);\n removeLoadingIndicator($o.leastSellingList);\n });\n },\n\n loadMostLeastRevenueItems = function(refresh) {\n showLoadingIndicator($o.bestGrossingList);\n showLoadingIndicator($o.leastGrossingList);\n\n loadDashboardData('most_least_revenue_items', refresh)\n .done(function(response) {\n if (!response.data.most) {\n response.data.most = {};\n }\n\n if (!response.data.least) {\n response.data.least = {};\n }\n\n renderTopBottomList($o.bestGrossingList, response.data.most);\n renderSparklines($o.bestGrossingList);\n\n renderTopBottomList($o.leastGrossingList, response.data.least);\n renderSparklines($o.leastGrossingList);\n })\n .always(function() {\n removeLoadingIndicator($o.bestGrossingList);\n removeLoadingIndicator($o.leastGrossingList);\n });\n },\n\n loadKPIs = function(refresh) {\n loadDashboardData('metrics', refresh)\n .done(function(response) {\n // column 1: conversion data\n $o.totalImpressionsKPI.text(response.data.impressions || 0);\n $o.avgConversionKPI.text(response.data.conversion || 0);\n $o.newCustomersKPI.text(response.data.new_customers || 0);\n\n // column 2: sales data\n $o.avgItemsSoldKPI.text(response.data.avg_items_sold || 0);\n $o.totalItemsSoldKPI.text(response.data.total_items_sold || 0);\n\n // column 3: revenue data\n $o.avgRevenueKPI.text(response.data.avg_purchase || 0);\n $o.totalRevenueKPI.text(response.data.total_revenue || 0);\n });\n },\n\n renderTopBottomList = function($list, data) {\n $o.list = [];\n\n i = 0;\n l = data ? data.length : 0;\n\n if (l > 0) {\n // create list item for each data set\n for (; i < l; i++) {\n $o.list.push(renderListItem(\n data[i].post_id,\n data[i].post_title,\n data[i].amount,\n data[i].unit,\n data[i].sparkline\n ));\n }\n } else {\n $o.list = ['<dfn class=\"lp_topBottomList__empty-state\">' + lpVars.i18n.noData + '</dfn>'];\n }\n\n // replace existing HTML\n $list.html($o.list.join(''));\n },\n\n renderListItem = function(postId, itemName, kpiValue, kpiUnit, sparklineData) {\n var kpi = kpiUnit ? kpiValue + '<small>' + kpiUnit + '</small>' : kpiValue,\n valueClass = 'lp_value';\n\n if (kpiUnit === '%' || kpiUnit === '') {\n valueClass = 'lp_value-narrow';\n }\n\n return '<li>' +\n '<span class=\"lp_sparklineBar\">' + sparklineData + '</span>' +\n '<strong class=\"' + valueClass + '\">' + kpi + '</strong>' +\n '<i><a href=\"#\" class=\"lp_js_toggleItemDetails\">' + itemName + '</a></i>' +\n '</li>';\n },\n\n renderSparklines = function($context) {\n var $sparkline = $('.lp_sparklineBar', $context),\n // get the number of data points from the first matched sparkline\n dataPoints = $sparkline.first().text().split(',').length;\n\n if (dataPoints > 8) {\n // render lots of data points as line chart, because bars would have < 1 px width each\n $sparkline\n .peity('line', {\n fill : $o.colorBackground,\n height : 14,\n stroke : $o.colorBorder,\n width : 34,\n });\n } else {\n $sparkline\n .peity('bar', {\n fill : function() {\n return $o.colorBorder;\n },\n gap : 1,\n height : 14,\n width : 34,\n });\n }\n },\n\n loadDashboard = function(refresh) {\n\n refresh = refresh || false;\n loadMostLeastConvertingItems(refresh);\n loadMostLeastRevenueItems(refresh);\n loadMostLeastSellingItems(refresh);\n loadConvertingItems(refresh);\n loadTimePassLifecycles(refresh);\n loadRevenueItems(refresh);\n loadSellingItems(refresh);\n loadKPIs(refresh);\n },\n\n switchDashboardView = function($item) {\n var data = $.parseJSON($item.attr('data')),\n current_label = $.trim($item.html());\n\n if (data.view === lpVars.submenu.view.standard) {\n // standard KPI dashboard\n // change label\n $item.html(data.label);\n\n // set new data view\n data.view = lpVars.submenu.view.passes;\n\n // select view\n $o.standardKpiTab.show();\n $o.timePassesKpiTab.hide();\n\n // update data\n data.label = current_label;\n $item.attr('data', JSON.stringify(data));\n } else if (data.view === lpVars.submenu.view.passes) {\n // time passes dashboard\n // change label\n $item.html(data.label);\n\n // set new data view\n data.view = lpVars.submenu.view.standard;\n\n // select view\n $o.timePassesKpiTab.show();\n $o.standardKpiTab.hide();\n\n // update data\n data.label = current_label;\n $item.attr('data', JSON.stringify(data));\n }\n },\n\n loadTimePassLifecycles = function(refresh) {\n var data = $o.timepassDiagram;\n\n $.each($o.timepassDiagram, function(index) {\n var timePassId = $(data[index]).data('id');\n\n showLoadingIndicator($(data[index]));\n\n loadDashboardData('time_passes_expiry', refresh, timePassId)\n .done(function(response) {\n var max = parseInt(lpVars.maxYValue, 10) + 5, // add some air to y-axis scale\n $placeholder = $(data[index]),\n markings = [\n {\n // separator 1 after first 4 weeks (1 month)\n color : $o.colorBorder,\n lineWidth : 1,\n xaxis : {\n from : 3.5,\n to : 3.5,\n },\n },\n {\n // separator 2 after first 12 weeks (3 months)\n color : $o.colorBorder,\n lineWidth : 1,\n xaxis : {\n from : 11.5,\n to : 11.5,\n },\n },\n {\n // horizontal summary line for first month\n color : $o.colorBorder,\n lineWidth : 2,\n xaxis : {\n from : 0.25,\n to : 3.25,\n },\n yaxis : {\n from : max - 1,\n to : max - 1,\n },\n },\n {\n // horizontal summary line for month 2-3\n color : $o.colorBorder,\n lineWidth : 2,\n xaxis : {\n from : 3.75,\n to : 11.25,\n },\n yaxis : {\n from : max - 1,\n to : max - 1,\n },\n },\n ],\n plotOptions = {\n xaxis : {\n ticks : response.data.x,\n },\n yaxis : {\n show : false,\n max : max,\n tickFormatter : function(val) {\n return parseInt(val, 10);\n }\n },\n grid : {\n markings : markings,\n },\n },\n plotData = [\n {\n data : response.data.y,\n bars : {\n align : 'center',\n barWidth : 0.4,\n fillColor : $o.colorBackgroundLaterpay,\n horizontal : false,\n lineWidth : 0,\n show : true,\n },\n },\n ];\n\n // extend empty object to merge specific with default plotOptions without\n // modifying the defaults\n plotOptions = $.extend(true, {}, plotDefaultOptions, plotOptions);\n var $graph = $.plot($placeholder, plotData, plotOptions);\n\n // calculate the sum of time passes that expire in 0-4 and 5-12 weeks, respectively\n var sum04 = 0,\n sum512 = 0,\n i;\n for (i = 0; i < 5; i++) {\n sum04 += response.data.y[i][1];\n }\n for (i = 5; i < 13; i++) {\n sum512 += response.data.y[i][1];\n }\n\n // add labels to the flot graph:\n // get the offset of separator 1 within the flot placeholder\n var o1 = $graph.pointOffset({x: 3.5, y: 0}),\n label1 = '<div class=\"lp_time-pass-diagram__label\" ' +\n 'style=\"left:' + (o1.left - 30) + 'px; top:2px;\">' +\n lpVars.i18n.endingIn + '<br>' +\n '< 1 ' + lpVars.i18n.month +\n '</div>';\n // append that label to the graph\n $placeholder.append(label1);\n // get the offset of separator 2 within the flot placeholder\n var o2 = $graph.pointOffset({x: 11.5, y: 0}),\n label2 = '<div class=\"lp_time-pass-diagram__label\" ' +\n 'style=\"left:' + (o2.left - 30) + 'px; top:2px;\">' +\n lpVars.i18n.endingIn + '<br>' +\n '< 3 ' + lpVars.i18n.months +\n '</div>';\n // append that label to the graph\n $placeholder.append(label2);\n\n // add arrowhead to x-axis\n var o3 = $graph.pointOffset({x: 13, y: 0}),\n ctx = $graph.getCanvas().getContext('2d');\n o3.left += 8;\n o3.top += 4;\n ctx.beginPath();\n ctx.moveTo(o3.left, o3.top);\n ctx.lineTo(o3.left, o3.top - 7);\n ctx.lineTo(o3.left + 6, o3.top - 3.5);\n ctx.lineTo(o3.left, o3.top);\n ctx.fillStyle = $o.colorBorder;\n ctx.fill();\n\n // add x-axis label\n var xAxisLabel = '<div class=\"lp_time-pass-diagram__label\" ' +\n 'style=\"left:' + (o3.left + 10) + 'px; top:' + o3.top + 'px;\">' +\n lpVars.i18n.weeksLeft +\n '</div>';\n $placeholder.append(xAxisLabel);\n\n // add sum to 0-4 weeks interval\n var o4 = $graph.pointOffset({x: 1.5, y: max - 1}),\n sum04Label = '<div class=\"lp_time-pass-diagram__sum\" ' +\n 'style=\"left:' + (o4.left - 30) + 'px; top:' + (o4.top - 14) + 'px;\">' +\n sum04 +\n '</div>';\n $placeholder.append(sum04Label);\n\n // add sum to 5-12 weeks interval\n var o5 = $graph.pointOffset({x: 7.5, y: max - 1}),\n sum512Label = '<div class=\"lp_time-pass-diagram__sum\" ' +\n 'style=\"left:' + (o5.left - 30) + 'px; top:' + (o5.top - 14) + 'px;\">' +\n sum512 +\n '</div>';\n $placeholder.append(sum512Label);\n })\n .always(function() {\n removeLoadingIndicator($(data[index]));\n });\n });\n },\n\n initializePage = function() {\n bindEvents();\n loadDashboard();\n };\n\n initializePage();\n }", "function laterPayBackendDashboard() {\n var i, l,\n $o = {\n itemsPerList : 10,\n list : [],\n intervalToMs : {\n 'day' : 86400,\n 'week' : (86400 * 7),\n '2-weeks' : (86400 * 14),\n 'month' : (86400 * 30),\n },\n\n // heading with dashboard configuration selections\n configurationSelection : $('.lp_js_selectDashboardInterval, .lp_js_selectRevenueModel'),\n intervalChoices : $('.lp_js_selectDashboardInterval'),\n revenueModelChoices : $('.lp_js_selectRevenueModel'),\n currentInterval : $('#lp_js_displayedInterval'),\n previousInterval : $('#lp_js_loadPreviousInterval'),\n nextInterval : $('#lp_js_loadNextInterval'),\n refreshDashboard : $('#lp_js_refreshDashboard'),\n // general dropdown selectors\n dropdown : '.lp_dropdown',\n dropdownList : '.lp_dropdown_list',\n dropdownCurrentItem : '.lp_dropdown_currentItem',\n\n // diagrams\n conversionDiagram : $('#lp_js_conversionDiagram'),\n salesDiagram : $('#lp_js_salesDiagram'),\n revenueDiagram : $('#lp_js_revenueDiagram'),\n // colors\n colorBackground : '#e3e3e3',\n colorBackgroundLaterpay : '#50c371',\n colorBorder : '#ccc',\n colorTextLighter : '#bbb',\n\n // main KPIs\n totalImpressionsKPI : $('#lp_js_totalImpressions'),\n avgConversionKPI : $('#lp_js_avgConversion'),\n newCustomersKPI : $('#lp_js_shareOfNewCustomers'),\n\n avgItemsSoldKPI : $('#lp_js_avg-items-sold'),\n totalItemsSoldKPI : $('#lp_js_total-items-sold'),\n\n avgRevenueKPI : $('#lp_js_avgRevenue'),\n totalRevenueKPI : $('#lp_js_totalRevenue'),\n\n // top / bottom lists\n bestConvertingList : $('#lp_js_bestConvertingList'),\n leastConvertingList : $('#lp_js_leastConvertingList'),\n bestSellingList : $('#lp_js_bestSellingList'),\n leastSellingList : $('#lp_js_leastSellingList'),\n bestGrossingList : $('#lp_js_bestGrossingList'),\n leastGrossingList : $('#lp_js_leastGrossingList'),\n\n toggleItemDetails : '.lp_js_toggleItemDetails',\n\n // time passes customer lifecycle\n viewSelector : $('#lp_js_switchDashboardView'),\n standardKpiTab : $('#lp_js_standardKpiTab'),\n timePassesKPITab : $('#lp_js_timePassesKPITabjs'),\n timepassDiagram : $('.lp_js_timepassDiagram'),\n\n // strings cached for better compression\n expanded : 'lp_is-expanded',\n selected : 'lp_is-selected',\n active : 'lp_is-active',\n },\n\n plotDefaultOptions = {\n legend : {\n show : false,\n },\n xaxis : {\n font : {\n color : $o.colorTextLighter,\n lineHeight : 18,\n },\n show : true,\n },\n yaxis : {\n font : {\n color : $o.colorTextLighter,\n },\n min : 0,\n reserveSpace : true,\n ticks : 5,\n },\n series : {\n shadowSize : 0,\n },\n grid : {\n borderWidth : {\n top : 0,\n right : 0,\n bottom : 1,\n left : 0,\n },\n borderColor : $o.colorBorder,\n tickColor : 'rgba(247,247,247,0)', // transparent\n }\n },\n\n plotDefaultData = [\n {\n color : $o.colorBackgroundLaterpay,\n lines : {\n fill : false,\n gaps : true,\n lineWidth : 2.5,\n show : true,\n },\n points : {\n fill : true,\n fillColor : $o.colorBackgroundLaterpay,\n lineWidth : 0,\n radius : 4,\n show : true,\n }\n }\n ],\n\n bindEvents = function() {\n // toggle dropdown_list on touch devices\n $($o.dropdownCurrentItem)\n .click(function() {\n $(this).parent($o.dropdown).addClass($o.expanded);\n });\n\n // re-render dashboard in selected configuration\n $o.configurationSelection\n .mousedown(function() {\n var startTimestamp = $o.currentInterval.data('startTimestamp'),\n nextStartTimestamp,\n nextEndTimestamp,\n interval;\n // change selected item to clicked item\n $(this)\n .parents($o.dropdown)\n .removeClass($o.expanded)\n .find($o.dropdownCurrentItem)\n .text($(this).text())\n .end()\n .find('.' + $o.selected)\n .removeClass($o.selected)\n .end()\n .end()\n .addClass($o.selected);\n\n interval = getInterval();\n\n // check, if the 'next' button should be visible or hidden for the given interval\n nextStartTimestamp = startTimestamp + getIntervalDiff(interval);\n switchNextIntervalState(nextStartTimestamp, interval);\n\n // check, if the 'previous' button should be visible or hidden for the given interval\n nextEndTimestamp = startTimestamp - getIntervalDiff(interval);\n switchPreviousIntervalState(nextEndTimestamp, interval);\n\n setNextPrevTooltip(interval);\n setTimeRange(startTimestamp, interval);\n loadDashboard(false);\n })\n .click(function(e) {e.preventDefault();});\n\n // re-render dashboard with data of next interval\n $o.nextInterval\n .mousedown(function() {\n var startTimestamp = $o.currentInterval.data('startTimestamp'),\n interval = getInterval();\n\n if ($(this).hasClass('lp_nextLink--disabled')) {\n return;\n }\n\n startTimestamp = startTimestamp + getIntervalDiff(interval);\n\n switchNextIntervalState(startTimestamp, interval);\n switchPreviousIntervalState(startTimestamp, interval);\n setTimeRange(startTimestamp, interval);\n loadDashboard(true);\n })\n .click(function(e) {e.preventDefault();});\n\n // re-render dashboard with data of previous interval\n $o.previousInterval\n .mousedown(function() {\n var startTimestamp = $o.currentInterval.data('startTimestamp'),\n interval = getInterval();\n\n if ($(this).hasClass('lp_previousLink--disabled')) {\n return;\n }\n\n startTimestamp = startTimestamp - getIntervalDiff(interval);\n\n switchNextIntervalState(startTimestamp, interval);\n switchPreviousIntervalState(startTimestamp, interval);\n setTimeRange(startTimestamp, interval);\n loadDashboard(false);\n })\n .click(function(e) {e.preventDefault();});\n\n // refresh dashboard\n $o.refreshDashboard\n .mousedown(function() {\n loadDashboard(true);\n })\n .click(function(e) {e.preventDefault();});\n\n $($o.revenueModelChoices)\n .mousedown(function() {\n loadDashboard(true);\n })\n .click(function(e) {e.preventDefault();});\n\n$('body')\n.on('mousedown', $o.toggleItemDetails, function() {\n alert('Toggling post details coming soon');\n})\n.on('click', $o.toggleItemDetails, function(e) {e.preventDefault();});\n\n $o.viewSelector\n .mousedown(function() {\n switchDashboardView($(this));\n })\n .click(function(e) {e.preventDefault();});\n },\n\n switchNextIntervalState = function(timestamp, interval) {\n if (!isDateWithinInterval(timestamp)) {\n $o.nextInterval.addClass('lp_nextLink--disabled').attr({'data-tooltip' : ''});\n } else {\n var i18n = getNextPrevTooltip(interval);\n $o.nextInterval.removeClass('lp_nextLink--disabled').attr({'data-tooltip' : i18n.next});\n }\n },\n\n switchPreviousIntervalState = function(timestamp, interval) {\n if (!isDateWithinInterval(timestamp)) {\n $o.previousInterval.addClass('lp_previousLink--disabled').attr({'data-tooltip' : ''});\n } else {\n var i18n = getNextPrevTooltip(interval);\n $o.previousInterval.removeClass('lp_previousLink--disabled').attr({'data-tooltip' : i18n.prev});\n }\n },\n\n isDateWithinInterval = function(timestamp) {\n var currentDate = new Date(),\n intervalEnd = $o.currentInterval.data('intervalEndTimestamp'),\n intervalEndDate = new Date(intervalEnd * 1000),\n givenDate = new Date(timestamp * 1000);\n\n // yesterday\n currentDate.setDate(currentDate.getDate() - 1);\n\n // check, if the given date is gte yesterday\n if (givenDate.getMonth() === currentDate.getMonth() &&\n givenDate.getYear() === currentDate.getYear() &&\n givenDate.getDate() >= currentDate.getDate()) {\n\n return false;\n }\n\n // check, if the given date is lte the interval end date - earliest entry in post_views-table\n if (givenDate.getMonth() === intervalEndDate.getMonth() &&\n givenDate.getYear() === intervalEndDate.getYear() &&\n givenDate.getDate() <= intervalEndDate.getDate()) {\n\n return false;\n }\n\n return true;\n },\n\n getIntervalDiff = function(interval) {\n var diff = 86400; // 1 day\n if (interval === 'day') {\n diff = 86400;\n } else if (interval === 'week') {\n diff = diff * 8;\n } else if (interval === '2-weeks') {\n diff = diff * 16;\n } else if (interval === 'month') {\n diff = diff * 30;\n }\n\n return diff;\n },\n\n setNextPrevTooltip = function(interval) {\n var i18n = getNextPrevTooltip(interval);\n if (!i18n) {\n return;\n }\n\n $o.nextInterval.attr({'data-tooltip': i18n.next});\n $o.previousInterval.attr({'data-tooltip': i18n.prev});\n },\n\n getNextPrevTooltip = function(interval) {\n if (!lpVars.i18n.tooltips[interval]) {\n return false;\n }\n\n return lpVars.i18n.tooltips[interval];\n },\n\n switchDashboardView = function($item) {\n var data = $.parseJSON($item.attr('data')),\n current_label = $.trim($item.html());\n\n if (data.view === lpVars.submenu.view.standard) {\n // change label\n $item.html(data.label);\n // set new data view\n data.view = lpVars.submenu.view.passes;\n // select view\n $o.standardKpiTab.show();\n $o.timePassesKPITab.hide();\n // update data\n data.label = current_label;\n $item.attr('data',JSON.stringify(data));\n } else if ( data.view === lpVars.submenu.view.passes ) {\n // change label\n $item.html(data.label);\n // set new data view\n data.view = lpVars.submenu.view.standard;\n // select view\n $o.timePassesKPITab.show();\n $o.standardKpiTab.hide();\n // update data\n data.label = current_label;\n $item.attr('data',JSON.stringify(data));\n }\n },\n\n getInterval = function() {\n return $o.intervalChoices\n .parents($o.dropdownList)\n .find('.' + $o.selected)\n .attr('data-interval');\n },\n\n setTimeRange = function(startTimestamp, interval) {\n var endTimestamp,\n intervalInMs = $o.intervalToMs[interval],\n from,\n to,\n timeRange;\n\n // new endTimestamp\n endTimestamp = startTimestamp - intervalInMs;\n\n // * 1000 because of php strtotime()\n to = new Date(startTimestamp * 1000);\n from = new Date(endTimestamp * 1000);\n\n if (interval === 'day') {\n timeRange = to.getDate() + '.' + (to.getMonth() + 1) + '.' + to.getFullYear();\n } else {\n timeRange = from.getDate() + '.' + (from.getMonth() + 1) + '.' + from.getFullYear() +\n ' - ' +\n to.getDate() + '.' + (to.getMonth() + 1) + '.' + to.getFullYear();\n }\n\n // set the new startTimestamp as data attribute for refreshing the dashboard data.\n // set the new timeRange\n $o.currentInterval\n .data('startTimestamp', startTimestamp)\n .html(timeRange);\n },\n\n loadDashboardData = function(section, refresh, pass) {\n var interval = getInterval(),\n revenueModel = $o.revenueModelChoices\n .parents($o.dropdownList)\n .find('.' + $o.selected)\n .attr('data-revenue-model'),\n requestData = {\n // WP Ajax action\n 'action' : 'laterpay_get_dashboard_data',\n // nonce for validation and XSS protection\n '_wpnonce' : lpVars.nonces.dashboard,\n // data section to be loaded:\n // converting_items | selling_items | revenue_items | most_least_converting_items |\n // most_least_selling_items | most_least_revenue_items | metrics\n 'section' : section,\n // day | week | 2-weeks | month\n 'interval' : interval,\n // count of best / least performing items\n 'count' : $o.itemsPerList,\n // 1 (true): refresh data, 0 (false): only load the cached data; default: 1\n 'refresh' : refresh ? 1 : 0,\n // revenue model 'ppu', 'sis', or 'all'\n 'revenue_model' : revenueModel,\n // start-day to go backwards by interval\n 'start_timestamp' : $o.currentInterval.data('startTimestamp'),\n // time pass id (optional)\n 'pass_id' : pass\n },\n jqxhr;\n\n jqxhr = $.ajax({\n 'url' : lpVars.ajaxUrl,\n 'async' : true,\n 'method' : 'POST',\n 'data' : requestData,\n });\n\n jqxhr.done(function(data) {\n if (!data || data.success) {\n return;\n }\n setMessage(data.message, data.success);\n });\n\n return jqxhr;\n },\n\n showLoadingIndicator = function($target) {\n // add a state class, indicating that the element will be showing a loading indicator after a delay\n $target.addClass('lp_is-delayed');\n\n setTimeout(function() {\n if ($target.hasClass('lp_is-delayed')) {\n // add the loading indicator after a delay, if the element still has that state class\n $target.html('<div class=\"lp_loadingIndicator\"></div>');\n }\n }, 600);\n },\n\n removeLoadingIndicator = function($target) {\n if ($target.hasClass('lp_is-delayed')) {\n // remove the state class, thus canceling adding the loading indicator\n $target.removeClass('lp_is-delayed');\n } else {\n // remove the loading indicator\n $target.find('.lp_loadingIndicator').remove();\n }\n },\n\n loadConvertingItems = function(refresh) {\n showLoadingIndicator($o.conversionDiagram);\n\n loadDashboardData('converting_items', refresh)\n .done(function(response) {\n // generate a data point with 100% y-value for each conversion rate column as background\n var backColumns = [];\n i = 0;\n l = response.data.y.length;\n for (i; i < l; i++) {\n backColumns.push([i + 1, 100]);\n }\n\n var plotOptions = {\n xaxis: {\n ticks : response.data.x,\n },\n yaxis: {\n tickSize : null,\n max : 100,\n }\n },\n plotData = [\n {\n data : backColumns,\n bars : {\n align : 'center',\n barWidth : 0.6,\n fillColor : $o.colorBackground,\n horizontal : false,\n lineWidth : 0,\n show : true,\n }\n },\n {\n data : response.data.y,\n bars : {\n align : 'center',\n barWidth : 0.4,\n fillColor : $o.colorBackgroundLaterpay,\n horizontal : false,\n lineWidth : 0,\n show : true,\n }\n },\n ];\n\n plotOptions = $.extend(true, plotDefaultOptions, plotOptions);\n $.plot($o.conversionDiagram, plotData, plotOptions);\n })\n .always(function() {removeLoadingIndicator($o.conversionDiagram);});\n },\n\n loadTimePassLifecycles = function(refresh) {\n var data = $o.timepassDiagram;\n\n $.each($o.timepassDiagram, function(index) {\n var pass_id = $(data[index]).data('id');\n\n showLoadingIndicator($(data[index]));\n\n loadDashboardData('time_passes_expiry', refresh, pass_id)\n .done(function(response) {\n var max = response.data.max,\n backColumns = [];\n\n i = 0;\n l = response.data.y.length;\n for (i; i < l; i++) {\n backColumns.push([i, max]);\n }\n\n // var markings = [\n // {\n // color : $o.colorBorder,\n // lineWidth : 1,\n // xaxis : {\n // from : 3.5,\n // to : 3.5,\n // },\n // },\n // {\n // color : $o.colorBorder,\n // lineWidth : 1,\n // xaxis : {\n // from : 11.5,\n // to : 11.5,\n // },\n // },\n // ];\n var plotOptions = {\n xaxis : {\n ticks : response.data.x,\n },\n yaxis : {\n show : false,\n max : max,\n tickFormatter : function(val) {\n return parseInt(val, 10);\n }\n },\n // grid : {\n // markings : markings,\n // },\n },\n plotData = [\n {\n data : response.data.y,\n bars : {\n align : 'center',\n barWidth : 0.4,\n fillColor : $o.colorBackgroundLaterpay,\n horizontal : false,\n lineWidth : 0,\n show : true,\n },\n },\n ];\n\n plotOptions = $.extend(true, plotDefaultOptions, plotOptions);\n $.plot($(data[index]), plotData, plotOptions);\n })\n .always(function() {removeLoadingIndicator($(data[index]));});\n });\n },\n\n loadSellingItems = function(refresh) {\n showLoadingIndicator($o.salesDiagram);\n\n loadDashboardData('selling_items', refresh)\n .done(function(response) {\n var plotOptions = {\n xaxis: {\n ticks: response.data.x,\n },\n yaxis: {\n max: null,\n }\n },\n plotData = plotDefaultData;\n\n plotOptions = $.extend(true, plotDefaultOptions, plotOptions);\n plotData[0].data = response.data.y;\n\n $.plot($o.salesDiagram, plotData, plotOptions);\n })\n .always(function() {removeLoadingIndicator($o.salesDiagram);});\n },\n\n loadRevenueItems = function(refresh) {\n showLoadingIndicator($o.revenueDiagram);\n\n loadDashboardData('revenue_items', refresh)\n .done(function(response) {\n var plotOptions = {\n xaxis: {\n ticks: response.data.x,\n },\n yaxis: {\n max: null,\n }\n },\n plotData = plotDefaultData;\n\n plotOptions = $.extend(true, plotDefaultOptions, plotOptions);\n plotData[0].data = response.data.y;\n\n $.plot($o.revenueDiagram, plotData, plotOptions);\n })\n .always(function() {removeLoadingIndicator($o.revenueDiagram);});\n },\n\n loadMostLeastConvertingItems = function(refresh) {\n showLoadingIndicator($o.bestConvertingList);\n showLoadingIndicator($o.leastConvertingList);\n\n loadDashboardData('most_least_converting_items', refresh)\n .done(function(response) {\n if (!response.data.most) {\n response.data.most = {};\n }\n\n if (!response.data.least) {\n response.data.least = {};\n }\n\n renderTopBottomList($o.bestConvertingList, response.data.most);\n renderSparklines($o.bestConvertingList);\n\n renderTopBottomList($o.leastConvertingList, response.data.least);\n renderSparklines($o.leastConvertingList);\n })\n .always(function() {\n removeLoadingIndicator($o.bestConvertingList);\n removeLoadingIndicator($o.leastConvertingList);\n });\n },\n\n loadMostLeastSellingItems = function(refresh) {\n showLoadingIndicator($o.bestSellingList);\n showLoadingIndicator($o.leastSellingList);\n\n loadDashboardData('most_least_selling_items', refresh)\n .done(function(response) {\n if (!response.data.most) {\n response.data.most = {};\n }\n\n if (!response.data.least) {\n response.data.least = {};\n }\n\n renderTopBottomList($o.bestSellingList, response.data.most);\n renderSparklines($o.bestSellingList);\n\n renderTopBottomList($o.leastSellingList, response.data.least);\n renderSparklines($o.leastSellingList);\n })\n .always(function() {\n removeLoadingIndicator($o.bestSellingList);\n removeLoadingIndicator($o.leastSellingList);\n });\n },\n\n loadMostLeastRevenueItems = function(refresh) {\n showLoadingIndicator($o.bestGrossingList);\n showLoadingIndicator($o.leastGrossingList);\n\n loadDashboardData('most_least_revenue_items', refresh)\n .done(function(response) {\n if (!response.data.most) {\n response.data.most = {};\n }\n\n if (!response.data.least) {\n response.data.least = {};\n }\n\n renderTopBottomList($o.bestGrossingList, response.data.most);\n renderSparklines($o.bestGrossingList);\n\n renderTopBottomList($o.leastGrossingList, response.data.least);\n renderSparklines($o.leastGrossingList);\n })\n .always(function() {\n removeLoadingIndicator($o.bestGrossingList);\n removeLoadingIndicator($o.leastGrossingList);\n });\n },\n\n loadKPIs = function(refresh) {\n loadDashboardData('metrics', refresh)\n .done(function(response) {\n $o.totalImpressionsKPI.text(response.data.impressions || 0);\n $o.avgConversionKPI.text(response.data.conversion || 0);\n $o.newCustomersKPI.text(response.data.new_customers || 0);\n\n $o.avgItemsSoldKPI.text(response.data.avg_items_sold || 0);\n $o.totalItemsSoldKPI.text(response.data.total_items_sold || 0);\n\n $o.avgRevenueKPI.text(response.data.avg_purchase || 0);\n $o.totalRevenueKPI.text(response.data.total_revenue || 0);\n });\n },\n\n renderTopBottomList = function($list, data) {\n $o.list = [];\n\n i = 0;\n l = data ? data.length : 0;\n\n if (l > 0) {\n // create list item for each data set\n for (; i < l; i++) {\n $o.list.push(renderListItem(\n data[i].post_id,\n data[i].post_title,\n data[i].amount,\n data[i].unit,\n data[i].sparkline\n ));\n }\n } else {\n $o.list = ['<dfn>' + lpVars.i18n.noData + '</dfn>'];\n }\n\n // replace existing HTML\n $list.html($o.list.join(''));\n },\n\n renderListItem = function(postId, itemName, kpiValue, kpiUnit, sparklineData) {\n var kpi = kpiUnit ? kpiValue + '<small>' + kpiUnit + '</small>' : kpiValue,\n valueClass = 'lp_value';\n\n if (kpiUnit === '%' || kpiUnit === '') {\n valueClass = 'lp_value-narrow';\n }\n\n return '<li>' +\n '<span class=\"lp_sparklineBar\">' + sparklineData + '</span>' +\n '<strong class=\"' + valueClass + '\">' + kpi + '</strong>' +\n '<i><a href=\"#\" class=\"lp_js_toggleItemDetails\">' + itemName + '</a></i>' +\n '</li>';\n },\n\n renderSparklines = function($context) {\n var $sparkline = $('.lp_sparklineBar', $context),\n // get the number of data points from the first matched sparkline\n dataPoints = $sparkline.first().text().split(',').length;\n\n if (dataPoints > 8) {\n // render lots of data points as line chart, because bars would have < 1 px width each\n $sparkline\n .peity('line', {\n fill : $o.colorBackground,\n height : 14,\n stroke : $o.colorBorder,\n width : 34,\n });\n } else {\n $sparkline\n .peity('bar', {\n fill : function() {return $o.colorBorder;},\n gap : 1,\n height : 14,\n width : 34,\n });\n }\n },\n\n loadDashboard = function(refresh) {\n refresh = refresh || false;\n loadMostLeastConvertingItems(refresh);\n loadMostLeastRevenueItems(refresh);\n loadMostLeastSellingItems(refresh);\n loadConvertingItems(refresh);\n loadTimePassLifecycles(refresh);\n loadRevenueItems(refresh);\n loadSellingItems(refresh);\n loadKPIs(refresh);\n },\n\n initializePage = function() {\n bindEvents();\n loadDashboard();\n };\n\n initializePage();\n }", "function showDashboard() {\n var pageContentWrapper = $('#page-content-wrapper');\n pageContentWrapper.html(\"Dashboard contents\");\n}", "fetchTablesList() {\n return Api().get('table/fetchList')\n .then(res => res.data.tablesList)\n .catch(err => console.log('createTable err:', err));\n }", "function dashboardApps(data) {\n return logCollection.find(dataField).sort({ \"_id\": -1 }).skip(toSkip).limit(countLimit).toArray()\n .then(logAppList => {\n return logCollection.find(dataField).count()\n .then(logListCount => {\n var result = []\n if (logListCount) {\n for (var i = 0; i < logListCount; i++) {\n var getResult = {\n \"_id\": logAppList[i]._id,\n \"app_id\": logAppList[i].app_id,\n \"comp_id\": logAppList[i].comp_id,\n \"issues\": logAppList[i].issues,\n \"type\": logAppList[i].type,\n \"platform\": logAppList[i].platform,\n \"device\": logAppList[i].device,\n \"version\": logAppList[i].version,\n \"created_dateTime\": logAppList[i].created_dateTime\n }\n result.push(getResult)\n }\n var finalRes = {\n \"logList\": result,\n \"count\": logListCount\n }\n return finalRes; // Final Result for Loglist for Particular App \n\n } else {\n var err = { \"error\": \"log List not found\" };\n return err;\n }\n });\n\n }).catch(err => {\n return err;\n });\n }", "function _displayAvailableShows() {\n try {\n state.shows.map((show, index) => {\n console.log(`${index + 1}. ${show.name}`);\n })\n } catch (e) {\n console.log('Failed to list shows');\n }\n }", "static accountList(accounts) {\n\t\t\t\tlet list = [];\n\n\t\t\t\tif (accounts.length) {\n\t\t\t\t\taccounts.forEach(key => {\n\t\t\t\t\t\tlet accountID = key.id;\n\t\t\t\t\t\tlet accountName = key.toJSON().accountName;\n\t\t\t\t\t\tlet href = `/dashboard/account/${accountID}`;\n\t\t\t\t\t\tlist.push(<li key={key.id}><Link to={href} className=\"account-item\">{accountName}</Link></li>);\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn <ul>{list}</ul>;\n\t\t\t}", "spaceDashboard (baseUrl,username,spacename){\n browser.get(baseUrl + username + \"/\" + spacename);\n }", "function showRuns(){\n\t\t//get runs object\n\t\tvar runs2 = getRunsObject();\n\n\t\t//check if not empty\n\t\tif(runs2 != '' && runs2 != null){\n\t\t\tfor(var i = 0; i < runs2.length; i++){\n\t\t\t\t$('#stats').append('<li class=\"ui-body-inherit ui-li-static\"><strong>Date: </strong>'+runs2[i][\"date\"]+\n\t\t\t\t\t'<br><strong>Distance: </strong>'+runs2[i][\"miles\"]+'m<div class=\"controls\">'+\n\t\t\t\t\t'<a href=\"#edit\" id=\"editLink\" data-miles=\"'+runs2[i][\"miles\"]+'\" data-date=\"'+runs2[i][\"date\"]+'\">Edit</a> | <a href=\"#delete\" id=\"deleteLink\" data-miles=\"'+runs2[i][\"miles\"]+'\" data-date=\"'+runs2[i][\"date\"]+'\" onclick=\"return deleteRun()\">Delete</a></div</li>');\n\t\t\t}\n\t\t\t$('#home').bind('pageinit', function(){\n\t\t\t\t$('#stats').listview('refresh');\n\t\t\t});\n\t\t}else{\n\t\t\t$('#stats').html('<p>You have no logged run </p>');\n\t\t}\n\t}", "function get_reports() {\n var dataObj = {\n \"content\" : [\n { \"session_id\" : get_cookie() }\n ]\n };\n call_server('get_reports', dataObj);\n}", "function ListDashboardVersionsCommand(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 }", "function getTeamList() {\n if (\"caches\" in window) {\n caches.match(ENDPOINT_EPL + \"teams\").then(function (response) {\n if (response) {\n response.json().then(function (data) {\n showTeamList(data);\n })\n }\n })\n }\n\n fetchAPI(ENDPOINT_EPL + \"teams\")\n .then(data => {\n showTeamList(data);\n })\n .catch(error);\n}", "function initList() {\n allMySights = [];\n for (var j = 0; j < mySights.length; j = j + 3) {\n allMySights.push({nameofsight: mySights[j], visible: true});\n }\n}", "function listWorkspaces(data, workspaceCollectionName, accessKey) {\n $.each(data, function (n, value) {\n $('#workspaceList').append($('<option>', { value: value.workspaceId }).text(value.displayName));\n });\n if (data.length > 0) {\n getReports(data[0].workspaceId, workspaceCollectionName, accessKey);\n }\n}", "function getNewDashboardData() {\n $.ajax({\n url: '/dashboard/json/',\n dataType: 'json',\n success: refreshDashboard_cb\n });\n}", "function showHistoryVisits(){\n let $table=$(\"<table></table>\");\n $table.attr(\"id\",\"visitHistoryList\");\n $thead = $(\"<thead></thead>\");\n $thead.attr('id', 'visitHistoryListThead');\n $thead.html(\"<tr><th>Data</th><th>Godzina</th><th>Zwierzę</th><th>Status</th></tr>\");\n $tbody=$(\"<tbody></tbody>\");\n $tbody.attr('id','visitHistoryListTbody');\n $table.append($thead);\n $table.append($tbody);\n $(\"#contentDescription\").append($table);\n showHistoryFilterButtons();\n getMyVisits(\"ALL\");\n}", "function clearDashboard() {\n \n while (dashboard.firstChild) {\n dashboard.removeChild(dashboard.firstChild);\n }\n}", "function getAll() {\n activityService.getAll()\n .success(function(data) {\n $scope.activityList = data;\n })\n .error(function(error) {\n $scope.status = error.message;\n });\n }", "render() {\n const { dashboardStyle } = styles;\n\n return(\n <View style={ dashboardStyle }>\n <Header headerText={'Dashboard'}/>\n { this.renderDash() }\n </View>\n );\n }", "function genereateList() {\n channels.forEach(function(channel) {\n twitchAPI(channel);\n });\n}", "function getSegmentList(tabAccounts) {\r\n\tlet arrList = [];\r\n\tif (Banana.document.table('Categories')) {\r\n\t\tfor (let i = 0; i < Banana.document.table('Categories').rowCount; i++) {\r\n\t\t\tlet tRow = Banana.document.table('Categories').row(i);\r\n\t\t\tif (tRow.value(\"Category\").indexOf(\":\") == 0 && tRow.value(\"Category\").indexOf(\"::\") < 0 && tRow.value(\"Category\").substring(1,2)) {\r\n\t\t\t\tarrList.push(tRow.value(\"Category\"));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tfor (let i = 0; i < Banana.document.table('Accounts').rowCount; i++) {\r\n\t\t\tlet tRow = Banana.document.table('Accounts').row(i);\r\n\t\t\tif (tRow.value(\"Account\").indexOf(\":\") == 0 && tRow.value(\"Account\").indexOf(\"::\") < 0 && tRow.value(\"Account\").substring(1,2)) {\r\n\t\t\t\tarrList.push(tRow.value(\"Account\"));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn arrList;\r\n}", "function getBoats() {\n $.get(\"api/available\", function(availableBoats) {\n console.log(availableBoats);\n });\n }", "list(id) {\n const params = new Array();\n if (id != null) {\n params.push(`id=${id}`);\n }\n return this.rest.get(`${this.baseUrl}/list`, ...params);\n }", "list(id) {\n const params = new Array();\n if (id != null) {\n params.push(`id=${id}`);\n }\n return this.rest.get(`${this.baseUrl}/list`, ...params);\n }", "static async getListings() {\n let res = await this.request(`listings`);\n return res.listings;\n }", "function BlogsMainList(req, res, next) {\n blogsOptions.filters = {};\n const blogsApiUrl = parser.getCompleteApi(blogsOptions);\n\n fetchData(blogsApiUrl, 'blogs', req, res, next);\n}", "function populateDashboard(data){\n\tconsole.log('populateDashboard ran');\n\tgetAndGatherArtistInfo();\n\tretrieveLocalStorage();\n\tgetAndRenderUsername();\n\t//if the user has artwork in their profile, render the artwork thumb\n\tgetAndRenderArtworkThumb();\n}", "function getSegmentList(tabAccounts) {\r\n\tvar arrList = [];\r\n\tif (Banana.document.table('Categories')) {\r\n\t\tfor (var i = 0; i < Banana.document.table('Categories').rowCount; i++) {\r\n\t\t\tvar tRow = Banana.document.table('Categories').row(i);\r\n\t\t\tif (tRow.value(\"Category\").indexOf(\":\") == 0 && tRow.value(\"Category\").indexOf(\"::\") < 0 && tRow.value(\"Category\").substring(1,2)) {\r\n\t\t\t\tarrList.push(tRow.value(\"Category\"));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tfor (var i = 0; i < Banana.document.table('Accounts').rowCount; i++) {\r\n\t\t\tvar tRow = Banana.document.table('Accounts').row(i);\r\n\t\t\tif (tRow.value(\"Account\").indexOf(\":\") == 0 && tRow.value(\"Account\").indexOf(\"::\") < 0 && tRow.value(\"Account\").substring(1,2)) {\r\n\t\t\t\tarrList.push(tRow.value(\"Account\"));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn arrList;\r\n}", "queryLists() {\n fetch(\"https://deco3801-oblong.uqcloud.net/wanderlist/get_bucketlist_belonging_to_user/\" + this.state.userData.id)\n .then(response => response.json())\n .then(obj => this.loadLists(obj));\n }" ]
[ "0.67525214", "0.6546999", "0.63813317", "0.6291129", "0.62032723", "0.61814374", "0.61624265", "0.61431384", "0.61088717", "0.6051023", "0.6049563", "0.6040764", "0.6038037", "0.59621084", "0.5952256", "0.5867129", "0.584752", "0.58171797", "0.5793114", "0.57908624", "0.5776716", "0.5756436", "0.5703526", "0.5688634", "0.56869537", "0.56709915", "0.5645267", "0.56235397", "0.55877453", "0.5557906", "0.55259204", "0.55249614", "0.55151373", "0.54924726", "0.54902434", "0.54775953", "0.54651666", "0.54423976", "0.5426679", "0.5423641", "0.54144514", "0.541015", "0.54100025", "0.5407276", "0.5403639", "0.5387496", "0.5377533", "0.53752524", "0.53744054", "0.5362915", "0.5360035", "0.5358485", "0.53575504", "0.53505015", "0.5331565", "0.5323319", "0.53205925", "0.5316673", "0.5316094", "0.5309821", "0.53062695", "0.5305437", "0.53036505", "0.53027874", "0.5298457", "0.5297815", "0.5295985", "0.5295527", "0.5293883", "0.5289785", "0.5288643", "0.52850956", "0.527592", "0.52732766", "0.5272159", "0.52685714", "0.526796", "0.52532685", "0.52506256", "0.5248716", "0.52485937", "0.5233259", "0.5226822", "0.52203953", "0.5214026", "0.52083457", "0.52082086", "0.52002466", "0.5197183", "0.51942736", "0.5191959", "0.51882595", "0.5184673", "0.51825154", "0.51825154", "0.51825017", "0.5175109", "0.5174735", "0.5163174", "0.5160796" ]
0.62269497
4
This function adds a dashboard.
static async addDashboard(email, name, desc, metadata) { return new Promise((resolve, reject) => { Database.sendQuery('INSERT INTO Dashboard (Name,Description,email,metadata) VALUES ($1,$2,$3,$4) RETURNING *;', [name, desc, email, JSON.stringify(metadata)]) .then((result) => { // console.log(result); if (result.rows.length > 0) resolve(result.rows[0]); else reject(result); }) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newDashboard() {\r\n\t\t\treturn $izendaRsQuery.query('newcrs', ['DashboardDesigner'], {\r\n\t\t\t\tdataType: 'json'\r\n\t\t\t},\r\n\t\t\t// custom error handler:\r\n\t\t\t{\r\n\t\t\t\thandler: function () {\r\n\t\t\t\t\treturn 'Failed to create new dashboard';\r\n\t\t\t\t},\r\n\t\t\t\tparams: []\r\n\t\t\t});\r\n\t\t}", "function createDashboard() {\n var newDashboard = {};\n newDashboard.name = \"New Dashboard\";\n newDashboard.description = \"New Dashboard Description\";\n newDashboard.organisationId = null;\n newDashboard.createdBy = null;\n newDashboard.type = \"private\";\n newDashboard.widgets = [];\n newDashboard.homepage = false;\n newDashboard.backgroundColor = \"#FFFFFF\";\n newDashboard.widgetSpacing = 2;\n newDashboard.options = {\n columns: 15, // the width of the grid, in columns\n rows: 10, // the width of the grid, in columns\n pushing: true, // whether to push other items out of the way on move or resize\n floating: true, // whether to automatically float items up so they stack (you can temporarily disable if you are adding unsorted items with ng-repeat)\n swapping: true, // whether or not to have items of the same size switch places instead of pushing down if they are the same size\n width: 'auto', // can be an integer or 'auto'. 'auto' scales gridster to be the full width of its containing element\n colWidth: 'auto', // can be an integer or 'auto'. 'auto' uses the pixel width of the element divided by 'columns'\n //rowHeight: 'match', // can be an integer or 'match'. Match uses the colWidth, giving you square widgets.\n margins: [2, 2], // the pixel distance between each widget\n outerMargin: true, // whether margins apply to outer edges of the grid\n sparse: true, // \"true\" can increase performance of dragging and resizing for big grid (e.g. 20x50)\n isMobile: false, // stacks the grid items if true\n mobileBreakPoint: 600, // if the screen is not wider that this, remove the grid layout and stack the items\n mobileModeEnabled: true, // whether or not to toggle mobile mode when screen width is less than mobileBreakPoint\n minColumns: 1, // the minimum columns the grid must have\n minRows: 2, // the minimum height of the grid, in rows\n maxRows: 100,\n defaultSizeX: 1, // the default width of a gridster item, if not specifed\n defaultSizeY: 1, // the default height of a gridster item, if not specified\n minSizeX: 1, // minimum column width of an item\n maxSizeX: null, // maximum column width of an item\n minSizeY: 1, // minumum row height of an item\n maxSizeY: null, // maximum row height of an item\n resizable: {\n enabled: true,\n handles: ['n', 'e', 's', 'w', 'ne', 'se', 'sw', 'nw'],\n start: function (event, $element, widget) { console.log('resize-start'); console.log(widget); console.log($element); }, // optional callback fired when resize is started,\n resize: function (event, $element, widget) { console.log('resize'); console.log(widget); console.log($element); }, // optional callback fired when item is resized,\n stop: function (event, $element, widget) { console.log('resize-stop'); console.log(widget); console.log($element); } // optional callback fired when item is finished resizing\n },\n draggable: {\n enabled: true, // whether dragging items is supported\n // handle: '.my-class', // optional selector for drag handle\n start: function (event, $element, widget) { console.log('drag-start'); console.log(widget); console.log($element); }, // optional callback fired when drag is started,\n drag: function (event, $element, widget) { console.log('drag'); console.log(widget); console.log($element); }, // optional callback fired when item is moved,\n stop: function (event, $element, widget) { console.log('drag-stop'); console.log(widget); console.log($element); } // optional callback fired when item is finished dragging\n }\n\n };\n return newDashboard;\n }", "function Dashboard() {\n return /*#__PURE__*/react_default.a.createElement(FeatureBox, null, /*#__PURE__*/react_default.a.createElement(FeatureHeader, {\n alignItems: \"center\"\n }, /*#__PURE__*/react_default.a.createElement(FeatureHeaderTitle, null, \"Dashboard\"), /*#__PURE__*/react_default.a.createElement(Dashboard_DebugInfoButton, {\n ml: \"auto\"\n })), /*#__PURE__*/react_default.a.createElement(Dashboard_OperationBanner, {\n mb: \"4\"\n }), /*#__PURE__*/react_default.a.createElement(Dashboard_MetricsCharts, null), /*#__PURE__*/react_default.a.createElement(Dashboard_LatestEventList, {\n mb: \"4\"\n }), /*#__PURE__*/react_default.a.createElement(Dashboard_OperationList, {\n mb: \"4\"\n }), /*#__PURE__*/react_default.a.createElement(Dashboard_AppList, null));\n}", "function addNewDashboardMonitor2() {\n ctrl.newDashboardMonitor2es.push({name: '', url: ''});\n }", "function addPanel() {\n var template = require(\"text!html/panel.html\");\n var panelHtml = Mustache.render(template, Strings);\n\n panel = PanelManager.createBottomPanel(COMMAND_ID, $(panelHtml), 200);\n\n // Listeners on the panel\n var $cardboardPanel = $(\"#brackets-cardboard\");\n\n $cardboardPanel\n .on( \"click\", \".brackets-cardboard-close\", function () {\n cardboardTogglePanel(false);\n })\n .on( \"click\", \".brackets-cardboard-close-error\", function () {\n $(this).parents(\"tr\").remove();\n })\n .on( \"click\", \"#brackets-cardboard-show\", show)\n .on( \"keydown\", \".brackets-cardboard-search input\", search)\n .on( \"click\", \".brackets-cardboard-manager\", selectManager)\n .on( \"click\", \".brackets-cardboard-install\", install)\n .on( \"click\", \".brackets-cardboard-update\", update)\n .on( \"click\", \".brackets-cardboard-uninstall\", uninstall)\n .on( \"click\", \".brackets-cardboard-clear\", clearPanel);\n }", "function loadDashboard(data){\n //set global database\n database = data;\n //hide the login\n screen.remove(login);\n //append the dashboard object to the main screen\n screen.append(dashboard);\n //populate the tables list\n mysqlAssistant.listTables(function(callback){\n //add tables to dashboard list\n \tdashTables.setItems(callback);\n \t//render the dashboard\n screen.render();\n });\n}", "function createLogEntry(dashboard) {\n const {title, creator, created, _id} = dashboard;\n const kind = 'Dashboard';\n\n const logEntry = new LogEntry({\n _id: new mongoose.Types.ObjectId(),\n title,\n creator,\n created,\n kind,\n text: creator + \" skapade en \" + kind + \" med titel '\" + title + \"'.\",\n contentId: _id,\n request: {\n type: \"GET\",\n url: \"/api/dashboards/\" + _id\n }\n }).save().catch(err => {console.log(err)});\n}", "function addPanel(panel) {\n\t _.defaults(panel, {\n\t size_x: 3,\n\t size_y: 2\n\t });\n\n\t // ignore panels that don't have vis id's\n\t if (!panel.id) {\n\t // In the interest of backwards compat\n\t if (panel.visId) {\n\t panel.id = panel.visId;\n\t panel.type = 'visualization';\n\t delete panel.visId;\n\t } else {\n\t throw new Error('missing object id on panel');\n\t }\n\t }\n\n\t panel.$scope = $scope.$new();\n\t panel.$scope.panel = panel;\n\t panel.$scope.parentUiState = $scope.uiState;\n\n\t panel.$el = $compile('<li><dashboard-panel></li>')(panel.$scope);\n\n\t // tell gridster to use the widget\n\t gridster.add_widget(panel.$el, panel.size_x, panel.size_y, panel.col, panel.row);\n\n\t // update size/col/etc.\n\t refreshPanelStats(panel);\n\n\t // stash the panel and it's scope in the element's data\n\t panel.$el.data('panel', panel);\n\t panel.$el.data('$scope', panel.$scope);\n\t }", "function showDashboard() {\r\n\t\t$('#container img').remove();\r\n\t\t$('#login-form').remove();\r\n\t\t//TODO:cleanup after this part\r\n\t\t$('<div/>').attr('id', 'chart-container').appendTo($('#container'));\r\n\t\t$('<div/>').addClass('chart-options').attr('id', 'chart-options-container').appendTo($('#center'));\r\n\t\t\r\n\t\tvar chartparent = $('#chart-options-container');\r\n\t\taddChartOptions([\r\n\t\t {\r\n\t\t \t src : './images/column-chart.png',\r\n\t\t \t type : 'column',\r\n\t\t \t parent : chartparent\r\n\t\t }, {\r\n\t\t \t src : './images/chart-line.png',\r\n\t\t \t type : 'line',\r\n\t\t \t parent : chartparent\r\n\t\t },{\r\n\t\t \t src : './images/chart-bar.png',\r\n\t\t \t type : 'bar',\r\n\t\t \t parent : chartparent\r\n\t\t }, {\r\n\t\t \t src : './images/chart-area.png',\r\n\t\t \t type : 'area',\r\n\t\t \t parent : chartparent\r\n\t\t }, {\r\n\t\t \t src : './images/chart-pie.png',\r\n\t\t \t type : 'pie',\r\n\t\t \t parent : chartparent\r\n\t\t }]);\r\n\t\tvar sPref = readCookie('sm-dash-chart');\r\n\t\tsPref = (sPref == null ? 'column' : sPref);\r\n\t\tplotCommonChart( sPref );\r\n\t\twriteCookie('sm-dash-chart', sPref, 1);\r\n\t\t$('<a/>').html(\"Workspace\").attr('href', \"services.htm\").appendTo($('<li/>').appendTo('#menu'));\r\n\t}", "createBoard() {\n commonActions.click(this.createNewBoardButton);\n return new dashboardForm();\n }", "function BabylonInspectorDashboard() {\n // name , html for dash css for dash\n _super.call(this, \"babylonInspector\", \"control.html\", \"control.css\");\n this._ready = false;\n this.id = 'BABYLONINSPECTOR';\n this._dataTreeGenerator = new DataTreeGenerator(this);\n this.treeRoot = null;\n }", "function dashboardAgentCreate ( req, res, next ) {\n var params =\n { di: req.session.di\n , name: req.body.name\n }\n _callIX( '/agent/add', params, function ( e, result ) {\n if (e) return next( e )\n var agent =\n { 'device': jwt.handle() // CLI Agent device is created here rather than at device\n , 'handle': result.handle\n , 'sub': req.session.di // no passcode is used with CLI Agents\n }\n db.storeAgent( 'setup', agent, function (e) {\n var results =\n { 'device': agent.device\n , 'token': result.token\n }\n if (e) return next( e )\n return res.send( { 'result': results } )\n })\n })\n}", "function addPanel (name = '') {\n if (name === '') {\n name = 'Settings'\n if (panels.length > 0) {\n name += ' ' + (panels.length + 1)\n }\n }\n const panel = new Panel(name)\n panels.push(panel)\n panel.appendTo($content)\n return panel\n}", "addPanel(params) {\n // Remove existing one. Can be added by a reload.\n if (this.getPropertyValue(params.id, 'id')) {\n this.removePanel(params.id);\n }\n\n const newPanel = {\n [params.id]: {\n id: params.id,\n $panel: $('#' + params.id),\n visible: params.visible,\n closeSelector: params.closeSelector,\n url: params.url,\n modal: params.modal,\n triggerElement: null,\n triggeredActive: { element: null, css: null },\n warning: { selector: params.warning.selector, trigger: params.warning.trigger },\n clearable: params.clearable,\n loader: { selector: params.loader.selector, trigger: params.loader.trigger },\n hasClickAway: params.hasClickAway,\n hasEscAway: params.hasEscAway,\n modalAction: null,\n },\n };\n\n // add click handler for closing panel.\n newPanel[params.id].$panel.on('click', params.closeSelector, () => {\n this.closePanel(params.id);\n });\n\n newPanel[params.id].$panel.appendTo($('.atk-side-panels'));\n\n this.service.panels.push(newPanel);\n }", "function DashboardScene () {\n}", "function showDashboard() {\n var pageContentWrapper = $('#page-content-wrapper');\n pageContentWrapper.html(\"Dashboard contents\");\n}", "function showAdminDashboard() {\n $.dashboard.setWidth('95%');\n $.dashboard.setHeight('93%');\n $.dashboard.setTop('5%');\n $.dashboard.setBottom('5%');\n $.dashboard.setRight('3%');\n $.dashboard.setLeft(20);\n $.dashboard.setOpacity('1.0');\n $.dashboard_container.setHeight(Ti.UI.FILL);\n $.dashboard_container.setWidth(Ti.UI.FILL);\n handlePageSelection({\n page : 'configurations'\n });\n}", "createPlayerDashboard() {\r\n\r\n this.dashboard = new BrowserWindow({\r\n webPreferences: {\r\n nodeIntegration: true,\r\n contextIsolation: false,\r\n experimentalFeatures: true,\r\n },\r\n autoHideMenuBar: true,\r\n icon: path.join(__dirname, 'images/android-chrome-384x384.png'),\r\n title: `Dsign dashboard`,\r\n width: 600,\r\n height: 800,\r\n minHeight: 500,\r\n minWidth: 600,\r\n useContentWidth: true\r\n });\r\n\r\n this.dashboard.loadFile(`${__dirname}${path.sep}${this._getDashboardEntryPoint()}`);\r\n\r\n /**\r\n * On close browser window\r\n */\r\n this.dashboard.on('closed', () => {\r\n this.dashboard = null;\r\n app.quit();\r\n });\r\n }", "function showDashboard() {\n document.querySelector('.main-nav__item--signup').classList.add('hide');\n document.querySelector('.main-nav__item--logout').classList.remove('hide');\n document.querySelector('.logged-in-content').classList.remove('hide');\n document.querySelector('.main-content').classList.add('main-content--dashboard');\n inviteNewUser();\n logout();\n }", "function Dashboard(url, params) {\n if (url instanceof db.Dashboard.DAO) {\n this.persistent = url;\n } else {\n params = params || {};\n this.persistent = db.Dashboard.build({\n url: url,\n description: params.description,\n timeout: params.timeout,\n delay: params.delay,\n viewport: params.viewport,\n availability: params.availability\n });\n }\n}", "function makePanel(panel){\n var panel= GetPanel(panel)\n console.log(panel.getWidgets())\n dashConfiguration.splice(dashConfiguration.indexOf(panel.getId()),1)\n var widgets= panel.getWidgets()\n widgets.forEach(function(widget){\n widget.MakeWidget()\n })\n}", "dashboardCreateRegion() {\n const overlay = document.querySelector('.regions-overlay'),\n button = document.querySelector('.dash-create-regions-button'),\n close = overlay.querySelector('.close'),\n form = overlay.querySelector('form'),\n endpoint = '/api/v1/regions/new';\n\n this.ActionHelpers.loadDashboardModal(overlay, button, close, form, endpoint);\n }", "addWidget(id, target){\n let canvasOrPanelAdd;\n if (target === 'Canvas'){\n canvasOrPanelAdd = this.state.canvasWidgets;\n }\n else {\n canvasOrPanelAdd = this.state.rightPanelWidgets;\n\n }\n let newWidget;\n if (id % 2 === 1 || id === 1){\n newWidget = {\n widgetId: id,\n type: 'Bar',\n icon: 'fa-chart-bar'\n };\n }\n else {\n newWidget = {\n widgetId: id,\n type: 'Pie',\n icon: 'fa-chart-pie'\n };\n }\n canvasOrPanelAdd.push(newWidget);\n return canvasOrPanelAdd;\n }", "static add(screen) {\n this.screens.set(screen.id, screen);\n return screen;\n }", "function initDashboard() {\n\n // the 'layout' JSON array defines the internal structure of the layout\n // The sequence is always layoutGroup --> tabbedGroup --> layoutPanel\n // The layoutGroup has the orientation which tells whether to add child tabs (panels) in\n // verticle fashion or hoizontal fashion.\n var layout = [\n {\n // Main panel\n type: \"layoutGroup\",\n // Horrizontal orientation determines the layout of city search panel groups and the weather data panel groups\n orientation: \"horizontal\",\n width: \"100%\",\n height: \"100%\",\n items: [\n {\n // Search city panel group: Left parent panel (layout-group) that holds all tabs in left side of the splitter\n type: \"layoutGroup\",\n // Actually the orientation=verticle is not required as there is only one panel in this.items[]\n orientation: \"vertical\",\n allowPin: false,\n width: \"30%\",\n items: [\n {\n // 1st and the only Tab panel for 'Search City'\n type: \"tabbedGroup\",\n height: \"100%\",\n pinnedHeight: 30,\n items: [\n {\n // Layout pannel for the 'Search City' tab\n type: \"layoutPanel\",\n title: \"Search for a City\",\n contentContainer: \"SearchCityPanel\",\n initContent: function () {\n initCitiesTable();\n },\n },\n ],\n },\n ],\n },\n {\n // Weather data panel group: Right parent panel (layout-group) for displaying weather details\n type: \"layoutGroup\",\n // The orientation: \"vertical\" here ensures the Today's weather panel and the forecast panel are \n // laid out vertically - one above and one below \n orientation: \"vertical\",\n allowPin: false,\n width: \"70%\",\n items: [\n {\n // Tab group for today's weather panel\n type: \"tabbedGroup\",\n height: \"52%\",\n pinnedHeight: 30,\n items: [\n {\n type: \"layoutPanel\",\n title: \"Today's Weather\",\n contentContainer: \"TodaysWeatherPanel\",\n\n },\n ],\n },\n {\n // Tab group for forecast panel\n type: \"tabbedGroup\",\n height: \"48%\",\n pinnedHeight: 30,\n items: [\n {\n type: \"layoutPanel\",\n title: \"5 Day Forecast\",\n contentContainer: \"ForecastPanel\",\n\n },\n ],\n }\n ],\n }\n ],\n },\n ];\n $(\"#jqxLayout\").jqxLayout({\n width: 1250,\n //width: '100%',\n //width: getWidth(\"layout\"),\n height: 650,\n layout: layout,\n contextMenu: true,\n });\n //alert(\"initDashboardComp\");\n loadWeatherData(0);\n}", "function Dashboard() {\n return (\n <div className=\"dashboard-container\">\n <Link className=\"dashboard-content\" to=\"/create-user\">Create User</Link><br />\n <Link className=\"dashboard-content\" to=\"/users\">List Users</Link>\n </div>\n )\n}", "function addData(data) {\n console.log(` Adding: ${data.name} (${data.icon})`);\n Reports.insert(data);\n}", "function add() {\r\n DlgHelper.AjaxAction(\"/schedule/add/\", \"POST\", function (data) {\r\n\r\n if (data != null && data != \"\") {\r\n refresh().done(function () { DlgHelper.ShowDialogSuccess(\"Добавлено: \" + data, 1000); });\r\n } else {\r\n DlgHelper.ShowDialogError(\"Неверный ввод...\", 2000);\r\n }\r\n\r\n });\r\n }", "function showDashboard(){\n\n\t//Cache la div create film\n\t $(\"#divFormFilm\").hide();\n\n\t$.ajax({\n\t\tmethod: \"POST\", \n\t\turl:\"template/dashboard.php\",\n\t\n\t}).done((template)=>{\n\t\t//Attache le contenu dans la div avec l'ID (contenu)\n\t\t$(\"#contenu\").html(template);\n\t\t//rendreInvisible(contenu);\n\t});\n}", "function addNewDestination(newDestination){\n const destinationPanel = document.querySelector(\"#show-panel\")\n\n listofDestinations.innerHTML += `\n <li class='destination-btn' id=${newDestination.id}>${newDestination.name} </li>\n `\n\n destinationPanel.innerHTML = `\n <h2> ${newDestination.name} </h2>\n <img src=${newDestination.image} class=\"newDestination-image\">\n <h3>Climate:</h3> ${newDestination.climate}\n <h3>Attractions:</h3> ${newDestination.attractions}\n <h3>Description:</h3> <p>${newDestination.description}</p>\n <h3>Past Reviews:</h3>\n `\n}", "async function addUserDash() {\n const dashHtml = await getUserDashHtml(); \n const dashElement = $(dashHtml);\n $(dashElement[2]).change(function () {\n if (this.childNodes[1].checked) {\n displaySaved = true;\n\n // Populate saved places\n displaySavedPlaces();\n $('#' + SCROLL_ID).children().each(function() {\n if(!savedPlacesSet.has($(this).attr('placeId'))) {\n $(this).hide();\n }\n });\n\n for (let marker of markers) {\n if(!savedPlacesSet.has(marker.id)) {\n marker.setMap(null);\n }\n }\n\n $('#searchOptions').hide();\n\n // Populate and show trip dashboard\n querySavedTrips();\n document.getElementById('tripName').value = '';\n $('#tripOptions').show();\n } else {\n displaySaved = false;\n\n $('#' + SCROLL_ID).children().show();\n // If the card is a saved place but not in the search results, then hide\n $('#' + SCROLL_ID).children().each(function() {\n if(savedPlacesSet.has($(this).attr('placeId')) && !(displayedPlacesSet.has($(this).attr('placeId'))) ) {\n removePlace($(this).attr('placeId'));\n }\n });\n\n for (let marker of markers) {\n marker.setMap(map);\n }\n\n // Switch from trip to search dashboard\n $('#trips').empty(); \n $('#tripOptions').hide();\n $('#searchOptions').show();\n }\n });\n // Logout user if they click the logout button\n $(dashElement[4]).click(function () {\n firebase.auth().signOut().catch(function(error) {\n console.log('Error occurred while signing user out ' + error);\n });\n });\n $('#' + DASH_ID).append(dashElement);\n}", "function initDetailDashboard(){\n $('#dashboard-container').find('div[data-role=panel-container]').remove();\n $engine.toggleViewLoader(false);\n $engine.toggleViewLoader(true, 'Loading.. Please wait.', $('#dashboard-loader'));\n var _options = {\n startDate: moment(new Date(2014, 5, 12)),\n minDate: moment().subtract('months', 6),\n rangeToggleButtons: ['3 Months', 'Current Month'],\n rangeSelectLabel : 'Custom',\n customShortcuts: ['Monthly', 'Weekly', 'Daily']\n };\n dateCompoment = new DateFilterComponent($('#datefilter_container'), _options);\n loadCount = 0;\n objloadedArr.length = null;\n if(!sessionObject) sessionObject = new SessionObject();\n sessionObject.getSessionObject();\n }", "render() {\n const { dashboardStyle } = styles;\n\n return(\n <View style={ dashboardStyle }>\n <Header headerText={'Dashboard'}/>\n { this.renderDash() }\n </View>\n );\n }", "function fillDashboard(desiredList) {\n clearDashboard();\n desiredList.forEach(element => {\n\n let box = document.createElement('a');\n box.className = 'tarjeta';\n box.id = element.name;\n box.href = 'vista.html?'+element.name; \n\n let img = document.createElement('img');\n img.src = element.image;\n\n let photoname = document.createElement('h5');\n photoname.innerHTML = element.name;\n\n box.appendChild(img);\n box.appendChild(photoname);\n dashboard.appendChild(box);\n\n })\n}", "function AddOnePagePlan(data) {\n // @TODO\n \n \n $.ajax({\n type: \"post\",\n url: \"AddOnePagePlan\",\n data: { data: JSON.stringify(data) },\n success: function (response) {\n myApp.Dialogs.alertSuccess('Inserted', 'One Page Plan, Created!', {\n callback: function (response) {\n redirectToCyclePriorities();\n }\n });\n },\n error: function (response) { },\n })\n\n \n }", "_addToBottomArea(widget, options) {\n if (!widget.id) {\n console.error('Widgets added to app shell must have unique id property.');\n return;\n }\n // Temporary: widgets are added to the panel in order of insertion.\n this._bottomPanel.addWidget(widget);\n this._onLayoutModified();\n if (this._bottomPanel.isHidden) {\n this._bottomPanel.show();\n }\n }", "function saveDashboard(dashboard){\n console.log(dashboard.toSource());\n /*\n $http.get(serverURL+'/user/dashboard').\n then(function(data) {\n //sth\n }).catch(function(data) {\n alert('服务器异常,保存失败');\n });\n */\n }", "function createDash(cwidth, cheight)\n {\n this.body = d3.select(\"#dashboardContainer\")\n .append(\"svg:svg\")\n .attr(\"class\", \"dash\")\n .attr(\"width\", cwidth)//this.config.size)\n .attr(\"height\", cheight);// this.config.size);\n this.body.append(\"svg:ellipse\")\t// outer shell\n .attr(\"cx\", cwidth/2)//this.config.cx)\n .attr(\"cy\", cheight/2)//this.config.cy)\n .attr(\"rx\", cwidth/2)//this.config.raduis)\n .attr(\"ry\", (cheight/2)-50)\n .style(\"fill\", xDim<0.5? blueColor : dimBlueColor)\n .style(\"fill-opacity\", 0.7)\n .style(\"stroke\", \"#000\")\n .style(\"stroke-width\", \"2px\");\n var dasharea = this.body.selectAll(\"ellipse\");\n dashContainer = this.body.append(\"svg:g\").attr(\"class\", \"dashContainer\")\n .attr(\"width\",cwidth+4)\n .attr(\"height\",cheight+2);\n }", "function _addNewButton(panel, index = null) {\n const container = DOMtools.returnElement({\n type: \"div\",\n class: \"box container new\",\n attribute: {\n \"data-projectindex\": index\n }\n });\n const newNameInput = DOMtools.returnElement({\n type: \"input\",\n class: \"text textinput\",\n attribute: {\n type: \"text\",\n placeholder: \"+ add new\",\n spellcheck: \"false\",\n }\n });\n container.appendChild(newNameInput);\n newNameInput.addEventListener(\"focusout\", submitAndRerender);\n panel.appendChild(container);\n }", "function redirectToDashboard() {\n var form = $(\"<form action='/grouper/dashboard' method='POST'>\" +\n \"<input type='hidden' name='login_email' value ='\" + localStorage.getItem(\"grouper_email\") + \"'>\" +\n \"<input type='hidden' name='login_hash' value ='\" + localStorage.getItem(\"grouper_hash\") + \"'>\" +\n \"</form>\");\n $(\"body\").append(form);\n form.submit();\n}", "function createPanelTurnout(normalRouteElemID, divergingRouteElemID)\n{\n var panelTurnout = new PanelTurnout(normalRouteElemID, divergingRouteElemID);\n \n if(panelTurnout.successfullyCreated == true)\n turnoutsOnPanel.push(panelTurnout);\n}", "function createDashboard(data, labelsParam, from, to, ajaxUrlParam) {\n labels = labelsParam;\n ajaxUrl = ajaxUrlParam;\n if (data[0] == undefined) {\n //No data to show, so just stop here\n $(\"detailDataContainer\").show();\n return;\n }\n board = new DcDashboard();\n // Set dashboard width same as div width\n // var width = $(\".dashboardContainer\").css(\"width\").replace(\"px\", \"\");\n // board.setDashboardWidth(+width);\n charts = new Object();\n var dataCounts = getDataCounts(data);\n showUniqueValues(dataCounts, data, labels);\n\n // BROWSER FILTER\n var browser = board.allData.dimension(function (d) {\n return \"\" + d['browser'];\n });\n var browserGroup = browser.group().reduceSum(function (d) {\n return d['count']\n });\n var browserLabelAccessor = function (d) {\n return labels['browser'] ? labels['browser'][d.key] : d.key;\n };\n var browserPie = board.addPieChart('dcChart', 'browser-chart', browser, browserGroup, browserLabelAccessor);\n\n browserPie.title(function (d) {\n var label = labels['browser'] ? labels['browser'][d.key] : d.key;\n return label + \": \" + d.value;\n });\n charts[\"browser-chart\"] = browserPie;\n\n // MEDIATYPE FILTER\n var mediaType = board.allData.dimension(function (d) {\n return \"\" + d['mediaType'];\n });\n var mediaTypeGroup = mediaType.group().reduceSum(function (d) {\n return d['count']\n });\n var mediaTypeLabelAccessor = function (d) {\n return d.key\n };\n charts[\"mediaType-chart\"] = board.addPieChart('dcChart', 'mediaType-chart', mediaType, mediaTypeGroup, mediaTypeLabelAccessor);\n\n // SUBTYPE FILTER\n var subtype = board.allData.dimension(function (d) {\n return \"\" + d['subtype'];\n });\n var subtypeGroup = subtype.group().reduceSum(function (d) {\n return d['count'];\n });\n var subtypeLabelAccessor = function (d) {\n return d.key\n };\n charts[\"subtype-chart\"] = board.addPieChart('dcChart', 'subtype-chart', subtype, subtypeGroup, subtypeLabelAccessor);\n\n // PAGE FILTER\n var page = board.allData.dimension(function (d) {\n return \"\" + d['page'];\n });\n var pageGroup = page.group().reduceSum(function (d) {\n return d['count'];\n });\n var pageLabelAccessor = function (d) {\n return labels['page'] ? labels['page'][d.key] : d.key\n };\n var pagePie = board.addPieChart('dcChart', 'page-chart', page, pageGroup, pageLabelAccessor);\n pagePie.title(function (d) {\n var label = labels['page'] ? labels['page'][d.key] : d.key;\n return label + \": \" + d.value;\n });\n charts[\"page-chart\"] = pagePie;\n\n //JOBGROUP FILTER\n var jobGroup = board.allData.dimension(function (d) {\n return \"\" + d['jobGroup']\n });\n var jobGroupGroup = jobGroup.group().reduceSum(function (d) {\n return d['count'];\n });\n var jobGroupLabelAccessor = function (d) {\n if (d.key < 0) {\n return \"undefined\"\n }\n return labels['jobGroup'] ? labels['jobGroup'][d.key] : \"\" + d.key\n };\n var jobGroupPie = board.addPieChart('dcChart', 'jobGroup-chart', jobGroup, jobGroupGroup, jobGroupLabelAccessor);\n jobGroupPie.title(function (d) {\n var label = labels['jobGroup'] ? labels['jobGroup'][d.key] : d.key;\n return label + \": \" + d.value;\n });\n charts[\"jobGroup-chart\"] = jobGroupPie;\n\n // MEASURED EVENT FILTER\n var measuredEvent = board.allData.dimension(function (d) {\n return \"\" + d['measuredEvent'];\n });\n var measuredEventGroup = measuredEvent.group().reduceSum(function (d) {\n return d['count'];\n });\n var measuredEventLabelAccessor = function (d) {\n if (d.key < 0) {\n return \"undefined\"\n }\n return labels['measuredEvent'] ? labels['measuredEvent'][d.key] : \"\" + d.key\n };\n var measuredEventPie = board.addPieChart('dcChart', 'measuredEvent-chart', measuredEvent, measuredEventGroup, measuredEventLabelAccessor);\n measuredEventPie.title(function (d) {\n var label = labels['measuredEvent'] ? labels['measuredEvent'][d.key] : d.key;\n return label + \": \" + d.value;\n });\n charts[\"measuredEvent-chart\"] = measuredEventPie;\n\n // HOST FILTER\n if (dataCounts['host'] > 1) {\n var host = board.allData.dimension(function (d) {\n return \"\" + d['host'];\n });\n var hostGroup = host.group().reduceSum(function (d) {\n return d['count'];\n });\n var hostLabelAccessor = function (d) {\n return d.key\n };\n charts[\"host-chart\"] = board.addRowChart('dcChart', 'host-chart', host, hostGroup, dataCounts['host'], hostLabelAccessor);\n }\n\n var loadingIndicatorGlobal = document.getElementById(\"loadingIndicatorGlobal\");\n loadingIndicatorGlobal.style.display = 'none';\n var detailDataContainer = document.getElementById(\"detailDataContainer\");\n detailDataContainer.style.display = 'block';\n\n // Show count of selected data\n board.addDataCount('dcChart', 'dc-data-count');\n\n // ### BEGIN LINE CHARTS\n var date_Dimension = board.allData.dimension(function (d) {\n return d.date;\n });\n\n var loadTime_ttfb_avg = date_Dimension.group().reduce(\n //add\n function (p, v) {\n p.count += v['count'];\n p.loadTimeSum += v['loadTimeMs_avg'] * v['count'];\n p.loadTimeAvg = p.count ? d3.round((p.loadTimeSum / p.count), 2) : 0;\n p.ttfbSum += v['ttfb_avg'] * v['count'];\n p.ttfbAvg = p.count ? d3.round((p.ttfbSum / p.count), 2) : 0;\n p.downloadTimeSum += v['downloadTime_avg'] * v['count'];\n p.downloadTimeAvg = p.count ? d3.round((p.downloadTimeSum / p.count), 2) : 0;\n p.sslTimeSum += v['sslTime_avg'] * v['count'];\n p.sslTimeAvg = p.count ? d3.round((p.sslTimeSum / p.count), 2) : 0;\n p.connectTimeSum += v['connectTime_avg'] * v['count'];\n p.connectTimeAvg = p.count ? d3.round((p.connectTimeSum / p.count), 2) : 0;\n p.dnsTimeSum += v['dnsTime_avg'] * v['count'];\n p.dnsTimeAvg = p.count ? d3.round((p.dnsTimeSum / p.count), 2) : 0;\n p.bytesInSum += v['bytesIn_avg'] * v['count'];\n p.bytesInAvg = p.count ? d3.round((p.bytesInSum / p.count), 2) : 0;\n p.bytesOutSum += v['bytesOut_avg'] * v['count'];\n p.bytesOutAvg = p.count ? d3.round((p.bytesOutSum / p.count), 2) : 0;\n return p;\n },\n //remove\n function (p, v) {\n p.count -= v['count'];\n p.loadTimeSum -= v['loadTimeMs_avg'] * v['count'];\n p.loadTimeAvg = p.count ? d3.round((p.loadTimeSum / p.count), 2) : 0;\n p.ttfbSum -= v['ttfb_avg'] * v['count'];\n p.ttfbAvg = p.count ? d3.round((p.ttfbSum / p.count), 2) : 0;\n p.downloadTimeSum -= v['downloadTime_avg'] * v['count'];\n p.downloadTimeAvg = p.count ? d3.round((p.downloadTimeSum / p.count), 2) : 0;\n p.sslTimeSum -= v['sslTime_avg'] * v['count'];\n p.sslTimeAvg = p.count ? d3.round((p.sslTimeSum / p.count), 2) : 0;\n p.connectTimeSum -= v['connectTime_avg'] * v['count'];\n p.connectTimeAvg = p.count ? d3.round((p.connectTimeSum / p.count), 2) : 0;\n p.dnsTimeSum -= v['dnsTime_avg'] * v['count'];\n p.dnsTimeAvg = p.count ? d3.round((p.dnsTimeSum / p.count), 2) : 0;\n p.bytesInSum -= v['bytesIn_avg'] * v['count'];\n p.bytesInAvg = p.count ? d3.round((p.bytesInSum / p.count), 2) : 0;\n p.bytesOutSum -= v['bytesOut_avg'] * v['count'];\n p.bytesOutAvg = p.count ? d3.round((p.bytesOutSum / p.count), 2) : 0;\n return p;\n },\n //init\n function (p, v) {\n return {\n count: 0,\n loadTimeAvg: 0,\n loadTimeSum: 0,\n ttfbAvg: 0,\n ttfbSum: 0,\n downloadTimeAvg: 0,\n downloadTimeSum: 0,\n sslTimeAvg: 0,\n sslTimeSum: 0,\n connectTimeAvg: 0,\n connectTimeSum: 0,\n dnsTimeAvg: 0,\n dnsTimeSum: 0,\n bytesInAvg: 0,\n bytesInSum: 0,\n bytesOutAvg: 0,\n bytesOutSum: 0\n };\n });\n\n // Accessors for reductio min and max\n var minValueAccessor = function (d) {\n if (d.value.min)\n return d.value.min;\n else\n return null;\n };\n var maxValueAccessor = function (d) {\n if (d.value.max)\n return d.value.max;\n else\n return null;\n };\n\n var loadTimeGroup_min = reductio().min(function (d) {\n return +d['loadTimeMs_min']\n })(date_Dimension.group());\n var loadTimeGroup_max = reductio().max(function (d) {\n return +d['loadTimeMs_max']\n })(date_Dimension.group());\n var ttfbGroup_min = reductio().min(function (d) {\n return +d['ttfb_min']\n })(date_Dimension.group());\n var ttfbGroup_max = reductio().max(function (d) {\n return +d['ttfb_max']\n })(date_Dimension.group());\n var downloadTimeGroup_min = reductio().min(function (d) {\n return +d['downloadTime_min']\n })(date_Dimension.group());\n var downloadTimeGroup_max = reductio().max(function (d) {\n return +d['downloadTime_max']\n })(date_Dimension.group());\n var sslTimeGroup_min = reductio().min(function (d) {\n return +d['sslTime_min']\n })(date_Dimension.group());\n var sslTimeGroup_max = reductio().max(function (d) {\n return +d['sslTime_max']\n })(date_Dimension.group());\n var connectTimeGroup_min = reductio().min(function (d) {\n return +d['connectTime_min']\n })(date_Dimension.group());\n var connectTimeGroup_max = reductio().max(function (d) {\n return +d['connectTime_max']\n })(date_Dimension.group());\n var dnsTimeGroup_min = reductio().min(function (d) {\n return +d['dnsTime_min']\n })(date_Dimension.group());\n var dnsTimeGroup_max = reductio().max(function (d) {\n return +d['dnsTime_max']\n })(date_Dimension.group());\n var bytesInGroup_min = reductio().min(function (d) {\n return +d['bytesIn_min']\n })(date_Dimension.group());\n var bytesInGroup_max = reductio().max(function (d) {\n return +d['bytesIn_max']\n })(date_Dimension.group());\n var bytesOutGroup_min = reductio().min(function (d) {\n return +d['bytesOut_min']\n })(date_Dimension.group());\n var bytesOutGroup_max = reductio().max(function (d) {\n return +d['bytesOut_max']\n })(date_Dimension.group());\n\n var composite = board.getCompositeChart('dcChart', 'line-chart');\n\n var allGraphs = {};\n\n var colorScale = d3.scale.category10();\n\n function createLineChart(jobFilter, label, name, valueAccessor, unit) {\n var group = remove_empty_bins(jobFilter, valueAccessor);\n allGraphs[name] = board.createLineChart(composite, date_Dimension, group, colorScale(label), label, valueAccessor, unit);\n }\n\n // avg graph loadTime\n createLineChart(loadTime_ttfb_avg, \"LoadTimeMs Avg\", \"loadTimeAvg\", function (d) {\n return d.value.loadTimeAvg;\n });\n\n // avg graph ttfb\n createLineChart(loadTime_ttfb_avg, \"TTFB Avg\", \"ttfbAvg\", function (d) {\n return d.value.ttfbAvg;\n });\n\n // avg graph downloadTime\n createLineChart(loadTime_ttfb_avg, \"Download Time Avg\", \"downloadTimeAvg\", function (d) {\n return d.value.downloadTimeAvg;\n });\n\n // avg graph sslTime\n createLineChart(loadTime_ttfb_avg, \"SSL Time Avg\", \"sslTimeAvg\", function (d) {\n return d.value.sslTimeAvg;\n });\n // avg graph connectTime\n createLineChart(loadTime_ttfb_avg, \"Connect Time Avg\", \"connectTimeAvg\", function (d) {\n return d.value.connectTimeAvg;\n });\n // avg graph dnsTime\n createLineChart(loadTime_ttfb_avg, \"DNS Time Avg\", \"dnsTimeAvg\", function (d) {\n return d.value.dnsTimeAvg;\n });\n // avg graph bytesIn\n createLineChart(loadTime_ttfb_avg, \"Bytes In Avg\", \"bytesInAvg\", function (d) {\n return d.value.bytesInAvg;\n }, \"bytes\");\n // avg graph bytesOut\n createLineChart(loadTime_ttfb_avg, \"Bytes Out Avg\", \"bytesOutAvg\", function (d) {\n return d.value.bytesOutAvg;\n }, \"bytes\");\n\n // min graph loadTime\n createLineChart(loadTimeGroup_min, \"LoadTimeMs Min\", \"loadTimeMin\", minValueAccessor);\n // min graph ttfb\n createLineChart(ttfbGroup_min, \"TTFB Min\", \"ttfbMin\", minValueAccessor);\n // min graph downloadTime\n createLineChart(downloadTimeGroup_min, \"Download Time Min\", \"downloadTimeMin\", minValueAccessor);\n // min graph sslTime\n createLineChart(sslTimeGroup_min, \"SSL Time Min\", \"sslTimeMin\", minValueAccessor);\n // min graph connectTime\n createLineChart(connectTimeGroup_min, \"Connect Time Min\", \"connectTimeMin\", minValueAccessor);\n // min graph dnsTime\n createLineChart(dnsTimeGroup_min, \"DNS Time Min\", \"dnsTimeMin\", minValueAccessor);\n // min graph bytesIn\n createLineChart(bytesInGroup_min, \"Bytes In Min\", \"bytesInMin\", minValueAccessor, \"bytes\");\n // min graph bytesOut\n createLineChart(bytesInGroup_min, \"Bytes Out Min\", \"bytesOutMin\", minValueAccessor, \"bytes\");\n\n // max graph loadTime\n createLineChart(loadTimeGroup_max, \"LoadTimeMs Max\", \"loadTimeMax\", maxValueAccessor);\n // max graph ttfb\n createLineChart(ttfbGroup_max, \"TTFB Max\", \"ttfbMax\", maxValueAccessor);\n // max graph ttfb\n createLineChart(downloadTimeGroup_max, \"Download Time Max\", \"downloadTimeMax\", maxValueAccessor);\n // max graph ttfb\n createLineChart(sslTimeGroup_max, \"SSL Time Max\", \"sslTimeMax\", maxValueAccessor);\n // max graph ttfb\n createLineChart(connectTimeGroup_max, \"Connect Time Max\", \"connectTimeMax\", maxValueAccessor);\n // max graph dns\n createLineChart(dnsTimeGroup_max, \"DNS Time Max\", \"dnsTimeMax\", maxValueAccessor);\n // max graph bytesIn\n createLineChart(bytesInGroup_max, \"Bytes In Max\", \"bytesInMax\", maxValueAccessor, \"bytes\");\n // max graph bytesOut\n createLineChart(bytesOutGroup_max, \"Bytes Out Max\", \"bytesOutMax\", maxValueAccessor, \"bytes\");\n\n // 24 = [loadTime, ttfb, ..., bytesIn]*[avg,min,max]\n board.addCompositeChart('dcChart', 'line-chart', from, to, 24);\n redrawCompositeChart();\n\n // ### END LINE CHARTS\n\n // ### BEGIN TIME CHART\n var timeDimension = board.allData.dimension(function (d) {\n return d.date;\n });\n\n var timeGroup = timeDimension.group().reduceSum(function (d) {\n return d['count'];\n });\n board.addTimeChart('dcChart', 'timeChart', timeDimension, timeGroup, from, to);\n // ### END TIME CHART\n\n // Add data to dashboard\n var p1 = new Promise(\n function (resolve, reject) {\n board.addData(data);\n }\n );\n\n // Add onClick Listener\n $(document).on('change', 'input:checkbox[name=\"measurementCheckbox\"]', function (event) {\n $(this).parent().toggleClass(\"btn-primary\");\n $(this).parent().toggleClass(\"btn-default\");\n redrawCompositeChart();\n $(this).parent().removeClass(\"focus\");\n });\n\n $(document).keyup(function (e) {\n if (e.keyCode == 27) {\n $(\".card-modal\").hide();\n $(\"#preselectedValuesContainer\").hide();\n }\n });\n\n $('.card-modal').click(function () {\n $(\".card-modal\").hide();\n $(\"#preselectedValuesContainer\").hide();\n });\n $('.card-header .close').click(function () {\n $(\".card-modal\").hide();\n $(\"#preselectedValuesContainer\").hide();\n });\n\n $('.card-modal-inner').click(function (e) {\n e.stopPropagation();\n });\n\n function redrawCompositeChart() {\n board.setAnimationTime(500);\n\n var showAvg = document.getElementById(\"avg\").checked;\n var showMax = document.getElementById(\"max\").checked;\n var showMin = document.getElementById(\"min\").checked;\n var visibleGraphs = [];\n\n function handleValueTypeCheckbox(avgName, minName, maxName) {\n if (showAvg)\n visibleGraphs.push(allGraphs[avgName]);\n\n if (showMin)\n visibleGraphs.push(allGraphs[minName]);\n if (showMax)\n visibleGraphs.push(allGraphs[maxName]);\n }\n\n if (document.getElementById(\"loadTimeMs\").checked) {\n handleValueTypeCheckbox(\"loadTimeAvg\", \"loadTimeMin\", \"loadTimeMax\");\n }\n if (document.getElementById(\"ttfb\").checked) {\n handleValueTypeCheckbox(\"ttfbAvg\", \"ttfbMin\", \"ttfbMax\");\n }\n if (document.getElementById(\"downloadTime\").checked) {\n handleValueTypeCheckbox(\"downloadTimeAvg\", \"downloadTimeMin\", \"downloadTimeMax\");\n }\n if (document.getElementById(\"sslTime\").checked) {\n handleValueTypeCheckbox(\"sslTimeAvg\", \"sslTimeMin\", \"sslTimeMax\");\n }\n if (document.getElementById(\"connectTime\").checked) {\n handleValueTypeCheckbox(\"connectTimeAvg\", \"connectTimeMin\", \"connectTimeMax\");\n }\n if (document.getElementById(\"dnsTime\").checked) {\n handleValueTypeCheckbox(\"dnsTimeAvg\", \"dnsTimeMin\", \"dnsTimeMax\");\n }\n if (document.getElementById(\"bytesIn\").checked) {\n handleValueTypeCheckbox(\"bytesInAvg\", \"bytesInMin\", \"bytesInMax\");\n }\n if (document.getElementById(\"bytesOut\").checked) {\n handleValueTypeCheckbox(\"bytesOutAvg\", \"bytesOutMin\", \"bytesOutMax\");\n }\n\n\n board.getCompositeChart('dcChart', 'line-chart').compose(visibleGraphs);\n dc.renderAll();\n addOnClickListeners();\n hideDataTable();\n board.setAnimationTime(700);\n }\n}", "function addActivity() { \n SidebarActions.createActivity('Content', $scope.data.thisContent)\n}", "addWidget(widget, rank) {\n widget.parent = null;\n widget.hide();\n const item = { widget, rank };\n const index = this._findInsertIndex(item);\n ArrayExt.insert(this._items, index, item);\n this._stackedPanel.insertWidget(index, widget);\n const title = this._sideBar.insertTab(index, widget.title);\n // Store the parent id in the title dataset\n // in order to dispatch click events to the right widget.\n title.dataset = { id: widget.id };\n if (title.icon instanceof LabIcon) {\n // bind an appropriate style to the icon\n title.icon = title.icon.bindprops({\n stylesheet: 'sideBar'\n });\n }\n else if (typeof title.icon === 'string' || !title.icon) {\n // add some classes to help with displaying css background imgs\n title.iconClass = classes(title.iconClass, 'jp-Icon', 'jp-Icon-20');\n }\n this._refreshVisibility();\n }", "function App() {\n return (\n <div className=\"App\">\n {/*<Entry/>*/}\n <DefaultLayout>\n { /* <Dashboard /> */}\n <AddTicket/>\n </DefaultLayout>\n \n\n </div>\n );\n}", "function initLocalDashboardPage(){\r\n\treportsSection = \"dashboard\";\r\n\treportsObject = getDashboardReports(sid);\r\n\tvar list = $(\"#dashboard\");\r\n\tlist.empty();\r\n\tvar predefinedReports = reportsObject.predefined;\r\n\tif(predefinedReports.length > 0){\r\n\t\t\r\n\t\t$.each(predefinedReports, function(k, vObj){\r\n\t\t\tvar raport = prepareDashboardReport(vObj.code);\r\n\t\t\treportObjectToExecute = loadDashboardReport(raport);\r\n\t\t\tlist.append(\r\n\t\t\t\t\t$(\"<div>\",{class:\"dashboard-item-\"+reportObjectToExecute.class+\" uss\",id:reportObjectToExecute.id})\r\n\t\t\t\t\t\t.append($(\"<div>\",{class:\"title\"}))\r\n\t\t\t\t\t\t.append($(\"<div>\",{class:\"form\"}))\r\n\t\t\t\t\t\t.append($(\"<div>\",{class:\"graph\",id:\"graph-\"+reportObjectToExecute.id}).append($(\"<div>\",{class:\"loading-span\"}).text(\"Loading ...\")))\r\n\t\t\t);\r\n\t\t\trenderDashboardReport(reportObjectToExecute);\r\n\t\t});\r\n\t}\r\n}", "function addMonitor() {\n\tif (numMonitors >= maxNumMonitors) {\n\t\talert(\"This tool has a limit of \" + maxNumMonitors + \" monitors\");\n\t} else {\n\t\t$(\"#monitorBox\" + ++numMonitors).fadeIn(400);\n\t\t$(\"#monitorBox\" + numMonitors).css(\"display\", \"inline-block\");\n\t\tdisplayTotalNumPixels();\n displayTotalWidth();\n displayTotalArea();\n displayTotalMonitorsCost();\n displayTotalSetupCost();\n\t}\n}", "function save(dashboard, filename){\n return createContent(dashboard, filename).then( function(content){\n console.log('Saving dashboard to '+ filename);\n console.log('Content dump:' + content.cdfstructure);\n\n var saveDashboardUrl = CONTEXT_PATH + 'plugin/pentaho-cdf-dd/api/syncronizer/saveDashboard';\n var successFunction = function(result){\n if (result && result.status == \"true\") {\n console.log(\"Dashboard saved successfully\");\n } else {\n console.log(\"Errors saving file: \" + result.result);\n }\n return result;\n };\n return submitForm(saveDashboardUrl, content, JSON.parse).then( successFunction );\n });\n\n }", "_insertAddNewTab() {\n const that = this,\n tabLabelContainer = that._addTabLabelContainer(undefined, true).tabLabelContainer;\n\n tabLabelContainer.$.addClass('jqx-add-new-tab');\n\n that.$.tabStrip.appendChild(tabLabelContainer);\n\n that._addNewTab = tabLabelContainer;\n }", "function ac_createCLIPanel() {\n\t\n\t// Create DOM Elements\n\t$(\"#ac_tool_box\").append('<div id=\"ac_cli_panel\" class=\"ac_panel\" style=\"display:none\"></div>');\n\t$(\"#ac_cli_panel\").append('<div id=\"ac_cli_titlebar\" class=\"ac_titlebar\">');\n\t$(\"#ac_cli_titlebar\").append('<ul id=\"ac_cli_links\" class=\"ac_links\"></ul>');\n\t$(\"#ac_cli_titlebar\").append('<div id=\"ac_cli_title\" class=\"ac_title\">Mafia CLI</div>');\n\n\t$(\"#ac_cli_panel\").append('<div id=\"ac_cli_content\" class=\"ac_panel_content\"></div>');\n\t$(\"#ac_cli_panel\").append('<div id=\"ac_cli_form\" class=\"ac_panel_form\"></div>');\n\t$(\"#ac_cli_form\").append('<form id=\"cliform\" class=\"ac_inputform\" onsubmit=\"return false;\" ></form>');\n\t$(\"#cliform\").append('<table width=\"100%\"><tr><td><input maxlength=\"200\" class=\"ac_input\" type=\"text\" id=\"cliinput\" name=\"cliinput\" autocomplete=\"off\"></td><td width=\"1\"><input type=\"button\" id=\"clibutton\" class=\"ac_button\" value=\"Execute\"></td></tr></table>');\n\n\t// Attach Event handlers\n\t$('#cliinput').keyup(function(event) {\n\t\tevent.stopPropagation();\n\t\tac_cliKeyUp(event);\n\t});\n\t$(\"#clibutton\").click(function () { \n ac_submitCLICommand();\n });\n}", "function addMenu () {\n $('.add-button').click(() => {\n $('.add-menu').toggle()\n })\n\n $('.add-lesson').click(() => {\n const newLesson = prompt('What would you like to name your new lesson?')\n\n draftData.lessons.push({\n lessonTitle: newLesson,\n parts: [\n {\n partTitle: 'My Great Part',\n partContent: 'Text goes here.'\n }\n ]\n })\n\n loadCreateSideBar(draftData)\n })\n\n $('.add-part').click(() => {\n let newPartLocation = prompt('Which lesson should the part be added to?')\n\n if (newPartLocation > draftData.lessons.length) {\n alert('Please pick a lesson that exists.')\n } else {\n const newPartTitle = prompt('What would you like to name your new part?')\n\n draftData.lessons[newPartLocation - 1].parts.push({\n partTitle: newPartTitle,\n partContent: 'Text goes here.'\n })\n\n loadCreateSideBar(draftData)\n }\n })\n}", "function addReports(data) {\n console.log(` Adding: ${data.itemID} (${data.reporter})`);\n Reports.insert(data);\n}", "function addSWtoBoard(sw) {\n // Add swimlane in swimlane management window\n var objtext = getSwimlaneDisplay(sw.Name, sw.Swimlane_ID, sw.Type);\n $(\"#currentSwimlane\").append(objtext);\n\n // Add swimlane in kanban board\n var table = (sw.Type == 1) ? \"backlog\" : \"task\";\n var id = sw.Swimlane_ID;\n var pos = $(\".swimlane\").length - 1;\n\n var th = \"<th data-id='\" + id + \"' data-type='\" + sw.Type + \"' data-status='\" + sw.Data_status + \"'>\" +\n \"<div class='swName' title='\" + sw.Name + \"'>\" + sw.Name + \"</div>\" +\n \"<img class='btnAddItem' onclick='showInsertWindow('\" + table + \"Window', \" + pos + \",\" + id + \")' \" +\n \"src='images/sidebar/add_item.png'></th>\";\n $(\"#kanban tr:eq(0)\").append(th);\n\n var td = \"<td class='connected ui-sortable' data-id='\" + id + \"' \" +\n \"data-lane-type='\" + sw.Type + \"' data-status='\" + sw.Data_status + \"'></td>\"\n $(\"#kanban tr:eq(1)\").append(td);\n recalibrate();\n $(\".window-content\").perfectScrollbar(\"update\");\n}", "function validate_dashboard_overview() {\n var form = get_form_data('#game_overview_form');\n\n if (check_field_empty(form.game_id, 'Game Id'))\n return false;\n\n if (check_field_int(form.game_id, 'Game Id'))\n return false;\n\n var dataObj = {\n \"content\" : [ {\n \"session_id\" : get_cookie()\n }, {\n \"game_id\" : form.game_id\n } ]\n };\n call_server('game_overview', dataObj);\n}", "constructor(scope, id, props) {\n super(scope, id, { type: CfnDashboard.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_iotsitewise_CfnDashboardProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnDashboard);\n }\n throw error;\n }\n cdk.requireProperty(props, 'dashboardDefinition', this);\n cdk.requireProperty(props, 'dashboardDescription', this);\n cdk.requireProperty(props, 'dashboardName', this);\n this.attrDashboardArn = cdk.Token.asString(this.getAtt('DashboardArn', cdk.ResolutionTypeHint.STRING));\n this.attrDashboardId = cdk.Token.asString(this.getAtt('DashboardId', cdk.ResolutionTypeHint.STRING));\n this.dashboardDefinition = props.dashboardDefinition;\n this.dashboardDescription = props.dashboardDescription;\n this.dashboardName = props.dashboardName;\n this.projectId = props.projectId;\n this.tags = new cdk.TagManager(cdk.TagType.STANDARD, \"AWS::IoTSiteWise::Dashboard\", props.tags, { tagPropertyName: 'tags' });\n }", "function drawDashboard() {\n // Create our data table.\n _data = new google.visualization.DataTable(_jsonIn);\n //data = _jsonIn;\n\n // Create a dashboard.\n var dashboard = new google.visualization.Dashboard(\n document.getElementById('dashboard_div'));\n\n // Create a range slider, passing some options\n var scoreRangeSlider = new google.visualization.ControlWrapper({\n 'controlType': 'NumberRangeFilter',\n 'containerId': 'filter_score_div',\n 'options': {\n 'filterColumnLabel': 'Score'\n }\n });\n // Create a range slider, passing some options\n var exDateRangeSlider = new google.visualization.ControlWrapper({\n 'controlType': 'DateRangeFilter',\n 'containerId': 'filter_exdate_div',\n 'options': {\n 'filterColumnLabel': 'ExDate'\n }\n });\n // Create a range slider, passing some options\n /*\n var donutRangeSlider = new google.visualization.ControlWrapper({\n 'controlType': 'NumberRangeFilter',\n 'containerId': 'filter_div',\n 'options': {\n 'filterColumnLabel': 'Donuts eaten'\n }\n });\n */\n // \n var linkedTable = new google.visualization.ChartWrapper({\n 'chartType': 'Table',\n 'containerId': 'table_div',\n 'options': {\n //'width': \n //'height': 400\n }\n });\n //dashboard.bind(scoreRangeSlider, linkedTable);\n dashboard.bind(exDateRangeSlider, linkedTable);\n // Draw the dashboard.\n dashboard.draw(_data);\n}", "_addToMenuArea(widget, options) {\n var _a;\n if (!widget.id) {\n console.error('Widgets added to app shell must have unique id property.');\n return;\n }\n options = options || {};\n const rank = (_a = options.rank) !== null && _a !== void 0 ? _a : DEFAULT_RANK;\n this._menuHandler.addWidget(widget, rank);\n this._onLayoutModified();\n if (this._menuHandler.panel.isHidden) {\n this._menuHandler.panel.show();\n }\n }", "async function openDashboard(i) {\n if (i < -2 || i >= this.state.panels.length) return\n\n Actions.closeCtxMenu()\n Actions.resetSelection()\n this.state.dashboardIsOpen = true\n\n if (i === -2) {\n this.state.dashboard = {\n dashboard: 'HiddenPanelsDashboard',\n panels: this.state.panels.filter(b => !b.bookmarks && b.inactive),\n }\n return\n }\n\n this.state.panelIndex = i\n\n if (i === -1) this.state.dashboard = { dashboard: 'TabsDashboard', name: '', new: true }\n else this.state.dashboard = this.state.panels[i]\n}", "_addToMainArea(widget, options) {\n if (!widget.id) {\n console.error('Widgets added to app shell must have unique id property.');\n return;\n }\n options = options || {};\n const dock = this._dockPanel;\n const mode = options.mode || 'tab-after';\n let ref = this.currentWidget;\n if (options.ref) {\n ref = find(dock.widgets(), value => value.id === options.ref) || null;\n }\n const { title } = widget;\n // Add widget ID to tab so that we can get a handle on the tab's widget\n // (for context menu support)\n title.dataset = Object.assign(Object.assign({}, title.dataset), { id: widget.id });\n if (title.icon instanceof LabIcon) {\n // bind an appropriate style to the icon\n title.icon = title.icon.bindprops({\n stylesheet: 'mainAreaTab'\n });\n }\n else if (typeof title.icon === 'string' || !title.icon) {\n // add some classes to help with displaying css background imgs\n title.iconClass = classes(title.iconClass, 'jp-Icon');\n }\n dock.addWidget(widget, { mode, ref });\n // The dock panel doesn't account for placement information while\n // in single document mode, so upon rehydrating any widgets that were\n // added will not be in the correct place. Cache the placement information\n // here so that we can later rehydrate correctly.\n if (dock.mode === 'single-document') {\n this._mainOptionsCache.set(widget, options);\n }\n if (options.activate !== false) {\n dock.activateWidget(widget);\n }\n }", "function addLoginButtons() {\n document.getElementById(TOP_ID).innerHTML = TOP_INFO_STR;\n const dashElement = $(getLoginHtml());\n $('#' + DASH_ID).append(dashElement);\n}", "function clearDashboard() {\n \n while (dashboard.firstChild) {\n dashboard.removeChild(dashboard.firstChild);\n }\n}", "dashboard() {\n return this.getDashboardV1()\n .catch((err) => {\n console.error(\"Error in 'marketCapHistory' method of nomics module\\n\" + err);\n throw new Error(err);\n });\n }", "function openDashboard() {\n if (dashboardRBElement.checked == true) {\n localStorage.setItem(\"patientId\", getPatientId());\n window.open(\"../dashboard.html\", \"_self\");\n } else {\n \n }\n }", "function createShelterDiv(){\n var newDiv = '<div class=\"panel panel-default\" id=\"shelter-panel\">'+\n '<div class=\"panel-heading\">'+\n '<h3 class=\"panel-title\">Local Animal Shelters</h3>'+\n '</div>'+\n '<div class=\"panel-body\" id=\"shelter-list\">'+\n // Panel content\n '</div>'+\n '</div>';\n $(\"#shelters\").append(newDiv); \n\n}", "function addStep(stepData, actionbar) {\r\n\t\r\n var stepDataObject = JSON.parse(stepData); \r\n \r\n \r\n var newStep = ++window.maxStep;\r\n \r\n //add step index to the stepData\r\n stepDataObject.stepIndex = newStep;\r\n \r\n var container = addContainer(newStep);\r\n addCircleDiv(container, newStep, actionbar);\r\n addCaptionDiv(container, stepDataObject.name);\r\n stepsDict[stepDataObject.name] = stepDataObject;\r\n stepsArray[newStep] = stepDataObject;\r\n \r\n if(actionbar)\r\n {\r\n\t//add the Change State Event\r\n\t$(\".stepContainer\").click(clickOnState);\r\n\tuiOutlineNextSteps();\r\n }\r\n else{\r\n\t//if dashboard\r\n\t$(\".stepContainer\").click(clickOnUseCase);\r\n\t\r\n }\r\n}", "add(board) {\n return this._$http({\n url: this._AppConstants.api + '/board/',\n method: 'POST',\n headers: {\n Authorization: this._JWT.get()\n },\n data: board\n }).then((res) => res.data);\n\n }", "function show_dashboard(){\n document.location.href = \"/dashboards/all_category\";\n}", "function renderDashboardUX(){\n DATA_METRICS_ARR = metrics_arr;\n if(from_date == 'None'){\n $('#date-subtitle').html('Duration: 3 months | monthly');\n }else{\n $('#date-subtitle').html('From: '+ from_date.split(' ')[0] + ' | To: ' + to_date.split(' ')[0] + ' | Filtered: '+ aggreg_typ);\n }\n $('#dashboard-container').empty();\n $('#dashboard-container').dashboard({\n configSrc : DASHBOARD_CONFIG,\n utilsObj : $engine,\n templateObj : $('#graphtemplate'),\n metricsArr : DATA_METRICS_ARR\n });\n $engine.log('DASHBOARD > setupDashboardUX: Config: ' + DASHBOARD_CONFIG);\n }", "function AnalyticsDashboard(props) {\n var _a = React.useState(props.viewId), viewId = _a[0], setViewId = _a[1];\n var _b = react_use_analytics_api_1.useAnalyticsApi(), ready = _b.ready, gapi = _b.gapi, authorized = _b.authorized;\n var showViewSelector = !props.hideViewSelector;\n var showAuth = !props.hideAuth;\n var renderedCharts = React.createElement(React.Fragment, null);\n if (ready && gapi && viewId) {\n renderedCharts = props.renderCharts ? props.renderCharts(gapi, viewId) : React.createElement(React.Fragment, null);\n }\n var analyticsAuthWidgetsClassName = 'analytics-auth-widgets';\n return (React.createElement(\"div\", { className: \"analytics-dashboard\" },\n !ready && (typeof props.loadingText === 'string' ? props.loadingText : 'Loading...'),\n ready && (React.createElement(React.Fragment, null,\n authorized && !!props.chartsAppearFirst && renderedCharts,\n !authorized && showAuth && (React.createElement(\"div\", { className: analyticsAuthWidgetsClassName },\n React.createElement(AuthorizeButton_1.AuthorizeButton, { gapi: gapi, authOptions: props.authOptions, idPrefix: props.dashId, hideRefreshButton: props.hideRefreshButton, refreshButtonText: props.refreshButtonText }))),\n authorized && (React.createElement(React.Fragment, null,\n showViewSelector && (React.createElement(ViewSelector_1.ViewSelector, { gapi: gapi, onChange: function (viewId) { return setViewId(viewId); }, idPrefix: props.dashId })),\n showAuth && (React.createElement(\"div\", { className: analyticsAuthWidgetsClassName },\n React.createElement(SignOutButton_1.SignOutButton, { gapi: gapi, noReload: props.noReloadOnSignOut, text: props.signOutButtonText }))),\n !props.chartsAppearFirst && renderedCharts))))));\n}", "function getNewDashboardData() {\n $.ajax({\n url: '/dashboard/json/',\n dataType: 'json',\n success: refreshDashboard_cb\n });\n}", "addWidget( widget )\r\n {\r\n console.assert( widget , `Tried to add a invalid widget: ${widget}`,window.DEBUG);\r\n\r\n this.widgets = this.widgets || [];\r\n this.widgets[widget.id] = widget;\r\n }", "function createDashboard(groupId, sectionTag, group) {\n\n var groupUniqueTag = '-' + sectionTag + groupId;\n\n var dashboardId = document.getElementById('dashboard_div' + groupUniqueTag);\n //var dashboard = new google.visualization.Dashboard(dashboardId);\n var dashboard = new google.visualization.Dashboard(document.getElementById('dashboard_div' + groupUniqueTag));\n\n var allDashboardsForGroup = groupDashboards[group] || [];\n allDashboardsForGroup.push(dashboard);\n groupDashboards[group] = allDashboardsForGroup;\n\n var options = {\n title: 'xxUtilization',\n is3D: 'true',\n width: 1000,\n height: 600\n };\n\n var categoryPicker = new google.visualization.ControlWrapper({\n controlType: 'CategoryFilter',\n containerId: 'TeamName' + groupUniqueTag,\n options: {\n filterColumnLabel: 'Online', // filter by Team name\n ui: {\n caption: 'true / false',\n sortValues: true,\n allowNone: true,\n allowMultiple: true,\n allowTyping: true\n }\n\n }\n });\n\n var cssClassNames = {\n\t'headerRow': 'italic-darkblue-font bold-font',\n\t'tableRow': '',\n\t'oddTableRow': 'beige-background',\n\t'selectedTableRow': 'orange-background grey-background',\n\t'hoverTableRow': '',\n\t'headerCell': 'gold-border',\n\t'tableCell': '',\n\t'rowNumberCell': 'underline-blue-font'\n };\n\n // The Table visualization doesn't use any row properties. You have to set the style property for each cell in the row.\n var tableOptions = {\n\tallowHtml: 'true', // case sensitive\n\talternatingRowStyle: 'false',\n\twidth: '100%',\n\t'cssClassNames': cssClassNames,\n\tsortColumn: 0,\n\tsortAscending: true,\n\tsort: 'enable'\n };\n\n var table = new google.visualization.ChartWrapper({\n 'chartType': 'Table',\n 'containerId': 'table_div' + groupUniqueTag,\n 'options': tableOptions,\n 'view': {\n\t 'columns': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n }\n });\n\n // table.setOptions(options); // gets set, but table cells ignore options\n\n // data.setProperties(1,1,{'allowHTML':'true','style':'font-style:bold; font-size:22px; color:\"green\"; background-color:\"blue\";'});\n // data.setCell(5, 3, 0, \"bb\", {'className': 'bold-green-font large-font right-text'});\n // data.setCell(6, 3, undefined, undefined, {'style': 'background-color: red;'});\n\n // google tables/charts only does a \"row\" select -- no way to get column info\n google.visualization.events.addListener(table, 'select', function() {\n\n var chart = table.getChart();\n var gs = chart.getSelection()[0]; // only first?\n var deviceCardStatus = cardDeviceShadeStatus[groupUniqueTag];\n var deviceName = deviceCardStatus;\n if (gs != null) {\n var row = gs.row;\n\t //\t console.log('selected row=['+row+']');\n\t var dvn = groupDVNs[group];\n var deviceName = dvn[row];\n }\n\n var containerElement = document.getElementById('device_div'+groupUniqueTag);\n if (deviceName && (deviceCardStatus == null || deviceCardStatus != deviceName) ) {\n containerElement.style.display='inline-block';\n updateAndShowDeviceDiv(groupUniqueTag, deviceName, chart);\n } else {\n containerElement.style.display='none';\n cardDeviceShadeStatus[groupUniqueTag] = null;\n }\n\n });\n\n dashboard.bind([categoryPicker], [table]);\n\n var thisGroupRef = firebase.database().ref('/group/' + group + '/devices/');\n console.log('listening for=[/group/'+group+'/devices/]');\n\n thisGroupRef.on('value', function(data) {\t\n var dv = data.val();\n console.log('received \"value\" update for devices for group: ['+group+'] data: [' + JSONStringify(dv) + ']')\n // console.log('separator ________________________________');\n // check and de-dupe devices? how to clean out dupes?\n var devices = [];\n for (var k in dv) {\n\t //\t devices.push(dv[k]); // values for /connections\n\t devices.push(k); // keys for /devices/\n }\n updateTableForGroup(dashboard, group, devices);\n });\n\n\n} // DRAW DASHBOARD -- dfdf", "function Dashboard () {\n\n // Default values for date. These should be dynamic in future versions!\n // That means updating the initial charts accordingly to these values.\n this.boundMin = new Date(2015, 0, 1);\n this.boundMax = new Date(2015, 11, 1);\n this.timeMin = new Date(2015, 0, 1);\n this.timeMax = new Date(2015, 11, 1);\n\n //initialize pie, line and bar charts\n this.pie = this.createPie().highcharts();\n this.line = this.createLine(0, 11).highcharts();\n this.bar = this.createBar().highcharts();\n\n // initializing the slider\n this.createSlider();\n\n this.pieData = [];\n this.lineData = [];\n this.barData = [];\n\n // Stored values regarding the timeslide\n // defaulf being end and start of year (should be dynamic based on input as above).\n this.monthStart = 0;\n this.monthEnd = 11;\n\n // Current countryCode (if any);\n this.countryCode = null;\n\n // add initial data to pie chart and line/bar chart\n this.getPieData(this.countryCode);\n this.getLineData(this.countryCode);\n this.getBarData(this.countryCode);\n\n}", "function add_new_partition() {\n\t//console.log ( ' ajouter une nouvelle partition ');\n\t// show the table allowing to enter the new partition\n\t$(\"#table_new_partition\").show();\n\t// hide the button\n\t$(\"#button_new_partition\").hide();\n\t// show the button to record a new partition\n\t$(\"#button_record_new_partition\").show();\n\t// disable the button to record a new partition\n\t$('#button_record_new_partition').prop('disabled', true);\n\t// check if at least two inputs are provided\n\tif ( isArtistNameProvided () && isSongNameProvided() ) {\n\t\t// record button is enabled\n\t\t$('#button_record_new_partition').prop('disabled', false);\n\t}\n}", "function addJSToJSPanel(location){\r\n\tvar fName = Util.removePath(location,false);\r\n\tvar tableObj = $(\"dot_customJSPanel_table\");\r\n\r\n\tvar newRow = tableObj.insertRow(-1);\r\n\tnewRow.id = \"row\"+fName;\r\n\t\r\n\tvar newCol1 = newRow.insertCell(0);\r\n\tnewCol1.className = \"panelClm\";\r\n\t\r\n\tvar newAnchor = document.createElement('a');\r\n\tnewAnchor.innerHTML = fName;\r\n\tnewAnchor.href=\"javascript:;\";\r\n\tnewAnchor.setAttribute(\"onClick\",\"updateJSEditAreaWithValue('\"+fName+\"');Util.showDialog('jsEditArea', 'Edit Javascript', 600);\");\r\n\tnewCol1.appendChild(newAnchor);\r\n}", "function dashboardClicked() {\n $(\".container-fluid\").find('main')\n .load(\"dashboard.html\").find('');\n}", "function drawDashboard() {\n\n // Create our data table.\n var data = google.visualization.arrayToDataTable([\n ['typeQuestion', 'Nombre de questions'],\n ['Choix Multiples', getQuestionsMultiples(question)],\n ['Choix Simple', getQuestionsSimples(question)],\n ['Reponse Texte', getQuestionsTexte(question)],\n ]);\n\n // Create a dashboard.\n var dashboard = new google.visualization.Dashboard(\n document.getElementById('dashboard_div'));\n\n // Create a range slider, passing some options\n var donutRangeSlider = new google.visualization.ControlWrapper({\n 'controlType': 'NumberRangeFilter',\n 'containerId': 'filter_div',\n 'options': {\n 'filterColumnLabel': 'Nombre de questions'\n }\n });\n\n // Create a pie chart, passing some options\n var pieChart = new google.visualization.ChartWrapper({\n 'chartType': 'PieChart',\n 'containerId': 'chart_div',\n 'options': {\n 'width': 475,\n 'height': 350,\n 'pieSliceText': 'value',\n 'legend': 'bottom'\n }\n });\n\n // Establish dependencies, declaring that 'filter' drives 'pieChart',\n // so that the pie chart will only display entries that are let through\n // given the chosen slider range.\n dashboard.bind(donutRangeSlider, pieChart);\n\n // Draw the dashboard.\n dashboard.draw(data);\n}", "function dash_appear() {\n appointments.style.display = \"none\";\n dashboard.style.display = \"block\";\n}", "function initAdminDashboard () {\n // Set up the lobby table\n var lobbyTable = $('#bb-lobby-table').DataTable({\n // Sort by status, then by id\n 'order': [\n [6, 'asc'],\n [0, 'asc']\n ],\n \n 'ajax': '/app-data/lobbies/' + tourneyName,\n \n 'columns': [\n {\n 'data': 'id',\n 'responsivePriority': 1\n },\n \n {\n 'data': 't1Name',\n 'type': 'anti-empty',\n 'responsivePriority': 3\n },\n \n {\n 'data': 't2Name',\n 'type': 'anti-empty',\n 'responsivePriority': 3\n },\n \n { 'data': 'score' },\n \n {\n 'data': 'room',\n 'type': 'anti-empty'\n },\n \n // Special rendering for time formatting\n { \n 'data': 'startTime',\n 'render': function (data, type, full, meta) {\n switch (type) {\n case 'type':\n return 'date';\n \n default:\n return data == ''\n ? 'N/A'\n : getTimerString(new Date(new Date() - new Date(data)));\n }\n },\n 'responsivePriority': 4\n },\n \n // Special rendering for colors and icons\n { \n 'data': 'status',\n 'render': function (data, type, full, meta) {\n switch (type) {\n case 'display':\n return formatLobbyStatus(data);\n \n case 'sort':\n return data.sort;\n \n case 'type':\n return 'string';\n \n default:\n return data.display;\n }\n },\n 'responsivePriority': 2\n }\n ]\n });\n \n // Set up the team table\n var teamTable = $('#bb-team-table').DataTable({\n 'ajax': '/app-data/teams/' + tourneyName,\n \n 'columns': [\n { 'data': 'seed' },\n { 'data': 'name' },\n \n // Special rendering for label coloring\n {\n 'data': 'online',\n 'render': function(data, type, full, meta) {\n switch (type) {\n case 'display':\n return formatTeamOnline(data);\n \n case 'type':\n return 'string';\n \n default:\n return data;\n }\n }\n },\n \n // Special rendering for colors and icons\n {\n 'data': 'status',\n 'render': function(data, type, full, meta) {\n switch (type) {\n case 'display':\n return formatTeamStatus(data);\n \n case 'type':\n return 'string';\n \n default:\n return data.display;\n }\n }\n }\n ]\n });\n \n // When tabs are switched, we need to recalculate the responsize table's width since it was hidden before\n $('#bb-admin-dash-tables').on('shown.bs.tab', function(e) {\n $(this).find('.table').DataTable().responsive.recalc();\n });\n \n // Refresh tables periodically\n tableRefresh = setInterval(function() {\n lobbyTable.ajax.reload(null, false); // Don't reset paging\n teamTable.ajax.reload(null, false);\n }, 5000);\n \n // Called when the inner page content is removed to load a new page.\n $('.content').on('destroy', function() {\n window.clearInterval(tableRefresh);\n });\n}", "function addSwimlane() {\n showProcessingDiaglog();\n var sw = new Swimlane();\n $.ajax({\n url: \"Handler/SwimlaneHandler.ashx\",\n data: {\n action: \"addSwimlane\",\n projectID: projectID,\n swimlane: JSON.stringify(sw)\n },\n type: \"post\",\n success: function (result) {\n showSuccessDiaglog(0);\n resetSwForm();\n sw.Swimlane_ID = result;\n\n // Add new swimlane to the board and swimlane management window\n addSWtoBoard(sw);\n\n // Send to other clients\n proxyNote.invoke(\"insertSwimlane\", sw);\n }\n });\n}", "function addTab(pPar){\n tabs_c.add({\n id: pPar.id,\n title: pPar.title,\n layout:'fit',\n closable: true,\n autoLoad:{url:pPar.url,\n params:{pObj: pPar.id},\n scripts: true,\n method: 'post'}\n }).show();\n }", "function addConnector(connectorToSend, succeed, failed) {\n ///connector.dashboard_id = \"50dc22648a8e497891000001\"; TODO\n var params = JSON.stringify(connectorToSend);\n var request = new CDServicesAccess.CdServices(CDServicesAccess.ServiceType.Service, CDServicesAccess.typeRequest.Post, _CONNECTORS_BASE_URL_SERVICES, params, CdServicesHelper.headers, _succeed, failed);\n request.launchService();\n function _succeed(connector)\n {\n succeed(JSON.parse(connector.responseText).connector);\n }\n }", "addWidgetJson(metrics) {\n // Each single metric in the metrics array has the following format:\n // [Namespace, MetricName, [{DimensionName,DimensionValue}...] [Rendering Properties Object] ]\n // See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html#CloudWatch-Dashboard-Properties-Metrics-Array-Format\n const op = pulumi.all([this.spread(), widgets_simple_1.statisticString(this.spread())]).apply(([uw, stat]) => {\n const result = [];\n if (uw.period % 60 !== 0) {\n throw new Error(`Dashboard metric period must be a multiple of 60: ${uw.period}`);\n }\n result.push(uw.namespace);\n result.push(uw.name);\n // note that dimensions are just added added directly into the array, there's no\n // sub-array or other structure to hold them.\n if (uw.dimensions) {\n for (const key in uw.dimensions) {\n if (uw.dimensions.hasOwnProperty(key)) {\n result.push(key);\n result.push(uw.dimensions[key]);\n }\n }\n }\n const renderingProps = {\n stat,\n color: uw.color,\n label: uw.label,\n period: uw.period,\n visible: uw.visible,\n yAxis: uw.yAxis,\n };\n result.push(renderingProps);\n return result;\n });\n metrics.push(op);\n }", "add() {\n this.$state.go('dbaas-logs.detail.streams.add', {\n serviceName: this.serviceName,\n });\n }", "function addRoom() {\n\tvar roomName = $('#add-room-name').val();\n\tvar posting = $.post(roomsAddURI, {\n\t\tname : roomName\n\t});\n\tposting.done(function(data) {\n\t\t//Add room via rest api then join it\n\t\tvar room = JSON.parse(JSON.stringify(data));\n\t\tjoinRoom(room.roomId, true);\n\t});\n}", "function DashboardWrapper({ showDashboard2 }) {\n const loader = (\n <div className=\"vads-u-margin-y--4 vads-u-padding-y--0p5\">\n <LoadingIndicator message=\"Please wait while we load the application for you.\" />\n </div>\n );\n const content = showDashboard2 ? <DashboardV2 /> : <DashboardV1 />;\n return <Suspense fallback={loader}>{content}</Suspense>;\n}", "function reflowDashboard() {\n loadDashboard(true);\n adjustHeight();\n }", "function displayDashboard(_id, _hideNav) {\n\tif (!_hideNav) {\n\t\t_hideNav = 'no';\n\t}\n\t\n\tif (!_id) {\n\t\talert(\"Please select MapsBI Dashboard to display\");\n\t\treturn false;\n\t}\n\t\n\twindow.ischanged = false;\n\twindow.location = mapsBiDashboardViewUrl + '&custparam_dashid='+_id+'&custparam_showanv='+_hideNav;\n}", "function showUserDashboard(user: User): Admin {\n return new SuperAdmin('1', 'Jina', 'JustJina')\n}", "function addNewActivity() {\n\n // get the name of the activity\n // and check that it's not empty\n var name = view.activityName.val();\n if (name == '') {\n event.preventDefault();\n event.stopPropagation();\n view.activityNameErrorLabel.addClass('error');\n return;\n }\n\n // get the length of the activity\n // and check that the value is numerical and greater than 0\n var length = view.activityLength.val();\n if (isNumber(length)) {\n if (length <= 0) {\n event.preventDefault();\n event.stopPropagation();\n view.activityLengthErrorLabel.html('Length must be greater than 0.');\n view.activityLengthErrorLabel.addClass('error');\n return;\n }\n } else {\n event.preventDefault();\n event.stopPropagation();\n view.activityLengthErrorLabel.html('Value must be numerical.');\n view.activityLengthErrorLabel.addClass('error');\n return;\n }\n // the value we got from the dialog is a string and we have to convert\n // it to an integer, otherwise we get weird results when computing the total\n // length of a day (found out the hard way ;-))\n length = parseInt(length);\n\n // get the type of the activity\n var type = view.activityType.val();\n switch (type) {\n case '0':\n type = 0; break;\n case '1':\n type = 1; break;\n case '2':\n type = 2; break;\n case '3':\n type = 3; break;\n default:\n console.log(\"Error: unknown activity type\");\n }\n\n // get the description of the activity\n var description = view.activityDescription.val();\n\n // create new activity and add it to the model\n var newActivity = new Activity(name, length, type, description);\n model.addParkedActivity(newActivity);\n\n }", "function getDashboardUrl (dashboardName) {\n return APP_CONFIG.apiUrl + '/dashboards/' + dashboardName + '/data';\n }", "function emptyDashboard(){\n $(\"#dashboard_tab .value_td span\",main_tabs_context).html(spinner);\n}", "function emptyDashboard(){\n $(\"#dashboard_tab .value_td span\",main_tabs_context).html(spinner);\n}", "constructor(name, args, opts = {}) {\n const region = utils.ifUndefined(args.region, utils.getRegionFromOpts(opts));\n super(name, {\n dashboardName: utils.ifUndefined(args.name, name),\n dashboardBody: getDashboardBody(args, region).apply(b => JSON.stringify(b)),\n }, opts);\n this.url = pulumi.interpolate `https://${region}.console.aws.amazon.com/cloudwatch/home?region=${region}#dashboards:name=${this.dashboardName}`;\n }", "function reRenderDashboard() {\n body.innerHTML = renderDashboardDiv(dashboardCaption,\n notesToLinks, notesCaption,\n notesItems, buttonClass);\n }", "renderCreatePage() {\n\n /**\n * Render add new pages\n * @type {WorkspaceDataAddPageElement}\n */\n this.elements.$addPage = new WorkspaceDataAddPageElement(this, {\n style: 'add-page',\n $container: this.get$item().$,\n events: {\n click: ['prepareCreatePage']\n }\n });\n }", "function build_newShotPanel (shotObj, compItem, stat)\r\n {\r\n // define UI panel specifities\r\n // title for shot panel\r\n var title = undefined;\r\n if (showShotStatus_inPanelName == true) var title = shotObj.name + \" [\" + stat +\"]\";\r\n else title = shotObj.name;\r\n var compPanel = TabbedPanel.add(\"tab\");\r\n compPanel.text = title ;\r\n compPanel.comp = compItem; // extra argument passed through panel object \r\n compPanel.appFolder = shotObj.appFolder; // extra argument passed through panel object \r\n compPanel.orientation = \"column\";\r\n compPanel.margins = [10,5,10,5];\r\n compPanel.grp = compPanel.add(\"group\");\r\n compPanel.grp.alignment = ['fill','fill'];\r\n /* Export Option Master Group */\r\n compPanel.ExportOptionsGrp = compPanel.grp.add(\"group\", undefined, undefined, {name: 'ExportOptionsGrp'});\r\n compPanel.ExportOptionsGrp.orientation = \"row\";\r\n compPanel.ExportOptionsGrp.alignment = ['fill','middle'];\r\n compPanel.ExportOptionsGrp.alignChildren = ['center','middle'];\r\n compPanel.AECheck = compPanel.ExportOptionsGrp.add(\"checkbox\", undefined, \"AE\", {name: 'AECheck'}); // 0\r\n compPanel.AECheck.value = shotObj.exportAE;\r\n compPanel.AECheck.helpTip = \"Export After Effect project for this shot if checked\";\r\n compPanel.QTCheck = compPanel.ExportOptionsGrp.add(\"checkbox\", undefined, \"QT\", {name: 'QTCheck'}); // 1\r\n compPanel.QTCheck.value = shotObj.exportQT;\r\n compPanel.QTCheck.helpTip = \"Export Quicktime file for this shot if checked\";\r\n compPanel.FramingCheck = compPanel.ExportOptionsGrp.add(\"checkbox\", undefined, \"Framing\", {name: 'FramingCheck'}); // 2\r\n compPanel.FramingCheck.value = shotObj.exportFraming;\r\n compPanel.FramingCheck.helpTip = \"Export framing of this shot for animators if checked\";\r\n compPanel.MultiFramingCheck = compPanel.ExportOptionsGrp.add(\"checkbox\", undefined, \"Multi-Framing\", {name: 'MultiFramingCheck'}); // 2\r\n compPanel.MultiFramingCheck.value = (shotObj.exportMultiFraming == true);\r\n compPanel.MultiFramingCheck.helpTip = \"Export start frame, end frame and wide\";\r\n compPanel.MACheck = compPanel.ExportOptionsGrp.add(\"checkbox\", undefined, \"3D Anim\", {name: 'MACheck'}); // 3\r\n compPanel.MACheck.value = false;\r\n compPanel.MACheck.helpTip = \"Export maya file for 3D anim if checked\";\r\n compPanel.export_status = compPanel.grp.add(\"group\", undefined, undefined, {name: 'export_status'}); // 4\r\n compPanel.export_status.alignment = ['right','middle'];\r\n compPanel.AddBGAssetBttn = compPanel.export_status.add(\"button\", undefined, \"Add BG asset\", {name: 'AddBGAssetBttn'});\r\n compPanel.appFolder_bttn_obj = compPanel.export_status.add(\"image {name: \\\"appFolder_bttn_obj\\\", helpTip:\\\"Open approved folder\\\", image: \\\"\"+(icons_folder+\"folder_icon_3.png\")+\"\\\"}\");\r\n \r\n /* This grp will contains assets and files to export */\r\n compPanel.assets_grp = compPanel.add(\"group\", undefined, \"assets_group\", {name: 'assets_grp'});\r\n compPanel.assets_grp.orientation = \"column\";\r\n compPanel.assets_grp.margins = [0,10,0,10];\r\n compPanel.assets_grp.id = 1;\r\n compPanel.assets_grp.alignment = ['fill','top'];\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t// J Hearn - this panel contains notes\r\n\t\t\t\t\t\tcompPanel.notes_panel = compPanel.add(\"panel\", undefined, \"Notes\");\r\n compPanel.notes_panel.orientation = \"column\";\r\n compPanel.notes_panel.margins = [0,5,0,5];\r\n compPanel.notes_panel.id = 2;\r\n\t\t\t\t\t\t\tcompPanel.notes_panel.alignment = ['fill','top'];\r\n\t\t\t\t\t\t\tcompPanel.notes_panel.alignChildren = ['fill','fill'];\r\n\t\t\t\t\t\tcompPanel.notes_to_grp = compPanel.notes_panel.add(\"group\");\r\n\t\t\t\t\t\t\tcompPanel.notes_to_grp.orientation = \"row\";\r\n\t\t\t\t\t\t\tcompPanel.notes_to_grp.alignment = ['fill','top'];\r\n\t\t\t\t\t\tcompPanel.notes_to_grp.add(\"statictext\", undefined, \"To:\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcompPanel.notes_to = new TagEditor(compPanel.notes_to_grp, usersAndDepts.users.sort(), shotObj.notesTo);\r\n\t\t\t\t\t\tcompPanel.notes_depts_grp = compPanel.notes_panel.add(\"group\");\r\n\t\t\t\t\t\t\tcompPanel.notes_depts_grp.orientation = \"row\";\r\n\t\t\t\t\t\t\tcompPanel.notes_depts_grp.alignment = ['fill','top'];\r\n\t\t\t\t\t\tcompPanel.notes_depts_grp.add(\"statictext\", undefined, \"Departments:\");\r\n\t\t\t\t\t\tcompPanel.notes_depts = new TagEditor(compPanel.notes_depts_grp, usersAndDepts.departments.sort(), shotObj.notesDepts);\r\n\t\t\t\t\t\tcompPanel.notes_edit = compPanel.notes_panel.add(\"edittext\", undefined, shotObj.notes, {multiline: true});\r\n \r\n // ACTIONS\r\n compPanel.AddBGAssetBttn.onClick = function ()\r\n { \r\n // create BGcreationPanel\r\n newAsset = bgassettool (this, shotObj, episodeFolder, compItem, undefined);\r\n if (newAsset instanceof Object)\r\n { \r\n // build ui panel for this new asset\r\n new_panel = build_bg_asset_panel (this.parent.parent.parent.children[1], newAsset, shotObj);\r\n // update assets Lists!\r\n if (newAsset.status.match(/re-use|locked/gi))\r\n {\r\n assets_list = readFile (episodeFolder, 'asset');\r\n if (newAsset.name in assets_list)\r\n {\r\n bg_reuse = assets_list[newAsset.name];\r\n // it is a bg re-use of an asset of the episode.\r\n newAsset.sg_id = bg_reuse['sg_id'];\r\n // add the actual shot to list of parent shots of the asset\r\n bg_reuse['parentShot'].push(shotObj.name);\r\n addAssetToFile (episodeFolder, bg_reuse);\r\n }\r\n // add the bg-asset to the .shots List\r\n updateAssetInShotFile (appFolder, newAsset, 'add', newAsset['sg_id']);\r\n }\r\n else\r\n {\r\n // get export status checkbox's value\r\n queueStatus = new_panel.children[2].children[2].value;\r\n // add the bg-asset to the .asset List\r\n addAssetToFile (episodeFolder, newAsset);\r\n // add the bg-asset to the .shots List\r\n updateAssetInShotFile (appFolder, newAsset, 'add', queueStatus);\r\n }\r\n // update the ui\r\n new_panel.parent.parent.layout.layout(true);\r\n // make sure there is a maya file for 3D BGs\r\n if (newAsset.id.match(/3D|camera/gi))\r\n {\r\n //we need 3D for this BG\r\n if (compPanel.MACheck.value == false) compPanel.MACheck.notify();\r\n }\r\n }\r\n };\r\n compPanel.appFolder_bttn_obj.onClick = function ()\r\n { \r\n appDir = new Folder(shotObj.appFolder);\r\n appDir.execute();\r\n getExportedFiles (this, shotObj);\r\n };\r\n \r\n compPanel.MACheck.onClick = function () {\r\n maya_file = shotObj.maFile;\r\n if (maya_file) { build_maya_file_panel (compPanel.assets_grp, this, maya_file, appFolder); }\r\n else { build_maya_file_panel (compPanel.assets_grp, this, undefined, appFolder); };\r\n \r\n };\r\n compPanel.AECheck.onClick = function () { updateEntryInShotFile (appFolder, this.value, \"AE\"); };\r\n compPanel.QTCheck.onClick = function () { updateEntryInShotFile (appFolder, this.value, \"QT\"); };\r\n compPanel.FramingCheck.onClick = function ()\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcompPanel.MultiFramingCheck.enabled = this.value;\r\n\t\t\t\t\t\t\tif (!this.value && compPanel.MultiFramingCheck.value)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tcompPanel.MultiFramingCheck.value = false;\r\n\t\t\t\t\t\t\t\tupdateEntryInShotFile (appFolder, compPanel.MultiFramingCheck.value, \"MultiFraming\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tupdateEntryInShotFile (appFolder, this.value, \"Framing\");\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tcompPanel.MultiFramingCheck.onClick = function () { updateEntryInShotFile (appFolder, this.value, \"MultiFraming\"); };\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcompPanel.notes_to.onChange = function () { updateEntryInShotFile(appFolder, compPanel.notes_to.tags, \"NotesTo\");};\r\n\t\t\t\t\t\tcompPanel.notes_depts.onChange = function () { updateEntryInShotFile(appFolder, compPanel.notes_depts.tags, \"NotesDepts\");};\r\n\t\t\t\t\t\tcompPanel.notes_edit.onChange = function () { updateEntryInShotFile(appFolder, compPanel.notes_edit.text, \"Notes\");};\r\n\t\t\t\t\t\t\r\n // \r\n // re build the panel\r\n TabbedPanel.layout.layout(true);\r\n return compPanel;\r\n }", "function appendPanel(){\n\t\t/*jQuery('<div/>', {\n\t\t id: \"foo\",\n\t\t text: \"Get into Facebook\"\n\t\t }).appendTo(\"body\");*/\n\t\tvar panelSeklly = '<div class=\"panel panel-default\">\\n' +\n\t\t\t\t '\t<div class=\"panel-heading\">\\n' + \n\t\t\t\t '\t\t<h3 class=\"panel-title\">Panel title</h3>\\n' + \n\t\t\t \t '\t</div>\\n' + \n\t \t\t\t '\t<div class=\"panel-body\">\\n' + \n \t\t\t\t '\t\tPanel content\\n' + \n \t\t\t\t '\t</div>\\n' + \n\t\t\t\t '\t<div class=\"panel-footer\">Panel footer</div>\\n' + \n\t\t\t\t'</div>';\n\t\t//window.alert(\"Hello\");\n\t\tvar editor = edManager.getCurrentFullEditor();\n\t\tif(editor){\n\t\t\tvar insertionPos = editor.getCursorPos();\n\t\t\teditor.document.replaceRange(panelSeklly, insertionPos);\n\t\t}\t\n\t}", "addNewBoard(board) {\n loadAllRows().then((response) => this.appendNewBoard(board, response));\n }", "click(){\n\t\t\t\tcreateAddWindow();\n\t\t\t}" ]
[ "0.6828042", "0.65590954", "0.64667284", "0.6252167", "0.6248012", "0.61539525", "0.61025417", "0.60104656", "0.5931182", "0.58997107", "0.58325845", "0.58136743", "0.5784717", "0.5781746", "0.57746947", "0.5765361", "0.57632524", "0.5677169", "0.5582797", "0.55572206", "0.5548929", "0.5399355", "0.5332489", "0.5326901", "0.5324444", "0.52704614", "0.5256327", "0.5254296", "0.52106035", "0.5201014", "0.5189251", "0.51810634", "0.5171251", "0.51651996", "0.51424956", "0.5142395", "0.51339185", "0.5131075", "0.51310104", "0.51115394", "0.5101155", "0.5100706", "0.5079572", "0.50585043", "0.5056794", "0.5054256", "0.5054106", "0.5053915", "0.5051701", "0.5045192", "0.5043696", "0.50358194", "0.5031077", "0.50299406", "0.502951", "0.502413", "0.50175273", "0.50132525", "0.50037426", "0.50029534", "0.50024956", "0.49906704", "0.49900344", "0.49849182", "0.4983307", "0.4979823", "0.49738023", "0.49679032", "0.49595952", "0.4951212", "0.49468094", "0.49434835", "0.49408978", "0.4916795", "0.4916363", "0.4916286", "0.4910962", "0.48932472", "0.4883897", "0.48827553", "0.48797303", "0.48713812", "0.4862908", "0.48539647", "0.48290426", "0.48203462", "0.48125744", "0.48094139", "0.48039156", "0.4800931", "0.47976103", "0.47973925", "0.47973925", "0.4796936", "0.47941512", "0.47882953", "0.47716197", "0.4768276", "0.47625145", "0.47619537" ]
0.5208261
29
This function removes a dashboard.
static async removeDashboard(email, dashboardID) { return new Promise((resolve, reject) => { Database.sendQuery('DELETE FROM Dashboard WHERE ( email = $1 ) AND ( ID = $2);', [email, dashboardID]) .then((result) => resolve(result.rows)) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearDashboard() {\n \n while (dashboard.firstChild) {\n dashboard.removeChild(dashboard.firstChild);\n }\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 dashboard_clear() {\n d3.select(\"#dashboard\").selectAll(\"svg\").remove();\n}", "function deleteNewDashboardMonitor2(idx) {\n ctrl.newDashboardMonitor2es.splice(idx, 1);\n }", "function deleteDashboardMonitor2(idx) {\n deletedDashboardStatuses.push(\n ctrl.dashboardMonitor2es.splice(idx, 1)[0]\n );\n }", "function hide() {\n\t\tdashboardContent.empty();\n\n\t}", "removePanel(id) {\n // remove from dom\n this.getPropertyValue(id, '$panel').remove();\n const temp = this.service.panels.filter((panel) => !panel[id]);\n this.service.panels.splice(0, this.service.panels.length, ...temp);\n }", "function deleteSWinBoard(id) {\n $(\".swimlane[data-id='\" + id + \"']\").remove();\n $(\"#kanban th[data-id='\" + id + \"']\").remove();\n $(\"#kanban td[data-id='\" + id + \"']\").remove();\n recalibrate();\n $(\".window-content\").perfectScrollbar(\"update\");\n}", "function deleteLoginArea(){\n removeLoginArea();\n}", "remove_widget(widget_id) {\n delete this.data[widget_id];\n }", "function deleteBoard(){\n\tif(grid != null){\n \t\tdocument.body.removeChild(grid);\n \t}\n}", "static async removeGraph(email, dashboardID, graphID) {\n\t\tlet query = 'DELETE FROM Graph as g WHERE (g.dashboardid in ( SELECT d.id from dashboard as d WHERE (d.email = $1) AND (d.id = $2))) AND (g.ID = $3);';\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tDatabase.sendQuery(query, [email, dashboardID, graphID])\n\t\t\t\t.then((result) => resolve(result.rows))\n\t\t\t\t.catch((result) => reject(result));\n\t\t});\n\t}", "destroy() {\n this.panel.remove();\n }", "function removeWidget(widget) {\r\n storage.get(\"tiles\", function(storage_data) {\r\n var widgets = storage_data.tiles;\r\n\r\n delete widgets[widget];\r\n\r\n storage.set({\"tiles\": widgets})\r\n });\r\n}", "function emptyDashboard(){\n $(\"#dashboard_tab .value_td span\",main_tabs_context).html(spinner);\n}", "function emptyDashboard(){\n $(\"#dashboard_tab .value_td span\",main_tabs_context).html(spinner);\n}", "function removeDiv() {\n $('.whiteOverlay').remove();\n}", "function removePanel(panel) {\n\t // remove from grister 'silently' (don't reorganize after)\n\t gridster.remove_widget(panel.$el);\n\n\t // destroy the scope\n\t panel.$scope.$destroy();\n\n\t panel.$el.removeData('panel');\n\t panel.$el.removeData('$scope');\n\t }", "function dashboardClicked() {\n $(\".container-fluid\").find('main')\n .load(\"dashboard.html\").find('');\n}", "function removeit(){\n\n removeData.remove();\n\n window.location.replace(\"index.html\");\n\n}", "function removeTab(data){\n var header = $(data).closest(\"li\");\n var index = $(\"#chat-area ul li\").index(header);\n $(\"#chat-area\").tabs(\"remove\", index);\n $(\"#chat-area\").tabs( \"refresh\" );\n}", "function deleteIt(){\n \tupdateDB(\"delete\", pageElements.alertText.dataset.id);\n }", "function deleteEntry(ENTRY){\n ENTRY_LIST.splice(ENTRY.id,1)\n updateUI()\n}", "function deleteListPanel() {\n var listPlayerPanel = document.getElementById(\"current-player-panel\");\n while (listPlayerPanel.hasChildNodes()) {\n listPlayerPanel.removeChild(listPlayerPanel.firstChild);\n }\n}", "function deletePlane(elem) {\n elem.remove();\n}", "function removeUser(offline) {\n if($(\"#online_\" + offline.id).length) {\n $(\"#online_\" + offline.id).remove();\n }\n}", "function handleDeleteActivity(event){\n let activityId = event.target.id\n event.target.parentElement.remove()\n deleteActivity(activityId)\n // activitiesDiv.remove()\n // console.log(activityCard)\n // activityCard.remove()\n}", "function removeWall() {\n\tvar i= planComponents.walls.indexOf(wallSelected);\n\t\n\tif (i!=-1)\n\t\tplanComponents.walls.splice(i,1);\n\t\n\treturn 1;\n}", "removeLink(index) {\n let list = this.state.card;\n let db = this.state.data;\n list.splice(index, 1);\n db.splice(index, 1);\n // remove card in local storage\n localStorage.clear();\n db.forEach(function(elem, index) {\n localStorage.setItem(index, elem);\n });\n \n this.setState({ list, db });\n\n if (!this.state.card.length) {\n document.querySelector('.dashboard').style.height = '100vh';\n }\n }", "function removeClimb() {\n fetch(`${url}`, {\n method: 'DELETE'\n }).then(res => res.json()).then((results) => alert(`Deleted Climb: ${results.confirmation._id}`))\n\n history.goBack()\n }", "function remove() {\n if ($window.confirm('Are you sure you want to delete?')) {\n vm.clientmanagement.$remove()\n .then(function(){\n $state.go('clientmanagements.list');\n });\n\n }\n }", "_removeWidget( widgetKey ) {\n const { firebaseUrl , boardKey } = this.authStoreState.appConfig;\n let widgetBase = new Firebase( `${firebaseUrl}/widgets/${boardKey}/${widgetKey}` );\n widgetBase.remove();\n widgetBase.off();\n NotificationActions.pushNotif({\n type : 'success',\n message : 'widgetRemoved'\n });\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}", "function removerTablero () {\n $(\".panel-tablero\").remove();\n}", "deleteShade(event) {\n localStorage.setItem('shadeid', event.target.id)\n fetch(`http://localhost:8000/shade/delete/${localStorage.getItem('shadeid')}`, {\n method: 'DELETE',\n headers: new Headers({\n 'Content-Type' : 'application/json',\n 'Authorization' : localStorage.getItem('token')\n }) \n }).then((res) => {\n localStorage.removeItem('shadeid')\n this.getShades();\n }\n )\n }", "function deleteConsoleAPI(url, sucessMsg, redirect) {\n $.ajax({\n url: url,\n type: 'DELETE',\n contentType: 'application/json',\n success: function(resp) {\n showSuccessAlert('Success', sucessMsg);\n hideConsoleModal(\"delete-dashboard\");\n window.location = redirect;\n },\n error: function() {\n showErrorAlert('Oops','Could not delete console');\n hideConsoleModal(\"delete-dashboard\");\n }\n });\n}", "function deleteHomePage() {\n var homepage = document.getElementById(\"homepage\");\n homepage.remove();\n }", "function deleteUserFeed() {\n div = document.getElementById('arqsiWidget');\n oldDiv = document.getElementById(\"arqsiWidgetUserFeed_div\");\n if (oldDiv) div.removeChild(oldDiv);\n}", "function handleDeletePlayer(){\n var jNum = localStorage.getItem(\"jerseyNumber\");\n firebase.database().ref('Players/JerseyNumber' +jNum).remove();\n window.location = \"/teamstats.html\";\n}", "function deleteHealthMonitor(request, response, appData) {\n if (!(hmId = request.param('uuid').toString())) {\n error = new appErrors.RESTServerError('Health Monitor id missing');\n commonUtils.handleJSONResponse(error, response, null);\n return;\n }\n deleteHealthMonitorCB(hmId, appData, function(error, results) {\n if (error) {\n commonUtils.handleJSONResponse(error, response, null);\n return;\n }\n commonUtils.handleJSONResponse(error, response, results);\n });\n}", "function remove()\n{\n // Stop any timers to prevent CPU usage\n // Remove any preferences as needed\n // widget.setPreferenceForKey(null, dashcode.createInstancePreferenceKey(\"your-key\"));\n}", "function remove()\n{\n // Stop any timers to prevent CPU usage\n // Remove any preferences as needed\n // widget.setPreferenceForKey(null, dashcode.createInstancePreferenceKey(\"your-key\"));\n}", "function routeDelete(routeID){\n if (routeID == 'all') {\n var isSure = confirm('Are you sure you want to delete all runs?');\n if (isSure){\n var storageArray = [];\n for (var i=0; i<localStorage.length;i++){\n if (localStorage.key(i).substr(0,15)=='Assignment2Path'){\n storageArray.push(localStorage.key(i).substr(-2));\n }\n }\n for (i=0;i<storageArray.length;i++){\n localStorage.removeItem('Assignment2Path' + storageArray[i]);\n document.getElementById(\"homepage-card-whole-\"+storageArray[i]).parentElement.removeChild(document.getElementById(\"homepage-card-whole-\"+storageArray[i]));\n }\n }\n\n } else {\n if (routeID<10){\n localStorage.removeItem('Assignment2Path0' + routeID);\n }\n else{\n localStorage.removeItem('Assignment2Path' + routeID);\n }\n if (routeID<10){\n document.getElementById(\"homepage-card-whole-0\"+routeID).parentElement.removeChild(document.getElementById(\"homepage-card-whole-0\"+routeID));\n }\n else{\n document.getElementById(\"homepage-card-whole-\"+routeID).parentElement.removeChild(document.getElementById(\"homepage-card-whole-\"+routeID));\n }\n \n }\n}", "function deletePort(element, data){\n $(element).parents('[data-type=\"port-group\"]').detach();\n }", "function deleteSettings(id){\n $(\"#currentSettings\").remove();\n $(\"#making\").slideUp(\"slow\");\n}", "function delete_input_panel() {\n let p = document.getElementById('user-input-panel');\n if (p !== null) {\n p.parentNode.remove(p);\n }\n}", "deleteStage() {\n let currentStages = this.props.stages,\n index = this.state.activeStage.index;\n\n currentStages.splice(index, 1);\n this.props.onStagesChange(currentStages);\n this.setState({ settingsOpen: false });\n }", "function removeClient(id) {\n if (clientWidgets[id])\n clientWidgets[id].destroy();\n delete clientWidgets[id];\n}", "function removeElement(element, tab, index){\n\tdocument.getElementById(TABLE).removeChild(element.parentNode);\n\tif(tab.length-1 <= 0){\n\t\tmyBrowser.storage.sync.set({[CREDENTIALSNAME]:new Array()},function(){});\n\t}else{\n\t\ttab.splice(index, NBOFELEMENTTOREMOVE);\n\t\tmyBrowser.storage.sync.set({[CREDENTIALSNAME]:tab},function(){});\n\t}\n\tdocument.getElementById(NBOFINSTANCE).textContent = \"MISP Instance :\" +tab.length;\n}", "function removeTab(evt){ //accept either the span event object or the panel\n var $span = $(evt.target);\n var panelRef = $span.parent().children(\"a\").attr(\"href\");\n var panelId = panelRef.substr(1);\n destroyChartMap(panelId);\n $(panelRef).remove();\n $span.parent().remove();\n delete panelGraphs[panelId];\n $graphTabs.tabs('refresh'); //tell JQUI to sync up\n if($graphTabs.find(\"li\").length == 0){\n editingPanelId = null; //dissociate the chart from the this edit session\n $(\"#btnEditGraphTop\").attr(\"disabled\",\"disabled\");\n $(\"button.add-to-graph\").attr(\"disabled\",\"disabled\");\n lastTabAnchorClicked.click();\n } else {\n $('#graph-tabs a:last').click();\n }\n $(\"#graph_title\").attr('value','');\n}", "function removeTab(tabs, id)\n{\n\tvar panelId = $(\"a[href='#\" + id + \"']\").closest( \"li\" ).remove().attr( \"aria-controls\" );\n\t$(\"#\"+ id).remove();\n\ttabs.tabs(\"refresh\");\n}", "function deleteEntry(entry){\n ENTRY_LIST.splice(entry.id, 1);\n// after we call the deleteEntry funciton we need to update the Total values again\n updateUI();\n }", "function removeStatus(snapshot) {\r\n $(\"#\" + snapshot.name()).remove();\r\n }", "remove(el) {\n const key = el.target.getAttribute(\"data-key\");\n Storage.removeSavedStops(key);\n el.target.parentNode.remove();\n\n const stops = Storage.getSavedStops();\n if(Object.keys(stops).length === 0) {\n this.renderNoStops();\n }\n }", "function onRemoveRegistrationPanel() {\n thisPresenter.destroy();\n }", "function removeCardFromPage(cardToBeRemoved){\n console.log(cardToBeRemoved);\n sectionRight.removeChild(cardToBeRemoved);\n}", "function loadDashboard(data){\n //set global database\n database = data;\n //hide the login\n screen.remove(login);\n //append the dashboard object to the main screen\n screen.append(dashboard);\n //populate the tables list\n mysqlAssistant.listTables(function(callback){\n //add tables to dashboard list\n \tdashTables.setItems(callback);\n \t//render the dashboard\n screen.render();\n });\n}", "function deleteWorkout(workoutToDelete) {\n // Set the options for the toaster message\n toastr.options = temporaryToast;\n\n // Retrieve the list of workout names to check\n var workoutNames = localStorage.getItem('workoutNames');\n // If the list of workout names already exists\n if (workoutNames) {\n // Parse the JSON data to an array\n var workoutNamesArray = JSON.parse(workoutNames);\n // If the workout is actually a saved workout name delete\n if ($.inArray(workoutToDelete, workoutNamesArray) > -1) {\n workoutNamesArray.remove(workoutToDelete);\n localStorage.setItem('workoutNames', JSON.stringify(workoutNamesArray));\n localStorage.removeItem(workoutToDelete);\n goToPage('main');\n } else {\n toastr.warning('Workout Does Not Exist', 'Unsuccessful');\n }\n } else {\n toastr.warning('Workout Does Not Exist', 'Unsuccessful');\n }\n}", "function destroy() {\n return client\n .delAsync(board);\n }", "function popProfile(to_delete) {\n\n document.getElementById(\"old_profile\").remove();\n\n}", "function deletePanel(url, data) {\n\n return $http({\n url: getURL(url),\n method: \"DELETE\",\n withCredentials: true, // allow passing cookies\n crossDomain: true,\n data: data,\n headers: getHeaderInformation()\n }).then(function (successResponse) {\n return successResponse;\n }, function (failureResponse) {\n return $q.reject(failureResponse);\n });\n }", "function removePart(tool_id) {\n axios.post(props.url + \"/delete?tool_id=\" + tool_id).then((response) => {\n window.location.reload()\n });\n }", "function deleteUseraccount() {\n data = \"name=\" + String($(\".username.act\").html()) + \"^class=User\";\n dbOperations(\"user\", \"delete_operation\", data);\n $(\"li.actparent\").remove();\n $(\"#userhistorypane\").css(\"opacity\", \"0\");\n check_for_active_row(\"username\", \"acc\");\n $(\"#userhistorypane\").animate({\n opacity: 1\n });\n\n}", "function removeGroup() {\n if(group){\n var data = localStorage.getItem(\"groups\");\n if(data && data != null){\n var list = $.parseJSON(data);\n for(var i = 0; i < list.length; i++){\n var g = list[i];\n if(g.id == group.id){\n list.splice(i, 1);\n break;\n }\n }\n localStorage.setItem(\"groups\", JSON.stringify(list));\n $(\"#students-div\").hide();\n\t\t\tgroup = undefined;\n retrieveGroups();\n }\n }else{\n shakeElement(\"minus\");\n }\n}", "function removeShip(ship){\n let shipHTML = document.getElementById(ship.getID());\n shipHTML.remove();\n}", "delete() {\n this.html.remove();\n }", "function deleteFromUI(act) {\n if (screen.width < 560) {\n animate(act, \"bounceOut\");\n setTimeout(() => {\n act.style.display = \"none\";\n }, 1000);\n } else {\n animate(act, \"fadeOutLeft\");\n setTimeout(() => {\n act.style.display = \"none\";\n }, 1000);\n }\n\n displayAlert(\"success\", \"delete successful\");\n }", "function removeArticle(articleId){\n var articleUrl = urlAdress + '/' + articleId + key;\n $.ajax(articleUrl, {\n type: 'DELETE',\n success: function(){ \n /*Set actual page to default first page, remove button for removed article. */\n $lastUsedButton.remove();\n showDefaultPage();\n updateUsedButtonLook($('.menu button:first-child')); \n //window.location.reload(); //alternative, just reload website instead \n },\n error: function(){console.log('Error: could not remove article');}\n });\n }", "function remove()\n{\n // Stop any timers to prevent CPU usage\n // Remove any preferences as needed\n // widget.setPreferenceForKey(null, dashcode.createInstancePreferenceKey(\"your-key\"));\n\n // widget.setPreferenceForKey(null, dashcode.createInstancePreferenceKey(PREF_KEY_NAME));\n widget.setPreferenceForKey(null, PREF_KEY_NAME);\n}", "function removeLeads() {\n localStorage.clear();\n myLeads = [];\n render(myLeads);\n}", "function removeTrain(){\n\tid = $(this).attr(\"key\");\n\tdbRef.child(id).remove(function(error) {\n\t\tif(error)\n\t\t\tconsole.log(\"Uh oh!\");\n\t\telse \n\t\t\tconsole.log(\"Success\");\n\t});\n}", "function eraseturn(){\n\tdelete Turn;\n}", "function deleteActivityLog(obj, id) {\n $(obj).closest(\"li\").remove();\n $.post(\n '/opengraph/deleteActivity',\n {\n id: id\n },\n function() {\n userRailActivityLog(1, 5);\n }\n );\n}", "function delAdmin(N) {\n TempAdmin = N;\n id = obj.admins[TempAdmin]._id;\n llamada(true, \"DELETE\", \"https://lanbide-node.herokuapp.com/admins/\" + id, \"JSON\");\n}", "function deleteblogrecoed(jah){\n\t//var deleteref = firebase.database().ref().child('/transportation/' + u).child(key);\n\n\twindow.alert(jah);\n\treturn jah.remove();\n\t\n\n}", "function deleteDds(id){\n\tlet tokenId = window.localStorage.getItem('code');\n\t$.ajax({ \n type: \"DELETE\",\n contentType: \"application/json\",\n\t\t\t headers :{\n\t\t\t\t \"Authorization\": 'Bearer '+tokenId\n\t\t\t },\n url: \"http://localhost:8080/Bacheca/api/board/DDS/\"+id,\n success: function(dati){\n\t\t\t\tlocation.reload();\n },\n error: function (xhr, ajaxOptions, thrownError) {\n \t\t switch(xhr.status) {\n \t\t\t case 401: {\n \t\t\t \twindow.alert(\"Non si è autorizzati ad eseguire questa operazione.\");\n \t\t\t \twindow.location = \"index.html\";\n \t\t\t \tbreak;\n \t\t\t }\n \t\t\t case 404: {\n \t\t\t \twindow.alert(\"Nessuna informazione trovata!\");\n \t\t\t \tbreak;\n \t\t\t }\n \t\t\t case 409: {\n \t\t\t \twindow.alert(\"Informazione duplicata!\");\n \t\t\t \tbreak;\n \t\t\t }\n \t\t\t default: {\n \t\t\t \twindow.alert(thrownError);\n \t\t\t }\n \t\t }\t\t \n \t\t }\n });\n}", "function deleteBoard() {\n if(document.getElementById('board').children) {\n for (let i=0; i<rows; i++){\n for (let j=0; j< cols; j++){\n let id = i + '_' + j;\n let el = document.getElementById(id);\n board.removeChild(el);\n }\n }\n }\n \n}", "function del (dept){\n if (dept != 0){\n fetch(`${url}/${dept}`,{\n method: 'DELETE',\n })\n .then(() => location.reload())\n .catch((error)=>{\n console.log(error);\n }) \n }else{\n console.log ('Button not Click Yet.')\n }\n}", "remover(id) {\n localStorage.removeItem(id)\n }", "function deleteOverlays() {\n clearOverlays();\n }", "function deleteEntry(id) {\n // create ajax DELETE call hold id from entries\n $.ajax({\n type: \"DELETE\",\n url: `/api/entries/${id}`,\n dataType: \"json\",\n contentType: \"application/json\",\n headers: {\n Authorization: `Bearer ${jwt}`\n }\n })\n //if call is succefull\n .done(function() {\n console.log(\"Deleting entry\");\n // call get user dashboard function\n getUserDashboard();\n })\n //if the call is failing\n .fail(function(jqXHR, error, errorThrown) {\n console.log(jqXHR);\n console.log(error);\n console.log(errorThrown);\n });\n}", "function deleteWidget(widgetId) {\n var widget = findWidgetById(widgetId);\n var index = widgets.indexOf(widget);\n widgets.splice(index, 1);\n }", "function removeToolbarButton() {\t\r\n\tvar navBar = document.getElementById('nav-bar');\r\n\tvar btn = document.getElementById('reportButton');\r\n\tif (navBar && btn) {\r\n\t\tnavBar.removeChild(btn);\r\n\t}\r\n}", "delete() {\n $(`#${this.idDOM}`).remove();\n }", "function deleteRow() {\n if (this.output_displayed) {\n document.getElementById(\"OUTPUT\").innerHTML = \"\";\n this.output_displayed = false;\n }\n var table = document.getElementById(\"schedule-table\");\n let name = this.name;\n let row = parseInt(name.substring(3));\n table.deleteRow(row);\n del_rows.splice(row-1, 1);\n\n updateIDs(row);\n updateRowDelIndexes(row);\n current_row -= 1;\n\n}", "function delReview(argument) {\n console.log(argument);\n var ref = new Firebase(\"https://nss-jer-trippin.firebaseio.com/trips/\" + argument);\n ref.remove();\n location.reload();\n }", "function newDashboard() {\r\n\t\t\treturn $izendaRsQuery.query('newcrs', ['DashboardDesigner'], {\r\n\t\t\t\tdataType: 'json'\r\n\t\t\t},\r\n\t\t\t// custom error handler:\r\n\t\t\t{\r\n\t\t\t\thandler: function () {\r\n\t\t\t\t\treturn 'Failed to create new dashboard';\r\n\t\t\t\t},\r\n\t\t\t\tparams: []\r\n\t\t\t});\r\n\t\t}", "remove(paladinID) {\n const palList = STATE.PaladinList.get();\n const index = palList.findIndex(pID => { return pID === paladinID; });\n if (index !== -1) {\n palList.splice(index, 1);\n STATE.PaladinList.set(palList);\n // // Remove the token's character's paladin abilities\n // const tokenObj = STATE.get('TokenList', paladinID) as TokenObj | undefined;\n // if (tokenObj !== undefined && tokenObj.characterID !== undefined) {\n // const abilities = findObjs({\n // _type: 'ability',\n // _characterid: paladinID,\n // }) as Ability[];\n // const abilitiesToRemove = abilities.filter(a => {\n // return Paladin.paladinAbilities().some(b => { return b[0] === a.get('name'); });\n // });\n // abilitiesToRemove.forEach(a => {\n // a.remove();\n // });\n // }\n }\n }", "function Delete(shoot){\n \n $.ajax({\n type: \"POST\",\n url: \"/delete\",\n data : {\n shoot: shoot\n },\n cache: false,\n }).done(function( data ) {\n M.toast({html: \"Shooting deleted.\"});\n var element = $('*[data-name=\"'+shoot+'\"]');\n element.css(\"background-color\",\"red\")\n element.hide();\n element.remove();\n });\n \n}", "function deleteRoomList(data) {\r\n let n = roomsName.indexOf(data);\r\n roomsName.splice(n, 1);\r\n rooms.splice(n, 1);\r\n console.log(rooms);\r\n let room = select(`#${data}`);\r\n room.remove();\r\n}", "function devConsoleDestory() {\n gsap.timeline()\n .to('#dev-console-area', {duration: .375, ease: 'power2.inOut', background: 'rgba(29, 29, 29, 0)'})\n .to('.central-content', {duration: .375, ease: 'power2.inOut', filter: 'blur(0px)'}, '-.375')\n .to('#title-wrapper', {duration: .375, ease: 'power2.inOut', filter: 'blur(0px)'}, '-.375')\n .to('.cta-wrapper', {duration: .375, ease: 'power2.inOut', filter: 'blur(0px)'}, '-.375')\n .to('.border-content', {duration: .375, ease: 'power2.inOut', filter: 'blur(0px)'}, '-.375')\n .to('#stroke-title', {duration: .375, ease: 'power2.inOut', filter: 'blur(0px)'}, '-.375')\n .to('.footer', {duration: .375, ease: 'power2.inOut', filter: 'blur(0px)'}, '-.375')\n .call(removeElement, [\"#dev-console-area\"])\n}", "static async deleteMaintab(maintabId, user) {\n\n const query = `\n DELETE FROM main_tabs\n WHERE main_tabs.id = $1 AND main_tabs.user_id = (SELECT id FROM users WHERE email=$2);\n `\n const result = await db.query(query, [maintabId, user.email]);\n\n return result.rows[0];\n }", "remove() {\n this._legacyOnly('remove', Messages.STOP_RENDERING);\n\n const {parent} = this;\n\n if (!parent) {\n return;\n }\n\n unmountComponentAtNode(parent);\n\n if (parent.parentNode) {\n parent.parentNode.removeChild(parent);\n }\n }", "function createDashboard() {\n var newDashboard = {};\n newDashboard.name = \"New Dashboard\";\n newDashboard.description = \"New Dashboard Description\";\n newDashboard.organisationId = null;\n newDashboard.createdBy = null;\n newDashboard.type = \"private\";\n newDashboard.widgets = [];\n newDashboard.homepage = false;\n newDashboard.backgroundColor = \"#FFFFFF\";\n newDashboard.widgetSpacing = 2;\n newDashboard.options = {\n columns: 15, // the width of the grid, in columns\n rows: 10, // the width of the grid, in columns\n pushing: true, // whether to push other items out of the way on move or resize\n floating: true, // whether to automatically float items up so they stack (you can temporarily disable if you are adding unsorted items with ng-repeat)\n swapping: true, // whether or not to have items of the same size switch places instead of pushing down if they are the same size\n width: 'auto', // can be an integer or 'auto'. 'auto' scales gridster to be the full width of its containing element\n colWidth: 'auto', // can be an integer or 'auto'. 'auto' uses the pixel width of the element divided by 'columns'\n //rowHeight: 'match', // can be an integer or 'match'. Match uses the colWidth, giving you square widgets.\n margins: [2, 2], // the pixel distance between each widget\n outerMargin: true, // whether margins apply to outer edges of the grid\n sparse: true, // \"true\" can increase performance of dragging and resizing for big grid (e.g. 20x50)\n isMobile: false, // stacks the grid items if true\n mobileBreakPoint: 600, // if the screen is not wider that this, remove the grid layout and stack the items\n mobileModeEnabled: true, // whether or not to toggle mobile mode when screen width is less than mobileBreakPoint\n minColumns: 1, // the minimum columns the grid must have\n minRows: 2, // the minimum height of the grid, in rows\n maxRows: 100,\n defaultSizeX: 1, // the default width of a gridster item, if not specifed\n defaultSizeY: 1, // the default height of a gridster item, if not specified\n minSizeX: 1, // minimum column width of an item\n maxSizeX: null, // maximum column width of an item\n minSizeY: 1, // minumum row height of an item\n maxSizeY: null, // maximum row height of an item\n resizable: {\n enabled: true,\n handles: ['n', 'e', 's', 'w', 'ne', 'se', 'sw', 'nw'],\n start: function (event, $element, widget) { console.log('resize-start'); console.log(widget); console.log($element); }, // optional callback fired when resize is started,\n resize: function (event, $element, widget) { console.log('resize'); console.log(widget); console.log($element); }, // optional callback fired when item is resized,\n stop: function (event, $element, widget) { console.log('resize-stop'); console.log(widget); console.log($element); } // optional callback fired when item is finished resizing\n },\n draggable: {\n enabled: true, // whether dragging items is supported\n // handle: '.my-class', // optional selector for drag handle\n start: function (event, $element, widget) { console.log('drag-start'); console.log(widget); console.log($element); }, // optional callback fired when drag is started,\n drag: function (event, $element, widget) { console.log('drag'); console.log(widget); console.log($element); }, // optional callback fired when item is moved,\n stop: function (event, $element, widget) { console.log('drag-stop'); console.log(widget); console.log($element); } // optional callback fired when item is finished dragging\n }\n\n };\n return newDashboard;\n }", "removePodcast(e){\n let id = e.target.id\n console.log(id)\n let podcast = JSON.parse(localStorage.getItem('podcast'));\n for (let c = 0 ; c < podcast.result.length ;c++){\n if(podcast.result[c].name === id){\n podcast.result.splice(c,1)\n }\n }\n localStorage.setItem('podcast',JSON.stringify(podcast))\n window.location.href= '/display/my%20list'\n }", "function deleteTool(id) {\n return db('tools')\n .where('id', id)\n .del()\n}", "function deleteRun(id, type) {\n\tvar row = $(\"#\" + id);\n\tblockUi(true);\n\t\n\tfunction complete() {\n\t\trow.hide();\n\t\tdoTableJqueryEvents();\n\t\tif (type == \"patient\") {\n\t\t\tvar url = \"/skills-tracker/shifts/delete-patient\";\n\t\t\tvar data = { \"patientId\" : id };\n\t\t} else {\n\t\t\tvar url = \"/skills-tracker/shifts/delete-run\";\t\t\t\n\t\t\tvar data = { \"runId\" : id };\n\t\t}\n\t\t\n\t\t$.post(url, data,\n\t\t\t function(response) {\n\t\t\t\t\tvar message = $(\"<tr><td colspan='7' class='undo'>\" + response + \"</td></tr>\");\n\t\t\t\t\t//$(\"#shift-list-messages\").html(message.hide().fadeIn(1000));\n\t\t\t\t\trow.before(message.fadeIn(1000));\n\t\t\t\t\n\t\t\t\t\t//var message = $(response);\n\t\t\t\t\t//$(\"#run-list-messages\").html(message.hide().fadeIn(1000));\n\t\t\t\t\t$('#undo-delete-' + id).click(function(event) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tundoDeleteRun(id, type);\n\t\t\t\t\t});\n\t\t\t\t\tblockUi(false);\n\t\t\t\t},\n\t\t\t\t'json');\n\t}\n\t\n\trow.fadeOut(1000, complete);\n}", "remove(runnerId, raceId){\n\n return removerunner.delete({idRacer:raceId,idRunner: parseInt(runnerId)}, {})\n }", "function remove(id, divForTask) {\n let deleteButton = document.createElement(\"div\");\n deleteButton.classList.add(\"exitbutton\");\n divForTask.appendChild(deleteButton);\n let exit1 = document.createElement(\"div\");\n let exit2 = document.createElement(\"div\");\n exit1.classList.add(\"exit1\");\n exit2.classList.add(\"exit2\");\n\n deleteButton.appendChild(exit1);\n deleteButton.appendChild(exit2);\n deleteButton.addEventListener(\"click\", function() {\n if (confirm('Czy chcesz usunąć tę notatkę?')) {\n localStorage.removeItem(id);\n location.reload();\n }\n })\n}", "async function deletePerformance(){\n\n let response = await airshot.process('performance','remove','post',{\n sheet_ID : sheet_ID\n });\n\n console.log(response);\n\n }" ]
[ "0.7051651", "0.6123528", "0.6077937", "0.5962638", "0.5910711", "0.5885954", "0.5751077", "0.57187843", "0.56767976", "0.5627682", "0.56218934", "0.5583366", "0.5539705", "0.5539109", "0.5530348", "0.5530348", "0.5527614", "0.55030346", "0.5488734", "0.5474143", "0.5470423", "0.54630035", "0.5456363", "0.54410166", "0.5433523", "0.54250664", "0.54194885", "0.5405848", "0.539982", "0.5397897", "0.53939855", "0.53938735", "0.53775966", "0.5374409", "0.5358403", "0.53507435", "0.5343969", "0.53373754", "0.53234404", "0.5318682", "0.5318225", "0.5318225", "0.5313362", "0.53125095", "0.5309362", "0.53092796", "0.52961206", "0.5295875", "0.5288763", "0.5258981", "0.5257851", "0.5252592", "0.5245166", "0.5232997", "0.52311003", "0.5211001", "0.52083606", "0.5207278", "0.52055675", "0.52008885", "0.51962775", "0.51882577", "0.51858425", "0.5185322", "0.5174854", "0.5171346", "0.5163341", "0.51482004", "0.5140315", "0.5132438", "0.51248634", "0.51228774", "0.5120433", "0.5118786", "0.5116916", "0.5110097", "0.51042664", "0.510381", "0.5102255", "0.5101318", "0.51006156", "0.5099992", "0.5091385", "0.50897896", "0.5081231", "0.50732833", "0.5072772", "0.50719774", "0.5071293", "0.50705284", "0.5069902", "0.50695026", "0.50643545", "0.5064308", "0.5064052", "0.5063876", "0.5058962", "0.5058187", "0.50571156", "0.5052314" ]
0.74165434
0
This function update a dashboard.
static async updateDashboard(email, dashboardID, fields, data) { data = data.map((item, i) => (i < fields.length && fields[i] === 'metadata' ? JSON.stringify(item) : item)); return new Promise((resolve, reject) => { Database.sendQuery(`UPDATE Dashboard SET ${fieldUpdates(fields, data, 2)} WHERE ( email = $1 ) AND ( ID = $2) RETURNING *;`, [email, dashboardID, ...data]) .then((result) => { // console.log(result); if (result.rows.length > 0) resolve(result.rows[0]); else reject(result); }) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateDashboard() {\n request\n .get(\"https://dsrealtimefeed.herokuapp.com/\")\n .end(function(res) {\n console.log(\"Pinged Dashboard, \" + res.status)\n if(res.status != 200) {\n stathat.trackEZCount(config.STATHAT, 'dsrealtime-feed-cant_ping', 1, function(status, response){});\n }\n });\n}", "function updateDashboard() {\n\t\n\t// speed\n\tif (speed < 10) {\n\t\tspeedData = '0' + speed;\n\t} else {\n\t\tspeedData = speed;\n\t}\n\n\t$(\"#kmh\").data(\"kendoRadialGauge\").value(speedData);\n\t$('#speedRT').text(speedData); \n\t\n\t\n\t// rpm\n\tvar dRpm = rpm / 1000.0;\n\t$(\"#rpm\").data(\"kendoRadialGauge\").value(dRpm);\t\n\t\n\t// lights\n\tif(light == 0) {\n\t\theadlampOff();\n\t}\n\telse {\n\t\theadlampOn(light);\n\t}\n\t\n\t// gear\n\tsetGear(gear);\n\t\n\t// door\n\tif(door == 0){\n\t\tcloseDoors()\n\t}\n\telse{\n\t\topenDoor(door);\t\n\t}\n\t\n\t\n\t// brake\n\tif(brake == 0) {\n\t\tbrakeOff();\n\t}\n\telse {\n\t\tbrakeOn();\n\t}\n\t\n\t// turn\n\tif(turn > 0){\n\t\tturnOn()\n\t}\n\telse {\n\t\tturnOff();\n\t}\n\t\n\t\n\t// fuel levels\n\t\n\t\n\t// temperature\n}", "function dashboardUpdateAll() {\n\t\tdashboardSet('stars', whiteStar + whiteStar + whiteStar);\n\t\tdashboardSet('tally', 0);\n\t\tdashboardSet('reset', semicircleArrow);\n\t\tdocument.getElementsByClassName('current-timer')[0].innerHTML = \"00:00\";\n}", "function updateDashboardData(type,value) {\n $(\"#\"+type+\"-var\").text(value);\n console.log(\"Updated \"+type+\" value\");\n}", "function updateDashboard() {\n setGraph1();\n setGraph2();\n setGraph3();\n}", "function reRenderDashboard() {\n body.innerHTML = renderDashboardDiv(dashboardCaption,\n notesToLinks, notesCaption,\n notesItems, buttonClass);\n }", "async function updateDashboardPlots() {\r\n\tawait createDashboardPlot();\r\n}", "function getNewDashboardData() {\n $.ajax({\n url: '/dashboard/json/',\n dataType: 'json',\n success: refreshDashboard_cb\n });\n}", "function adminUpdate(data) {\n\t\t\t\n\t\t\t\n\t\t}", "function reflowDashboard() {\n loadDashboard(true);\n adjustHeight();\n }", "function update()\n\t{\n\t setNavBarState({buttonDisabled: true});\n\t\t\n\t fetch('/api/get_script_status').then(res => res.json()).then(data => {\n\n\t\t//If our script is not currently \"Running\", then we start it.\n\t if (data.hasOwnProperty('status') === false || data[0]['status'] !== \"Running\" ) {\n\t\t setNavBarState({chipColor: \"yellow\", buttonDisabled: true, chipDisplay: \"inline\"});\n\t\t fetch('/api/update_data');\n\t\t}});\n\t}", "function showAdminDashboard() {\n $.dashboard.setWidth('95%');\n $.dashboard.setHeight('93%');\n $.dashboard.setTop('5%');\n $.dashboard.setBottom('5%');\n $.dashboard.setRight('3%');\n $.dashboard.setLeft(20);\n $.dashboard.setOpacity('1.0');\n $.dashboard_container.setHeight(Ti.UI.FILL);\n $.dashboard_container.setWidth(Ti.UI.FILL);\n handlePageSelection({\n page : 'configurations'\n });\n}", "function dashboardSet(dashboardClass, value) {\n\n// example of try..catch to show that I know about it\ntry {\n\n\t\tlet dashboardElement = retrieveFirstClassValue(dashboardClass);\n\t\tdashboardElement.innerHTML = ' ';\n\t\tdashboardElement.innerHTML = value;\n\t}\n\tcatch(err) {\n\t\tcleanUpandExit(\"??? Unable to find the '\" + dashboardClass + \"' class\", err);\n\t}\n}", "function updateDashboard(json) {\n\n //var widgets = xml.getElementsByTagName(\"widget\");\n var widgets = json.widgets;\n\n document.getElementById(\"dashboard\").innerHTML = \"\";\n document.getElementById(\"scripts\").innerHTML = \"\";\n\n for (var i = 0; i < widgets.length; i++) {\n\n\n document.getElementById(\"dashboard\").innerHTML += widgets[i].html;\n\n\n var js = widgets[i].script;\n if (js != null) {\n var script = document.createElement(\"script\");\n script.src = js;\n script.type = \"text/javascript\";\n document.getElementById(\"scripts\").appendChild(script);\n }\n }\n\n}", "function updateFirstLoadDashboard(){\n getloadModal().then(function(response){\n /*Se valida la existencia del jsonStore*/\n if(response[0].json.data && typeof response[0].json.data.loadModal !== 'undefined'){\n\n /*Se valida si el paseo ya se ha visto*/\n if(response[0].json.data.loadModal === null && $scope.userApp.state === configProvider.userStates.enroll){\n response[0].json.data.loadModal = false;\n jsonStore.replace(response).then(function() {\n loadBalance();\n }, function() {\n self.getBalance();\n self.firstLoadDashboard = false;\n errorManager.showAsyncMessage(messagesProvider.generalActions.errorOnFailure);\n });\n } else {\n self.getBalance();\n self.firstLoadDashboard = false;\n /*Llamar función para validar si es el primer pago del usuario enrolado*/\n validateFirstEnrollmentPayment();\n }\n\n } else {\n self.getBalance();\n self.firstLoadDashboard = false;\n /*Llamar función para validar si es el primer pago del usuario enrolado*/\n validateFirstEnrollmentPayment();\n }\n }, function(){\n self.getBalance();\n self.firstLoadDashboard = false;\n /*Llamar función para validar si es el primer pago del usuario enrolado*/\n validateFirstEnrollmentPayment();\n errorManager.showAsyncMessage(messagesProvider.generalActions.errorOnFailure);\n });\n\n }", "function updateScreen(){\n\tconsole.log(\"update screen\");\n\tObject.keys(state.stops).forEach(function(item){\n\t\tgetDataFromApi(item.substring(2), updateData);\n\t});\n\tdisplayData();\n}", "function loadDashboard(data){\n //set global database\n database = data;\n //hide the login\n screen.remove(login);\n //append the dashboard object to the main screen\n screen.append(dashboard);\n //populate the tables list\n mysqlAssistant.listTables(function(callback){\n //add tables to dashboard list\n \tdashTables.setItems(callback);\n \t//render the dashboard\n screen.render();\n });\n}", "function showDashboard() {\n var pageContentWrapper = $('#page-content-wrapper');\n pageContentWrapper.html(\"Dashboard contents\");\n}", "function saveDashboard(dashboard){\n console.log(dashboard.toSource());\n /*\n $http.get(serverURL+'/user/dashboard').\n then(function(data) {\n //sth\n }).catch(function(data) {\n alert('服务器异常,保存失败');\n });\n */\n }", "function update_page() {\n // gets local json file\n /*global $*/\n /*global ODS_api*/\n \n // update Permit and Transit info\n update_permits();\n \n // update items info\n update_items();\n \n // update Open Data info\n update_od_police();\n \n // update Transit info\n update_transit();\n \n // update website info\n update_site_data();\n \n // display updated date\n var d = new Date();\n var offset = -300;\n var estDate = new Date(d.getTime() + offset*60*1000);\n var uDate = estDate.toUTCString().replace('GMT', '');\n $('#stamp').text('Updated: ' + uDate + ' - Prototype - Revision 1');\n}", "update(req, res) {\n logging.logTheinfo(\"widgets index Router\");\n res.status(200).send(\"update\");\n\n }", "function updateDashboard(disp, requestUrl, callback) {\n\t// HN API: news\n\tvar req = https.get(hnapi.topstories, function(res) {\n var responseString = '';\n \n // Buffer the body entirely for processing as a whole\n res.on('data', function(data) {\n \t//console.log(responseString);\n responseString += data;\n });\n\n res.on('end', function() {\n callback(responseString, disp);\n });\n });\n\n req.on('error', function(e) {\n //console.log('problem with request' + e.message);\n });\n req.end();\n}", "function update(data) {\n console.log('+++ TODO');\n }", "function switchDashboard(url, alias) {\n $app.model.toDashboard.url = url;\n $app.model.m.siteAlias = alias === 'Hub' ? '' : alias;\n clearCache();\n $location.url(\"/diagnostic/summary\");\n }", "function updateStats() {\n\t$(\"#stats\").text(JSON.stringify(ozpIwc.metrics.toJson(),null,2));\n}", "function updateDash(){\n scoreDash.innerHTML = player.score;\n lifeDash.innerHTML = player.lives;\n speedDash.innerHTML = Math.round(player.speed*13);\n}", "function updateroster() {\n\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 }", "updateReport() {\n location.reload();\n }", "function update() {}", "function update() {\n updateMonthly(calculateMonthlyPayment(getCurrentUIValues()));\n}", "function initAdminDashboard () {\n // Set up the lobby table\n var lobbyTable = $('#bb-lobby-table').DataTable({\n // Sort by status, then by id\n 'order': [\n [6, 'asc'],\n [0, 'asc']\n ],\n \n 'ajax': '/app-data/lobbies/' + tourneyName,\n \n 'columns': [\n {\n 'data': 'id',\n 'responsivePriority': 1\n },\n \n {\n 'data': 't1Name',\n 'type': 'anti-empty',\n 'responsivePriority': 3\n },\n \n {\n 'data': 't2Name',\n 'type': 'anti-empty',\n 'responsivePriority': 3\n },\n \n { 'data': 'score' },\n \n {\n 'data': 'room',\n 'type': 'anti-empty'\n },\n \n // Special rendering for time formatting\n { \n 'data': 'startTime',\n 'render': function (data, type, full, meta) {\n switch (type) {\n case 'type':\n return 'date';\n \n default:\n return data == ''\n ? 'N/A'\n : getTimerString(new Date(new Date() - new Date(data)));\n }\n },\n 'responsivePriority': 4\n },\n \n // Special rendering for colors and icons\n { \n 'data': 'status',\n 'render': function (data, type, full, meta) {\n switch (type) {\n case 'display':\n return formatLobbyStatus(data);\n \n case 'sort':\n return data.sort;\n \n case 'type':\n return 'string';\n \n default:\n return data.display;\n }\n },\n 'responsivePriority': 2\n }\n ]\n });\n \n // Set up the team table\n var teamTable = $('#bb-team-table').DataTable({\n 'ajax': '/app-data/teams/' + tourneyName,\n \n 'columns': [\n { 'data': 'seed' },\n { 'data': 'name' },\n \n // Special rendering for label coloring\n {\n 'data': 'online',\n 'render': function(data, type, full, meta) {\n switch (type) {\n case 'display':\n return formatTeamOnline(data);\n \n case 'type':\n return 'string';\n \n default:\n return data;\n }\n }\n },\n \n // Special rendering for colors and icons\n {\n 'data': 'status',\n 'render': function(data, type, full, meta) {\n switch (type) {\n case 'display':\n return formatTeamStatus(data);\n \n case 'type':\n return 'string';\n \n default:\n return data.display;\n }\n }\n }\n ]\n });\n \n // When tabs are switched, we need to recalculate the responsize table's width since it was hidden before\n $('#bb-admin-dash-tables').on('shown.bs.tab', function(e) {\n $(this).find('.table').DataTable().responsive.recalc();\n });\n \n // Refresh tables periodically\n tableRefresh = setInterval(function() {\n lobbyTable.ajax.reload(null, false); // Don't reset paging\n teamTable.ajax.reload(null, false);\n }, 5000);\n \n // Called when the inner page content is removed to load a new page.\n $('.content').on('destroy', function() {\n window.clearInterval(tableRefresh);\n });\n}", "update(){}", "update(){}", "update(){}", "updateSoho() {\n this.applicationmenu.updated();\n }", "function update(obj){\n\n\t\tif (obj === \"guests\") {\n\t\t\tloadNbGuests();\n\n\t\t}\n\n\t\tloadMenuOverview()\n\t}", "function periodicUpdate() {\n // Increment update counter.\n updateCount += 1;\n \n // If the page has been loaded recently, initialize.\n if (updateCount < 3) {\n getData('sys/model', function(data) { updateElement('device-model', data.toString()); });\n getData('sys/os', function(data) { updateElement('device-os', data.toString()); });\n getData('ram/total', function(data) { updateElement('ram-total', Math.round(parseInt(data))); });\n getData('fs/0/total', function(data) { updateElement('disk-total', Math.round(parseInt(data))); });\n }\n \n if (serverOnline()) {\n // Server is online, update dash.\n \n $('#connection-online').removeClass('hidden');\n $('#connection-offline').addClass('hidden');\n\n if(!uptimeInterval) {\n getData('uptime', function(data) { initUptimeInterval(data); });\n }\n \n getData('cpu/temp', function(data) { updateElement('cpu-temp', Math.round(parseInt(data))); });\n getData('cpu/usage', function(data) { updateElement('cpu-usage', Math.round(parseInt(data))); });\n \n getData('ram/usage', function(data) { updateElement('ram-usage', Math.round(parseInt(data))); });\n getData('ram/used', function(data) { updateElement('ram-used', Math.round(parseInt(data))); });\n \n getData('fs/0/usage', function(data) { updateElement('disk-usage', Math.round(parseInt(data))); });\n getData('fs/0/used', function(data) { updateElement('disk-used', Math.round(parseInt(data))); });\n\n getData('network/transmit/eth0', function(data) { updateElement('network-transmit-eth0', Math.round(parseInt(data))); });\n getData('network/receive/eth0', function(data) { updateElement('network-receive-eth0', Math.round(parseInt(data))); });\n\n getData('network/transmit/wlan0', function(data) { updateElement('network-transmit-wlan0', Math.round(parseInt(data))); });\n getData('network/receive/wlan0', function(data) { updateElement('network-receive-wlan0', Math.round(parseInt(data))); });\n\n } else {\n // Server is offline, clear dash.\n \n $('#connection-online').addClass('hidden');\n $('#connection-offline').removeClass('hidden');\n\n window.clearInterval(uptimeInterval);\n uptimeInterval = undefined;\n updateElement('server-uptime', '00:00:00');\n \n updateElement('cpu-temp', 0);\n updateElement('cpu-usage', 0);\n \n updateElement('ram-usage', 0);\n updateElement('ram-used', 0);\n \n updateElement('disk-usage', 0);\n updateElement('disk-used', 0);\n\n updateElement('network-transmit-eth0', 0);\n updateElement('network-receive-eth0', 0);\n\n updateElement('network-transmit-wlan0', 0);\n updateElement('network-receive-wlan0', 0);\n\n }\n}", "function updatePage(json) {\n\tloadPage(json);\n\trefreshPersonalizedSchedule(json);\n}", "updateProfile() {}", "function createDashboard() {\n var newDashboard = {};\n newDashboard.name = \"New Dashboard\";\n newDashboard.description = \"New Dashboard Description\";\n newDashboard.organisationId = null;\n newDashboard.createdBy = null;\n newDashboard.type = \"private\";\n newDashboard.widgets = [];\n newDashboard.homepage = false;\n newDashboard.backgroundColor = \"#FFFFFF\";\n newDashboard.widgetSpacing = 2;\n newDashboard.options = {\n columns: 15, // the width of the grid, in columns\n rows: 10, // the width of the grid, in columns\n pushing: true, // whether to push other items out of the way on move or resize\n floating: true, // whether to automatically float items up so they stack (you can temporarily disable if you are adding unsorted items with ng-repeat)\n swapping: true, // whether or not to have items of the same size switch places instead of pushing down if they are the same size\n width: 'auto', // can be an integer or 'auto'. 'auto' scales gridster to be the full width of its containing element\n colWidth: 'auto', // can be an integer or 'auto'. 'auto' uses the pixel width of the element divided by 'columns'\n //rowHeight: 'match', // can be an integer or 'match'. Match uses the colWidth, giving you square widgets.\n margins: [2, 2], // the pixel distance between each widget\n outerMargin: true, // whether margins apply to outer edges of the grid\n sparse: true, // \"true\" can increase performance of dragging and resizing for big grid (e.g. 20x50)\n isMobile: false, // stacks the grid items if true\n mobileBreakPoint: 600, // if the screen is not wider that this, remove the grid layout and stack the items\n mobileModeEnabled: true, // whether or not to toggle mobile mode when screen width is less than mobileBreakPoint\n minColumns: 1, // the minimum columns the grid must have\n minRows: 2, // the minimum height of the grid, in rows\n maxRows: 100,\n defaultSizeX: 1, // the default width of a gridster item, if not specifed\n defaultSizeY: 1, // the default height of a gridster item, if not specified\n minSizeX: 1, // minimum column width of an item\n maxSizeX: null, // maximum column width of an item\n minSizeY: 1, // minumum row height of an item\n maxSizeY: null, // maximum row height of an item\n resizable: {\n enabled: true,\n handles: ['n', 'e', 's', 'w', 'ne', 'se', 'sw', 'nw'],\n start: function (event, $element, widget) { console.log('resize-start'); console.log(widget); console.log($element); }, // optional callback fired when resize is started,\n resize: function (event, $element, widget) { console.log('resize'); console.log(widget); console.log($element); }, // optional callback fired when item is resized,\n stop: function (event, $element, widget) { console.log('resize-stop'); console.log(widget); console.log($element); } // optional callback fired when item is finished resizing\n },\n draggable: {\n enabled: true, // whether dragging items is supported\n // handle: '.my-class', // optional selector for drag handle\n start: function (event, $element, widget) { console.log('drag-start'); console.log(widget); console.log($element); }, // optional callback fired when drag is started,\n drag: function (event, $element, widget) { console.log('drag'); console.log(widget); console.log($element); }, // optional callback fired when item is moved,\n stop: function (event, $element, widget) { console.log('drag-stop'); console.log(widget); console.log($element); } // optional callback fired when item is finished dragging\n }\n\n };\n return newDashboard;\n }", "function update() {\n updateGym(id, name, address1, address2, town, county, openingHours)\n .then(() => {\n alert(\"Gym Information updated!\");\n })\n .catch((error) => {\n alert(error.message);\n });\n }", "function update() {\n getCurrentUIValues();\n calculateMonthlyPayment(UIValues);\n updateMonthly();\n}", "function Customize_Dashboard_Layout(dashboard_id) {\n $.ajax({\n url: '../Dashboard/Customize_Dashboard_Layout',\n //data: { 'dashboard_Id': dashboard_id },\n type: \"GET\",\n dataType: \"html\",\n cache: false,\n success: function (data) {\n $('#customize_layout').html(data); //write the dialog content into the diaog container\n //set the dahboard_id in the hiddin field\n $(\"#Dashboard_Id\").val(dashboard_id);\n },\n error: function (xhr, ajaxOptions, thrownError) {\n alert('Error');\n }\n });\n}", "function update() {\n //Location.reload() method reloads the current URL, like the Refresh button.\n document.location.reload()\n}", "function newDashboard() {\r\n\t\t\treturn $izendaRsQuery.query('newcrs', ['DashboardDesigner'], {\r\n\t\t\t\tdataType: 'json'\r\n\t\t\t},\r\n\t\t\t// custom error handler:\r\n\t\t\t{\r\n\t\t\t\thandler: function () {\r\n\t\t\t\t\treturn 'Failed to create new dashboard';\r\n\t\t\t\t},\r\n\t\t\t\tparams: []\r\n\t\t\t});\r\n\t\t}", "function save(dashboard, filename){\n return createContent(dashboard, filename).then( function(content){\n console.log('Saving dashboard to '+ filename);\n console.log('Content dump:' + content.cdfstructure);\n\n var saveDashboardUrl = CONTEXT_PATH + 'plugin/pentaho-cdf-dd/api/syncronizer/saveDashboard';\n var successFunction = function(result){\n if (result && result.status == \"true\") {\n console.log(\"Dashboard saved successfully\");\n } else {\n console.log(\"Errors saving file: \" + result.result);\n }\n return result;\n };\n return submitForm(saveDashboardUrl, content, JSON.parse).then( successFunction );\n });\n\n }", "function updateReport(report) {\n $.ajax({\n method: \"PUT\",\n url: \"/api/reports\",\n data: report\n })\n .then(function() {\n window.location.href = \"/blog\";\n });\n }", "function updateActivity(id)\n{\n var index = findClientByID(id);\n clients[index].lastActivity = timestamp.timestamp();\n refreshClients();\n}", "function updateDashboard(view) {\n const viewModel = { \n ...state.account,\n formattedBalance: state.account.balance.toFixed(2)\n };\n \n bind(view, viewModel);\n \n const template = document.getElementById('transaction');\n const table = view.querySelector(\"tbody\");\n \n for (let transaction of state.account.transactions) {\n const row = template.content.cloneNode(true);\n const viewModel = { \n ...transaction, \n formattedAmount: transaction.amount.toFixed(2) \n };\n \n bind(row, viewModel);\n table.append(row);\n }\n \n}", "updateBoard(log) {\n const message = {\n key: \"boardUpdate\",\n data: {\n turnCounter: this.yinsh.turnCounter,\n board: this.yinsh.getBoardJSON(),\n log,\n }\n };\n this.messagePlayers(message);\n }", "function Dashboard(url, params) {\n if (url instanceof db.Dashboard.DAO) {\n this.persistent = url;\n } else {\n params = params || {};\n this.persistent = db.Dashboard.build({\n url: url,\n description: params.description,\n timeout: params.timeout,\n delay: params.delay,\n viewport: params.viewport,\n availability: params.availability\n });\n }\n}", "function fill_admin_status(data) {\n if (!data[\"LoggedIn\"]) {\n vis_off(\"mainarea\");\n vis_on(\"loginarea\");\n return;\n }\n vis_on(\"mainarea\");\n vis_off(\"loginarea\");\n var nredhits = data[\"redhits\"];\n var nbluehits = data[\"bluehits\"];\n set_value(\"redscore\", nredhits);\n set_value(\"bluescore\", nbluehits);\n set_value(\"gamestatusmsg\", data[\"gamestatusmsg\"]);\n set_value(\"gamemodediv\", data[\"gamemode\"]);\n set_value(\"clockdiv\", data[\"clock\"]);\n set_indicator_color(\"mover1indicator\", data[\"mover1\"]);\n set_indicator_color(\"mover2indicator\", data[\"mover2\"]);\n set_indicator_color(\"slider1indicator\", data[\"slider1\"]);\n set_indicator_color(\"slider2indicator\", data[\"slider2\"]);\n set_indicator_color(\"slider3indicator\", data[\"slider3\"]);\n set_indicator_color(\"slider4indicator\", data[\"slider4\"]);\n set_indicator_color(\"slider5indicator\", data[\"slider5\"]);\n set_indicator_color(\"slider6indicator\", data[\"slider6\"]);\n set_indicator_color(\"basket2indicator\", data[\"basket1\"]);\n set_indicator_color(\"basket1indicator\", data[\"basket2\"]);\n set_dirty_textbox(\"blueraketextbox\", data[\"blue_rake\"]);\n set_dirty_textbox(\"blueadjtextbox\", data[\"blue_adj\"]);\n set_dirty_textbox(\"redraketextbox\", data[\"red_rake\"]);\n set_dirty_textbox(\"redadjtextbox\", data[\"red_adj\"]);\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 }", "function moveToDashboard(obj) {\n for (let i = 0; i < allNotes.length; i++) {\n if (allNotes[i].titleOfNoteBook == obj.titleOfObject) {\n allNotes[i].titleOfNoteBook = \"Dashboard\";\n }\n }\n}", "function ChangePanel (id){\n var newPanel;\n var widget=GetWidget(id);\n\n var gridster = $(\"#panel\"+actualPanel+\" ul\").gridster().data('gridster');\n gridster.remove_widget(\"#widget\"+id,function(){\n var NowPanel= GetPanel(actualPanel)\n NowPanel.deleteElement(widget)\n $(\"#currentSettings input[type='radio']:checked\").each(function() {\n newPanel=$(this).attr('value')\n });\n\n widget.panel=parseInt(newPanel);\n var ToPanel= GetPanel(newPanel)\n ToPanel.pushElement(widget)\n if(dashConfiguration.indexOf(parseInt(newPanel))==-1){\n widget.MakeWidget()\n }else{\n makePanel(newPanel)\n }\n showPanel(newPanel)\n $(\"#currentSettings\").remove();\n $(\"#making\").slideUp(\"slow\");\n $(\"#companies\").slideUp(\"slow\");\n if($(\"#companiesList\").length!=0){\n $(\"#companiesList\").html(\"\")\n \n }\n });\n}", "function updateSettings() {\n const panelConsole = $('#console');\n const collapsed = !MonitoringConsole.Model.Settings.isDispayed();\n let groups = [];\n if (collapsed) {\n panelConsole.removeClass('state-show-settings');\n } else {\n if (!panelConsole.hasClass('state-show-settings')) {\n panelConsole.addClass('state-show-settings'); \n }\n groups = groups.concat(createAppSettings());\n groups.push(createColorSettings());\n groups.push(createPageSettings());\n if (MonitoringConsole.Model.Page.Widgets.Selection.isSingle())\n groups = groups.concat(createWidgetSettings(MonitoringConsole.Model.Page.Widgets.Selection.first()));\n }\n $('#Settings').replaceWith(Components.createSettings({\n id: 'Settings', \n collapsed: collapsed, \n groups: groups,\n onSidebarToggle: () => {\n MonitoringConsole.Model.Settings.toggle();\n updateSettings();\n },\n onWidgetAdd: showAddWidgetModalDialog,\n }));\n }", "function onPageChange( page , data ) \n {\n if( page == \"#dashboardPage\" )\n {\n $(\"#welcomePage\").hide();\n $(\"#dashboardListPage\").hide();\n \n //App.View.DashboardList.Modal.close();\n \n $(\"#dashboardListButton\").hide();\n $(\"#titleDashboard\").show();\n var $dashboardList = $( \"#dashboardList\" );\n $dashboardList.empty();\n var dashboardList = App.Model.Dashboard.dashboards; \n var index = 0;\n var oUserConfigure = App.Configure.getUserConfigure();\n if ( oUserConfigure.role == 1 ) {\n //\n App.Model.Dashboard.setSysConfLock( true );\n $('#createNewDashboard').hide();\n $('#dashboardPageNav').hide();\n $('#switchLockDashboard').hide();\n $('#deleteDashboard').hide();\n $('#createNewChart2').hide();\n //\n for( index=0; index < oUserConfigure.dashboardList.length; index++ )\n {\n if (index < oUserConfigure.dashboardList.length) \n {\n var value = oUserConfigure.dashboardList[index];\n if (dashboardList[value] != undefined) {\n $dashboardList.append( '<li><a data-open=\"' + value + '\" href=\"board/'+value+'\">' + dashboardList[value].name + '</a></li>' );\n }\n }\n }\n } else {\n \n $('#createNewDashboard').show();\n \n for( index=0; index < dashboardList.length; index++ ) {\n $dashboardList.append( '<li><a data-open=\"' + index + '\" href=\"board/'+index+'\">' + dashboardList[index].name + '</a></li>' );\n }\n }\n\n var dashboard = App.Model.Dashboard.getDashboard( data );\n var fistDashboard = App.Model.Dashboard.getDashboard( 0 );\n if (dashboard == null)\n {\n if (fistDashboard == null)\n {\n // Quick-fix: Wait to make sure page fade completes before changing pages\n // TODO: Add navigation queue\n setTimeout( function() {\n window.location.href = \"#\";\n } , 500 );\n return;\n }\n else\n {\n dashboard = fistDashboard;\n }\n }\n\n App.Net.createConnection().done( function() {\n App.View.Status.set( \"App.Model.Datasource.getDatasources done.\" );\n loadDashboard( dashboard );\n });\n \n /*kewei added : When user change page, get background setting*/\n App.Model.Dashboard.getBKSetting();\n }\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 updateActivityLog(data) {\n s.activityLog.html(data.partial);\n }", "function updateActivityLog(data) {\n s.activityLog.html(data.partial);\n }", "updateAbout(activeAccountAccess, value, activeAccountId) {\n this.props.updateAbout(activeAccountAccess, value, activeAccountId);\n this.setState({ updateAccounts: true });\n }", "onUpdate (panels) {\n if (this.props.onUpdate) {\n this.props.onUpdate(panels.slice())\n }\n }", "update(dt) {\n this.instance.update(dt);\n }", "function portalUpdate() {\n for (i = 0; i < portalCount; i++) {\n portals[i].update();\n }\n}", "async update() {}", "function updateUI(id) {\n \n let newUrl = getUrl(id);\n let cardConfirmedToday = document.getElementById(\"card-confirmed-today\"),\n cardConfirmedAll = document.getElementById(\"card-confirmed-all\"),\n cardRecoveredToday = document.getElementById(\"card-recovered-today\"),\n cardRecoveredAll = document.getElementById(\"card-recovered-all\"),\n cardDeathsToday = document.getElementById(\"card-deaths-today\"),\n cardDeathsAll = document.getElementById(\"card-deaths-all\");\n\n fetch(newUrl)\n .then(function (response) {\n if (response.status !== 200) {\n console.warn(\n \"Looks like there was a problem. Status Code: \" + response.status\n );\n return;\n }\n response.json().then(function (data) {\n cardConfirmedToday.innerHTML =\n numeral(data.todayCases).format(\"0,0\") + \" New Cases\";\n cardConfirmedAll.innerHTML =\n numeral(data.cases).format(\"0,0\") + \" Total Cases\";\n cardRecoveredToday.innerHTML =\n numeral(data.todayRecovered).format(\"0,0\") + \" New Cases\";\n cardRecoveredAll.innerHTML =\n numeral(data.recovered).format(\"0,0\") + \" Total Cases\";\n cardDeathsToday.innerHTML =\n numeral(data.todayDeaths).format(\"0,0\") + \" New Cases\";\n cardDeathsAll.innerHTML =\n numeral(data.deaths).format(\"0,0\") + \" Total Cases\";\n createGraph(data)\n });\n })\n .catch(function (err) {\n console.error(\"Fetch Error -\", err);\n });\n }", "function updateActivity(id) {\n vm.updateResponse = \"\";\n if (!vm.isConnected()) {\n alert(\"Connect to Strava to update the local DB.\");\n return;\n }\n vm.updateResponse = \"Update in progress...\";\n $http.get('updateactivity', { params: { activity_id: id } }).then(function (response) {\n vm.updateResponse = \"Activity successfully updated.\";\n addPacetoActivities(response.data);\n setGearsNamesForActivities(response.data);\n const activitiesToRemove = []\n for (var i = 0; i < vm.activities.length; i++) {\n if (vm.activities[i].id == id) {\n activitiesToRemove.push(vm.activities[i])\n vm.activities[i] = response.data[0];\n break;\n }\n }\n updateGearTotals(response.data, activitiesToRemove);\n });\n }", "function update() {\n const currentReqValues = getCurrentUIValues();\n updateMonthly(calculateMonthlyPayment(currentReqValues));\n}", "function updateSWinBoard(id, name) {\n // In swimlane management window\n $(\".swimlane[data-id='\" + id + \"'] .swName\").html(name);\n\n // Update in the board\n $(\"#kanban th[data-id='\" + id + \"'] .swName\").html(name).attr(\"title\", name);\n}", "update() {\n\t\tbus.emit('Server:Update', this)\n\t\tif (this.Vars._displayStatusMessage) {\n\t\t\tthis.Vars._displayStatusMessage = false\n\t\t}\n\t\tthis.log('Updating Server Info')\n\t}", "function updateUI(type) {\n var messageObject = {\n type: CONFIG.UPDATE_UI,\n subtype: type ? type : \"\",\n value: type ? dynamicData[type] : dynamicData\n };\n if (DEBUG) {\n print(\"Update UI\", type);\n }\n ui.sendToHtml(messageObject);\n }", "[types.REQUEST_METRICS_DASHBOARD](state) {\n state.emptyState = dashboardEmptyStates.LOADING;\n }", "function showDashboard() {\n document.querySelector('.main-nav__item--signup').classList.add('hide');\n document.querySelector('.main-nav__item--logout').classList.remove('hide');\n document.querySelector('.logged-in-content').classList.remove('hide');\n document.querySelector('.main-content').classList.add('main-content--dashboard');\n inviteNewUser();\n logout();\n }", "updateLayouts(data) {\n return this.http.put('/tenant/settings/layouts', data);\n }", "update(component, value) {\n\t\tif(component instanceof ResetButton) {\n\t\t\tlocalStorage.clear();\n\t\t\twindow.location.reload();\n\t\t\treturn;\n\t\t}\n\n\t\tconst label = component.props.label || component.props.panelName;\n\t\tconst setting_name = settings_map[label.toLowerCase()];\n\n\t\tStorage.set(setting_name, value);\n\t\tStorage.saveAll(); // Doesn't really affect performance, should be fine\n\t}", "function _onUpdateSuccess(data) {\n console.log(\"Updated!\", data);\n vm.$alertService.success(\"update website\");\n \n }", "function refreshData()\n{\n\n\tDataAccess.Data(function (data)\n\t{\n\t\t// if((data[\"username\"] == undefined) || (data[\"password\"] == undefined))\n\t\t// \treturn notification(\"שם משתמש או סיסמא אינו מוגדר\",\"error\")\n\t\tvar progress = $('#courses').find(\"progress\");\n\t\t//show the progress bar\n\t\t$(progress).show();\n\t\t// Set the progress bar 0/2\n\n\t\tchrome.runtime.sendMessage({updatedata:true});\n\n\t\t$(progress).attr('value',1);\n\n\t})\n\n}", "function draw_Update_Button_Clicked(index) {\n\t\t//Update value of slider\n\t\td3.select('#finetune')\n\t\t\t.property('value', 4);\n\n\t\t//Generate new histogram array\n\t\tupdateData(index, 10);\n\t\t//Set domain for new data\n\t\tsetDomain();\n\t\t//Draw x axis again\n\t\tupdateX();\n\t\t//Draw y axis again\n\t\td3.select('#axisY')\n\t\t\t.transition().duration(500)\n\t\t\t.call(d3.axisLeft(y));\n\t\t//Update histogram chart\n\t\t//If the old data(class) has 2 semester\n\t\tif(data_Combined[currentData].value.length > 1) {\n\t\t\t//Check type of new class\n\t\t\tswitch(typeOfClass) {\n\t\t\t\tcase 1:\n\t\t\t\t\tupdateBoth();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tremoveSpring_updateFall();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tremoveFall_updateSpring();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tconsole.log('Draw update error 001');\n\t\t\t}\n\t\t} else {\n\t\t\tif(data_Combined[currentData].value[0].key == 'Fall17') {\n\t\t\t\tswitch(typeOfClass) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tupdateBoth();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tupdateFall();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tremoveFall_updateSpring();\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tconsole.log('Draw update error 002');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tswitch(typeOfClass) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tupdateBoth();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tremoveSpring_updateFall();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tupdateSpring();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tconsole.log('Draw update error 003');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcurrentData = index;\n\t}", "update() {\n localStorage.setItem('user', JSON.stringify(user))\n\n dataStore.set('config', user.config)\n dataStore.set('palette', user.palette)\n dataStore.set('projectPalette', user.projectPalette)\n dataStore.set('log', user.log)\n\n Log.refresh()\n }", "updateGoals(currentWeight, goalWeight, height) {\n return axios.put(\n API_URL + 'goal/update/',\n {\n currentWeight: currentWeight,\n goalWeight: goalWeight,\n height: height\n },\n { headers: authHeader() }\n );\n }", "function updateCurrentNodeWar(nwObject, message) {\n DB.Connect(message.guild)\n .table(\"nodewar\")\n .filter({ isActive: true })\n .update({ date: nwObject.date })\n .run()\n .then(result => {\n console.log(JSON.stringify(result, null, 2))\n })\n console.log(\"Updated nodewar.\")\n}", "goToDashboard() {\n this.setState({currentState: 'Dashboard'});\n this.setState({showButtons: true});\n if (this.state.loggedIn) {\n this.getWorkoutHistory();\n }\n if (this.state.interval) {\n clearInterval(this.state.interval);\n }\n }", "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}", "async function openDashboard(i) {\n if (i < -2 || i >= this.state.panels.length) return\n\n Actions.closeCtxMenu()\n Actions.resetSelection()\n this.state.dashboardIsOpen = true\n\n if (i === -2) {\n this.state.dashboard = {\n dashboard: 'HiddenPanelsDashboard',\n panels: this.state.panels.filter(b => !b.bookmarks && b.inactive),\n }\n return\n }\n\n this.state.panelIndex = i\n\n if (i === -1) this.state.dashboard = { dashboard: 'TabsDashboard', name: '', new: true }\n else this.state.dashboard = this.state.panels[i]\n}", "function updatePanel() {\n // Variables\n var data = attributeData;\n var sTempMeters = \"\";\n var iTempMeters = 0;\n var sLightMeters = \"\";\n var iLightMeters = 0;\n var sOnOffers = \"<div class='section'>\";\n var iOnOffers = 0;\n var sDimmers = \"\";\n var sIrColors = \"\";\n var sColorController = \"\";\n var sDoorWindowSensor = \"\";\n $(\"#warning\").empty();\n $(\"#warnings\").hide();\n var goforrefreshnexttime = false;\n // empty all the content\n $(\"#temps\").empty();\n $(\"#lums\").empty();\n $(\"#onoffs\").empty();\n $(\"#doorWindowSensor\").empty();\n\n sRes = true;\n\n // Adding content\n $.each(data, function (i, obj) {\n\n sRes = true;\n try {\n sRoom = \"\";\n try {\n sRoom = obj.clusterEndpoint.room;\n } catch (err) {\n sRoom = 0;\n }\n\n if (isRoomToBeShown(sRoom)) {\n var sRoomName = getRoomNameFromId(sRoom);\n\n // Adding the ir sensor (remote controller)\n if (obj.clusterEndpoint.name.toLowerCase().indexOf(\"infra\") != -1) {\n sColorController += \"<div id='colorWheel'></div>\";\n sIrColors += addRemoteController(obj.uuid);\n }\n\n else if ((obj.device.name.toLowerCase().indexOf(\"water\") != -1) || (obj.device.name.toLowerCase().indexOf(\"flood\") != -1)) {\n var sValue = obj.value.value;\n var sAgo = getReadingAgo(obj.value.timestamp);\n var sName = obj.clusterEndpoint.name;\n var sGuide = obj.clusterEndpoint.description;\n if (sGuide.indexOf(\"guide:\") != -1) {\n // If there is a guide, show it.\n sGuide = sGuide.replace(\"guide:\", \"\");\n } else {\n sGuide = \"\";\n }\n\n var sHtml = \"<p id='\" + obj.uuid + \"' class='leak'>\" + sName + \" \" + sValue + \" \" + sAgo + \"</p>\";\n if (showSensors) {\n sLightMeters += addOrChangeControl(obj.uuid, sHtml, sRoomName);\n }\n\n if ((obj.value.value === true) || (obj.value.value) === \"true\") {\n // There is leak, so show the warning\n issueWarning(sName, sGuide);\n }\n } else if ((obj.clusterEndpoint.name.toLowerCase().indexOf(\"off\") != -1) || (obj.clusterEndpoint.name.toLowerCase().indexOf(\"switch\") != -1)) {\n sOnOffers += addOrChangeOnOffControl(obj.uuid, obj.endpoint.name, obj.value.value, sRoomName, obj.device.uuid);\n iOnOffers++;\n if (iOnOffers >= switchcolumnheight) {\n sOnOffers += \"</div><div class='section'>\";\n iOnOffers = 0;\n }\n } else if (obj.clusterEndpoint.name.toLowerCase().indexOf(\"wall\") != -1) {\n sOnOffers += addOrChangeOnOffControl(obj.uuid, obj.endpoint.name, obj.value.value, sRoomName, obj.device.uuid);\n iOnOffers++;\n\n if (iOnOffers >= switchcolumnheight) {\n sOnOffers += \"</div><div class='section'>\";\n iOnOffers = 0;\n }\n\n } else if (obj.clusterEndpoint.name.toLowerCase().indexOf(\"dimmer\") != -1) {\n sDimmers += addOrChangeDimmerControl(obj.uuid, obj.endpoint.name, obj.value.value, sRoomName);\n } else if (obj.uiType.endpointType.toLowerCase().indexOf(\"temp\") != -1) {\n var sValue = getTempAdjusted(obj.value.value);\n var sAgo = getReadingAgo(obj.value.timestamp);\n var sUnit = obj.config.unit;\n var sName = obj.endpoint.name;\n var batteryLevel = getBatteryLevel(obj.device.uuid);\n\n var sHtml = \"<div id='\" + obj.uuid + \"' class='tempholder'><div class='batteryIconHolder'>\" + getBatteryStatus(batteryLevel, sName) + \"</div><div class='tempfigure'><font color='\" + getTempColor(sValue) + \"' size='40px'>\" + sValue + \" \" + sUnit + \"</font></div><div class='agotext'>\" + sName + \" \" + sAgo + \"</div></div>\";\n\n sTempMeters += addOrChangeControl(obj.uuid, sHtml, sRoomName, batteryLevel);\n\n\n } else if (showSensors && (obj.uiType.endpointType.toLowerCase().indexOf(\"light\") != -1)) {\n var sValue = getTempAdjusted(obj.value.value);\n var sAgo = getReadingAgo(obj.value.timestamp);\n var sUnit = obj.config.unit;\n var sName = obj.endpoint.name;\n\n var sHtml = \"<p id='\" + obj.uuid + \"' class='light'>\" + sName + \" \" + sValue + \" \" + sUnit + \" \" + sAgo + \"</p>\";\n sLightMeters += addOrChangeControl(obj.uuid, sHtml, sRoomName);\n } else if (obj.clusterEndpoint.name.toLowerCase().indexOf(\"door\") != -1) {\n\n var sDoorSensorImage = \"\";\n if (obj.value.value === \"true\") {\n // It's true, so door/window is open. Add the door open image\n sDoorSensorImage = \"<img class='doorWindowImg' src='images/dooropen.png'/>\";\n } else {\n // it's false, so it's closed. Add the door closed image.\n sDoorSensorImage = \"<img class='doorWindowImg' src='images/doorclosed.png'/>\";\n }\n\n\n sHtml = \"<div id=\" + obj.uuid + \" class='doorWindowDiv'><div>\" + obj.endpoint.name + \"</div>\" + sDoorSensorImage + \"</div>\";\n sDoorWindowSensor += addOrChangeControl(obj.uuid, sHtml, sRoomName);\n\n }\n\n } else {\n $(\"#\" + obj.uuid).remove();\n }\n\n\n } catch (err) {\n\n }\n\n\n });\n\n // Appending controllers\n $(\"#temps\").append(sTempMeters);\n $(\"#lums\").append(sLightMeters);\n $(\"#onoffs\").append(sOnOffers + \"</div>\" + sDimmers);\n $(\"#irContainer\").append(sIrColors);\n $(\"#colorWheelDiv\").append(sColorController);\n $(\"#doorWindowSensor\").append(sDoorWindowSensor);\n if (!showSensors) {\n $(\"#sensorcolumn\").hide();\n } else {\n $(\"#sensorcolumn\").show();\n }\n\n\n updating = false;\n\n return sRes;\n}", "function updateAStorageArea(storageAreaId){\n return fetch(`${STORAGE_AREAS_URL}/${storageAreaId}`, {\n method: 'PATCH',\n headers: {\n 'Content-Type': 'application/json',\n Accept: \"application/json\"\n },\n }),\n document.location.reload(true); // This will reload the page\n}", "function updateDiag(req, res) {\n diagramService.update(req.body)\n .then(function () {\n res.sendStatus(200);\n })\n .catch(function (err) {\n res.status(400).send(err);\n });\n}", "async function updateStats() {\n const stats = await (await fetch( './getStats', { method: 'POST'} )).json();\n\n // fill in static routes\n fillElements( stats );\n\n // progress bar\n document.querySelector( '.progress .tabresult' ).style.width = (100 * stats.tables.result / stats.tables.total) + '%';\n document.querySelector( '.progress .taberror' ).style.width = (100 * stats.tables.error / stats.tables.total) + '%';\n const progressTitle = `Results: ${(100 * stats.tables.result / stats.tables.total).toFixed(2)}% | Errors: ${(100 * stats.tables.error / stats.tables.total).toFixed(2)}%`;\n ['.progress', '.progress .tabresult', '.progress .taberror']\n .forEach( (sel) => document.querySelector( sel ).setAttribute( 'title', progressTitle ) );\n\n // update file availability\n for( const link of [ 'results', 'errors' ] ) {\n if( stats.files[ link ] ) {\n els[ link ].classList.remove( 'disabled');\n els[ link ].setAttribute( 'href', els[ link ].dataset.href );\n } else {\n els[ link ].classList.remove( 'disabled');\n els[ link ].removeAttribute( 'href' );\n }\n }\n\n // checkmark for finished\n if( stats.tables.unfinished < 1 ) {\n document.querySelector( '.finishedFlag' ).classList.add( 'finished' );\n } else {\n document.querySelector( '.finishedFlag' ).classList.remove( 'finished' );\n }\n\n // enable/disable evaluation section\n document.querySelector('#eval').style.display = stats.hasEvaluation ? 'block' : 'none';\n document.querySelector('#analysis').style.display = stats.hasEvaluation ? 'block' : 'none';\n\n }", "function update() {\n\t\t\n\t}", "goToDashboard() {\r\n this.setState({currentState: 'Dashboard'});\r\n this.setState({showButtons: true});\r\n if (this.state.loggedIn) {\r\n this.getWorkoutHistory();\r\n }\r\n if (this.state.interval) {\r\n clearInterval(this.state.interval);\r\n }\r\n }", "updateStats(){\n document.getElementById(\"hp\").innerHTML = health;\n document.getElementById(\"wp\").innerHTML = weapon;\n document.getElementById(\"xp\").innerHTML = exp;\n document.getElementById(\"lvl\").innerHTML = level;\n document.getElementById(\"dng\").innerHTML = dungeon;\n }", "function updateLastActivity(){\n var handlerUrl = runtime.handlerUrl(element, 'updateLastOnline');\n $.ajax({\n type: \"POST\",\n url: handlerUrl,\n data: JSON.stringify({\"hello\": \"world\"}),\n success: function(result){\n console.log(\"updating last online activity\",result);\n },\n error: function (request, status, error) {\n console.log(error);\n console.log(status);\n console.log(request.responseText);\n }\n });\n }", "update() {\n this.emit('fetch');\n if (this.guilds > 0 && this.users > 0) {\n if (!config.beta) {\n dogstatsd.gauge('musicbot.guilds', this.guilds);\n dogstatsd.gauge('musicbot.users', this.users);\n }\n let requestOptions = {\n headers: {\n Authorization: config.discord_bots_token\n },\n url: `https://bots.discord.pw/api/bots/${config.bot_id}/stats`,\n method: 'POST',\n json: {\n 'server_count': this.guilds\n }\n };\n request(requestOptions, (err, response, body) => {\n if (err) {\n return this.emit('error', err);\n }\n this.emit('info', 'Stats Updated!');\n this.emit('info', body);\n });\n if (!config.beta) {\n let requestOptionsCarbon = {\n url: 'https://www.carbonitex.net/discord/data/botdata.php',\n method: 'POST',\n json: {\n 'server_count': this.guilds,\n 'key': config.carbon_token\n }\n };\n request(requestOptionsCarbon, (err, response, body) => {\n if (err) {\n return this.emit('error', err)\n }\n this.emit('info', 'Stats Updated Carbon!');\n this.emit('info', body);\n });\n }\n }\n }", "function on_ui_update (args) {\n var info = args[0];\n console.log(\"on_ui_update() event received with: \" + info);\n showFeedback(info['success']['message'])\n }", "function updateActivities() {\n vm.updateResponse = \"\";\n if (!vm.isConnected()) {\n alert(\"Connect to Strava to update the local DB.\");\n return;\n }\n vm.updateResponse = \"Update in progress...\";\n $http.get('updateactivities').then((response) => {\n vm.updateResponse = \"Activities successfully updated.\";\n addPacetoActivities(response.data);\n updateGearTotals(response.data);\n setGearsNamesForActivities(response.data);\n vm.activities.push.apply(vm.activities, response.data);\n vm.nTotalItems = vm.activities.length;\n });\n }", "function recall() {\n tabs.open({\n \"url\" : self.data.url(\"dashboard.html\"),\n });\n}", "function ajax_board(){\n \n $.ajax({\n\t type: \"POST\",\n\t url: \"/WebArenaGoupSI1-04-BE/Board/board\",\n dataType: \"json\",\n\t success: function(data){\n update(data);\n },\n\t error: function (error){\n\t }\n }); \n\n}", "function update() {\n updateBodyCostDisplay();\n updateAddedComponentDisplay();\n updateBodyStringDisplay();\n updateComponentCountDisplay();\n updateComponentCountTable();\n updateProgressBar();\n }", "function clearDashboard() {\n \n while (dashboard.firstChild) {\n dashboard.removeChild(dashboard.firstChild);\n }\n}" ]
[ "0.70669836", "0.6812702", "0.6804895", "0.6512717", "0.6503218", "0.6297381", "0.6210645", "0.62055343", "0.60833675", "0.6001562", "0.591717", "0.5841518", "0.5799417", "0.5745279", "0.5697702", "0.5694805", "0.5665971", "0.56610817", "0.5621063", "0.5595451", "0.5594273", "0.5583513", "0.5576161", "0.5558487", "0.5526797", "0.5525195", "0.5512203", "0.54563564", "0.54513216", "0.5411476", "0.53831804", "0.5367094", "0.53520375", "0.53520375", "0.53520375", "0.5347319", "0.5345839", "0.53424853", "0.5331242", "0.5329343", "0.5322021", "0.5309335", "0.5305585", "0.5300155", "0.5293958", "0.52893984", "0.5276377", "0.5270951", "0.5263783", "0.5259441", "0.5251505", "0.52481496", "0.52428496", "0.52297497", "0.52255553", "0.5218694", "0.5207218", "0.52063775", "0.5199155", "0.5197125", "0.5197125", "0.5190511", "0.51837593", "0.518323", "0.5176504", "0.51698667", "0.51667154", "0.51582855", "0.5151413", "0.5148952", "0.51417834", "0.5131884", "0.5129507", "0.5121154", "0.5119684", "0.51186717", "0.5115976", "0.51150554", "0.51135004", "0.51131135", "0.51114386", "0.5106442", "0.50939506", "0.50936073", "0.5092457", "0.5092163", "0.5091487", "0.5088698", "0.5081663", "0.5081071", "0.5078118", "0.50750613", "0.5072921", "0.50706714", "0.5070317", "0.50668836", "0.50661784", "0.50652385", "0.5063138", "0.5058569" ]
0.6045793
9
GRAPHS This function is used to get a list of graphs.
static async getGraphList(email, dashboardID) { return new Promise((resolve, reject) => { Database.sendQuery('SELECT g.* from graph as g join (SELECT * from dashboard as d WHERE (d.email = $1) AND (d.id = $2)) as de on (g.dashboardid=de.id);', [email, dashboardID]) .then((result) => resolve(result.rows)) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawAllGridGraphs() {\n // bucket the grid graphs by number of edges\n var gg_list = []\n for (var i=0; i<=6; i++) {\n gg_list[i] = [];\n }\n \n for (var i=0; i<64; i++) {\n var edges_on = computeGridGraphNoEdges(i);\n var n_edges = edges_on.length;\n gg_list[n_edges].push(i);\n }\n \n drawGridGraphMatrix(gg_list);\n}", "_getGraphs(graph) {\n if (!isString(graph)) return this._graphs;\n var graphs = {};\n graphs[graph] = this._graphs[graph];\n return graphs;\n }", "getGraphs(subject, predicate, object) {\n var results = [];\n this.forGraphs(function (g) {\n results.push(g);\n }, subject, predicate, object);\n return results;\n }", "getGraphs(subject, predicate, object) {\n const results = [];\n this.forGraphs(g => {\n results.push(g);\n }, subject, predicate, object);\n return results;\n }", "_getGraphs(graph) {\n if (!isString(graph)) return this._graphs;\n const graphs = {};\n graphs[graph] = this._graphs[graph];\n return graphs;\n }", "function generateGraphs() {\n return [{\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BZDVkZmI0YzAtNzdjYi00ZjhhLWE1ODEtMWMzMWMzNDA0NmQ4XkEyXkFqcGdeQXVyNzYzODM3Mzg@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"It\",\n \"type\": \"column\",\n \"valueField\": \"It\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BNDAxMTZmZGItZmM2NC00M2E1LWI1NmEtZjhhODM2MGU0ZmJlXkEyXkFqcGdeQXVyNzkwMjQ5NzM@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"The Hangover\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.5,\n \"valueField\": \"The Hangover\"\n }, {\n \"balloonText\": \"<img src='https://ia.media-imdb.com/images/M/MV5BMTk3OTM5Njg5M15BMl5BanBnXkFtZTYwMzA0ODI3._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"The Notebook\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.45,\n \"valueField\": \"The Notebook\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BYzE5MjY1ZDgtMTkyNC00MTMyLThhMjAtZGI5OTE1NzFlZGJjXkEyXkFqcGdeQXVyNjU0OTQ0OTY@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Deadpool\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.4,\n \"valueField\": \"Deadpool\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BMGE1ZTQ0ZTEtZTEwZS00NWE0LTlmMDUtMTE1ZWJiZTYzZTQ2XkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Bad Boys\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.35,\n \"valueField\": \"Bad Boys\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BY2I1NWE2NzctNzNkYS00Nzg5LWEwZTQtN2I3Nzk3MTQwMDY2XkEyXkFqcGdeQXVyMTQxNzMzNDI@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Caddyshack\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.3,\n \"valueField\": \"Caddyshack\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BMzNmY2IwYzAtNDQ1NC00MmI4LThkOTgtZmVhYmExOTVhMWRkXkEyXkFqcGdeQXVyMTk5NDA3Nw@@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Die Hard\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.25,\n \"valueField\": \"Die Hard\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BMTg1MTY2MjYzNV5BMl5BanBnXkFtZTgwMTc4NTMwNDI@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Black Panther\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.2,\n \"valueField\": \"Black Panther\"\n }];\n }", "function buildGraphArray(){\n\t\t//Our grid is read in the oppirite order we built it\n\t\tfor(var h = 0; h < GAME.board.height; h++){\n\t\t\tGAME.boardGraphArray[h] = [];\n\t\t\tfor(var w = 0; w < GAME.board.width; w++){\t\n\t\t\t\tif (GAME.board.tiles[h][w].element.firstChild || ! GAME.board.tiles[h][w].passable) {\n\t\t\t\t\t//not passable\n\t\t\t\t\tGAME.boardGraphArray[h][w] = 0;\n\t\t\t\t}else{\n\t\t\t\t\t//passable\n\t\t\t\t\tGAME.boardGraphArray[h][w] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function groupGraphs() {\n // getting the graph elements\n graphDiv = document.getElementById(\"graphs\");\n graphDiv.innerHTML = \"\";\n // getting the groupings as an array\n groupings = getGrouping(parameterList.concat(extra));\n // iterating through the graphs and appending them to the canvas\n let currCanvas = document.createElement(\"canvas\");\n graphDiv.appendChild(currCanvas);\n if (groupings[1].length) {\n // temp = {};\n // temp[metrics[7]] = displayData[metrics[7]];\n // temp[metrics[10]] = displayData[metrics[10]];\n // console.log(temp);\n singleGraph(displayData, [metrics[0],metrics[1]], groupings[0], currCanvas);\n }\n for (let i = 2; i < groupings.length; i++) {\n let currCanvas = document.createElement(\"canvas\");\n graphDiv.appendChild(currCanvas);\n if (groupings[i].length) {\n singleGraph(displayData, groupings[i], groupings[0], currCanvas);\n }\n }\n\n}", "graphics () {\r\n let graphs = [];\r\n for (let i = 0; i < this.props.books.length; i++) {\r\n graphs.push(<GraphicMarket book={this.props.books[i].book} theme={this.props.theme} \r\n activeGraphic={this.props.books[i].book === this.state.currentBookMarket} key={i} onClick={ () => this.selectView(this.props.books[i].book) } /> );\r\n }\r\n return graphs;\r\n }", "_getGraphs (graph) {\n if (!isString(graph)) {\n return this._graphs\n }\n\n return {\n [graph]: this._graphs[graph]\n }\n }", "function convertDiagrammGoupe() {\r\n var groups = []\r\n for (var idx = 0 ; idx < FMSName.length; idx++) {\r\n groups.push({\r\n id: FMSName[idx],\r\n content: FMSName[idx],\r\n className: FMSName[idx] + \"-style\",\r\n options: {\r\n drawPoints: false,\r\n interpolation: false,\r\n },\r\n });\r\n }\r\n return groups;\r\n}", "function getGrid() {\n\tvar grid = new Array(4);\n\tgrid[0] = new Array(4);\n\tgrid[1] = new Array(4);\n\tgrid[2] = new Array(4);\n\tgrid[3] = new Array(4);\n\treturn grid;\n}", "function graphList(uId){\n \tloadGraphs.async(uId).then(function(results){\n\t\t\t\tsharedProperties.setUserGraphs(results.data);\n\t });\n }", "function makeGraphs(error, tourismData) {\n // first create a crossfilter, one per site\n // load the data in to the crossfilter\n var ndx = crossfilter(tourismData);\n \n // pass the crossfilter variable (ndx)\n // to the function that's going to draw the graph\n select_destination(ndx);\n show_paris_tourism(ndx);\n show_santorini_tourism(ndx);\n show_rome_tourism(ndx);\n \n // render graphs\n dc.renderAll();\n}", "get Charting() {}", "function showGraphs() {\n\t\tshowdone = 0;\n\t\tshowOneGraph(1);\n\t\tshowOneGraph(2);\n\t\tshowOneGraph(3);\n\t}", "function loadAllCharts() {\n loadTopN(\"Sources\", 10);\n loadTopN(\"Victims\", 10);\n loadTable();\n}", "function build_list_of_lines(){\n var count = 0;\n\n if (edges.length > 0){\n do {\n showArray(edges[count]);\n count++;\n }while (count != edges.length);\n }\n}", "function buildGraphs(utilizations) {\n var utilizationMap = {},\n result = {};\n\n // Bucket utilizations by type\n utilizations.forEach(function (u) {\n var k = u.key;\n utilizationMap[k] = utilizationMap[k] || [];\n utilizationMap[k].push(u);\n });\n\n // ...then convert to graphs\n Object.keys(utilizationMap).forEach(function (k) {\n result[k] = new ResourceGraph(utilizationMap[k]);\n });\n\n // Add battery state of charge\n if (domainObject.getModel().type === 'timeline' &&\n result.power &&\n domainObject.getModel().capacity > 0) {\n\n result.battery = new CumulativeGraph(\n result.power,\n 0,\n domainObject.getModel().capacity, // Watts\n domainObject.getModel().capacity,\n 1 / 3600000 // millis-to-hour (since units are watt-hours)\n );\n }\n\n return result;\n }", "plotJourneys() {\n for (let j of this.mapJourneys) {\n //plot ghost Session\n j.plotSessions(this);\n }\n }", "function plotGraph() {\n if (houses.data.length > 0) {\n for (let i = 0; i < houses.data.length; i++) {\n xs[i] = map(houses.data[i].inputs[0], 0, zoom, 0, wnx);\n ys[i] = map(houses.data[i].inputs[1], 0, zoom, wny, 200);\n cs[i] = houses.data[i].inputs[8];\n ps[i] = houses.data[i].target[0];\n }\n }\n}", "function buildGraph(list) {\n for (var i = 0; i < list.length; ++i) {\n\tlist[i].edge = [];\n\tfor (var j = 0; j < list.length; ++j) {\n\t if (i == j) continue;\n\t var share = shareEdge(list[i], list[j]); \n\t if (share != 'none') {\n\t\tlist[i].edge.push(list[j]);\n\t }\n\t}\t\n }\n}", "function initLayerGraphs(g) {\n var ranks = [];\n\n function dfs(u) {\n if (u === null) {\n g.children(u).forEach(function(v) { dfs(v); });\n return;\n }\n\n var value = g.node(u);\n value.minRank = ('rank' in value) ? value.rank : Number.MAX_VALUE;\n value.maxRank = ('rank' in value) ? value.rank : Number.MIN_VALUE;\n var uRanks = new Set();\n g.children(u).forEach(function(v) {\n var rs = dfs(v);\n uRanks = Set.union([uRanks, rs]);\n value.minRank = Math.min(value.minRank, g.node(v).minRank);\n value.maxRank = Math.max(value.maxRank, g.node(v).maxRank);\n });\n\n if ('rank' in value) uRanks.add(value.rank);\n\n uRanks.keys().forEach(function(r) {\n if (!(r in ranks)) ranks[r] = [];\n ranks[r].push(u);\n });\n\n return uRanks;\n }\n dfs(null);\n\n var layerGraphs = [];\n ranks.forEach(function(us, rank) {\n layerGraphs[rank] = g.filterNodes(nodesFromList(us));\n });\n\n return layerGraphs;\n}", "function getPathedGraph()\n\t\t{\n\t\t\tlet json_file = 'result.json' // can change later\n\t\t\tlet url = 'http://127.0.0.1:5000/getJsonLink/' + json_file\n\t\t\tfetch(url)\n\t\t\t\t.then((response) => {\n\t\t\t\t\treturn response.json()\n\t\t\t\t}).then((linkAndPath) => {\n\t\t\t\t\t// console.log(linkAndPath.path)\n\t\t\t\t\tfor(var i = 0; i < linkAndPath.path.length; i++)\n\t\t\t\t\t\tgeneratePathedGraph(i, linkAndPath.link, linkAndPath.path[i])\n\t\t\t\t})\n\t\t}", "function getPgPromises(pg,groupsize){\n\tvar todownload = [];\n\n\tvar maxitems = (pg * groupsize);\n\tvar firstitem = maxitems - (groupsize - 1);\n\tconsole.log(\"woking on: \",firstitem, maxitems);\n\n\tfor(var i = firstitem; i <= maxitems; i++){\n\t\tvar downloadedPage = loadPage(i);\n\t\ttodownload.push(downloadedPage);\n\t}\n\t\n\treturn todownload;\n}", "display() {\n let graph = \"\";\n console.log(this.edges);\n console.log(this.nodes)\n this.nodes.forEach(node => {\n let nodeEdges = this.edges.filter(edge => edge.node1 === node.name).map(edge => edge.node2).concat(this.edges.filter(edge => edge.node2 === node.name).map(edge => edge.node1));\n graph += node.name + \"->\" + nodeEdges.join(\", \") + \"\\n\";\n });\n console.log(graph)\n }", "function atualizaTodosGraficos() {\n\tvar diasMonitorados = diasMonitoradosPaciente();\n\tatualizaComBoxGrafico(diasMonitorados);\n\tvar diaAtual = dadosDiaAtual(diasMonitorados);\n\n\tgraficoPressaoArterial(diaAtual.dadosHoras);\n\tgraficoSaturacaoOxigenio(diaAtual.dadosHoras);\n\tgraficoFrequenciaCardiaca(diaAtual.dadosHoras);\n\tgraficoTemperaturaCorporea(diaAtual.dadosHoras);\n\tgraficoFrequenciaRespiratoria(diaAtual.dadosHoras);\n}", "function graphMaker(length) {\n let graph = new Array(length);\n\n for (let i = 0; i < length; i++) {\n graph[i] = new Array(length);\n graph[i][i] = 0;\n\n for (let j = i+1; j < length; j++) {\n graph[i][j] = Math.ceil(10*Math.random());\n }\n\n for (let j = 0; j < i; j++) {\n graph[i][j] = graph[j][i];\n }\n }\n\n return graph;\n}", "getAllCharts() {\n return Object.values(this.props.charts);\n }", "function CreateGraphicsGrid() {\n\tvar gridHTML = \"\";\n\tfor(i=0; i<100; i++) { // 10 x10\n\t\tgridHTML += '<div class=\"grid\" id=\"g' + i +'\"></div>';\n\t}\n\tdocument.getElementById(\"graphics-map\").innerHTML=gridHTML;\n\tvar gridHTMLz = \"\";\n\tfor(i=0; i<9; i++) { // 3x3\n\t\tgridHTMLz += '<div class=\"grid-z\" id=\"gz' + i +'\"></div>';\n\t}\n\tdocument.getElementById(\"graphics-map-z\").innerHTML=gridHTMLz;\n}", "function createContentForGraphs () {\n resetGraphValuesBeforeRendering();\n //first graph template\n var entireTemplateForGraphs = ``;\n AppData.listOfGraphsData.forEach(function (arrayItem, index, arrayObject) {\n var arrayItemWithDataSeriesAdded = returnDataSeriesForArrayItem(arrayItem); \n var tempGraphTemplate = \n `<div class=\"col-12 col-lg-6 mb-1\">\n <div class=\"card\"><div class=\"card-body\">` + returnGraphPlaceholder(arrayItemWithDataSeriesAdded) + `</div></div>\n </div>`;\n entireTemplateForGraphs = entireTemplateForGraphs + tempGraphTemplate;\n });\n /* since we created placeholder containers (returnGraphPlaceholder), we will start checking when those elements are added to DOM\n we want to attach Graphs when those elements are added to DOM\n */\n startCheckingForAddedGraphsPlaceholders();\n return entireTemplateForGraphs;\n }", "function getThingAll(solidDataset) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n acceptBlankNodes: false\n };\n var _a;\n const graph = typeof options.scope !== \"undefined\" ? internal_toIriString(options.scope) : \"default\";\n const thingsByIri = (_a = solidDataset.graphs[graph]) !== null && _a !== void 0 ? _a : {};\n return Object.values(thingsByIri).filter(thing => !isBlankNodeId(thing.url) || options.acceptBlankNodes);\n}", "function generateIdeaData()\n{\n createGraph();\n \n}", "function drawGrid(){\n var i, y,\n gridLine,\n gridLines = graph.paper.set(),\n avalaibleArea = graph.height - graph.padding.top - graph.padding.bottom;\n\n if (graph.options.grid.show) {\n for (i = 0; i < graph.options.grid.numYLabels; i++) {\n y = graph.height -\n i / (graph.options.grid.numYLabels - 1) * avalaibleArea -\n graph.padding.bottom +\n graph.padding.top;\n gridLine = graph.paper.path(\"M0\" + \" \" + y + \"L\" + graph.width + \" \" + y).attr('stroke', '#ddd');\n gridLines.push(gridLine);\n }\n } else if (graph.options.grid.showBaseline) {\n y = graph.height -\n graph.padding.bottom +\n graph.padding.top;\n gridLine = graph.paper.path(\"M0\" + \" \" + y + \"L\" + graph.width + \" \" + y).attr('stroke', '#ddd');\n gridLines.push(gridLine);\n }\n\n graph.grid = {\n lines: gridLines\n };\n }", "function buildGraph(edges){\n\tlet graph = Object.create(null);\n\tfunction addEdge(from, to){\n\t\tif (graph[from] == undefined){\n\t\t\tgraph[from] = [to];\n\t\t} else {\n\t\t\tgraph[from].push(to);\n\t\t}\n\t}\n\n\tfor (let [from, to] of roads.map(r => r.split('-'))){\n\t\taddEdge(from, to);\n\t\taddEdge(to, from);\n\t}\n\n\treturn graph;\n}", "function getDrawGraph(graphName){\n getDrawGraph(graphName, 0, 50, 1, '');\n }", "function singledisplay(){\n\n split_window(\"#Vergleich2\", \"s\");\n\n if(graphs.length == 2){\n draw(parent1, child1, \"s_g1\", link1);\n draw(parent2, child2, \"s_g2\", link2);\n }\n\n if(graphs.length >=3){\n draw(parent1, child1, \"s_g1\", link1);\n draw(parent2, child2, \"s_g2\", link2);\n draw(parent3, child3, \"s_g3\", link3);\n if(graphs.length == 4){\n draw(parent4, child4, \"s_g4\", link4);}\n }\n}", "function fillGrid() {\n let grid = 9;\n\n let gridArr = [];\n for (let i = 0; i < grid; i++) {\n const newDiv = document.createElement(\"div\");\n newDiv.classList.add(\"gam-layout\");\n newDiv.setAttribute(\"id\", `${i}`);\n gridArr.push(newDiv);\n gridCont.appendChild(newDiv);\n }\n return gridArr;\n }", "function buildGraph(list) {\n let graph = {};\n\n list.forEach((prereq) => {\n let [course, pre] = prereq.map(String);\n if (course in graph) {\n graph[course].push(pre);\n } else {\n graph[course] = [pre];\n }\n\n if (!(pre in graph)) {\n graph[pre] = [];\n }\n });\n\n return graph;\n}", "function graph1(g, parent,child){\n var key,prob;\n for(key in g){\n if(g[key].parents.length==0) parent.push(g[key]);\n else child.push(g[key]);\n //graphs[0][key].parents\n }\n}", "function getFrontendGroups(frontendStats) {\n groups=new Array();\n for (var elc=0; elc<frontendStats.childNodes.length; elc++) {\n var el=frontendStats.childNodes[elc];\n if ((el.nodeType==1) && (el.nodeName==\"groups\")) {\n for (var etc=0; etc<el.childNodes.length; etc++) {\n\tvar group=el.childNodes[etc];\n\tif ((group.nodeType==1)&&(group.nodeName==\"group\")) {\n\t var group_name=group.attributes.getNamedItem(\"name\");\n\t groups.push(group_name.value);\n\t}\n }\n }\n }\n return groups;\n}", "function populateGraph() {\n\n\t\t\t\t\tcolorClasses = Color.harmonious(data.numberOfSeries);\n\n\t\t\t\t\tvar paths = [];\n\t\t\t\t\tvar areaPoints = [];\n\t\t\t\t\tfor (var seriesIndex = 0; seriesIndex < data.numberOfSeries; seriesIndex++) {\n\t\t\t\t\t\tpaths.push([]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tvar dotElements = [];\n\n\t\t\t\t\tvar tracker;\n\t\t\t\t\tvar reversedKeys = data.keys.slice().reverse();\n\t\t\t\t\tvar reversedColorClasses = colorClasses.slice().reverse();\n\t\t\t\t\tif (data.numberOfSeries > 1) {\n\t\t\t\t\t\ttracker = generateXTracker(reversedColorClasses, reversedKeys);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar drawDots = (width / data.rows.length > Config.MINIMUM_SPACE_PER_DOT);\n\t\t\t\t\t\n\t\t\t\t\tdata.rows.forEach(function(dataItem, xValue) {\n\t\t\t\t\t\tvar alignedDots = [];\n\t\t\t\t\t\tvar xPixel = xScale.getPixel(xValue);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (! dataItem.isFill) {\n\t\t\t\t\t\t\tfor (var seriesIndex = 0; seriesIndex < dataItem.ySeries.length; seriesIndex++) {\n\t\t\t\t\t\t\t\tif (dataItem.ySeries[seriesIndex] === null) continue;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar yPixel = yScale.getPixel(dataItem.ySeries[seriesIndex].runningTotal);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tpaths[seriesIndex].push({\n\t\t\t\t\t\t\t\t\tx: xPixel,\n\t\t\t\t\t\t\t\t\ty: yPixel\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (drawDots) {\n\t\t\t\t\t\t\t\t\tvar dot = drawDot(xPixel, yPixel)\n\t\t\t\t\t\t\t\t\t\t.addClass(colorClasses[seriesIndex])\n\t\t\t\t\t\t\t\t\t\t.addClass('with-stroke')\n\t\t\t\t\t\t\t\t\t\t.addClass('fm-line-stroke');\n\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\tif (dataItem.ySeries[seriesIndex].annotation) {\n\t\t\t\t\t\t\t\t\tvar annotationPosition = yPixel - 20;\n\t\t\t\t\t\t\t\t\tvar\tannotationOrientation = 'top';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tvar tooltipObject = new Tooltip(paper, 'fm-stacked-area-tooltip fm-annotation', colorClasses[seriesIndex]);\n\t\t\t\t\t\t\t\t\tvar tooltip = tooltipObject.render(dataItem.xLabel, dataItem.ySeries[seriesIndex].annotation);\n\t\t\t\t\n\t\t\t\t\t\t\t\t\ttooltipObject.setPosition(xPixel, annotationPosition, annotationOrientation);\n\t\t\t\t\t\t\t\t\ttooltipObject.show();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (drawDots) {\n\t\t\t\t\t\t\t\t\tdotElements.push(dot);\n\t\t\t\t\t\t\t\t\talignedDots.push(dot);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\thoverAreas.append(drawHoverArea(dataItem, xValue, tracker, alignedDots)\n\t\t\t\t\t\t\t.attr({opacity: 0})\n\t\t\t\t\t\t\t.data('data', dataItem)\n\t\t\t\t\t\t);\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tpaths.forEach(function(path, index) {\n\t\t\t\t\t\tvar closingPoints = [];\n\t\t\t\t\t\tif (index === 0) {\n\t\t\t\t\t\t\tclosingPoints.push({\n\t\t\t\t\t\t\t\tx: path[path.length - 1].x,\n\t\t\t\t\t\t\t\ty: yScale.end\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tclosingPoints.push({\n\t\t\t\t\t\t\t\tx: path[0].x,\n\t\t\t\t\t\t\t\ty: yScale.end\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfor (var pointIndex = paths[index - 1].length - 1; pointIndex >= 0; pointIndex--) {\n\t\t\t\t\t\t\t\tclosingPoints.push(paths[index - 1][pointIndex]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tareaPoints.push(path.concat(closingPoints));\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tvar lines = [];\n\t\t\t\t\tvar areas = [];\n\t\t\t\t\tfor (var seriesIndex = 0; seriesIndex < data.numberOfSeries; seriesIndex++) {\n\t\t\t\t\t\tlines.push(\n\t\t\t\t\t\t\tdrawLine(paths[seriesIndex], false)\n\t\t\t\t\t\t\t\t.addClass(colorClasses[seriesIndex])\n\t\t\t\t\t\t\t\t.addClass('with-stroke')\n\t\t\t\t\t\t\t\t.addClass('fm-line-stroke')\n\t\t\t\t\t\t\t\t.addClass('no-fill')\n\t\t\t\t\t\t);\n\t\t\t\t\t\tareas.push(\n\t\t\t\t\t\t\tdrawLine(areaPoints[seriesIndex], false)\n\t\t\t\t\t\t\t\t.addClass(colorClasses[seriesIndex])\n\t\t\t\t\t\t\t\t.attr({opacity: Config.AREA_OPACITY})\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tareas.forEach(function(area) {\n\t\t\t\t\t\tgraphContent.append(area);\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tlines.forEach(function(line) {\n\t\t\t\t\t\tgraphContent.append(line);\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tdotElements.forEach(function(dot) {\n\t\t\t\t\t\tgraphContent.append(dot);\n\t\t\t\t\t})\n\t\t\t\t\t\n\t\t\t\t\tif (tracker) {\n\t\t\t\t\t\tgraphContent.append(tracker.line);\n\t\t\t\t\t\tgraphContent.append(tracker.label);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (data.numberOfSeries > 1) {\n\t\t\t\t\t\tdrawKey(data.keys);\n\t\t\t\t\t}\n\t\t\t\t}", "function drawGrid(){\n\t\tvar h = gameArea.canvas.height();\n\t\tvar w = gameArea.canvas.width();\n \n\n var paths = {\n strokeStyle : settings.gridColor,\n strokeWidth: .5,\n layer :true,\n name: 'grid'\n };\n \n var pathCount = 0;\n\t\tfor (var y = 0; y <= h; y += h/settings.rows) {\n pathCount++;\n paths[\"p\"+pathCount] = {\n type: 'line',\n x1: 0, y1: y,\n x2: w, y2: y\n };\n\t\t}\n\n\t\tfor (var x = 0; x <= w; x += w/settings.columns) {\n pathCount++;\n paths[\"p\"+pathCount] = {\n type: 'line',\n x1: x, y1: 0,\n x2: x, y2: h\n };\n\t\t}\n gameArea.canvas.drawPath(paths);\n\t}", "function defaultGraph() {\n return DEFAULTGRAPH;\n}", "function loaded(){\n graph([]);\n pieChart([],[],[],[]);\n}", "function getArtGraph() {\n const params = new URL(location.href).searchParams;\n const selectedWorkspace = params.get('workspace');\n const selectedArtifact = params.get('artifact');\n\n get(\"./workspaces/\" + selectedWorkspace + \"/\" + selectedArtifact).then(function(serialArt) {\n const MAX_LENGTH = 35;\n let dot = [];\n let art = JSON.parse(serialArt);\n\n dot.push(\"digraph G {\\n\");\n dot.push(\"\\tgraph [\\n\");\n dot.push(\"\\t\\trankdir = \\\"LR\\\"\\n\");\n dot.push(\"\\t\\tbgcolor=\\\"transparent\\\"\\n\");\n dot.push(\"\\t]\\n\");\n\n /* Artifact name and type */\n var s1 = (art.artifact.length <= MAX_LENGTH) ? art.artifact : art.artifact.substring(0, MAX_LENGTH) + \" ...\";\n dot.push(\"\\t\\\"\" + art.artifact + \"\\\" [ \" + \"\\n\\t\\tlabel = \\\"\" + s1 + \":\\\\n\");\n s1 = (art.type.length <= MAX_LENGTH) ? art.type :\n art.type.substring(0, MAX_LENGTH) + \" ...\";\n dot.push(s1 + \"|\");\n\n /* observable properties */\n Object.keys(art.properties).forEach(function(y) {\n var ss = Object.keys(art.properties[y])[0] + \"(\" + Object.values(art.properties[y])[0].toString() + \")\";\n var s2 = (ss.length <= MAX_LENGTH) ? ss : ss.substring(0, MAX_LENGTH) + \" ...\";\n dot.push(s2 + \"|\");\n });\n\n /* operations */\n art.operations.forEach(function(y) {\n var s2 = (y.length <= MAX_LENGTH) ? y : y.substring(0, MAX_LENGTH) + \" ...\";\n dot.push(s2 + \"\\\\n\");\n });\n dot.push(\"\\\"\\n\");\n dot.push(\"\\t\\tshape=record style=filled fillcolor=white\\n\");\n dot.push(\"\\t\\t];\\n\");\n\n /* Linked Artifacts */\n art.linkedArtifacts.forEach(function(y) {\n var str1 = (y.length <= MAX_LENGTH) ? y :\n y.substring(0, MAX_LENGTH) + \" ...\";\n dot.push(\"\\t\\t\\\"\" + y + \"\\\" [ label=\\\"\" + str1 + \"\\\"\");\n dot.push(\"\\t\\tshape=record style=filled fillcolor=white\\n\");\n dot.push(\"\\t]\\n\");\n dot.push(\"\\t\\\"\" + art.artifact + \"\\\" -> \\\"\" + y + \"\\\" [arrowhead=\\\"onormal\\\"]\");\n });\n\n /* observers */\n art.observers.forEach(function(y) {\n if (art.type !== \"cartago.AgentBodyArtifact\") {\n var s2 = (y.length <= MAX_LENGTH) ? y : y.substring(0, MAX_LENGTH) + \"...\";\n dot.push(\"\\t\\\"\" + y + \"\\\" [ \" + \"\\n\\t\\tlabel = \\\"\" + s2 + \"\\\"\\n\");\n dot.push(\"\\t\\tshape = \\\"ellipse\\\" style=filled fillcolor=white\\n\");\n dot.push(\"\\t];\\n\");\n dot.push(\"\\t\\\"\" + y + \"\\\" -> \\\"\" + art.artifact + \"\\\" [arrowhead=\\\"odot\\\"];\\n\");\n }\n });\n\n dot.push(\"}\\n\");\n\n /* Transition follows modal top down movement */\n var t = d3.transition().duration(750).ease(d3.easeLinear);\n d3.select(\"#artifactgraph\").graphviz().transition(t).renderDot(dot.join(\"\"));\n });\n}", "getVisitsGraphics() {\n return 90 + ',' + 70 + ',' + 90 + ',' + 70+ ',' + 75 + ',' + 80 + ',' + 70;\n }", "get sceneTopLevelGraphComponents() {\n this.__collectTopLevelSceneGraphComponents();\n return this.__topLevelSceneGraphComponents != null ? this.__topLevelSceneGraphComponents : [];\n }", "function getTrackListData () {\r\n const trackContainers = document.getElementsByClassName(\"trackContainer\");\r\n const tracks = [];\r\n for (let i = 0; i < trackContainers.length; i++) {\r\n container = trackContainers[i];\r\n tracks.push(getTrack(container));\r\n }\r\n return tracks;\r\n}", "groupings() {\n if (this._groupings) { // eslint-disable-line no-underscore-dangle\n return this._groupings; // eslint-disable-line no-underscore-dangle\n }\n if (this.viewType === 'scroll') {\n return [this.canvases];\n }\n if (this.viewType !== 'book') {\n return this.canvases.map(canvas => [canvas]);\n }\n const groupings = [];\n this.canvases.forEach((canvas, i) => {\n if (i === 0) {\n groupings.push([canvas]);\n return;\n }\n const isOddPage = i % 2 !== 0;\n const isEvenPage = !isOddPage;\n if ((isOddPage && !this.shiftBookView) || (isEvenPage && this.shiftBookView)) {\n // Odd page unshifted, or even page shifted\n groupings.push([canvas]);\n } else {\n // Odd page shifted, or even page unshifted\n groupings[groupings.length - 1].push(canvas);\n }\n });\n this._groupings = groupings; // eslint-disable-line no-underscore-dangle\n return groupings;\n }", "function _makeGrid () {\n\n let grid=[];\n\n for (let i = 0; i<8;i++){\n let rows = [];\n for( let j=0; j<8; j++){\n rows.push(undefined);\n }\n grid.push(rows);\n }\n\n grid[3][4] = new Piece(\"black\");\n grid[4][3] = new Piece(\"black\");\n grid[3][3] = new Piece(\"white\"); \n grid[4][4] = new Piece(\"white\"); \n\n return grid;\n}", "_getPathData() \n {\n var result = [];\n for(let chan=0;chan<this.config.params.plot.channelcount;chan++)\n {\n let data = this.chanData[chan];\n let chanres = [];\n let nextSlot = this.nextSlot[chan];\n\n // oldest data is at this.nextSlot, we want to run oldest to newest\n // this is only true after we've filled our array\n if(data.length < this.plotConfig.maxlength)\n {\n for(let i=0; i<data.length; i++)\n chanres.push(data[i]);\n }\n else\n for(let i=0; i<data.length; i++)\n {\n var j = (i + nextSlot) % this.plotConfig.maxlength;\n chanres.push(data[j]);\n }\n result.push(chanres);\n }\n return result;\n }", "function loadGroups() {\r\n\tgroups = [];\r\n\tgroups.push({\"group\":\"0\", \"gr1\":\"R2.7\"});\r\n\tgroups.push({\"group\":\"1\", \"gr1\":\"C1;C3.1;C3.2;C3.3\", \"title\":\"Risorse umane\", \"text\":\"(dettagliare i costi a seconda della causale, per esempio: compensi per personale; rimborsi spesa a favore di volontari e/o del personale). N.B. nel caso in cui i compensi per il personale superano il 50% dell’importo percepito è obbligatorio per le associazioni allegare copia delle buste paga del personale imputato fino alla concorrenza dell’importo rendicontato\"});\r\n\tgroups.push({\"group\":\"2\", \"gr1\":\"C2.1;C2.2;C5;C6.1;C8;C10\",\"title\":\"Costi di funzionamento\", \"text\":\"(dettagliare i costi a seconda della causale, per esempio: spese di acqua, gas, elettricità, pulizia; materiale di cancelleria; spese per affitto delle sedi; ecc…)\"});\r\n\tgroups.push({\"group\":\"3\", \"gr1\":\"C4;C6.2;C6.3;C7;C9;C11\", \"title\":\"Acquisto beni e servizi\", \"text\":\"(dettagliare i costi a seconda della causale, per esempio: acquisto e/o noleggio apparecchiature informatiche; acquisto beni immobili; prestazioni eseguite da soggetti esterni all’ente; affitto locali per eventi; ecc…)\"});\r\n\tgroups.push({\"group\":\"4\", \"gr1\":\"C12.2;C12.3\", \"title\":\"Erogazioni ai sensi della propria finalità istituzionale\", \"text\":\"N.B. in caso di erogazioni liberali ad altri enti/soggetti, anche esteri, è obbligatorio allegare copia del bonifico effettuato\"});\r\n\tgroups.push({\"group\":\"5\", \"gr1\":\"C12.1;C12.4;C13\", \"title\":\"Altre voci di spesa riconducibili al raggiungimento dello scopo sociale\", \"text\":\"\"});\r\n\tgroups.push({\"group\":\"6\", \"gr1\":\"P2.2\", \"title\":\"Accantonamento\", \"text\":\"(è possibile accantonare in tutto o in parte l’importo percepito, fermo restando che l’Ente beneficiario deve specificare nella relazione allegata al presente documento le finalità dell’accantonamento effettuato ed allegare il verbale del Consiglio di Amministrazione in cui viene deliberato l’accantonamento. Si fa presente, comunque, l’obbligo di spendere tutte le somme accantonate e rinviare il presente modello entro 24 mesi dalla percezione del contributo)\"});\r\n}", "linksToLines() {\n let gs = [];\n for (let i = 0, len = this._cs.length; i < len; i++) {\n let ln = this._cs[i];\n gs.push(new Pt_1.Group(this[ln[0]], this[ln[1]]));\n }\n return gs;\n }", "function showGraph() {\n\n let result = \"<br/><br/>\"\n for (let counter in currentGraph.vertices) {\n result = result + \"Adjacency List of vertex \" + currentGraph.vertices[counter].name + \"<br/>\";\n for (let edge of currentGraph.vertices[counter].adjList) {\n result = result + edge + \" \";\n }\n result = result + \"<br/><br/>\";\n }\n\n document.getElementById(\"graphRep\").innerHTML = result;\n}", "constructor() {\n // this.graphs = [];\n }", "get_graph(w) {\n let matrix = [...Array(this.nodes.length)].map(e => Array(this.nodes.length).fill(Z_open()));\n for(let e of this.edges) {\n matrix[e.i][e.j] = e.get_impedance(w);\n matrix[e.j][e.i] = matrix[e.i][e.j];\n }\n return matrix;\n }", "static async getall (params = {}) {\n try {\n const { data } = await request.get('/hierarchies', { params })\n\n return data || []\n } catch (error) {\n throw boom.boomify(error)\n }\n }", "function createList(seriesModel) {\n\t return createListFromArray(seriesModel.getSource(), seriesModel);\n\t } // export function createGraph(seriesModel) {", "function makeGrid(){\n\t\tvar startX = 149;\n\t\tvar startY = 119;\n\t\tvar interval = 6;\n\t\tvar nodeArray = [];\n\t\tfor (var i=0; i<660; i+=interval){\n\t\t\tfor (var j=0; j<660; j+=interval){\n\t\t\t\tnodeArray.push({x:startX+i,y:startY+j,city:null});\n\t\t\t}\n\t\t}\n\t\treturn nodeArray;\n\t}", "function get_metrics(finalize_groups) {\n\tvar finalize_groups = typeof finalize_groups !== 'undefined' ? finalize_groups : false;\n\n\tg_zoom_percent = Math.floor(g_fsize / 12 * 100);\n\n\tif(properties.doubleRowText) properties.groupHeaderRowsNumber = properties.groupHeaderRowsNumberDouble;\n\telse properties.groupHeaderRowsNumber = properties.groupHeaderRowsNumberSimple;\n if(!properties.showGroupHeaders) properties.extraRowsNumber=0;\n\telse properties.extraRowsNumber = getProperty(\"extraRowsNumber\", 0);\n\n cPlaylistManager.width = Math.floor(cPlaylistManager.default_width * g_zoom_percent / 100);\n cPlaylistManager.topbarHeight = Math.floor(cPlaylistManager.default_topbarHeight * g_zoom_percent / 100);\n cPlaylistManager.botbarHeight = Math.floor(cPlaylistManager.default_botbarHeight * g_zoom_percent / 100);\n cPlaylistManager.rowHeight = Math.floor(cPlaylistManager.default_rowHeight * g_zoom_percent / 100);\n cPlaylistManager.scrollbarWidth = Math.floor(cPlaylistManager.default_scrollbarWidth * g_zoom_percent / 100);\n\n if(properties.showHeaderBar) {\n //properties.headerBarHeight = Math.round(properties.defaultHeaderBarHeight * g_zoom_percent / 100);\n //properties.headerBarHeight = Math.floor(properties.headerBarHeight / 2) != properties.headerBarHeight / 2 ? properties.headerBarHeight : properties.headerBarHeight - 1;\n\t\tif(main_panel_state.isEqual(0) && properties.ParentName==\"MainPanel\") properties.headerBarHeight = properties.libraryHeaderBarHeight-1;\n\t\telse properties.headerBarHeight = properties.defaultHeaderBarHeight-1;\n } else {\n properties.headerBarHeight = 0;\n };\n if(properties.doubleRowText) {\n var _defaultRowHeight = properties.defaultRowHeight + properties.doubleRowPixelAdds;\n } else {\n var _defaultRowHeight = properties.defaultRowHeight;\n };\n properties.rowHeight = Math.round(_defaultRowHeight * g_zoom_percent / 100);\n cScrollBar.width = Math.floor(cScrollBar.defaultWidth * g_zoom_percent / 100);\n cScrollBar.minCursorHeight = Math.round(cScrollBar.defaultMinCursorHeight * g_zoom_percent / 100);\n //\n cover.margin = Math.floor(cover.default_margin * g_zoom_percent / 100);\n cover.w = properties.groupHeaderRowsNumber * properties.rowHeight;\n\tcover.max_w = properties.groupHeaderRowsNumber * properties.rowHeight;\n cover.h = properties.groupHeaderRowsNumber * properties.rowHeight;\n\tcover.max_h = properties.groupHeaderRowsNumber * properties.rowHeight;\n\n cFilterBox.w = Math.floor(cFilterBox.default_w * g_zoom_percent / 100);\n cFilterBox.h = Math.round(cFilterBox.default_h * 100 / 100);\n\n\tif(properties.doubleRowText)\n\t\tproperties.addedRows_end = Math.round(properties.addedRows_end_default/2)-((properties.showGroupHeaders)?properties.extraRowsNumber:0);\n\telse\n\t\tproperties.addedRows_end = properties.addedRows_end_default-((properties.showGroupHeaders)?properties.extraRowsNumber:0);\n\tif(properties.addedRows_end<0) properties.addedRows_end = 0;\n\n if(brw) {\n if(cScrollBar.enabled) {\n //brw.setSize(0, (properties.showHeaderBar ? properties.headerBarHeight : 0), ww - cScrollBar.width, wh - (properties.showHeaderBar ? properties.headerBarHeight : 0));\n\t\t\tbrw.setSize(0, (properties.showHeaderBar ? properties.headerBarHeight : 0), ww, wh - (properties.showHeaderBar ? properties.headerBarHeight : 0));\n } else {\n brw.setSize(0, (properties.showHeaderBar ? properties.headerBarHeight : 0), ww, wh - (properties.showHeaderBar ? properties.headerBarHeight : 0));\n };\n brw.setList(finalize_groups);\n //\n g_focus_row = brw.getOffsetFocusItem(g_focus_id);\n // if focused track not totally visible, we scroll to show it centered in the panel\n if(g_focus_row < scroll/properties.rowHeight || g_focus_row > scroll/properties.rowHeight + brw.totalRowsVis - 1) {\n scroll = (g_focus_row - Math.floor(brw.totalRowsVis / 2)) * properties.rowHeight;\n scroll = check_scroll(scroll);\n scroll_ = scroll;\n };\n if(brw.rowsCount > 0) brw.gettags(true);\n };\n}", "function emptySubplotLists() {\n var collectableSubplotTypes = Registry.collectableSubplotTypes;\n var out = {};\n var i, j;\n if (!collectableSubplotTypes) {\n collectableSubplotTypes = [];\n var subplotsRegistry = Registry.subplotsRegistry;\n for (var subplotType in subplotsRegistry) {\n var subplotModule = subplotsRegistry[subplotType];\n var subplotAttr = subplotModule.attr;\n if (subplotAttr) {\n collectableSubplotTypes.push(subplotType);\n\n // special case, currently just for cartesian:\n // we need to enumerate axes, not just subplots\n if (Array.isArray(subplotAttr)) {\n for (j = 0; j < subplotAttr.length; j++) {\n Lib.pushUnique(collectableSubplotTypes, subplotAttr[j]);\n }\n }\n }\n }\n }\n for (i = 0; i < collectableSubplotTypes.length; i++) {\n out[collectableSubplotTypes[i]] = [];\n }\n return out;\n}", "function showGroups(params) {\n term.clear();\n term.blue(\"Groups you belong to\\n\");\n drawLine();\n\n fs.readFile(os.homedir() + \"/.cligm.json\", 'utf8', function(err,data){\n if(!err) {\n var temp = JSON.parse(data).groups;\n for(var i in temp){\n term.white(temp[i].name + \"\\n\");\n }\n params();\n } else {\n term.red(\"Something has gone horribly wrong!\");\n }\n });\n}", "function generateCharts(schoolData, nationalData) {\n\n //Get all the chart elements\n var ctxLst = document.getElementsByClassName('charts');\n\n if (ctxLst.length > 0) {\n\n for (var i = 0; i < ctxLst.length; i++) {\n\n ctx = ctxLst[i].getContext('2d');\n\n //Get the id name of each of the chart elements\n var dataId = ctxLst[i].id;\n\n //Get the index in order to retrieve the list of data\n //required for a specific chart\n var index = getDataIndex(dataId);\n\n //Get the school and national data need for a specific chart\n var schoolChartData = [schoolData[index[0]], schoolData[index[1]], schoolData[index[2]]];\n\n var nationalChartData = [nationalData[index[0]], nationalData[index[1]], nationalData[index[2]]];\n\n //Remove any null result \n var chartData = dataForChart(schoolChartData, nationalChartData);\n\n //Generate the charts\n getChart(dataId, chartData, ctx);\n }\n }\n\n}", "function createAllGrids(){\n let allGrids = [];\n let startCoordinates = [];\n let tempGrid = [];\n for(let i=1; i<=9; i++){\n startCoordinates = setInitialCoordinates(i);\n tempGrid = createGrid(startCoordinates[0], startCoordinates[1]);\n allGrids.push(tempGrid);\n } \n return allGrids;\n}", "function show_available_graphs(table_data, data_type, county) {\n \n var skip_labels = ['Record ID', 'View report']\n , skip_labels_table = ['Record ID']\n , headings = []\n , table_headings = []\n , skip_indexes = []\n , too_many = []\n , data_and_msg\n , graph_type;\n //table stuff here \n table_data.cols.forEach(function(col, index) {\n if(skip_labels.indexOf(col.label) < 0) {\n headings.push({label:col.label, index: index});\n // group_on({label:col.label, index: index});\n }\n if (skip_labels_table.indexOf(col.label) < 0){\n table_headings.push(col);\n }\n else {\n skip_indexes.push(index);\n }\n });\n headings.forEach(function(heading) {\n data_and_msg = group_on(heading.label, data_type, headings, table_data.rows);\n \n if(data_and_msg['msg']) {\n too_many.push(data_and_msg['msg']);\n }\n\n });\n var source = find_source(county, data_type, headings, table_data.rows);\n make_table(table_data, table_headings, skip_indexes);\n if(too_many.length > 0) {\n var msg = '<div class=\"dd-graphs\"><p><b>The following fields have too many unique values to reasonably graph:</b></p>' + too_many.join(\"\\n\") + '</div>';\n $('#open-nc-widget').append(msg);\n\n }\n $('.graph-option').click(function() {\n which_graph = $(this).data('which');\n var graph_config = graph_configs[which_graph];\n $('.dd-graphs').each(function(index, el) {\n if($(this).attr('id') !== ('holder-' + which_graph)) {\n $(this).hide('slow');\n }\n });\n $(this).after('<button class=\"btn btn-default graph-show-all\">Back to all graphs</button>');\n $(this).hide();\n $('.graph-show-all').after(' <button class=\"btn btn-default graph-show-code\" style\"margin-left: 5px\">Get code</button>');\n $('.graph-show-code').click(function(e) {\n e.preventDefault();\n var graph_type = graph_config['graph_type'];\n var output_template = '_graph';\n var height = parseInt($('#graph-height').val()) || 'auto';\n var width = parseInt($('#graph-width').val());\n var context = {width: width, height: height, source: source, data: JSON.stringify(graph_config['data']), options: JSON.stringify(graph_config['options']), viz_type: graph_type ,script: 'script'};\n if(graph_type !== 'Table'){\n context['array_to'] = 'arrayTo';\n }\n else {\n context['view'] = JSON.stringify(graph_config.view);\n output_template = '_table';\n \n }\n var code = fill_template('embed_output' + output_template,context);\n var embed_textarea = fill_template('embed_textarea',{});\n $('#' + which_graph).before(embed_textarea);\n $('#embed-code').val(code);\n $('#embed-code').on('click',function() {\n this.select();\n });\n });\n $('.graph-show-all').click( function(e) {\n e.preventDefault();\n if(graph_type !== graph_config['graph_type']) {\n graph_type = graph_config['graph_type'];\n show_graph(graph_config,which_graph);\n }\n $('#embed-code-row, .widget-form, .graph-show-code').remove(); \n $('.dd-graphs').show('slow');\n $(this).remove();\n $('.graph-option').show();\n $('#graph-change-form').remove();\n });\n\n //puts existing values in form\n var form_template = 'graph_widget_form';\n var context = {};\n if(graph_config['graph_type'] === 'Table') {\n form_template = 'table_widget_form';\n context['headings'] = graph_config['headings'];\n }\n var form = fill_template(form_template, context);\n $('#holder-' + which_graph).append(form);\n if(graph_config['graph_type'] === 'LineChart') {\n $('#graph-change-row').remove();\n }\n $('.graph-change-param').each(function(i, el) {\n var param = $(this).data('option');\n var form_type = $(this).attr('type');\n var val;\n if(param.indexOf('.') !== -1) {\n var keys = param.split('.');\n var val_obj = graph_config['options'];\n keys.forEach( function(key) {\n val_obj = val_obj[key];\n });\n val = val_obj;\n }\n else {\n if(param === 'colors') {\n val = graph_config['options'][param][0];\n }\n else {\n val = graph_config['options'][param]; \n }\n }\n if(form_type === 'radio' || form_type === 'checkbox') {\n if($(this).val() === val) {\n $(this).attr('checked','checked');\n }\n \n }\n else {\n $(this).val(val);\n }\n });\n $('.graph-type').click( function() {\n graph_type = $(this).val();\n var temp_config = graph_config;\n graph_config['graph_type'] = graph_type;\n show_graph(graph_config,which_graph);\n });\n //puts form values in option obj\n $('#graph-change-button').click( function(e) {\n e.preventDefault();\n $('.graph-change-param').each( function(i, el) {\n var data_type = $(el).attr('type');\n if(data_type === 'number') {\n val = parseInt($(el).val());\n }\n else if (data_type === 'radio' || data_type === 'checkbox') {\n if($(el).is(':checked')) {\n val = $(el).val();\n }\n }\n else {\n val = $(el).val();\n }\n var param = $(el).data('option');\n if(param === 'hAxis.title' && val !== '' && val && (graph_config['graph_type'] === 'ColumnChart' || graph_config['graph_type'] === 'LineChart')) {\n graph_config['data'][0][1] = val;\n }\n if(param === 'vAxis.title' && val !== '' && val && graph_config['graph_type'] === 'BarChart') {\n graph_config['data'][0][1] = val;\n }\n if(param.indexOf('.') !== -1) {\n var keys = param.split('.');\n var val_obj = {};\n var last = keys.length;\n var first = keys[0];\n for(var i = 1; i < keys.length; i++) {\n val_obj[keys[i]] = val;\n }\n graph_config['options'][first] = val_obj;\n }\n else {\n if(param === 'colors') {\n if(graph_config['options']['colors'][0] !== val) {\n \n graph_config['options']['colors'].unshift(val);\n }\n }\n else {\n graph_config['options'][param] = val; \n }\n }\n \n });\n if(graph_config['graph_type'] === 'Table') {\n var show_cols = [];\n $('.table-fields').each(function(i, el) {\n if($(el).is(':checked')) {\n show_cols.push(parseInt($(el).val()));\n }\n });\n graph_config['view'] = show_cols;\n }\n show_graph(graph_config,which_graph);\n $('#embed-code-row').remove(); \n });\n $('#graph-change-reset').click(function(e) {\n e.preventDefault();\n $('.graph-change-param').each(function(i, el) {\n var param = $(this).data('option');\n var form_type = $(this).attr('type');\n var val;\n if(param.indexOf('.') !== -1) {\n var keys = param.split('.');\n var val_obj = graph_config['options'];\n keys.forEach( function(key) {\n val_obj = val_obj[key];\n });\n val = val_obj;\n }\n else {\n if(param === 'colors') {\n val = graph_config['options'][param][0];\n }\n else {\n val = graph_config['options'][param]; \n }\n }\n if(form_type === 'radio' || form_type === 'checkbox') {\n if($(this).val() === val) {\n $(this).prop('checked',true);\n }\n else {\n $(this).prop('checked', false);\n }\n \n }\n else {\n $(this).val(val);\n }\n if(graph_type !== 'ColumnChart') {\n graph_type = 'ColumnChart';\n show_graph(graph_config,which_graph);\n }\n }); \n });\n });\n }", "function makeGraphs(error, staffData) {\n var ndx = crossfilter(staffData);\n // Changes PizzaTime from a string to an integer\n staffData.forEach(function(d) {\n d.PizzaTime = parseInt(d.PizzaTime);\n });\n // Changes YearsService from string to integer\n staffData.forEach(function(d) {\n d.YearsService = parseInt(d.YearsService);\n });\n // Calls all data functions\n show_rank_balance(ndx);\n show_average_time_by_rank(ndx);\n show_years_of_service_vs_rank(ndx);\n show_years_service_vs_pizza_time(ndx);\n show_course_balance(ndx);\n show_number_of_staff(ndx);\n show_fastest_and_slowest_pizza_maker(ndx);\n show_percentage_split_of_under_40_seconds(ndx);\n show_longest_and_shortest_serving_worker(ndx);\n\n dc.renderAll();\n\n}", "function makeCharts() {\n issueChart();\n countChart();\n averageChart();\n}", "function $fde338bae77161dc$var$buildGraph() {\n const graph = {};\n // https://jsperf.com/object-keys-vs-for-in-with-closure/3\n const models = Object.keys($aXZ8b);\n for(let len = models.length, i = 0; i < len; i++)graph[models[i]] = {\n // http://jsperf.com/1-vs-infinity\n // micro-opt, but this is simple.\n distance: -1,\n parent: null\n };\n return graph;\n}", "getGroups() {\n\t return request.get({ uri: process.env.AUTHZ_API_URL + '/groups', json: true, headers: { 'Authorization': 'Bearer ' + this.accessToken } })\n\t .then(res => {\n\t log(chalk.green.bold('Groups:'), `Loaded ${res.groups.length} groups.`);\n\t return res.groups;\n\t });\n\t}", "getMultipleGraphDatas(state, getters) {\n const res = [\n {\n yAxisText: 'SOC',\n xAxisEnabled: false,\n labelsFormatterText: null,\n data: getters.getGraphDataSoc\n },\n {\n yAxisText: 'Intensity',\n xAxisEnabled: false,\n labelsFormatterText: 'I',\n data: getters.getGraphDataIntensity\n },\n {\n yAxisText: 'Temperature',\n xAxisEnabled: false,\n labelsFormatterText: '°',\n data: getters.getGraphDataTemperature\n },\n {\n yAxisText: 'Voltage',\n xAxisEnabled: true,\n labelsFormatterText: 'V',\n data: getters.getGraphDataVoltage\n },\n ];\n return res;\n }", "function fallback_graphs(data) {\n for(var s = 0; s < 8; s++) {\n create_graph(data, '&host=' + data['host'] + '&srv=' + data['service'] + '&source=' + s);\n }\n}", "function all() {\n\t if (resetNeeded) reset(), resetNeeded = false;\n\t return groups;\n\t }", "function createGraph(allPipe, allLead, allOpp, allSale, allCurrentPipe, allLost) {\n $('#pipelineName').show();\n $('#conversionName').show();\n $('#pipeLead').width((allLead / allCurrentPipe) * 800);\n $('#pipeOpportunity').width((allOpp / allCurrentPipe) * 800);\n $('#pipeSale').width((allSale / allCurrentPipe) * 800);\n $('#leadText').width((allLead / allCurrentPipe) * 800);\n $('#blankopp').width((allOpp / allCurrentPipe) * 800);\n $('#blankLead').width((allLead / allCurrentPipe) * 800);\n $('#oppText').width((allOpp / allCurrentPipe) * 800);\n $('#saleText').width((allSale / allCurrentPipe) * 800);\n // Calculate the widths for conversion rate\n var total = allLost + allSale;\n $('#wonOpp').width((allSale / total) * 660);\n $('#lostOpp').width((allLost / total) * 660);\n}", "function drawGraph(){\n if(graphData.length != 0){\n google.charts.load('current', {'packages':['corechart']});\n google.charts.setOnLoadCallback(drawChart);\n function drawChart() {\n var data = new google.visualization.DataTable();\n data.addColumn('number', 'Steps');\n data.addColumn('number', 'Time taken (in ms)');\n data.addRows(graphData);\n var options = {\n title: 'Algorithm Performance',\n vAxis: { title: \"Time taken (in ms)\" },\n hAxis: { title: \"Number of steps\" },\n legend: { position: 'bottom' }\n };\n var chart = new google.visualization.LineChart(document.getElementById('algograph'));\n chart.draw(data, options);\n }\n }\n}", "function generateGrid(length) {\n var grid = [];\n\n for(var i=0; i<length; ++i) {\n grid.push([]);\n }\n \n return grid;\n }", "function initVotingGraphs(){\n\t$(\".vote-result\").each(function(index){\n\t\tvoting_graph_list.push(makeVotingGraph($(this)));\n\t});\n}", "function show_chart() {\n outer_chart=[]\n inner_chart={}\n for(i=0;i<random_passenger_data.length;i++) {\n if(random_passenger_data[i].name.includes('sibsp') || random_passenger_data[i].name.includes('parch') || random_passenger_data[i].name.includes('fare')) {\n inner_chart['name'] = random_passenger_data[i].name\n inner_chart['value'] = random_passenger_data[i].value\n outer_chart.push(inner_chart)\n inner_chart={}\n }\n }\nreturn(outer_chart)\n}", "function pricesGuessGraph() {\n pricesGraph();\n for (let i = 0; i < houses.testData.length / 3; i++) {\n // Map colors\n let color = mapColor(tprice[i]);\n\n fill(color.r, color.g, color.b, 255);\n stroke(0, 105);\n strokeWeight(1);\n let x = map(tlon[i], 0, zoom, 0, wnx);\n let y = map(tlat[i], 0, zoom, wny, 200);\n ellipse(x + xoff, y + yoff, 5, 5);\n }\n}", "initHistory() {\n\t\tvar padding = 20,\n\t\t\tmarginWidth = 100,\n\t\t\twidth = screen.width - 500 - 500 - 2 * padding - marginWidth,\n\t\t\theight = 35;\n\n\t\tthis.checkpoints.forEach((cp, cp_i) => {\n\t\t\tthis.history[cp_i] = [];\n\t\t\tthis.historySVGDivs[cp_i] = [];\n\t\t\tthis.historySVGs[cp_i] = [];\n\t\t\tcp.testCases.forEach((testcase, tc_i) => {\n\t\t\t\tthis.history[cp_i][tc_i] = [];\n\t\t\t\tthis.historySVGDivs[cp_i][tc_i] = $(\"#history\" + cp_i + \"-\" + tc_i);\n\t\t\t\tthis.historySVGs[cp_i][tc_i] = d3.select(\"#history\" + cp_i + \"-\" + tc_i).append(\"svg\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\"width\", width)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\"height\", height);\n\t\t\t});\n\t\t});\n\t}", "reloadCharts() {\n for (const [, chart] of this.charts) {\n this.addChart(chart.factPath);\n }\n }", "function createGraph() {\n let graph = [];\n for (let i=0; i<v; i++) graph.push([]);\n\n for (let i of edges) {\n if (i.type === 1) continue;\n\n graph[i.from].push([i.to, parseInt(i.label)]);\n graph[i.to].push([i.from, parseInt(i.label)]);\n }\n return graph;\n}", "function getGraphEntries() {\n switch (currentUser.roles[0]) {\n case 'designer':\n return { primary: {key: \"approved\", value: \"Digitized\"}, secondary: {key: \"toBeApproved\", value: \"Yet to Approve\"} };\n break;\n case 'reviewer':\n return { primary: {key: \"approved\", value: \"Digitized\"}, secondary: {key: \"subToApprover\", value: \"Yet to Approve\"} };\n break;\n default:\n return { primary: {key: \"total\", value: \"Total Photos\"}, secondary: {key: \"approved\", value: \"Digitized\"} };\n } \n }", "function graphicSize() {\n var totalWindowWidth = window.innerWidth;\n var totalWindowHeight = window.innerHeight;\n\n var graphWidth = (totalWindowWidth - (windowMargins.left + windowMargins.right))/2;\n var graphHeight = (totalWindowHeight - (windowMargins.top + windowMargins.bottom))/2;\n\n return [graphWidth, 300];\n}", "function graphicSize() {\n var totalWindowWidth = window.innerWidth;\n var totalWindowHeight = window.innerHeight;\n\n var graphWidth = (totalWindowWidth - (windowMargins.left + windowMargins.right))/2;\n var graphHeight = (totalWindowHeight - (windowMargins.top + windowMargins.bottom))/2;\n\n return [graphWidth, 300];\n}", "function generateLines() { \n \t\t\tlet obj = {};\n \t\t\tlet arr = [];\n \t\t\tfor(let i = 0; i < rawData[selectedMeasures[0]].length; i++) { \n \t\t\t\tarr[i] = {}; \n \t\t\t\tfor(let j = 0; j < selectedMeasures.length; j++) {\n \t\t\t\t\tarr[i][selectedMeasures[j]] = rawData[selectedMeasures[j]][i];\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\treturn arr; \n \t}", "function loadGroups() {\n var url = EYA_CONF.biocacheServiceUrl + '/explore/hierarchy.json?callback=?';\n var params = {\n lat: $('#latitude').val(),\n lon: $('#longitude').val(),\n radius: $('#radius').val(),\n fq: 'geospatial_kosher:true',\n facets: 'species_group',\n qc: EYA_CONF.queryContext\n };\n\n $.getJSON(url, params, function(data) {\n if(data) {\n populateSpeciesGroups(data);\n }\n });\n }", "function getGraphInfos($experiment_node,$system_node){\n\tvar paintObject;\n\tvar paintObjectsArray = new Array();\n\t// Find the view name on root <system>\n\tvar $run_modules = $experiment_node.find('run');\n\t$run_modules.each(function(){\n\t\t// Find <paint> tags inside the run tag\t\n\t\t$paint_in_run_modules = $(this).find('paint');\n\t\t// Build the graph info array to return...\n\t\t$paint_in_run_modules.each(function(index,element) {\n\t\t\tvar paintObject = new Object();\n\t\t\tpaintObject.module = $(element).parent().attr('module');\n\t\t\t// Module can be remote. Atributes are defined like this\n\t\t\t// type=\"remote\" source=\"//62.204.199.218:1099/D71F73A7AE4E112B5DF4172E60E059E5\"\n\t\t\t// Default value\n\t\t\tpaintObject.isRemoteModule = false;\n\t\t\tif ( typeof $(this).attr('type') != \"undefined\"){\n\t\t\t\tmoduleType = $(this).attr('type');\n\t\t\t\tif (moduleType==\"remote\"){\n\t\t\t\t\t// Remote module !!!\n\t\t\t\t\tpaintObject.isRemoteModule = true;\n\t\t\t\t\tpaintObject.remoteSystem = $(this).attr('source');\n\t\t\t\t}\n\t\t\t}\n\t\t\t// names and colors!!!\n\t\t\tpaintObject.names = ($(this).attr('names')).split(\",\");\n\t\t\tpaintObject.colors = ($(this).attr('colors')).split(\",\");\n\t\t\tpaintObjectsArray.push(paintObject);\n\t\t\t// END of each of paint tags\n\t\t});\n\t\t// END of each of run modules\n\t});\n\treturn paintObjectsArray;\n}", "function buildGrid() {\n $scope.startup = false\n $scope.grid = []\n for (var i = 0; i < 6; i++) {\n var row = i\n $scope.grid[row] = [];\n for (var j = 0; j < 7; j++) {\n var column = j\n $scope.grid[row].push({ row: row, col: column })\n }\n }\n console.log($scope.grid);\n return $scope.grid\n }", "function showGraph() {\r\n\tvar size = 50;\r\n\tcontent = '<div style=\"display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; width: ' + (size + 10) * arguments.length + 'px; margin: 0 auto\">';\r\n\tfor (var divChild = 0; divChild < arguments.length; divChild++) {\r\n\t\tcontent += '<div style=\"background: ' + getRandomColor() + '; width: 50px; height: ' + arguments[divChild] * size + 'px\"></div>';\r\n\t}\r\n\tcontent += '</div>';\r\n\treturn content;\r\n}", "drawTopRanks(smallchartdiv, topRanks, data) {\n // console.log(data.length)\n // draw a rectangle element for each result\n // for (var i = 0; i < topRanks.length; i++) {\n // // create the svg for country row\n // var smallsvg = smallchartdiv\n // .append('svg')\n // .attr('width', 1200)\n // .attr('height', 460)\n // .attr(\"fill\", \"Black\");\n // // we will create 1 g for each small multiple graph\n // var g = smallsvg.append(\"g\");\n // g.append(\"text\")\n // .attr(\"x\", 0)\n // .attr(\"y\", 30 + 110)\n // .style(\"fill\", \"Black\")\n // .text(data[i].Name);\n // g.append(\"rect\")\n // .attr(\"x\", 300)\n // .attr(\"width\", 300)\n // .attr(\"height\", 300)\n // .style(\"fill\", \"White\");\n // g.append(\"rect\")\n // .attr(\"x\", 600)\n // .attr(\"width\", 300)\n // .attr(\"height\", 300)\n // .style(\"fill\", \"Green\");\n // g.append(\"rect\")\n // .attr(\"x\", 900)\n // .attr(\"width\", 300)\n // .attr(\"height\", 300)\n // .style(\"fill\", \"Blue\");\n // }\n }", "function displayGraphs(data) {\n $('#charts').html('');\n $('#all-programs tbody').html('');\n $.each(data, function(i, item) {\n if (i < numCharts) {\n $('#charts').append('<div class=\"chart-container\" data-program-id=\"' + item.ProgramID + '\"><div id=\"graph-' + item.ProgramID + '\" class=\"chart\"><h2>' + item.Name + '</h2><a href=\"#\" onclick=\"toggleEditProgramName($(this)); return false;\" class=\"edit-icon\"></a><h3>Sales by month</h3><div id=\"chart-' + item.ProgramID + '\"></div></div><div class=\"total-monthly\">' +\n '<table><thead>' +\n '<tr><td>Total Monthly</td><td>Current</td><td>1-Year</td></tr>' +\n '</thead><tbody>' +\n '<tr><td>Sales</td><td>' + formatCurrency(item.TotalMonthlySales) + '</td><td id=\"line-' + item.ProgramID + '\" class=\"line\"></td></tr>' +\n '</tbody></table>' +\n '</div><a href=\"#\" onclick=\"getPricing($(this)); return false;\">more</a><div class=\"additional-data\"></div></div>');\n buildChartData(item.Sales, \"chart-\" + item.ProgramID);\n buildLineData(item.Sales, \"line-\" + item.ProgramID);\n }\n else {\n var output = '<tr><td class=\"chart-container\" data-program-id=\"' + item.ProgramID + '\">' + item.Name + '<a href=\"#\" onclick=\"getPricing($(this)); return false;\">more</a><div class=\"additional-data\"></div></td><td>' + formatCurrency(item.TotalMonthlySales) + '</td><td>' + item.MonthlyAttendance + ' <span class=\"unit\">vists</span></td></tr>';\n $('#all-programs table').append(output);\n }\n });\n}", "function drawChartListing(livelist,livesale,liverent,pendinglist,pendsale,pendrent,lesspics,lesspicssale,lesspicsrent)\n\n\t\t\t{\n\n\t\t\t\tvar portalsArray = [];\n\n\t\t\t\tvar salesArray = [];\n\n\t\t\t\tvar rentalsArray = [];\n\n\t\t\t\tvar itemsCount = 0;\n\n\t\t\t\t//$.each(portalData, function( index, value ) {\n\n\t\t\t\t portalsArray.push([1,livelist]);\n\n\t\t\t\t salesArray.push([1,livesale]);\n\n\t\t\t\t rentalsArray.push([1,liverent]);\n\n\t\t\t\t // itemsCount++;\n\n\t\t\t\t//});\n\n\t\t\t\t portalsArray.push([2,pendinglist]);\n\n\t\t\t\t salesArray.push([2,pendsale]);\n\n\t\t\t\t rentalsArray.push([2,pendrent]);\n\n\t\t\t\t portalsArray.push([3,lesspics]);\n\n\t\t\t\t salesArray.push([3,lesspicssale]);\n\n\t\t\t\t rentalsArray.push([3,lesspicsrent]);\n\n\t\t\t\t itemsCount = 3;\n\n\t\t\t\t plotDataMe(salesArray,rentalsArray,portalsArray,itemsCount);\n\n\t\t\n\n\t\t\t\t\n\n\t\t\t}", "function buildCharts() {\n const charts = document.getElementsByClassName( 'simple-chart-target' );\n for ( let i = 0; i < charts.length; i++ ) {\n buildChart( charts[i] );\n }\n}", "function calculateGraphDim() {\n const w = window.innerWidth;\n const h = window.innerHeight;\n\n function greatestCommonDivisor(x, y) {\n if (typeof x !== 'number' || typeof y !== 'number') return false;\n x = Math.abs(x);\n y = Math.abs(y);\n while (y) {\n var t = y;\n y = x % y;\n x = t;\n }\n return x > 30 ? x : 30; // The minimal size of the table boxes is 20px\n }\n\n const gcd = greatestCommonDivisor(w, h);\n const tableW = Math.floor(w / gcd);\n const tableH = Math.floor(h / gcd);\n return [tableW, tableH];\n }", "function init_graph(){\n var list = [];\n var max_index = board.rows * board.cols - 1;\n for(var r = 0; r < board.rows; r++){\n for(var c = 0; c < board.cols; c++){\n var code = board.data[r][c];\n var index = r * board.rows + c;\n var right = index + 1;\n var below = index + board.cols;\n var adjacents = [];\n //open to the right and not on the right edge\n if(code.charAt(0) === '0' && c < (board.cols - 1)){\n util.assert(right >= 0 && right <= max_index);\n adjacents.push(right);\n //open to the bottom and not on the bottom edge\n }if(code.charAt(1) === '0' && r < (board.rows - 1)){\n util.assert(below >= 0 && below <= max_index);\n adjacents.push(below);\n }\n list.push(adjacents);\n }\n }\n board.graph = list;\n symmetric_closure(board.graph);\n }", "function getGrades(){\n return [8,8.5,6,7]\n}", "function getChampionships(params) {\n return datagraph.get(params.year+'.json' , params , null);\n }", "function drawSvg() {\n\t\t// selector can be #residential, or #commercial which should be in graph.html\n\t\tvar dataSources = [{selector: '#commercial', data: data.commGraphData}, \n\t\t\t{selector: '#residential', data: data.residGraphData}];\n\n\t\tdataSources.forEach(function(item) {\n\t\t\tvar canvas = createCanvas(item.selector, item.data);\n\t\t\tdrawHorizontalLabel(canvas);\n\t\t\tdrawVerticalLable(canvas, item.data);\n\t\t\tdrawHeatMap(canvas, item.data);\n\t\t});\n\t}", "function geometry(groups) {\n var path = [],\n i = -1,\n n = groups.length,\n d;\n var px = Math.floor(scale_x(groups[1].key)) - Math.floor(scale_x(groups[0].key));\n var space = Math.max(2,px / 6);\n var gap = Math.max(2,px - 2*space);\n var x,y,y2;\n while (++i < n) {\n d = groups[i];\n x = Math.round(scale_x(d.key));\n y = Math.round(scale_y(d.value));\n path.push(\"M\", x+ space, \",\", height, \"V\", y, \"h\"+ gap +\"V\", height);\n }\n return path.join(\"\");\n }" ]
[ "0.62509817", "0.62508154", "0.61527437", "0.6102442", "0.60972035", "0.57372195", "0.567425", "0.5500317", "0.53657454", "0.5306064", "0.5238956", "0.51961464", "0.5181526", "0.5177458", "0.5127694", "0.5091358", "0.5087445", "0.50514096", "0.5047456", "0.5043607", "0.5034449", "0.50241", "0.5002753", "0.49606064", "0.49550334", "0.49549744", "0.49117735", "0.49047825", "0.48913565", "0.48898733", "0.48835143", "0.48819163", "0.48792547", "0.48739344", "0.48716137", "0.48675293", "0.48637152", "0.48415777", "0.48389003", "0.48220968", "0.48215166", "0.48210216", "0.48062548", "0.48060837", "0.47993904", "0.4794524", "0.47890702", "0.47780034", "0.47681955", "0.47616398", "0.47541586", "0.47401717", "0.47353324", "0.47245386", "0.4718449", "0.47137615", "0.47136787", "0.47115788", "0.47068235", "0.4700485", "0.46997425", "0.4686738", "0.46863052", "0.46846533", "0.46845418", "0.46827316", "0.4682136", "0.46795443", "0.46776915", "0.46751794", "0.46747866", "0.46736306", "0.46669063", "0.4665764", "0.46653566", "0.46615037", "0.46586537", "0.46579644", "0.46554494", "0.46452528", "0.46450996", "0.4642959", "0.4642862", "0.4641432", "0.4641432", "0.4635104", "0.46342915", "0.4630775", "0.46283048", "0.46224838", "0.46222332", "0.46155998", "0.4615465", "0.46151152", "0.46142825", "0.4613527", "0.46116638", "0.46107614", "0.46067196", "0.45974654" ]
0.5222326
11
This function is used to add a graph to a dashboard.
static async addGraph(email, dashboardID, title, options, metadata) { let query = 'INSERT INTO GRAPH as g (dashboardid, title, metadata, options) (SELECT $1,$2,$3,$4 WHERE EXISTS (SELECT $5 FROM dashboard AS d WHERE (d.email = $5) AND (d.ID = $1)) ) RETURNING g.*'; return new Promise((resolve, reject) => { Database.sendQuery(query, [dashboardID, title, JSON.stringify(metadata), JSON.stringify(options), email]) .then((result) => { // console.log(result); if (result.rows.length > 0) resolve(result.rows[0]); else reject(result); }) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addToGraphs() {\n if (data.getNumberOfRows() >= 5) {\n\t\tdata.removeRow(0);\n\t\tdataViaAjax();\n\t\tdrawChart();\n\t }\n\t }", "function updateDashboard() {\n setGraph1();\n setGraph2();\n setGraph3();\n}", "function createGraph()\n\t{\n\t\tgraph = that.add('graph', {\n\t\t\tw: that.size,\n\t\t\th: that.size,\n\t\t\tinputCount: that.inputCount,\n\t\t\teq: [{eq:that.eq.eq, color: style.eqColor}],\n\t\t\txRange: that.axis.x,\n\t\t\tyRange: that.axis.y,\n\t\t\tlabelSkip: that.axis.skip,\n\t\t\tusePiLabels: that.axis.usePiLabels\n\t\t}, {\n\t\t\ttop: that.id + ' top ' + style.margin,\n\t\t\tleft: that.id + ' left ' + style.margin\n\t\t});\n\t}", "function makegraph() {\n\tchart = new CanvasJS.Chart(\"graphDiv\", {\n\t\taxisX: {\n\t\t\ttitle: _(\"Cycle number\"),\n\t\t\t/** x axis label */\n\t\t\ttitleFontSize: 22,\n\t\t\t/** Chart font size */\n\t\t\tlabelFontSize: 18,\n\t\t\tminimum: 0,\n\t\t\tinterval: 2\n\t\t},\n\t\taxisY: {\n\t\t\ttitle: _(\"Amount of DNA\"),\n\t\t\ttitleFontSize: 22,\n\t\t\tlabelFontSize: 18,\n\t\t\tminimum: 0\n\t\t},\n\t\tshowInLegend: false,\n\t\tdata: [{\n\t\t\tcolor: \"red\",\n\t\t\ttype: \"line\",\n\t\t\tmarkerType: \"circle\",\n\t\t\tlineThickness: 3,\n\t\t\tdataPoints: dataplotArray /** Datapoints to be plot, stored in the array */\n\t\t}]\n\t});\n\tchart.render();\n\tchain_reaction_stage.update();\n}", "function createGraph(graphData) {\n Highcharts.chart('graph', {\n chart: {\n zoomType: 'x',\n type: 'line'\n },\n title: {\n text: graphData.title\n },\n tooltip: {\n valueDecimals: 2\n },\n xAxis: {\n type: 'datetime',\n title: {\n text: graphData.xAxisTitle\n }\n },\n yAxis: {\n type: 'linear',\n title: {\n text: graphData.yAxisTitle\n }\n },\n series: graphData.series,\n exporting: {\n buttons: {\n contextButton: {\n menuItems: ['viewFullscreen', 'separator', 'downloadPNG', 'downloadJPEG', 'downloadSVG']\n }\n }\n }\n });\n }", "function addDataToGraph(theData) {\n const theDataHistorial = theData.historial; //obtener historial del JSON de la tienda\n setGraphData({\n labels: theDataHistorial.map((aName) => aName.fecha), //labels con las fechas de actualización\n datasets: [\n {\n label: \"Quantity of the store\",\n data: theDataHistorial.map((item) => item.cantidadAnterior), //datos con la cantidad anterior en la actualizacion\n fill: false,\n backgroundColor: \"rgb(255, 255, 255)\",\n borderColor: \"#1d2d44\",\n },\n ],\n });\n }", "function attachGraphToPlaceholder (inputObjectWithData) {\n // Build the Graph chart\n if (!inputObjectWithData || !inputObjectWithData.elementId || !inputObjectWithData.graphData) {\n return;\n }\n Highcharts.chart(inputObjectWithData.elementId, inputObjectWithData.graphData);\n }", "function drawGraph(){\n if(graphData.length != 0){\n google.charts.load('current', {'packages':['corechart']});\n google.charts.setOnLoadCallback(drawChart);\n function drawChart() {\n var data = new google.visualization.DataTable();\n data.addColumn('number', 'Steps');\n data.addColumn('number', 'Time taken (in ms)');\n data.addRows(graphData);\n var options = {\n title: 'Algorithm Performance',\n vAxis: { title: \"Time taken (in ms)\" },\n hAxis: { title: \"Number of steps\" },\n legend: { position: 'bottom' }\n };\n var chart = new google.visualization.LineChart(document.getElementById('algograph'));\n chart.draw(data, options);\n }\n }\n}", "async _showChart(node, parentId, typeChart, isFromEdge = false, secondNode = null, isFromCluster = false, isFromHC = false, newQuery = null) {\n let title, chartNode, viewChild, link, convertData;\n var parentPosition = await this.getPosition();\n var childId = \"chart-\" + state.indexChart;\n let _viewChild = select(this._dashboard.shadowRoot.querySelector(\".graph\")).append(\"mge-view\")\n .attr(\"x\", parentPosition.x + 30)\n .attr(\"y\", parentPosition.y + 30)\n .attr(\"dataset-name\", \"data-\" + state.indexQueryData)\n .attr(\"type-vis\", typeChart)\n .attr(\"id-view\", childId);\n chartNode = await _viewChild.node().getChart();\n await chartNode.setData(node, state._data[this.datasetName], secondNode, isFromEdge, isFromCluster, isFromHC);\n convertData = await chartNode.setData();\n viewChild = _viewChild.node();\n if (newQuery)\n title = newQuery.name;\n else\n title = await this.generateTitle(node, convertData, typeChart, parentId, isFromEdge, secondNode, isFromCluster, isFromHC);\n await viewChild.setTitle(title);\n link = await this._dashboard._addLink(this.element, viewChild);\n await this._dashboard.addChart(parentId, {\n id: childId, title: title, typeChart: viewChild.typeVis, hidden: false,\n x: viewChild.x, y: viewChild.y, view: viewChild, link: link\n });\n await this._dashboard.refreshLinks();\n if (typeChart == state.typeChart.histogram) {\n if (node.cluster) {\n alert(\"Not implemented!!\");\n return;\n }\n }\n return _viewChild;\n }", "function loaded(){\n graph([]);\n pieChart([],[],[],[]);\n}", "function drawGraph () {\n var model = modelConnect();\n var drawGraphAPI = \"showData(\\\"Sample Data\\\",[{name:\\\"A Chart\\\",type: \\\"chart\\\",xLabel: \\\"Chart x-axis\\\",yLable: \\\"Chart y-axis\\\",Legend: \\\"top\\\",horizontalGrid: true, verticalGrid: true,xType:\\\"Numeric\\\",xData: [1,2,3,4,5], data:[{data: [1,4,9,16,25],type:\\\"line\\\",name:\\\"Energy\\\",},{data: [1,2,3,4,5],type:\\\"line\\\", name:\\\"Cost\\\"}] }])\";\n model.postMessage(drawGraphAPI,\"*\");\n}", "function updateChart(_graph) {\r\n\r\n\t\t//get the name and dashboard and plot data, \r\n\t\t//the chart id matches the dashboard_graphname key\r\n\t\t//as it is created in this way in the template\r\n\t\t//for now, just alert the data\r\n\t\t//alert(\"you updated the graph, it is: \"+ JSON.stringify(graph));\r\n\t\tvar graph = JSON.parse(_graph)\r\n\t\tvar containerID = \"\"+graph.dashboard +\"_\"+graph.name;\r\n\r\n\t\t//var test = false; \r\n\t\t//alert(\"xplot: \"+graph.xplot)\t\r\n\t\t///alert(\"yplot: \"+graph.yplot)\r\n\t\t//create the chart\r\n\t\t\r\n\t\t//alert(\"updateChart container id for set up: \" + containerID)\r\n\t\t//alert(graph.graph)\r\n\t\t//containerID, type, xTitle, yTitle, startDate, endDate, source\r\n\t\t//var chart = setUpChart(containerID, graph.graph.toString(), graph.startDate, graph.endDate, \"Webtrends\")\r\n\t\tvar chart = setUpChart(containerID, graph.graph.toString())\r\n\r\n\t\r\n\t\t//Fill in the data into the chart\r\n\t\t\r\n\t\t/*\r\n\t\t\r\n\t\t//update management Chart\r\n\t\t//if(!test){\r\n\t var jqueryAdress = \"#\"+containerID;\r\n\t\t\r\n\t\t//var chart=$(containerID).highcharts();\r\n\t\t\r\n\t\t//var chart=$(jqueryAdress).highcharts();\r\n\t\t\r\n\t\t\r\n\t\t//} else {\t\r\n\t\t\t//update chart 1\r\n\t\t//var chart=$(\"#containerChAnalyticsGraph1\").highcharts();\r\n\t\t//}\r\n\t\t//alert(\"id 1: \"+containerID)\r\n\t\t//alert(\"data in update chart \"+JSON.stringify(graph))\r\n\t\t//var gr = JSON.stringify(graph)\r\n\t\t//var _containerID = \"#\"+gr.dashboard+\"_\"+gr.selectedName;\r\n\t\t//alert(\"chart \"+chart.type)\r\n\t\t//alert(\"chart type \"+chart.type)\r\n\t\t//var integerArray = [ JSON.parse(data).yAxis ];*/\r\n\t\ttry{\r\n\t\t\tvar str = graph.yplot.toString();\r\n\t\t\t//alert(\"y in update \"+str)\r\n\t\t\tvar _res = str.split(\",\");\r\n\t\t\tvar res = [];\r\n\t\t\t//alert(\"res1: \"+res)\r\n\t\t\t//alert(\"str.split 1 \"+str);\t\r\n\t\t\t//alert(\"iArray1: \"+integerArray);\t\t\t\r\n\t\t\tfor( var i = 0; i < _res.length; i++ ) {\r\n\t\t\t\tres.push(parseInt( _res[i], 10 ));\r\n\t\t\t}\r\n\t\t\t//alert(\"after split: \"+res);\t\t\t\r\n\t\t\t//http://jsfiddle.net/4tuvC/\r\n\t\t\t//chart.xAxis[0].setCategories(data[0]);\r\n\t\t\t//chart[0].xAxis[0].update(data[\"xAxis\"], true);\r\n\t\t\t\r\n\t\t\t//chart.series[0].setData( res ,true);\r\n\t\t\t\t\t\r\n\t\t\tchart.addSeries({\r\n\t data: res\r\n\t })\r\n\t\t\t\r\n\t\t\t/*\r\n\t\t\t////////////////////////////////////////////////////////\r\n\t\t\t//plot labels\r\n\t\t\t////////////////////////////////////////////////////////\r\n\t\t\t//var stringArray = [ JSON.parse(data).xAxis ];\r\n\t\t\tstr = graph.xplot.toString()\r\n\t\t\t//str = JSON.parse(graph).xplot.toString();\r\n\t\t\t//alert(\"xplot in try: \" + str)\r\n\t\t\tvar _res = str.split(\",\");\r\n\t\t\t//alert(\"str.split: 2\" + _res)\r\n\t\t\t/*alert(\"res1: \"+res)*/\t\t\r\n\t\t\t//http://jsfiddle.net/4tuvC/\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//chart.xAxis[0].setCategories(_res);\r\n\t\t\t//chart[0].xAxis[0].update(res, true);\r\n\t\t\t\r\n\t\t} catch (e){\r\n\t\t\t//alert(\"made a mistake\")\r\n\t\t}\r\n}", "addDataVisuals () {\n }", "async function updateDashboardPlots() {\r\n\tawait createDashboardPlot();\r\n}", "function show_graph(graph_config, graph_div) {\n var graph_type = graph_config.graph_type || \"ColumnChart\";\n if(graph_type === 'Table') {\n var data = new google.visualization.DataTable(graph_config.data);\n data = new google.visualization.DataView(data);\n if(graph_config.view) {\n data.setColumns(graph_config.view);\n }\n }\n else {\n var data = new google.visualization.arrayToDataTable(graph_config.data);\n }\n var chart = new google.visualization[graph_type](document.getElementById(graph_div));\n chart.draw(data, graph_config.options);\n \n }", "static setNewGraph(graphData = null) {\n exports.graph = new GraphCustom(graphData);\n }", "function GraphNewCtrl(Graph, $scope, $location) {\r\n $scope.$emit('updatePath', '/graphs/');\r\n $scope.$emit('updateMenu', 'graphs');\r\n var graph = Graph.get();\r\n $scope.graph = graph;\r\n\r\n $scope.save = function (graph) {\r\n graph.$create();\r\n $location.path('/graphs/');\r\n };\r\n\r\n\r\n}", "function push(chart) {\n charts.push(chart);\n }", "function graphCreate(id) {\n ctx = document.getElementById(id).getContext(\"2d\");\n myLine = new Chart(ctx)\n myLineChart = myLine.Line(producersIds[id].data, {\n tooltipTemplate: \"<%if (label){%><%=label%>: <%}%><%= value %>kb\",\n });\n producersIds[id].canvas = ctx;\n producersIds[id].myLine = myLine;\n producersIds[id].myLineChart = myLineChart;\n\n}", "function addGraphTabs() {\n const graphContainer = document.getElementById(\"graphs-container\");\n const graphListTarget = document.querySelector(\"#graph-btn\");\n\n // Add buttons to display graphs\n graphContainer.childNodes.forEach(element => {\n if (element.nodeType !== Node.TEXT_NODE) {\n const button = document.createElement(\"button\");\n button.classList.add(\"btn\", \"btn-sm\", \"btn-outline-secondary\");\n button.textContent = element.dataset.graphName;\n graphListTarget.appendChild(button);\n\n button.addEventListener(\"click\", (e) => {\n document.querySelectorAll(\"#graph-btn button\").forEach((otherBtn) => {\n otherBtn.classList.remove('active');\n });\n e.target.classList.add('active');\n document.querySelectorAll(\".graph-display\").forEach((otherGraph) => {\n otherGraph.classList.add(\"hidden\");\n });\n\n element.classList.remove(\"hidden\");\n });\n }\n });\n\n document.querySelector(\"#graph-btn button\").classList.add('active');\n}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'X');\n data.addColumn('number', 'Price');\n \n data.addRows(graphData)\n\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.LineChart(document.getElementById('chart_div'));\n chart.draw(data, fullWidthOptions);\n }", "function make_graph() {\n $.get(\"/user_progress_analytics\",function (data, status) {\n let pc = document.getElementById('progressBarGraph').getContext('2d');\n let myChart = new Chart(pc, {\n type: 'bar',\n data: {\n labels: [\"Completed\", \"Uncompleted\"],\n datasets: [{\n label: '# of Tasks',\n data: data,\n backgroundColor: [\n 'rgba(75, 192, 192, 0.2)', // GREEN\n 'rgba(255, 99, 132, 0.2)', // RED\n\n // 'rgba(54, 162, 235, 0.2)', // BLUE\n // 'rgba(255, 206, 86, 0.2)', // YELLOW\n // 'rgba(153, 102, 255, 0.2)', // PURPLE\n // 'rgba(255, 159, 64, 0.2)' // Orange\n ],\n borderColor: [\n 'rgba(75, 192, 192, 1)',\n 'rgba(255,99,132,1)',\n //\n // 'rgba(54, 162, 235, 1)',\n // 'rgba(255, 206, 86, 1)',\n // 'rgba(153, 102, 255, 1)',\n // 'rgba(255, 159, 64, 1)'\n ],\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero:true\n }\n }]\n },\n title: {\n display: true,\n text: 'Overall Project Progress Based On Tasks Completed To Tasks Uncompleted'\n }\n }\n });\n });\n}", "function showGraph() {\n if ($('.about-graph').length !== 0) {\n var aboutGraph = new Graph('.about-graph', '/js/graph-data', {\n clickActiveElements: []\n });\n\n $('#aboutGraph').on('click', function() {\n if (!$(this).hasClass('active')) {\n aboutGraph.update('/js/graph-data', {\n removeElements: [],\n clickActiveElements: []\n });\n\n $('.about-graph-buttons a').each(function() {\n if ($(this).hasClass('active')) {\n $(this).removeClass('active');\n }\n\n if ($(this).hasClass('skills')) {\n $(this).addClass('active');\n }\n });\n }\n\n $(this).toggleClass('active');\n $('.about-toggle-button').toggleClass('active');\n\n $('.hideaway-content').slideToggle('middle');\n\n $('.showing-content').slideToggle('middle');\n });\n\n $('.about-graph-buttons a.skills').on('click', function () {\n aboutGraph.update('/js/graph-data', {\n removeElements: [],\n clickActiveElements: []\n });\n });\n\n $('.about-graph-buttons a.education').on('click', function () {\n aboutGraph.update('/js/second-graph-data', {\n removeElements: [\n 'xAxis',\n 'pathArea',\n 'yAxis',\n 'tooltips'\n ],\n extendedTooltip: true\n });\n });\n\n $('.about-graph-buttons a').on('click', function() {\n $('.about-graph-buttons a').removeClass('active');\n $(this).addClass('active');\n });\n\n\n addWidth();\n\n $window.resize(function () {\n addWidth();\n });\n }\n /**\n * Function to add width to graph parent container when window width less than 767px.\n */\n function addWidth() {\n if (window.innerWidth <= 767) {\n $('.about-graph').width(window.innerWidth - 100);\n } else {\n $('.about-graph').removeAttr('style');\n }\n }\n }", "function showGraph() {\n if ($('.about-graph').length !== 0) {\n var aboutGraph = new Graph('.about-graph', '/js/graph-data', {\n clickActiveElements: []\n });\n\n $('#aboutGraph').on('click', function() {\n if (!$(this).hasClass('active')) {\n aboutGraph.update('/js/graph-data', {\n removeElements: [],\n clickActiveElements: []\n });\n\n $('.about-graph-buttons a').each(function() {\n if ($(this).hasClass('active')) {\n $(this).removeClass('active');\n }\n\n if ($(this).hasClass('skills')) {\n $(this).addClass('active');\n }\n });\n }\n\n $(this).toggleClass('active');\n $('.about-toggle-button').toggleClass('active');\n\n $('.hideaway-content').slideToggle('middle');\n\n $('.showing-content').slideToggle('middle');\n });\n\n $('.about-graph-buttons a.skills').on('click', function () {\n aboutGraph.update('/js/graph-data', {\n removeElements: [],\n clickActiveElements: []\n });\n });\n\n $('.about-graph-buttons a.education').on('click', function () {\n aboutGraph.update('/js/second-graph-data', {\n removeElements: [\n 'xAxis',\n 'pathArea',\n 'yAxis',\n 'tooltips'\n ],\n extendedTooltip: true\n });\n });\n\n $('.about-graph-buttons a').on('click', function() {\n $('.about-graph-buttons a').removeClass('active');\n $(this).addClass('active');\n });\n\n\n addWidth();\n\n $window.resize(function () {\n addWidth();\n });\n }\n /**\n * Function to add width to graph parent container when window width less than 767px.\n */\n function addWidth() {\n if (window.innerWidth <= 767) {\n $('.about-graph').width(window.innerWidth - 100);\n } else {\n $('.about-graph').removeAttr('style');\n }\n }\n }", "function setGraph() {\r\n\tchartBusyProc();\r\n\tvar lyrId = $(\"#chartLayer\").val();\r\n\t// console.log(lyrId);\r\n\tif (lyrId == 'x') {\r\n\t\tif (typeof chartFun == 'undefined') {\r\n\t\t\t// chartBusyDone();\r\n\t\t\tchartError('Selection required to display graph');\r\n\t\t}\r\n\t\teval(chartFun+'(\"'+ newUrl+'\")');\r\n\t} else { /// assuming wms layer\r\n\t\tvar lyr = map.getLayer(lyrId);\r\n\t\tif (typeof markers == 'undefined') {\r\n\t\t\t// chartBusyDone();\r\n\t\t\tchartError(\"A location on the map needs to be selected.\");\r\n\t\t} else {\r\n\t\t\tWMSFeatInfo(lyr);\r\n\t\t} \r\n\t}\r\n}", "drawGraph() {\n logger.debug('ParticipantScore: drawGraph', this.props.graphType);\n const chart = this.chart;\n\n const timelineData = this.props.graphDatasets[GraphDatasetTypes.UTTERANCE_TIMELINE].data;\n logger.debug('ParticipantScore: timelineData', { timelineData });\n\n // Is this component trying to visualise an empty dataset?\n const emptyDataset = timelineData.utts.length === 0;\n if (emptyDataset) {\n chart.hide();\n this.props.dashboardGraphLoaded(this.props.graphType);\n return;\n }\n chart.show();\n\n const chartData = this.getGraphData();\n chart.data = chartData;\n }", "function createDashboard(data, labelsParam, from, to, ajaxUrlParam) {\n labels = labelsParam;\n ajaxUrl = ajaxUrlParam;\n if (data[0] == undefined) {\n //No data to show, so just stop here\n $(\"detailDataContainer\").show();\n return;\n }\n board = new DcDashboard();\n // Set dashboard width same as div width\n // var width = $(\".dashboardContainer\").css(\"width\").replace(\"px\", \"\");\n // board.setDashboardWidth(+width);\n charts = new Object();\n var dataCounts = getDataCounts(data);\n showUniqueValues(dataCounts, data, labels);\n\n // BROWSER FILTER\n var browser = board.allData.dimension(function (d) {\n return \"\" + d['browser'];\n });\n var browserGroup = browser.group().reduceSum(function (d) {\n return d['count']\n });\n var browserLabelAccessor = function (d) {\n return labels['browser'] ? labels['browser'][d.key] : d.key;\n };\n var browserPie = board.addPieChart('dcChart', 'browser-chart', browser, browserGroup, browserLabelAccessor);\n\n browserPie.title(function (d) {\n var label = labels['browser'] ? labels['browser'][d.key] : d.key;\n return label + \": \" + d.value;\n });\n charts[\"browser-chart\"] = browserPie;\n\n // MEDIATYPE FILTER\n var mediaType = board.allData.dimension(function (d) {\n return \"\" + d['mediaType'];\n });\n var mediaTypeGroup = mediaType.group().reduceSum(function (d) {\n return d['count']\n });\n var mediaTypeLabelAccessor = function (d) {\n return d.key\n };\n charts[\"mediaType-chart\"] = board.addPieChart('dcChart', 'mediaType-chart', mediaType, mediaTypeGroup, mediaTypeLabelAccessor);\n\n // SUBTYPE FILTER\n var subtype = board.allData.dimension(function (d) {\n return \"\" + d['subtype'];\n });\n var subtypeGroup = subtype.group().reduceSum(function (d) {\n return d['count'];\n });\n var subtypeLabelAccessor = function (d) {\n return d.key\n };\n charts[\"subtype-chart\"] = board.addPieChart('dcChart', 'subtype-chart', subtype, subtypeGroup, subtypeLabelAccessor);\n\n // PAGE FILTER\n var page = board.allData.dimension(function (d) {\n return \"\" + d['page'];\n });\n var pageGroup = page.group().reduceSum(function (d) {\n return d['count'];\n });\n var pageLabelAccessor = function (d) {\n return labels['page'] ? labels['page'][d.key] : d.key\n };\n var pagePie = board.addPieChart('dcChart', 'page-chart', page, pageGroup, pageLabelAccessor);\n pagePie.title(function (d) {\n var label = labels['page'] ? labels['page'][d.key] : d.key;\n return label + \": \" + d.value;\n });\n charts[\"page-chart\"] = pagePie;\n\n //JOBGROUP FILTER\n var jobGroup = board.allData.dimension(function (d) {\n return \"\" + d['jobGroup']\n });\n var jobGroupGroup = jobGroup.group().reduceSum(function (d) {\n return d['count'];\n });\n var jobGroupLabelAccessor = function (d) {\n if (d.key < 0) {\n return \"undefined\"\n }\n return labels['jobGroup'] ? labels['jobGroup'][d.key] : \"\" + d.key\n };\n var jobGroupPie = board.addPieChart('dcChart', 'jobGroup-chart', jobGroup, jobGroupGroup, jobGroupLabelAccessor);\n jobGroupPie.title(function (d) {\n var label = labels['jobGroup'] ? labels['jobGroup'][d.key] : d.key;\n return label + \": \" + d.value;\n });\n charts[\"jobGroup-chart\"] = jobGroupPie;\n\n // MEASURED EVENT FILTER\n var measuredEvent = board.allData.dimension(function (d) {\n return \"\" + d['measuredEvent'];\n });\n var measuredEventGroup = measuredEvent.group().reduceSum(function (d) {\n return d['count'];\n });\n var measuredEventLabelAccessor = function (d) {\n if (d.key < 0) {\n return \"undefined\"\n }\n return labels['measuredEvent'] ? labels['measuredEvent'][d.key] : \"\" + d.key\n };\n var measuredEventPie = board.addPieChart('dcChart', 'measuredEvent-chart', measuredEvent, measuredEventGroup, measuredEventLabelAccessor);\n measuredEventPie.title(function (d) {\n var label = labels['measuredEvent'] ? labels['measuredEvent'][d.key] : d.key;\n return label + \": \" + d.value;\n });\n charts[\"measuredEvent-chart\"] = measuredEventPie;\n\n // HOST FILTER\n if (dataCounts['host'] > 1) {\n var host = board.allData.dimension(function (d) {\n return \"\" + d['host'];\n });\n var hostGroup = host.group().reduceSum(function (d) {\n return d['count'];\n });\n var hostLabelAccessor = function (d) {\n return d.key\n };\n charts[\"host-chart\"] = board.addRowChart('dcChart', 'host-chart', host, hostGroup, dataCounts['host'], hostLabelAccessor);\n }\n\n var loadingIndicatorGlobal = document.getElementById(\"loadingIndicatorGlobal\");\n loadingIndicatorGlobal.style.display = 'none';\n var detailDataContainer = document.getElementById(\"detailDataContainer\");\n detailDataContainer.style.display = 'block';\n\n // Show count of selected data\n board.addDataCount('dcChart', 'dc-data-count');\n\n // ### BEGIN LINE CHARTS\n var date_Dimension = board.allData.dimension(function (d) {\n return d.date;\n });\n\n var loadTime_ttfb_avg = date_Dimension.group().reduce(\n //add\n function (p, v) {\n p.count += v['count'];\n p.loadTimeSum += v['loadTimeMs_avg'] * v['count'];\n p.loadTimeAvg = p.count ? d3.round((p.loadTimeSum / p.count), 2) : 0;\n p.ttfbSum += v['ttfb_avg'] * v['count'];\n p.ttfbAvg = p.count ? d3.round((p.ttfbSum / p.count), 2) : 0;\n p.downloadTimeSum += v['downloadTime_avg'] * v['count'];\n p.downloadTimeAvg = p.count ? d3.round((p.downloadTimeSum / p.count), 2) : 0;\n p.sslTimeSum += v['sslTime_avg'] * v['count'];\n p.sslTimeAvg = p.count ? d3.round((p.sslTimeSum / p.count), 2) : 0;\n p.connectTimeSum += v['connectTime_avg'] * v['count'];\n p.connectTimeAvg = p.count ? d3.round((p.connectTimeSum / p.count), 2) : 0;\n p.dnsTimeSum += v['dnsTime_avg'] * v['count'];\n p.dnsTimeAvg = p.count ? d3.round((p.dnsTimeSum / p.count), 2) : 0;\n p.bytesInSum += v['bytesIn_avg'] * v['count'];\n p.bytesInAvg = p.count ? d3.round((p.bytesInSum / p.count), 2) : 0;\n p.bytesOutSum += v['bytesOut_avg'] * v['count'];\n p.bytesOutAvg = p.count ? d3.round((p.bytesOutSum / p.count), 2) : 0;\n return p;\n },\n //remove\n function (p, v) {\n p.count -= v['count'];\n p.loadTimeSum -= v['loadTimeMs_avg'] * v['count'];\n p.loadTimeAvg = p.count ? d3.round((p.loadTimeSum / p.count), 2) : 0;\n p.ttfbSum -= v['ttfb_avg'] * v['count'];\n p.ttfbAvg = p.count ? d3.round((p.ttfbSum / p.count), 2) : 0;\n p.downloadTimeSum -= v['downloadTime_avg'] * v['count'];\n p.downloadTimeAvg = p.count ? d3.round((p.downloadTimeSum / p.count), 2) : 0;\n p.sslTimeSum -= v['sslTime_avg'] * v['count'];\n p.sslTimeAvg = p.count ? d3.round((p.sslTimeSum / p.count), 2) : 0;\n p.connectTimeSum -= v['connectTime_avg'] * v['count'];\n p.connectTimeAvg = p.count ? d3.round((p.connectTimeSum / p.count), 2) : 0;\n p.dnsTimeSum -= v['dnsTime_avg'] * v['count'];\n p.dnsTimeAvg = p.count ? d3.round((p.dnsTimeSum / p.count), 2) : 0;\n p.bytesInSum -= v['bytesIn_avg'] * v['count'];\n p.bytesInAvg = p.count ? d3.round((p.bytesInSum / p.count), 2) : 0;\n p.bytesOutSum -= v['bytesOut_avg'] * v['count'];\n p.bytesOutAvg = p.count ? d3.round((p.bytesOutSum / p.count), 2) : 0;\n return p;\n },\n //init\n function (p, v) {\n return {\n count: 0,\n loadTimeAvg: 0,\n loadTimeSum: 0,\n ttfbAvg: 0,\n ttfbSum: 0,\n downloadTimeAvg: 0,\n downloadTimeSum: 0,\n sslTimeAvg: 0,\n sslTimeSum: 0,\n connectTimeAvg: 0,\n connectTimeSum: 0,\n dnsTimeAvg: 0,\n dnsTimeSum: 0,\n bytesInAvg: 0,\n bytesInSum: 0,\n bytesOutAvg: 0,\n bytesOutSum: 0\n };\n });\n\n // Accessors for reductio min and max\n var minValueAccessor = function (d) {\n if (d.value.min)\n return d.value.min;\n else\n return null;\n };\n var maxValueAccessor = function (d) {\n if (d.value.max)\n return d.value.max;\n else\n return null;\n };\n\n var loadTimeGroup_min = reductio().min(function (d) {\n return +d['loadTimeMs_min']\n })(date_Dimension.group());\n var loadTimeGroup_max = reductio().max(function (d) {\n return +d['loadTimeMs_max']\n })(date_Dimension.group());\n var ttfbGroup_min = reductio().min(function (d) {\n return +d['ttfb_min']\n })(date_Dimension.group());\n var ttfbGroup_max = reductio().max(function (d) {\n return +d['ttfb_max']\n })(date_Dimension.group());\n var downloadTimeGroup_min = reductio().min(function (d) {\n return +d['downloadTime_min']\n })(date_Dimension.group());\n var downloadTimeGroup_max = reductio().max(function (d) {\n return +d['downloadTime_max']\n })(date_Dimension.group());\n var sslTimeGroup_min = reductio().min(function (d) {\n return +d['sslTime_min']\n })(date_Dimension.group());\n var sslTimeGroup_max = reductio().max(function (d) {\n return +d['sslTime_max']\n })(date_Dimension.group());\n var connectTimeGroup_min = reductio().min(function (d) {\n return +d['connectTime_min']\n })(date_Dimension.group());\n var connectTimeGroup_max = reductio().max(function (d) {\n return +d['connectTime_max']\n })(date_Dimension.group());\n var dnsTimeGroup_min = reductio().min(function (d) {\n return +d['dnsTime_min']\n })(date_Dimension.group());\n var dnsTimeGroup_max = reductio().max(function (d) {\n return +d['dnsTime_max']\n })(date_Dimension.group());\n var bytesInGroup_min = reductio().min(function (d) {\n return +d['bytesIn_min']\n })(date_Dimension.group());\n var bytesInGroup_max = reductio().max(function (d) {\n return +d['bytesIn_max']\n })(date_Dimension.group());\n var bytesOutGroup_min = reductio().min(function (d) {\n return +d['bytesOut_min']\n })(date_Dimension.group());\n var bytesOutGroup_max = reductio().max(function (d) {\n return +d['bytesOut_max']\n })(date_Dimension.group());\n\n var composite = board.getCompositeChart('dcChart', 'line-chart');\n\n var allGraphs = {};\n\n var colorScale = d3.scale.category10();\n\n function createLineChart(jobFilter, label, name, valueAccessor, unit) {\n var group = remove_empty_bins(jobFilter, valueAccessor);\n allGraphs[name] = board.createLineChart(composite, date_Dimension, group, colorScale(label), label, valueAccessor, unit);\n }\n\n // avg graph loadTime\n createLineChart(loadTime_ttfb_avg, \"LoadTimeMs Avg\", \"loadTimeAvg\", function (d) {\n return d.value.loadTimeAvg;\n });\n\n // avg graph ttfb\n createLineChart(loadTime_ttfb_avg, \"TTFB Avg\", \"ttfbAvg\", function (d) {\n return d.value.ttfbAvg;\n });\n\n // avg graph downloadTime\n createLineChart(loadTime_ttfb_avg, \"Download Time Avg\", \"downloadTimeAvg\", function (d) {\n return d.value.downloadTimeAvg;\n });\n\n // avg graph sslTime\n createLineChart(loadTime_ttfb_avg, \"SSL Time Avg\", \"sslTimeAvg\", function (d) {\n return d.value.sslTimeAvg;\n });\n // avg graph connectTime\n createLineChart(loadTime_ttfb_avg, \"Connect Time Avg\", \"connectTimeAvg\", function (d) {\n return d.value.connectTimeAvg;\n });\n // avg graph dnsTime\n createLineChart(loadTime_ttfb_avg, \"DNS Time Avg\", \"dnsTimeAvg\", function (d) {\n return d.value.dnsTimeAvg;\n });\n // avg graph bytesIn\n createLineChart(loadTime_ttfb_avg, \"Bytes In Avg\", \"bytesInAvg\", function (d) {\n return d.value.bytesInAvg;\n }, \"bytes\");\n // avg graph bytesOut\n createLineChart(loadTime_ttfb_avg, \"Bytes Out Avg\", \"bytesOutAvg\", function (d) {\n return d.value.bytesOutAvg;\n }, \"bytes\");\n\n // min graph loadTime\n createLineChart(loadTimeGroup_min, \"LoadTimeMs Min\", \"loadTimeMin\", minValueAccessor);\n // min graph ttfb\n createLineChart(ttfbGroup_min, \"TTFB Min\", \"ttfbMin\", minValueAccessor);\n // min graph downloadTime\n createLineChart(downloadTimeGroup_min, \"Download Time Min\", \"downloadTimeMin\", minValueAccessor);\n // min graph sslTime\n createLineChart(sslTimeGroup_min, \"SSL Time Min\", \"sslTimeMin\", minValueAccessor);\n // min graph connectTime\n createLineChart(connectTimeGroup_min, \"Connect Time Min\", \"connectTimeMin\", minValueAccessor);\n // min graph dnsTime\n createLineChart(dnsTimeGroup_min, \"DNS Time Min\", \"dnsTimeMin\", minValueAccessor);\n // min graph bytesIn\n createLineChart(bytesInGroup_min, \"Bytes In Min\", \"bytesInMin\", minValueAccessor, \"bytes\");\n // min graph bytesOut\n createLineChart(bytesInGroup_min, \"Bytes Out Min\", \"bytesOutMin\", minValueAccessor, \"bytes\");\n\n // max graph loadTime\n createLineChart(loadTimeGroup_max, \"LoadTimeMs Max\", \"loadTimeMax\", maxValueAccessor);\n // max graph ttfb\n createLineChart(ttfbGroup_max, \"TTFB Max\", \"ttfbMax\", maxValueAccessor);\n // max graph ttfb\n createLineChart(downloadTimeGroup_max, \"Download Time Max\", \"downloadTimeMax\", maxValueAccessor);\n // max graph ttfb\n createLineChart(sslTimeGroup_max, \"SSL Time Max\", \"sslTimeMax\", maxValueAccessor);\n // max graph ttfb\n createLineChart(connectTimeGroup_max, \"Connect Time Max\", \"connectTimeMax\", maxValueAccessor);\n // max graph dns\n createLineChart(dnsTimeGroup_max, \"DNS Time Max\", \"dnsTimeMax\", maxValueAccessor);\n // max graph bytesIn\n createLineChart(bytesInGroup_max, \"Bytes In Max\", \"bytesInMax\", maxValueAccessor, \"bytes\");\n // max graph bytesOut\n createLineChart(bytesOutGroup_max, \"Bytes Out Max\", \"bytesOutMax\", maxValueAccessor, \"bytes\");\n\n // 24 = [loadTime, ttfb, ..., bytesIn]*[avg,min,max]\n board.addCompositeChart('dcChart', 'line-chart', from, to, 24);\n redrawCompositeChart();\n\n // ### END LINE CHARTS\n\n // ### BEGIN TIME CHART\n var timeDimension = board.allData.dimension(function (d) {\n return d.date;\n });\n\n var timeGroup = timeDimension.group().reduceSum(function (d) {\n return d['count'];\n });\n board.addTimeChart('dcChart', 'timeChart', timeDimension, timeGroup, from, to);\n // ### END TIME CHART\n\n // Add data to dashboard\n var p1 = new Promise(\n function (resolve, reject) {\n board.addData(data);\n }\n );\n\n // Add onClick Listener\n $(document).on('change', 'input:checkbox[name=\"measurementCheckbox\"]', function (event) {\n $(this).parent().toggleClass(\"btn-primary\");\n $(this).parent().toggleClass(\"btn-default\");\n redrawCompositeChart();\n $(this).parent().removeClass(\"focus\");\n });\n\n $(document).keyup(function (e) {\n if (e.keyCode == 27) {\n $(\".card-modal\").hide();\n $(\"#preselectedValuesContainer\").hide();\n }\n });\n\n $('.card-modal').click(function () {\n $(\".card-modal\").hide();\n $(\"#preselectedValuesContainer\").hide();\n });\n $('.card-header .close').click(function () {\n $(\".card-modal\").hide();\n $(\"#preselectedValuesContainer\").hide();\n });\n\n $('.card-modal-inner').click(function (e) {\n e.stopPropagation();\n });\n\n function redrawCompositeChart() {\n board.setAnimationTime(500);\n\n var showAvg = document.getElementById(\"avg\").checked;\n var showMax = document.getElementById(\"max\").checked;\n var showMin = document.getElementById(\"min\").checked;\n var visibleGraphs = [];\n\n function handleValueTypeCheckbox(avgName, minName, maxName) {\n if (showAvg)\n visibleGraphs.push(allGraphs[avgName]);\n\n if (showMin)\n visibleGraphs.push(allGraphs[minName]);\n if (showMax)\n visibleGraphs.push(allGraphs[maxName]);\n }\n\n if (document.getElementById(\"loadTimeMs\").checked) {\n handleValueTypeCheckbox(\"loadTimeAvg\", \"loadTimeMin\", \"loadTimeMax\");\n }\n if (document.getElementById(\"ttfb\").checked) {\n handleValueTypeCheckbox(\"ttfbAvg\", \"ttfbMin\", \"ttfbMax\");\n }\n if (document.getElementById(\"downloadTime\").checked) {\n handleValueTypeCheckbox(\"downloadTimeAvg\", \"downloadTimeMin\", \"downloadTimeMax\");\n }\n if (document.getElementById(\"sslTime\").checked) {\n handleValueTypeCheckbox(\"sslTimeAvg\", \"sslTimeMin\", \"sslTimeMax\");\n }\n if (document.getElementById(\"connectTime\").checked) {\n handleValueTypeCheckbox(\"connectTimeAvg\", \"connectTimeMin\", \"connectTimeMax\");\n }\n if (document.getElementById(\"dnsTime\").checked) {\n handleValueTypeCheckbox(\"dnsTimeAvg\", \"dnsTimeMin\", \"dnsTimeMax\");\n }\n if (document.getElementById(\"bytesIn\").checked) {\n handleValueTypeCheckbox(\"bytesInAvg\", \"bytesInMin\", \"bytesInMax\");\n }\n if (document.getElementById(\"bytesOut\").checked) {\n handleValueTypeCheckbox(\"bytesOutAvg\", \"bytesOutMin\", \"bytesOutMax\");\n }\n\n\n board.getCompositeChart('dcChart', 'line-chart').compose(visibleGraphs);\n dc.renderAll();\n addOnClickListeners();\n hideDataTable();\n board.setAnimationTime(700);\n }\n}", "function addTab(title) {\n var tab_title = (title.length==0)?'Graph '+tab_counter:title;\n var panelId = 'graphTab'+tab_counter++;\n\n var tabsLength = $(common.mustache(templates.graphTab, {\n title: tab_title,\n href: panelId\n }))\n .appendTo($graphTabs.find('.ui-tabs-nav'))\n .find('li').length;\n $graphTabs.append(common.mustache(templates.graphDiv, {\n panelId: panelId\n }));\n $graphTabs\n .tabs(\"refresh\")\n .tabs( \"option\", \"active\", tabsLength-1)\n .find('li.graph-tab span.ui-icon-close').off().click(removeTab);\n\n //this causes problem when deleting tabs\n $graphTabs.find( \".ui-tabs-nav\" ).sortable({ axis: \"x\", distance: 10 });\n $(\".ui-tabs-selected a\").each(function(){$(this).attr(\"title\", $(this).html())});\n resizeCanvas();\n\n //in revised layout, show only if graph tabs and search tables are shown $(\"#show-hide-pickers\").show();\n $('#graph-tabs a:last').click(function(){\n hideGraphEditor()\n });\n return panelId;\n}", "function showDashboard() {\r\n\t\t$('#container img').remove();\r\n\t\t$('#login-form').remove();\r\n\t\t//TODO:cleanup after this part\r\n\t\t$('<div/>').attr('id', 'chart-container').appendTo($('#container'));\r\n\t\t$('<div/>').addClass('chart-options').attr('id', 'chart-options-container').appendTo($('#center'));\r\n\t\t\r\n\t\tvar chartparent = $('#chart-options-container');\r\n\t\taddChartOptions([\r\n\t\t {\r\n\t\t \t src : './images/column-chart.png',\r\n\t\t \t type : 'column',\r\n\t\t \t parent : chartparent\r\n\t\t }, {\r\n\t\t \t src : './images/chart-line.png',\r\n\t\t \t type : 'line',\r\n\t\t \t parent : chartparent\r\n\t\t },{\r\n\t\t \t src : './images/chart-bar.png',\r\n\t\t \t type : 'bar',\r\n\t\t \t parent : chartparent\r\n\t\t }, {\r\n\t\t \t src : './images/chart-area.png',\r\n\t\t \t type : 'area',\r\n\t\t \t parent : chartparent\r\n\t\t }, {\r\n\t\t \t src : './images/chart-pie.png',\r\n\t\t \t type : 'pie',\r\n\t\t \t parent : chartparent\r\n\t\t }]);\r\n\t\tvar sPref = readCookie('sm-dash-chart');\r\n\t\tsPref = (sPref == null ? 'column' : sPref);\r\n\t\tplotCommonChart( sPref );\r\n\t\twriteCookie('sm-dash-chart', sPref, 1);\r\n\t\t$('<a/>').html(\"Workspace\").attr('href', \"services.htm\").appendTo($('<li/>').appendTo('#menu'));\r\n\t}", "function afficherGraphe() {\n\t\n\t\n\t\t// Création du graphe\n\t\tvar chart = new AmCharts.AmSerialChart();\n\t\tchart.dataProvider = chartData;\n\t\tchart.categoryField = \"country\";\n\t\tvar graph = new AmCharts.AmGraph();\n\t\tgraph.valueField = \"visits\";\n\t\tgraph.type = \"column\";\n\t\tchart.addGraph(graph);\n\t\tchart.write('statistiques');\n\n\n}", "function makeCharts() {\n issueChart();\n countChart();\n averageChart();\n}", "function addData(graph, label, data, color) {\n\n if (color === undefined) {\n //If no color was set, use the default graph color\n color = \"--graph\";\n }\n\n //Loop through all of the datasets on the graph to try and find a dataset with a matching label\n for (let dataset of pathGraph.data.datasets) {\n\n if (dataset.label === label) {\n //If the labels match add the new data to the dataset\n\n //Loop through each point and add it to the dataset\n for (let point of data) {\n dataset.data.push(point);\n }\n\n //Update the graph to show changes\n pathGraph.update();\n return;\n }\n }\n\n //If no dataset is found matching the label create a new dataset\n\n let dataset = {\n\n //Set the dataset label the the label passed in\n label: label,\n\n //Sets the label to the --graph color specified in style.css color specified in style.css\n labelColor: getComputedStyle(document.documentElement).getPropertyValue(color),\n\n //Sets the point border and background colors --graph color specified in style.css color specified in style.css\n borderColor: getComputedStyle(document.documentElement).getPropertyValue(color),\n backgroundColor: getComputedStyle(document.documentElement).getPropertyValue(color),\n\n //Sets the radius of the points to 5px\n pointRadius: 5,\n\n //Sets the data in the dataset to the data passed in\n data: data\n };\n\n //Add the dataset to the graph\n graph.data.datasets.push(dataset);\n\n //Update the graph to show changes\n graph.update();\n}", "function addSmartlifeGraph(module_data) {\n let style = { };\n let id;\n\n id = module_data.name.toLowerCase() + '_' + module_data.room.toLowerCase();\n\n style.x = 150;\n style.y = 150;\n style.img = '';\n\n cyto.removeGraphElementByID(id);\n\n if ((Config.modules.smartlife.node.delNodeAfterCommand) && (module_data.set == 'false')) {\n return;\n } else {\n if (fs.existsSync('./resources/core/plugins/smartlife/modules.json')) {\n let prop = fs.readJsonSync('./resources/core/plugins/smartlife/modules.json', {\n throws: false\n });\n if (prop[id]) {\n style.x = prop[id].x;\n style.y = prop[id].y;\n }\n }\n\n if (fs.existsSync('./resources/core/plugins/smartlife/assets/nodes/' + module_data.name + '.json')) {\n let prop = fs.readJsonSync('./resources/core/plugins/smartlife/assets/nodes/' + module_data.name + '.json', {\n throws: false\n });\n if (prop) {\n style.x = prop.position.x;\n style.y = prop.position.y;\n }\n }\n\n return new Promise((resolve, reject) => {\n cyto.getGraph()\n .then(cy => cyto.addGraphElement(cy, id))\n .then(elem => cyto.addElementName(elem, id))\n .then(elem => cyto.addElementClass(elem, nodeType))\n .then(elem => cyto.addElementImage(elem, __dirname + '/assets/images/modules/' + module_data.icone + '.png'))\n .then(elem => cyto.addElementSize(elem, 45))\n .then(elem => cyto.selectElement(elem, false))\n .then(elem => cyto.addElementRenderedPosition(elem, style.x, style.y))\n .then(elem => cyto.onClick(elem, (evt) => {\n // cyto.selectElement(evt, !cyto.isElementSelected(evt))\n showContextMenu(evt, module_data);\n }))\n\n .then(elem => {\n resolve(elem);\n })\n .catch(err => {\n reject();\n })\n })\n }\n}", "function addEnsInstrumentGraph() {\r\n\t$('#instrumentationPane').append('<tr>' +\r\n\t\t\t'<td id=\"violinOne\" class=\"instrument\">V1</td>' +\r\n\t\t\t'<td id=\"violinTwo\" class=\"instrument\">V2</td>' +\r\n\t\t\t'<td id=\"viola\" class=\"instrument\">Va</td>' +\r\n\t\t\t'<td id=\"cello\" class=\"instrument\">C</td>' +\r\n\t\t\t'<td id=\"bass\" class=\"instrument\">B</td>' +\r\n\t\t'</tr>');\r\n}", "function drawChart(data,Container,width,height,arrBuckets,props) {\n\n// alert(\"Drawing chart\");\n\n var csvfile = arrBuckets.timeline.title + \",\" + arrBuckets.value.title + '\\n';\n \n var dataValues = d3.map(data, function(d,i) {csvfile += d.timeline+ \",\" + d.value + '\\n';\n return d.timeline + \",\" + d.value;});\n \n var chartDiv = document.getElementById(Container[0][0].id);\n var win = window\n , doc = document\n , ele = doc.documentElement\n , bdy = doc.getElementsByTagName(\"body\")[0]\n , screenWidth = screen.width;\n\n var main_margin = {top: 15, right: 15, bottom: 15, left: 15};\n\n chartDiv.style.top = main_margin.top + \"px\";\n chartDiv.style.left = main_margin.left + \"px\";\n chartDiv.style.width = width - main_margin.left - main_margin.right + \"px\";\n chartDiv.style.height = height - main_margin.top - main_margin.bottom + \"px\";\n\n mygraph = new Dygraph(\n chartDiv,\n csvfile, // CSV file\n props\n );\n\n}", "function drawPerformanceAppraisalChart(graphData, chartIdName) {\n jQuery('#performanceAppraisalChart'+chartIdName).show();\n \n if(graphData){\n var xlabels = graphData.xAxisValues;\n var yseries = graphData.labels;\n var bgcolorArr = [];\n var bordercolorArr = [];\n var len = graphData.xAxisValues.length;\n for(let i = 0; i < len; i++){\n var clrObj = dynamicColors();\n bgcolorArr[i] = clrObj.bgcolor;\n bordercolorArr[i] =clrObj.bordercolor;\n }\n \n var ctx = document.getElementById('performanceAppraisalChart'+chartIdName);\n var myChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: xlabels,\n datasets: [{\n data: yseries,\n backgroundColor: bgcolorArr,\n borderColor: bordercolorArr,\n borderWidth: 1\n }]\n },\n options: {\n responsive: true,\n legend: {\n display: false\n \n },\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n });\n }\n }", "function createLineNewChart(title, data, color, chartDiv) {\n let container = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* create */ \"h\"](chartDiv, _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* Container */ \"b\"]);\n container.layout = \"horizontal\";\n container.fixedWidthGrid = true;\n container.width = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* percent */ \"k\"](100);\n container.height = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* percent */ \"k\"](100);\n let chart = container.createChild(_amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* XYChart */ \"j\"]);\n chart.width = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* percent */ \"k\"](45);\n chart.height = 70;\n chart.data = data;\n chart.padding(20, 5, 2, 5);\n let categoryAxis = chart.xAxes.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* CategoryAxis */ \"a\"]());\n categoryAxis.renderer.grid.template.location = 0;\n categoryAxis.renderer.grid.template.disabled = true;\n categoryAxis.renderer.baseGrid.disabled = true;\n categoryAxis.renderer.labels.template.disabled = true;\n categoryAxis.cursorTooltipEnabled = false;\n categoryAxis.dataFields.category = \"Period\";\n let valueAxis = chart.yAxes.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* ValueAxis */ \"i\"]());\n valueAxis.min = 0;\n valueAxis.renderer.grid.template.disabled = true;\n valueAxis.renderer.baseGrid.disabled = true;\n valueAxis.renderer.labels.template.disabled = true;\n valueAxis.cursorTooltipEnabled = false;\n chart.cursor = new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* XYCursor */ \"k\"]();\n chart.cursor.lineY.disabled = true;\n chart.cursor.behavior = \"none\";\n let series = chart.series.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* LineSeries */ \"e\"]());\n series.tooltipText = \"{Period}: [bold]{value}\";\n series.dataFields.categoryX = \"Period\";\n series.dataFields.valueY = \"value\";\n series.tensionX = 0.8;\n series.strokeWidth = 1;\n series.stroke = '#fff'; // render data points as bullets\n\n let bullet = series.bullets.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* CircleBullet */ \"b\"]());\n bullet.circle.opacity = 1;\n bullet.circle.fill = color;\n bullet.circle.propertyFields.opacity = \"opacity\";\n bullet.circle.radius = 3;\n return chart;\n }", "function createLineNewChart(title, data, color, chartDiv) {\n let container = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* create */ \"h\"](chartDiv, _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* Container */ \"b\"]);\n container.layout = \"horizontal\";\n container.fixedWidthGrid = true;\n container.width = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* percent */ \"k\"](100);\n container.height = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* percent */ \"k\"](100);\n let chart = container.createChild(_amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* XYChart */ \"j\"]);\n chart.width = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* percent */ \"k\"](45);\n chart.height = 70;\n chart.data = data;\n chart.padding(20, 5, 2, 5);\n let categoryAxis = chart.xAxes.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* CategoryAxis */ \"a\"]());\n categoryAxis.renderer.grid.template.location = 0;\n categoryAxis.renderer.grid.template.disabled = true;\n categoryAxis.renderer.baseGrid.disabled = true;\n categoryAxis.renderer.labels.template.disabled = true;\n categoryAxis.cursorTooltipEnabled = false;\n categoryAxis.dataFields.category = \"Period\";\n let valueAxis = chart.yAxes.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* ValueAxis */ \"i\"]());\n valueAxis.min = 0;\n valueAxis.renderer.grid.template.disabled = true;\n valueAxis.renderer.baseGrid.disabled = true;\n valueAxis.renderer.labels.template.disabled = true;\n valueAxis.cursorTooltipEnabled = false;\n chart.cursor = new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* XYCursor */ \"k\"]();\n chart.cursor.lineY.disabled = true;\n chart.cursor.behavior = \"none\";\n let series = chart.series.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* LineSeries */ \"e\"]());\n series.tooltipText = \"{Period}: [bold]{value}\";\n series.dataFields.categoryX = \"Period\";\n series.dataFields.valueY = \"value\";\n series.tensionX = 0.8;\n series.strokeWidth = 1;\n series.stroke = '#fff'; // render data points as bullets\n\n let bullet = series.bullets.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* CircleBullet */ \"b\"]());\n bullet.circle.opacity = 1;\n bullet.circle.fill = color;\n bullet.circle.propertyFields.opacity = \"opacity\";\n bullet.circle.radius = 3;\n return chart;\n }", "function createLineNewChart(title, data, color, chartDiv) {\n let container = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_13__[/* create */ \"h\"](chartDiv, _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_13__[/* Container */ \"b\"]);\n container.layout = \"horizontal\";\n container.fixedWidthGrid = true;\n container.width = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_13__[/* percent */ \"k\"](100);\n container.height = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_13__[/* percent */ \"k\"](100);\n let chart = container.createChild(_amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_14__[/* XYChart */ \"j\"]);\n chart.width = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_13__[/* percent */ \"k\"](45);\n chart.height = 70;\n chart.data = data;\n chart.padding(20, 5, 2, 5);\n let categoryAxis = chart.xAxes.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_14__[/* CategoryAxis */ \"a\"]());\n categoryAxis.renderer.grid.template.location = 0;\n categoryAxis.renderer.grid.template.disabled = true;\n categoryAxis.renderer.baseGrid.disabled = true;\n categoryAxis.renderer.labels.template.disabled = true;\n categoryAxis.cursorTooltipEnabled = false;\n categoryAxis.dataFields.category = \"Period\";\n let valueAxis = chart.yAxes.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_14__[/* ValueAxis */ \"i\"]());\n valueAxis.min = 0;\n valueAxis.renderer.grid.template.disabled = true;\n valueAxis.renderer.baseGrid.disabled = true;\n valueAxis.renderer.labels.template.disabled = true;\n valueAxis.cursorTooltipEnabled = false;\n chart.cursor = new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_14__[/* XYCursor */ \"k\"]();\n chart.cursor.lineY.disabled = true;\n chart.cursor.behavior = \"none\";\n let series = chart.series.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_14__[/* LineSeries */ \"e\"]());\n series.tooltipText = \"{Period}: [bold]{value}\";\n series.dataFields.categoryX = \"Period\";\n series.dataFields.valueY = \"value\";\n series.tensionX = 0.8;\n series.strokeWidth = 1;\n series.stroke = '#fff'; // render data points as bullets\n\n let bullet = series.bullets.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_14__[/* CircleBullet */ \"b\"]());\n bullet.circle.opacity = 1;\n bullet.circle.fill = color;\n bullet.circle.propertyFields.opacity = \"opacity\";\n bullet.circle.radius = 3;\n return chart;\n }", "function addChartToDashboard(name, type, sheets, row, col, lastRow, lastCol, vCol, compareStepsBack) {\n var chartBuilder = sheets['charts'].newChart();\n chartBuilder\n .setOption('title', name)\n .setOption('width', 800)\n .setOption('height', 349)\n .setOption('colors', ['#fa9d1c', '#00507d'])\n .setPosition(row, col, 0, 0);\n\n switch (type) {\n case \"column\":\n var statsRow = (vCol - 2) * 12 + 1;\n // First range for a column chart is always the same column with QS from 1 to 10.\n var dataRanges = [sheets['dataH'].getRange(1, 1, 11, 1)];\n if (compareStepsBack && lastCol > 2) {\n // The column for comparison is either the specified number of columns behind lastCol, or 2 (the first column with data).\n dataRanges.push(sheets['dataH'].getRange(statsRow, Math.max(2, lastCol - compareStepsBack), 11, 1));\n }\n dataRanges.push(sheets['dataH'].getRange(statsRow, lastCol, 11, 1));\n chartBuilder = chartBuilder.asColumnChart();\n break;\n case \"line\":\n var dataRanges = [sheets['dataV'].getRange(5, 1, lastRow - 2, 1), sheets['dataV'].getRange(5, vCol, lastRow - 2, 1)];\n chartBuilder = chartBuilder.asLineChart();\n chartBuilder.setOption(\"vAxis.maxValue\", 10);\n chartBuilder.setOption(\"vAxis.ticks\", [0, 2, 4, 6, 8, 10]);\n chartBuilder.setLegendPosition(Charts.Position.NONE);\n break;\n }\n\n for (var i in dataRanges) chartBuilder.addRange(dataRanges[i]);\n sheets['charts'].insertChart(chartBuilder.build());\n}", "function setupGraph() {\n graphImg = d3\n .select(\"#plotarea\")\n .append(\"svg\")\n .attr(\"width\", displayWidth)\n .attr(\"height\", displayHeight)\n .attr(\"class\", \"chart\");\n\n // X - Axis\n // We create a group element to nest our bottom axes labels.\n graphImg.append(\"g\").attr(\"class\", \"xText\");\n graphImg.append(\"g\").attr(\"class\", \"yText\");\n}", "function addDataDiagramm(Buid) { \r\n var VehicleFMSInfo = {\r\n FirmID: FirmID,\r\n BUID: Buid,\r\n Start: DiTel.LoadTimeDomain.StartTime,\r\n End: DiTel.LoadTimeDomain.EndTime,\r\n };\r\n $(\"#Div_Diagramm\").show();\r\n //GROUP setzen in die Diagramme\r\n setDiagrammGroups();\r\n setDiagrammItems(VehicleFMSInfo);\r\n\r\n //Legende bauen;\r\n DiTel.populateExternalLegend();\r\n\r\n// //Timeline Daten laden\r\n addDataTimeline(Buid);\r\n\r\n}", "function displayGraph() {\n\tvar dateArray = null;\n\tvar dateString = localStorage.localStoredDates;\n\tif(!dateString) {\n\t\tdateArray = [];\n\t}\n\telse {\n\t\tdateArray = JSON.parse(dateString);\n\t\tvar newDiv;\n\t\tfor (var i = 0; i < dateArray.length; i++) {\n\t\t\tif (i % 2 == 0) {\n\t\t\t\tnewDiv = document.createElement(\"div\"); \n\t\t\t\tnewDiv.className = \"bar\";\n\t\t\t\tdocument.getElementById(\"holder\").appendChild(newDiv); \n\t\t\t\tnewDiv.style.left = '0px';\n\t\t\t\tnewDiv.style.top = (valueToPercent(dateArray[i])) + \"%\"; \n\t\t\t} else {\n\t\t\t\tnewDiv.style.height = (valueToPercent(dateArray[i])) - (valueToPercent(dateArray[i-1])) + \"%\";\n\t\t\t}\n\t\t}\n\t}\t\n}", "function drawchart() {\r\n const filters = getFilters();\r\n const drawData = filterData(\r\n filters[\"startDate\"],\r\n filters[\"endDate\"],\r\n filters[\"provincesFilter\"]\r\n );\r\n timeLapseChart = new TimeLapseChart(\"timelapse-chart\");\r\n timeLapseChart\r\n .setTitle(\"COVID-19 ARGENTINA - EVOLUCIÓN EN EL TIEMPO\")\r\n .setColumnsStyles(columnNames)\r\n .addDatasets(drawData)\r\n .render();\r\n}", "function updatePlotly(newdata, newlayout) {\n var BAR = document.getElementById(\"plot\"); \n Plotly.newPlot(BAR, newdata, newlayout);\n }", "function addNewQueryChart() {\n // Record IDs, maximum panel ID is increased by 1 becomes the current panel ID\n maxPID += 1;\n currentPID = maxPID;\n\n // Create DOMs of new query chart panel and append it to query tab\n var nextQueryChart = panelsDOM.newQueryChartDOM(currentPID);\n nextQueryChart.appendTo($(\"#query-area\"));\n\n // Create DOM of new survey selector, set value of the new survey selector as the current sID\n // Then hide the survey selector because sID can only be changed from overview tab\n var nextSurveyArea = panelsDOM.newSurveyAreaDOM(currentPID);\n nextSurveyArea.find(\".surveyselector\").val(sID);\n nextSurveyArea.hide(); \n\n // Create DOMs of new question selector and query chart header\n var nextQuestionArea = panelsDOM.newQuestionAreaDOM(currentPID);\n var nextQuestionSelector = panelsDOM.newQuestionSelectorDOM(currentPID); // Note: this DOM adding cannot be omitted in this function!\n var nextQueryHeader = panelsDOM.newQueryHeaderDOM(currentPID);\n \n // Add survey selector, question selector and header into the upper part of chart panel\n nextSurveyArea.prependTo(nextQueryChart.find(\".panel\"));\n nextQuestionArea.prependTo(nextQueryChart.find(\".panel\"));\n nextQuestionSelector.appendTo(nextQuestionArea);\n nextQueryHeader.prependTo(nextQueryChart.find(\".panel\"));\n \n // Activate Bootstrap select features on all new added selectors\n // And add tags (tooltips) to new selectors\n nextQuestionArea.find(\".selectpicker\").selectpicker(\"refresh\");\n addOptionTags(nextQuestionArea.find(\".question-selector\"));\n\n // Get width of query tab\n var query_width = parseInt($(\"#query-area\").css(\"width\"));\n // Activate resizable features on the new query chart\n nextQueryChart.resizable({\n maxWidth: query_width, // Please note that the maximum width cannot exceed the width of query tab\n minWidth: 350,\n minHeight: 250,\n alsoResize: $(this).find('.panel'), // Each chart has an embedded \".panel\" container with identical size and should be resized together\n resize: function (event, ui) {\n adjustQCSize($(this).attr(\"qcID\")); // During resizing, all SVG elements will be resized to fit the new size of chart\n },\n stop: function (event, ui) {\n adjustQCSize($(this).attr(\"qcID\")); // Upon finishing resizing, all SVG elements will be resized to fit the new size of chart\n }\n });\n\n // Create an empty query chart\n createQueryEmpty(currentPID);\n nextQueryChart.find('.another-btn').hide();\n }", "function createGraph(params) {\n\n var startdate = params.date.getTime();\n var enddate = startdate + 1000*60*60*25;\n var n = (params.end - params.start)/params.incr;\n\n $.ajax({\n\turl: baseURL + \"station/\" + params.startStation + \n\t \"/to/\" + params.endStation + \"/\" + params.direction + \"?endDate=\" + enddate +\n\t \"&startDate=\" + startdate + \"&startTime=\" + params.start + \"&endTime=\" + \n\t (parseFloat(params.start)+parseFloat(params.offset)) + \"&\" + \"seriesTimeIncrement=\" + params.incr + \n\t \"&numberOfRuns=\" + n,\n\tdataType: 'jsonp',\n\ttimeout: 1000*60,\n\tsuccess: function( content ) {\n\t if (params.callback !== undefined) {\n\t\tparams.callback();\n\t }\n\n\t var data = [];\n\t var count = 0;\n\t for(var i=parseFloat(params.start);i<parseFloat(params.end);i+=parseFloat(params.incr)) {\n\t\tdata.push([i + params.offset, content[count]]);\n\t\tcount += 1;\n\t }\n\t \n\t renderChart(data, \n\t\t\t\"Time to \" + params.startStationName + \n\t\t\t\" to \" + params.endStationName,\n\t\t\tparams.element);\n\t}\n });\n}", "function makechartswithdata(dataprovider,variablel) {\n if (chart != null) {chart.clear(); chart=null;}\n // SERIAL CHART\n chart = new AmCharts.AmSerialChart();\n chart.pathToImages = \"/static/amcharts/amcharts/images/\";\n chart.dataProvider = dataprovider;\n chart.categoryField = \"time\";\n\n // listen for \"dataUpdated\" event (fired when chart is inited) and call zoomChart method when it happens\n chart.addListener(\"dataUpdated\", zoomChart);\n\n // AXES\n // category -- xaxis\n var categoryAxis = chart.categoryAxis;\n categoryAxis.parseDates = false; // as our data is date-based, we set parseDates to true\n categoryAxis.minorGridEnabled = true;\n categoryAxis.axisColor = \"#DADADA\";\n categoryAxis.twoLineMode = false;\n categoryAxis.title = \"Hour\";\n\n // first value axis (on the left)\n var valueAxis1 = new AmCharts.ValueAxis();\n valueAxis1.axisColor = \"#FF6600\";\n valueAxis1.axisThickness = 2;\n valueAxis1.gridAlpha = 0;\n valueAxis1.title=\"Wait Time (mins)\"\n chart.addValueAxis(valueAxis1);\n\n // GRAPHS\n // first graph\n \n var axisl = [valueAxis1];\n var bulletl = [\"round\",\"square\",\"triangleUp\"];\n var thicknessl = [3,3,1,2,2,2,4,4,4,1,1,1,1,1,1,1,1,1,1,];\n for (var graphi=0; graphi<variablel.length; graphi++) {\n var vard = variablel[graphi];\n\n var graph1 = new AmCharts.AmGraph();\n //select axis\n graph1.valueAxis = axisl[vard.axis]; // we have to indicate which value axis should be used\n graph1.title = vard.description;\n graph1.valueField = vard.name;\n graph1.bullet = bulletl[graphi%(bulletl.length)];//\"round\";\n graph1.hideBulletsCount = 30;\n graph1.bulletBorderThickness = 1;\n graph1.lineThickness = thicknessl[graphi%(thicknessl.length)];\n //graph1.type = \"smoothedLine\";\n graph1.balloonText=\"<span style='font-size:12px;'>[[title]]: <b>[[value]]</b></span>\"\n graph1.hidden = (vard.h == \"t\");\n chart.addGraph(graph1);\n\n\n }\n \n // CURSOR\n var chartCursor = new AmCharts.ChartCursor();\n chartCursor.cursorAlpha = 0.1;\n chartCursor.fullWidth = true;\n chart.addChartCursor(chartCursor);\n\n // SCROLLBAR\n var chartScrollbar = new AmCharts.ChartScrollbar();\n chart.addChartScrollbar(chartScrollbar);\n\n // LEGEND\n //var legend = new AmCharts.AmLegend();\n //legend.marginLeft = 10;\n //legend.useGraphSettings = true;\n //chart.addLegend(legend);\n\n // WRITE\n chart.write(\"chartdiv\");\n}", "function drawDashboard() {\n\n // Create our data table.\n var data = google.visualization.arrayToDataTable([\n ['typeQuestion', 'Nombre de questions'],\n ['Choix Multiples', getQuestionsMultiples(question)],\n ['Choix Simple', getQuestionsSimples(question)],\n ['Reponse Texte', getQuestionsTexte(question)],\n ]);\n\n // Create a dashboard.\n var dashboard = new google.visualization.Dashboard(\n document.getElementById('dashboard_div'));\n\n // Create a range slider, passing some options\n var donutRangeSlider = new google.visualization.ControlWrapper({\n 'controlType': 'NumberRangeFilter',\n 'containerId': 'filter_div',\n 'options': {\n 'filterColumnLabel': 'Nombre de questions'\n }\n });\n\n // Create a pie chart, passing some options\n var pieChart = new google.visualization.ChartWrapper({\n 'chartType': 'PieChart',\n 'containerId': 'chart_div',\n 'options': {\n 'width': 475,\n 'height': 350,\n 'pieSliceText': 'value',\n 'legend': 'bottom'\n }\n });\n\n // Establish dependencies, declaring that 'filter' drives 'pieChart',\n // so that the pie chart will only display entries that are let through\n // given the chosen slider range.\n dashboard.bind(donutRangeSlider, pieChart);\n\n // Draw the dashboard.\n dashboard.draw(data);\n}", "function drawChart() {\n\n // Create the data table.\n var data = google.visualization.arrayToDataTable([\n ['Test Name', 'Passed', 'Failed', 'Skipped']\n ].concat(values));\n\n var options = {\n title: 'Last ' + values.length + ' Test Runs',\n legend: { position: 'bottom' },\n colors: ['green', 'red', 'yellow'],\n backgroundColor: bgColor,\n isStacked: true\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.SteppedAreaChart(document.getElementById('historyChart'));\n chart.draw(data, options);\n \n }", "function AddToChart(index) {\n var dataToAdd = fileData[index];\n console.log(\"Adding\", index, dataToAdd.name);\n if (!Exists(fileData.tableIndex)) {\n dataToAdd.tableIndex = index;\n }\n if (inChart.length > 0 && $.grep(inChart, function (a) { return a.tableIndex == index; }).length != 0) {\n console.warn(\"Already in chart\");\n } else if (inChart.length > 0 && !DataParser.MatchingEvents(inChart[0], dataToAdd)) {\n console.warn(\"Incompatable\");\n } else {\n inChart.push(dataToAdd);\n UpdateChart();\n }\n}", "function addDataPoint() {\n // add a new data point to the dataset\n let now = vis.moment();\n datasetGraph.add({\n x: now,\n y: y(now / 1000,function (data) {\n return data;\n }),\n group:0\n });\n // datasetGraph.add({\n // x: now,\n // y: y(now / 500),\n // group:1\n // });\n // datasetGraph.add({\n // x: now,\n // y: y(now / 750),\n // group:2\n // });\n // datasetGraph.add({\n // x: now,\n // y: y(now / 123),\n // group:3\n // });\n // // remove all data points which are no longer visible\n // var range = graph2d.getWindow();\n // var interval = range.end - range.start;\n // var oldIds = datasetGraph.getIds({\n // filter: function (item) {\n // return item.x < range.start - interval;\n // }\n // });\n // datasetGraph.remove(oldIds);\n\n setTimeout(addDataPoint, DELAY);\n}", "function createGraph() {\n // Set our height and width after we load.\n var windowWidth = element[0].clientWidth;\n if (windowWidth <= 0) {\n return;\n }\n else if (windowWidth - myCfg.ExtraWidthX < 0) {\n myCfg.w = windowWidth;\n }\n else if (windowWidth - myCfg.ExtraWidthY < 0) {\n myCfg.h = windowWidth;\n }\n else {\n myCfg.w = element[0].clientWidth - myCfg.ExtraWidthX;\n myCfg.h = element[0].clientWidth - myCfg.ExtraWidthX;\n }\n\n // Creat the chart.\n RadarChart.draw(\"#graph\", scope.data, myCfg); // eslint-disable-line no-undef\n\n // Setup our click events.\n if (typeof scope.legend !== \"undefined\" && scope.legend !== null && scope.legend.length > 0) {\n // Get all legend text elements.\n var legendItems = element[0].querySelectorAll(\"text.legend\"),\n thisItem;\n\n // For each legend item found with matching text, set up our click bind.\n angular.forEach(scope.legend, function (l) {\n thisItem = [...legendItems].filter(e => e.textContent === l.name || e.textContent === l.name + ' (NA)');\n angular.forEach(thisItem, function (i) {\n angular.element(i).bind('click', l.click);\n });\n });\n }\n }", "function drawChart() {\n\n\t\t// Get the dataGraphic array form PHP\n\t\tvar dataOptionsGraphic = JSON.parse(jsonDataGraphic);\n\n\t\tfor (col in dataOptionsGraphic) {\n\t\t\tdataOptionsGraphic[col][5] = strTooltipStart + dataOptionsGraphic[col][1] + strTooltipEnd;\n\t\t}\n\n\t\t// Header of the data Graphic\n\t\tvar headDataGraphic = [M.util.get_string('choice', 'evoting'), M.util.get_string('countvote', 'evoting'), {\n\t\t\ttype: 'string',\n\t\t\trole: 'style'\n\t\t}, {\n\t\t\ttype: 'string',\n\t\t\trole: 'annotation'\n\t\t}, 'id', {\n\t\t\t'type': 'string',\n\t\t\t'role': 'tooltip',\n\t\t\t'p': {\n\t\t\t\t'html': true\n\t\t\t}\n\t\t}, {\n\t\t\ttype: 'string'\n\t\t}];\n\t\t// Create the complete data of the Graphic by integrated header data\n\t\tdataOptionsGraphic.splice(0, 0, headDataGraphic);\n\t\toptionsGraph = {\n\t\t\ttitle: \"\",\n\t\t\tallowHtml: true,\n\t\t\theight: 450,\n\t\t\tlegend: {\n\t\t\t\tposition: 'none'\n\t\t\t},\n\t\t\tanimation: {\n\t\t\t\tduration: 500,\n\t\t\t\teasing: 'out'\n\t\t\t},\n\n\t\t\tvAxis: {\n\t\t\t\tgridlines: {\n\t\t\t\t\tcolor: '#000000'\n\t\t\t\t},\n\t\t\t\ttextPosition: 'out',\n\t\t\t\ttextStyle: {\n\t\t\t\t\tcolor: '#007cb7',\n\t\t\t\t\tfontName: 'Oswald, Times-Roman',\n\t\t\t\t\tbold: true,\n\t\t\t\t\titalic: false\n\t\t\t\t}\n\n\t\t\t},\n\t\t\thAxis: {\n\t\t\t\ttitle: M.util.get_string('totalvote', 'evoting') + \" : \" + sumVote,\n\t\t\t\tminValue: \"0\",\n\t\t\t\tmaxValue: max,\n\t\t\t\tgridlines: {\n\t\t\t\t\tcolor: '#e6e6e6'\n\t\t\t\t},\n\t\t\t\ttextStyle: {\n\t\t\t\t\tcolor: '#e6e6e6'\n\t\t\t\t},\n\t\t\t\ttitleTextStyle: {\n\t\t\t\t\tcolor: '#007cb7',\n\t\t\t\t\tfontName: 'Oswald, Times-Roman',\n\t\t\t\t\tbold: false,\n\t\t\t\t\titalic: false\n\t\t\t\t}\n\t\t\t},\n\t\t\tbaselineColor: '#007cb7',\n\t\t\ttooltip: {\n\t\t\t\tisHtml: true\n\t\t\t},\n\n\t\t\tannotations: {\n\t\t\t\ttextStyle: {\n\t\t\t\t\tfontName: 'Oswald,Helvetica,Arial,sans-serif',\n\t\t\t\t\tbold: false,\n\t\t\t\t\titalic: false,\n\t\t\t\t\tcolor: '#007cb7',\n\t\t\t\t\tauraColor: 'rgba(255,255,255,0)',\n\t\t\t\t\topacity: 1,\n\t\t\t\t\tx: 20\n\t\t\t\t},\n\t\t\t\talwaysOutside: false,\n\t\t\t\thighContrast: true,\n\t\t\t\tstemColor: '#000000'\n\t\t\t},\n\t\t\tbackgroundColor: '#f6f6f6',\n\t\t\tchartArea: {\n\t\t\t\tleft: '5%',\n\t\t\t\ttop: '5%',\n\t\t\t\theight: '75%',\n\t\t\t\twidth: '100%'\n\t\t\t}\n\t\t};\n\n\t\tdataGraph = google.visualization.arrayToDataTable(dataOptionsGraphic);\n\t\tdataGraph.setColumnProperty(0, {\n\t\t\tallowHtml: true\n\t\t});\n\t\tviewGraph = new google.visualization.DataView(dataGraph);\n\t\tviewGraph.setColumns([0, 1, 2, 3, 5]);\n\n\t\t// Create and draw the visualization.\n\t\tchart = new google.visualization.BarChart(document.getElementById('chartContainer'));\n\t\t$(\".answerCount\").each(function () {\n\t\t\tidOption = $(this).prop('id');\n\t\t});\n\t\tupdateOptionGraphicMax();\n\n\t\tmanageGoodAnswer();\n\t}", "function manageGraph() {\n updateKeys();\n\n if ($(objectGraph + \" svg\").length > 0) {\n updateGraph();\n } else {\n addGraph();\n updateGraph();\n arrangeLabels();\n }\n\n}", "function displayGraphs(data) {\n $('#charts').html('');\n $('#all-programs tbody').html('');\n $.each(data, function(i, item) {\n if (i < numCharts) {\n $('#charts').append('<div class=\"chart-container\" data-program-id=\"' + item.ProgramID + '\"><div id=\"graph-' + item.ProgramID + '\" class=\"chart\"><h2>' + item.Name + '</h2><a href=\"#\" onclick=\"toggleEditProgramName($(this)); return false;\" class=\"edit-icon\"></a><h3>Sales by month</h3><div id=\"chart-' + item.ProgramID + '\"></div></div><div class=\"total-monthly\">' +\n '<table><thead>' +\n '<tr><td>Total Monthly</td><td>Current</td><td>1-Year</td></tr>' +\n '</thead><tbody>' +\n '<tr><td>Sales</td><td>' + formatCurrency(item.TotalMonthlySales) + '</td><td id=\"line-' + item.ProgramID + '\" class=\"line\"></td></tr>' +\n '</tbody></table>' +\n '</div><a href=\"#\" onclick=\"getPricing($(this)); return false;\">more</a><div class=\"additional-data\"></div></div>');\n buildChartData(item.Sales, \"chart-\" + item.ProgramID);\n buildLineData(item.Sales, \"line-\" + item.ProgramID);\n }\n else {\n var output = '<tr><td class=\"chart-container\" data-program-id=\"' + item.ProgramID + '\">' + item.Name + '<a href=\"#\" onclick=\"getPricing($(this)); return false;\">more</a><div class=\"additional-data\"></div></td><td>' + formatCurrency(item.TotalMonthlySales) + '</td><td>' + item.MonthlyAttendance + ' <span class=\"unit\">vists</span></td></tr>';\n $('#all-programs table').append(output);\n }\n });\n}", "function drawDashboard() {\n // Create our data table.\n _data = new google.visualization.DataTable(_jsonIn);\n //data = _jsonIn;\n\n // Create a dashboard.\n var dashboard = new google.visualization.Dashboard(\n document.getElementById('dashboard_div'));\n\n // Create a range slider, passing some options\n var scoreRangeSlider = new google.visualization.ControlWrapper({\n 'controlType': 'NumberRangeFilter',\n 'containerId': 'filter_score_div',\n 'options': {\n 'filterColumnLabel': 'Score'\n }\n });\n // Create a range slider, passing some options\n var exDateRangeSlider = new google.visualization.ControlWrapper({\n 'controlType': 'DateRangeFilter',\n 'containerId': 'filter_exdate_div',\n 'options': {\n 'filterColumnLabel': 'ExDate'\n }\n });\n // Create a range slider, passing some options\n /*\n var donutRangeSlider = new google.visualization.ControlWrapper({\n 'controlType': 'NumberRangeFilter',\n 'containerId': 'filter_div',\n 'options': {\n 'filterColumnLabel': 'Donuts eaten'\n }\n });\n */\n // \n var linkedTable = new google.visualization.ChartWrapper({\n 'chartType': 'Table',\n 'containerId': 'table_div',\n 'options': {\n //'width': \n //'height': 400\n }\n });\n //dashboard.bind(scoreRangeSlider, linkedTable);\n dashboard.bind(exDateRangeSlider, linkedTable);\n // Draw the dashboard.\n dashboard.draw(_data);\n}", "function createContentForGraphs () {\n resetGraphValuesBeforeRendering();\n //first graph template\n var entireTemplateForGraphs = ``;\n AppData.listOfGraphsData.forEach(function (arrayItem, index, arrayObject) {\n var arrayItemWithDataSeriesAdded = returnDataSeriesForArrayItem(arrayItem); \n var tempGraphTemplate = \n `<div class=\"col-12 col-lg-6 mb-1\">\n <div class=\"card\"><div class=\"card-body\">` + returnGraphPlaceholder(arrayItemWithDataSeriesAdded) + `</div></div>\n </div>`;\n entireTemplateForGraphs = entireTemplateForGraphs + tempGraphTemplate;\n });\n /* since we created placeholder containers (returnGraphPlaceholder), we will start checking when those elements are added to DOM\n we want to attach Graphs when those elements are added to DOM\n */\n startCheckingForAddedGraphsPlaceholders();\n return entireTemplateForGraphs;\n }", "async function renderGraph(){\n var config = {\n type: 'line',\n data: {\n labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n datasets: [{\n label: '',\n backgroundColor: \"rgba(240, 114, 41, 0.2)\",\n borderColor: \"rgba(240, 114, 41, 1)\",\n data: [\n await getFromStorage(\"month_january_count\", 0),\n await getFromStorage(\"month_february_count\", 0),\n await getFromStorage(\"month_march_count\", 0),\n await getFromStorage(\"month_april_count\", 0),\n await getFromStorage(\"month_may_count\", 0),\n await getFromStorage(\"month_june_count\", 0),\n await getFromStorage(\"month_july_count\", 0),\n await getFromStorage(\"month_august_count\", 0),\n await getFromStorage(\"month_september_count\", 0),\n await getFromStorage(\"month_october_count\", 0),\n await getFromStorage(\"month_november_count\", 0),\n await getFromStorage(\"month_december_count\", 0)\n ],\n fill: true,\n }]\n },\n options: {\n responsive: true,\n maintainAspectRatio: false,\n title: {\n display: false,\n },\n tooltips: {\n mode: 'index',\n intersect: false,\n },\n hover: {\n mode: 'nearest',\n intersect: true\n },\n scales: {\n xAxes: [{\n display: false,\n scaleLabel: {\n display: false,\n labelString: 'Month'\n }\n }],\n yAxes: [{\n display: false,\n scaleLabel: {\n display: false,\n },\n ticks: {\n padding: 10,\n },\n }]\n },\n legend: { \n display: false \n },\n elements: {\n point:{\n radius: 0\n }\n },\n layout: {\n padding: {\n left: 0,\n right: 0,\n top: 5,\n bottom: 2\n }\n }\n }\n };\n\n var ctx = document.getElementById('canvas').getContext('2d');\n ctx.height = 90;\n window.myLine = new Chart(ctx, config);\n}", "function detectElementTypeAndAddToDashboard(item) {\n var origitem = item;\n var counter = 0;\n item = \"#\" + item;\n //Detect graphtypes\n $(item).children(\".graphtype\").each(function (i, objtag) {\n var $tag = $(objtag);\n var graphtype = 0; //1 - Line, 2 - Area, 3 - Pie, 0 - Unknown\n var graphtypestring = \"\"; //line_chart, area_chart, pie_chart, Unknown\n var orig_tag_style = $tag.attr(\"style\");\n\n $tag.css({\"display\": \"none\"});\n if ($tag.hasClass('area_chart')) {\n graphtype = 2;\n graphtypestring = \"area_chart\";\n } else if ($tag.hasClass('line_chart')) {\n graphtype = 1;\n graphtypestring = \"line_chart\";\n } else if ($tag.hasClass('pie_chart')) {\n graphtype = 3;\n graphtypestring = \"pie_chart\";\n } else if ($tag.hasClass('bar_chart')) {\n graphtype = 4;\n graphtypestring = \"bar_chart\";\n } else if ($tag.hasClass('gauge_chart')) {\n graphtype = 5;\n graphtypestring = \"gauge_chart\";\n } else {\n alert(\"Unknown device element!\");\n return true;\n }\n\n var chart_title;\n $(objtag).children(\"h3\").each(function (i2, objtag2) {\n if ($(objtag2).attr(\"name\") == \"Title\") {\n chart_title = $(objtag2).text();\n }\n });\n\n //Loop over all feeds of graph and count it\n var count = 0;\n var graphic = [];\n var optionstmp = {};\n //Don't forget to map hidden div and visible flotvhart div, if any info is needed later\n var mappingAttr = \"graphtype_mapping_\" + counter;\n $tag.attr(\"mapping\", mappingAttr);\n //Add the flot placeholder to dashboard\n var flot_placeholder = origitem + \"_\" + graphtypestring + \"_\" + counter + \"_placeholder\";\n\n //Append the placeholder and after you get the count update it properly\n $(item).append(\"<div title=\\\"\" + chart_title + \"\\\" id=\\\"\" + flot_placeholder + \"\\\" mapping=\\\"\" + mappingAttr + \"\\\" class=\\\"graphtype_new \" + graphtypestring + \"\\\" feedscount=\\\"0\\\"></div>\");\n\n $(objtag).children(\".graphtypefeeds\").children().each(function (i2, objtag2) {\n //<div deviceid=\"1\" objectname=\"sen4\" objecttype=\"Sensor\" devicename=\"device1\" feedid=\"4\" value=\"f4ef12415e455b93b4280318f88cbfb60d1d37d0ccdec50dff42cf86958390d8\" name=\"dpenTEST@device1@sen4\" optgroup=\"Sensors\"></div>\n var data = [];\n var data_pie = 0;\n var objtag2_feedid = $(objtag2).attr(\"feedid\");\n var objtag2_keyhash = $(objtag2).attr(\"value\");\n var objtag2_devicename = $(objtag2).attr(\"devicename\");\n var objtag2_deviceid = $(objtag2).attr(\"deviceid\");\n var objtag2_objecttype = $(objtag2).attr(\"objecttype\");\n var objtag2_objectname = $(objtag2).attr(\"objectname\");\n var url = \"/dataPull/pull/\" + objtag2_feedid + \"/\" + objtag2_keyhash + \"/\" + objtag2_devicename + \"/\" + objtag2_deviceid + \"/\" + objtag2_objecttype + \"/\" + objtag2_objectname;\n\n //Get the data of the feed\n //$.post( \"/dataPull/pull/4/f4ef12415e455b93b4280318f88cbfb60d1d37d0ccdec50dff42cf86958390d8/device1/1/Sensor/sen4/1111111111/1234567899\", function( postdata ) {\n //$.post( url+\"/1111111111/1113089736\", function( postdata ) {\n //Array of {\"_id\":{\"$id\":\"543abea8591255d60bd31de9\"},\"objectValue\":4,\"timestamp\":1413089736}\n\n graphic.push({\n url: url,\n label: $(objtag2).attr(\"name\"),\n });\n\n if (graphtypestring == \"line_chart\") {\n //Add the data into the dataset\n optionstmp = options_line;\n } else if (graphtypestring == \"pie_chart\") {\n optionstmp = options_pie;\n } else if (graphtypestring == \"area_chart\") {\n optionstmp = options_area;\n } else if (graphtypestring == \"bar_chart\") {\n //initializeFlotGraphics(\"#\"+flot_placeholder,dataset,options_bar);\n optionstmp = options_bar;\n } else if (graphtypestring == \"gauge_chart\") {\n optionstmp = options_gauge;\n }\n //POST\n //});\n\n count++;\n });\n\n //Add all flot graphics and on second step initialize them\n addFlotGraphic(counter, \"#\" + flot_placeholder, graphic, graphtype, count, optionstmp)\n\n //Updating placeholder with feedscount\n $(\"#\" + flot_placeholder).attr(\"feedscount\", count);\n\n //$(item).append(\"<div title=\\\"\"+chart_title+\"\\\" id=\\\"\"+flot_placeholder+\"\\\" mapping=\\\"\"+mappingAttr+\"\\\" class=\\\"graphtype_new \" + graphtypestring +\"\\\" feedscount=\\\"\"+ count +\"\\\"></div>\");\n $(\"#\" + flot_placeholder).attr(\"style\", orig_tag_style);\n\n //Count of graphtypes\n counter++;\n });\n //Detect graphtypes - END\n\n //Detect device_elements\n var counter = 0;\n $(item).children(\".device_element\").each(function (i, objtag) {\n var $tag = $(objtag);\n var device_element = -1; //0 - Sensor; 2 - Switch1, 3 - Switch2\n var typestring = \"\"; //sensor, switch1, switch2, ....\n var orig_tag_style = $tag.attr(\"style\");\n\n $tag.css({\"display\": \"none\"});\n if ($tag.hasClass('sensorvalue')) {\n device_element = 0;\n typestring = \"sensorvalue\";\n } else if ($tag.hasClass('switch1')) {\n device_element = 1;\n typestring = \"switch1\";\n } else if ($tag.hasClass('switch2')) {\n device_element = 2;\n typestring = \"switch2\";\n } else if ($tag.hasClass('switch3')) {\n device_element = 3;\n typestring = \"switch3\";\n } else if ($tag.hasClass('switch4')) {\n device_element = 4;\n typestring = \"switch4\";\n } else if ($tag.hasClass('sensordoor')) {\n device_element = 5;\n typestring = \"sensordoor\";\n } else if ($tag.hasClass('sensorwindow')) {\n device_element = 6;\n typestring = \"sensorwindow\";\n } else if ($tag.hasClass('sensorlamp')) {\n device_element = 7;\n typestring = \"sensorlamp\";\n } else {\n alert(\"Unknown device element!\");\n return true;\n }\n\n var device_element_title;\n $(objtag).children(\"h3\").each(function (i2, objtag2) {\n if ($(objtag2).attr(\"name\") == \"Title\") {\n device_element_title = $(objtag2).text();\n }\n });\n\n //Loop over all feeds of graph and count it\n var count = 0;\n var dataset = [];\n //Don't forget to map hidden div and visible flotvhart div, if any info is needed later\n var mappingAttr = \"deviceelementtype_mapping_\" + counter;\n $tag.attr(\"mapping\", mappingAttr);\n //Construct the placeholder to dashboard as add also device_element counter\n var placeholder = origitem + \"_\" + typestring + \"_\" + counter + \"_placeholder\";\n\n $(objtag).children(\".graphtypefeeds\").children().each(function (i2, objtag2) {\n //<div deviceid=\"1\" objectname=\"sen4\" objecttype=\"Sensor\" devicename=\"device1\" feedid=\"4\" value=\"f4ef12415e455b93b4280318f88cbfb60d1d37d0ccdec50dff42cf86958390d8\" name=\"dpenTEST@device1@sen4\" optgroup=\"Sensors\"></div>\n\n //Limit to just one feed\n if (count > 0) {\n alert(\"Limit to only one feed on device element!\");\n return false;\n }\n\n var data = [];\n var objtag2_feedid = $(objtag2).attr(\"feedid\");\n var objtag2_keyhash = $(objtag2).attr(\"value\");\n var objtag2_devicename = $(objtag2).attr(\"devicename\");\n var objtag2_deviceid = $(objtag2).attr(\"deviceid\");\n var objtag2_objecttype = $(objtag2).attr(\"objecttype\");\n var objtag2_objectname = $(objtag2).attr(\"objectname\");\n\n //Get the data of the feed\n //$.post( \"/dataPull/pull/4/f4ef12415e455b93b4280318f88cbfb60d1d37d0ccdec50dff42cf86958390d8/device1/1/Sensor/sen4/1111111111/1234567899\", function( postdata ) {\n $.post(\"/dataPull/pullLast/\" + objtag2_feedid + \"/\" + objtag2_keyhash + \"/\" + objtag2_devicename + \"/\" + objtag2_deviceid + \"/\" + objtag2_objecttype + \"/\" + objtag2_objectname + \"/1111111111/1111111111\", function (postdata) {\n //Array of {\"_id\":{\"$id\":\"543abea8591255d60bd31de9\"},\"objectValue\":4,\"timestamp\":1413089736}\n var dataJSON = JSON.stringify(postdata);\n var dataJsonParsed = $.parseJSON(dataJSON);\n //It is allowed only one feed so get the element in json\n var obj = dataJsonParsed[0];\n dataset = dataJsonParsed[0];\n //obj.timestamp obj.objectValue\n\n //data.push(dataJsonParsed);\n //Add the data into the dataset\n //dataset.push({\n //\tlabel: $(objtag2).attr(\"name\"),\n //\tdata: data,\n //});\n\n initializeDeviceElements(\"#\" + placeholder, device_element, dataset);\n //Save device_element for later update\n //through websockets\n device_elements.push({\n item: $tag,\n placeholder: \"#\" + placeholder,\n device_element: device_element,\n dataset: dataset,\n class_base: typestring,\n class_on: \"open\",\n class_off: \"close\"\n });\n\n });\n //Get the data of the feed - END\n\n //Count of feeds\n count++;\n });\n\n //Add bindings and styling to the elements according to their type sensor switch1 switch2 switch3 ...\n if (device_element == 0) { //Sensor\n $(item).append(\"<div title=\\\"\" + device_element_title + \"\\\" id=\\\"\" + placeholder + \"\\\" mapping=\\\"\" + mappingAttr + \"\\\" class=\\\"device_element_new \" + typestring + \"\\\" feedscount=\\\"\" + count + \"\\\">NaN</div>\");\n $(\"#\" + placeholder).attr(\"style\", orig_tag_style);\n $(\"#\" + placeholder).css({\"border\": \"solid\"});\n //Add click binding\n $(\"#\" + placeholder).click(function (e) {\n updateTooltipHover(\"#\" + placeholder, e);\n });\n } else if (device_element == 1) { //Method - Switch1\n $(item).append(\"<div title=\\\"\" + device_element_title + \"\\\" id=\\\"\" + placeholder + \"\\\" mapping=\\\"\" + mappingAttr + \"\\\" class=\\\"device_element_new \" + typestring + \"\\\" feedscount=\\\"\" + count + \"\\\"></div>\");\n $(\"#\" + placeholder).attr(\"style\", orig_tag_style);\n\n //Add click binding\n $(\"#\" + placeholder).click(function () {\n var ret = executeAction(item, \"#\" + placeholder, device_element, dataset);\n });\n\n } else if (device_element == 2) { //Method - Switch2\n $(item).append(\"<div title=\\\"\" + device_element_title + \"\\\" id=\\\"\" + placeholder + \"\\\" mapping=\\\"\" + mappingAttr + \"\\\" class=\\\"device_element_new \" + typestring + \"\\\" feedscount=\\\"\" + count + \"\\\"></div>\");\n $(\"#\" + placeholder).attr(\"style\", orig_tag_style);\n } else if (device_element == 3) { //Method - Switch3\n $(item).append(\"<div title=\\\"\" + device_element_title + \"\\\" id=\\\"\" + placeholder + \"\\\" mapping=\\\"\" + mappingAttr + \"\\\" class=\\\"device_element_new \" + typestring + \"\\\" feedscount=\\\"\" + count + \"\\\"></div>\");\n $(\"#\" + placeholder).attr(\"style\", orig_tag_style);\n } else if (device_element == 4) { //Method - Switch4\n $(item).append(\"<div title=\\\"\" + device_element_title + \"\\\" id=\\\"\" + placeholder + \"\\\" mapping=\\\"\" + mappingAttr + \"\\\" class=\\\"device_element_new \" + typestring + \"\\\" feedscount=\\\"\" + count + \"\\\"></div>\");\n $(\"#\" + placeholder).attr(\"style\", orig_tag_style);\n $(\"#\" + placeholder).css({\"border\": \"solid\"});\n\n //Add click binding\n $(\"#\" + placeholder).click(function () {\n var ret = executeAction(item, \"#\" + placeholder, device_element, dataset);\n });\n } else if (device_element == 5) { //Method - sensordoor\n $(item).append(\"<div title=\\\"\" + device_element_title + \"\\\" id=\\\"\" + placeholder + \"\\\" mapping=\\\"\" + mappingAttr + \"\\\" class=\\\"device_element_new \" + typestring + \"\\\" feedscount=\\\"\" + count + \"\\\"></div>\");\n $(\"#\" + placeholder).attr(\"style\", orig_tag_style);\n } else if (device_element == 6) { //Method - sensorwindow\n $(item).append(\"<div title=\\\"\" + device_element_title + \"\\\" id=\\\"\" + placeholder + \"\\\" mapping=\\\"\" + mappingAttr + \"\\\" class=\\\"device_element_new \" + typestring + \"\\\" feedscount=\\\"\" + count + \"\\\"></div>\");\n $(\"#\" + placeholder).attr(\"style\", orig_tag_style);\n } else if (device_element == 7) { //Method - sensorlamp\n $(item).append(\"<div title=\\\"\" + device_element_title + \"\\\" id=\\\"\" + placeholder + \"\\\" mapping=\\\"\" + mappingAttr + \"\\\" class=\\\"device_element_new \" + typestring + \"\\\" feedscount=\\\"\" + count + \"\\\"></div>\");\n $(\"#\" + placeholder).attr(\"style\", orig_tag_style);\n }\n\n counter++;\n\n });\n //Detect device_elements - END\n\n //Detect control_panels\n var counter = 0;\n $(item).children(\".control_panel\").each(function (i, objtag) {\n var $tag = $(objtag);\n var control_panel = -1; //0, 1, 2\n var typestring = \"\"; //sensor, switch1, switch2, ....\n var orig_tag_style = $tag.attr(\"style\");\n\n $tag.css({\"display\": \"none\"});\n if ($tag.hasClass('control_panel1')) {\n control_panel = 0;\n typestring = \"control_panel1\";\n } else {\n alert(\"Unknown control panel!\");\n return true;\n }\n\n var control_panel_title;\n $(objtag).children(\"h3\").each(function (i2, objtag2) {\n if ($(objtag2).attr(\"name\") == \"Title\") {\n control_panel_title = $(objtag2).text();\n }\n });\n\n //Loop over all h4 childs\n var count = 0;\n var dataset = [];\n //Don't forget to map hidden div and visible flotvhart div, if any info is needed later\n var mappingAttr = \"control_panel_mapping_\" + counter;\n $tag.attr(\"mapping\", mappingAttr);\n //Construct the placeholder to dashboard as add also device_element counter\n var placeholder = origitem + \"_\" + typestring + \"_\" + counter + \"_placeholder\";\n\n //Add placeholder element for the control panel\n $(item).append(\"<div title=\\\"\" + control_panel_title + \"\\\" id=\\\"\" + placeholder + \"\\\" mapping=\\\"\" + mappingAttr + \"\\\" class=\\\"control_panel_new \" + typestring + \"\\\" panelelements=\\\"\" + count + \"\\\"></div>\");\n\n $(objtag).children(\"h4\").each(function (i2, objtag2) {\n //<h4 class=\"control_panel_timepicker\" name=\"Timepicker\" whattoupdate=\"timepicker\" value=\"1\" type=\"checkbox\"></h4>\n //<h4 class=\"control_panel_hoovertooltips\" name=\"HooverTooltips\" whattoupdate=\"hoovertooltips\" value=\"1\" type=\"checkbox\"></h4>\n //<h4 class=\"control_panel_clicktooltips\" name=\"ClickTooltips\" whattoupdate=\"clicktooltips\" value=\"1\" type=\"checkbox\"></h4>\n //<h4 class=\"control_panel_zoom\" name=\"Zoom\" whattoupdate=\"zoom\" value=\"1\" type=\"checkbox\"></h4>\n //<h4 class=\"control_panel_pan\" name=\"Pan\" whattoupdate=\"pan\" value=\"1\" type=\"checkbox\"></h4>\n //<h4 class=\"control_panel_manualrefresh\" name=\"ManualRefresh\" whattoupdate=\"manualrefresh\" value=\"1\" type=\"checkbox\"></h4>\n //<h4 class=\"control_panel_autorefresh\" name=\"AutoRefresh\" whattoupdate=\"autorefresh\" value=\"1\" type=\"checkbox\"></h4>\n //<h4 class=\"control_panel_reset\" name=\"Reset\" whattoupdate=\"reset\" value=\"1\" type=\"checkbox\"></h4>\n\n var objtag2_class = $(objtag2).attr(\"class\");\n var objtag2_name = $(objtag2).attr(\"name\");\n var objtag2_value = $(objtag2).attr(\"value\");\n var objtag2_type = $(objtag2).attr(\"type\");\n\n if (objtag2_name == \"Timepicker\" && objtag2_value == 1) {\n addControlPanelTimepicker(\"#\" + placeholder, $(objtag2));\n } else if (objtag2_name == \"HooverTooltips\" && objtag2_value == 1) {\n addControlPanelHooverTooltips(\"#\" + placeholder, objtag2);\n } else if (objtag2_name == \"ClickTooltips\" && objtag2_value == 1) {\n addControlPanelClickTooltips(\"#\" + placeholder, objtag2);\n } else if (objtag2_name == \"Zoom\" && objtag2_value == 1) {\n addControlPanelZoom(\"#\" + placeholder, objtag2);\n } else if (objtag2_name == \"Pan\" && objtag2_value == 1) {\n addControlPanelPan(\"#\" + placeholder, objtag2);\n } else if (objtag2_name == \"ManualRefresh\" && objtag2_value == 1) {\n addControlPanelManualRefresh(\"#\" + placeholder, objtag2);\n } else if (objtag2_name == \"AutoRefresh\" && objtag2_value == 1) {\n addControlPanelAutoRefresh(\"#\" + placeholder, objtag2);\n } else if (objtag2_name == \"Refresh\" && objtag2_value == 1) {\n addControlPanelRefresh(\"#\" + placeholder, objtag2);\n } else if (objtag2_name == \"Reset\" && objtag2_value == 1) {\n addControlPanelReset(\"#\" + placeholder, objtag2);\n }\n\n //Count of feeds\n count++;\n });\n\n $(\"#\" + placeholder).attr(\"panelelements\", count);\n $(\"#\" + placeholder).attr(\"style\", orig_tag_style);\n $(\"#\" + placeholder).css({\"border-width\": \"thin\"});\n $(\"#\" + placeholder).css({\"border-style\": \"solid\"});\n\n counter++;\n\n });\n //Detect control_panels - END\n\n //Now show up the dashboard, after all elements are ready and all unneeded are hidden\t\n $(item).css({\"display\": \"block\"});\n}", "function addGraph() {\n var dataset = cambioDataset(datosTotales);\n\n var padding = 50;\n\n xScale = d3.scale.linear()\n .domain([0, d3.max(dataset, function(d) {\n return d[1];\n })])\n .range([padding, width - padding]);\n\n yScale = d3.scale.linear()\n .domain([0, d3.max(dataset, function(d) {\n return d[2];\n })])\n .range([height - padding, padding]);\n\n rScale = d3.scale.sqrt()\n .range([mobileScreen ? 1 : 3, mobileScreen ? 5 : 15])\n .domain([0, d3.max(dataset, function(d) {\n return d[3];\n })]);\n\n xAxis = d3.svg.axis()\n .scale(xScale)\n .orient(\"bottom\")\n .ticks(8);\n\n yAxis = d3.svg.axis()\n .scale(yScale)\n .orient(\"left\")\n .ticks(8, \"s\");\n\n\n svg = d3.select(objectGraph).append(\"svg\")\n .attr(\"width\", \"100%\")\n .attr(\"height\", \"100%\")\n .attr('viewBox', '0 0 ' + Math.max(width, height) + ' ' + Math.min(width, height))\n .attr('preserveAspectRatio', 'xMinYMin');\n\n\n svg.selectAll(\"circle\")\n .data(dataset)\n .enter()\n .append(\"circle\")\n .attr(\"class\", \"circulo\")\n .attr(\"cx\", function(d) {\n return xScale(d[1]);\n })\n .attr(\"cy\", function(d) {\n return yScale(d[2]);\n })\n .attr(\"r\", function(d) {\n if (radio) {\n return rScale(d[3]);\n } else {\n return radioDefault;\n }\n })\n .attr(\"value\", function(d) {\n return d[0]\n })\n .on(\"mouseover\", function(d) {\n //console.log(d[0]);\n });\n\n svg.selectAll(\"text\")\n .data(dataset)\n .enter()\n .append(\"text\")\n .attr(\"class\", \"label\")\n .text(function(d) {\n return d[0];\n })\n .attr(\"x\", function(d) {\n return xScale(d[1]) + 20; // Returns scaled location of x\n })\n // .attr(\"text-anchor\",\"middle\")\n .attr(\"y\", function(d) {\n return yScale(d[2]) + 2; // Returns scaled circle y\n })\n .attr(\"font-size\", \"10px\")\n .attr(\"text-anchor\", \"start\")\n .attr(\"fill\", \"white\");\n\n svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"id\", \"xAxis\")\n .attr(\"transform\", \"translate(0,\" + (height - padding) + \")\")\n .call(xAxis);\n\n svg.select(\"#xAxis\")\n .append('text')\n .attr(\"id\", \"labelX\")\n .attr('text-anchor', 'end')\n .attr(\"transform\", \"translate(\" + (width - padding) + \", -10)\")\n .text(labelX);\n\n\n svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .attr(\"id\", \"yAxis\")\n .attr(\"transform\", \"translate(\" + padding + \",0)\")\n .call(yAxis);\n\n svg.select(\"#yAxis\")\n .append('text')\n .attr(\"id\", \"labelY\")\n .attr('text-anchor', 'end')\n .attr(\"transform\", \"translate(20,50) rotate(-90)\")\n .text(labelY);\n\n d3.select(\".content__item--show #cambiador\")\n .on(\"change\", function() {\n updateGraph();\n });\n}", "function addSeries(chart, name, channel_id, field_number, api_key, results, color, yaxis, conversion_function) {\n yaxis = yaxis || 0;\n conversion_function = conversion_function || function(x) {return x};\n \n // get the data with a webservice call\n $.getJSON('https://api.thingspeak.com/channels/' + channel_id + '/fields/' + field_number + '.json?offset=0&round=2&results=' + results + '&api_key=' + api_key, function(data) {\n\n var chart_data = [];\n var gap_count = 0;\n var field_name = 'field' + field_number;\n var prev_time = Date.parse(data.feeds[0].created_at);\n \n // iterate through each feed\n $.each(data.feeds, function() {\n // get value and time\n var value = conversion_function(parseFloat(this[field_name]));\n var time = Date.parse(this.created_at);\n // skip nulls in data (data with a time but no measurement)\n if (isNaN(value) && ++gap_count) return;\n gap_count=0;\n // deliberately add gap if no measurements for several minutes\n if (time-prev_time > 5*60*1000) chart_data.push([time-1,null]);\n prev_time=time;\n // add to chart data\n chart_data.push([time, value]);\n });\n\n // add the chart data (if valid)\n if (chart_data.length) chart.addSeries({ data: chart_data, name: name, color: color, yAxis: yaxis }); \n });\n }", "function createDashboard() {\n var newDashboard = {};\n newDashboard.name = \"New Dashboard\";\n newDashboard.description = \"New Dashboard Description\";\n newDashboard.organisationId = null;\n newDashboard.createdBy = null;\n newDashboard.type = \"private\";\n newDashboard.widgets = [];\n newDashboard.homepage = false;\n newDashboard.backgroundColor = \"#FFFFFF\";\n newDashboard.widgetSpacing = 2;\n newDashboard.options = {\n columns: 15, // the width of the grid, in columns\n rows: 10, // the width of the grid, in columns\n pushing: true, // whether to push other items out of the way on move or resize\n floating: true, // whether to automatically float items up so they stack (you can temporarily disable if you are adding unsorted items with ng-repeat)\n swapping: true, // whether or not to have items of the same size switch places instead of pushing down if they are the same size\n width: 'auto', // can be an integer or 'auto'. 'auto' scales gridster to be the full width of its containing element\n colWidth: 'auto', // can be an integer or 'auto'. 'auto' uses the pixel width of the element divided by 'columns'\n //rowHeight: 'match', // can be an integer or 'match'. Match uses the colWidth, giving you square widgets.\n margins: [2, 2], // the pixel distance between each widget\n outerMargin: true, // whether margins apply to outer edges of the grid\n sparse: true, // \"true\" can increase performance of dragging and resizing for big grid (e.g. 20x50)\n isMobile: false, // stacks the grid items if true\n mobileBreakPoint: 600, // if the screen is not wider that this, remove the grid layout and stack the items\n mobileModeEnabled: true, // whether or not to toggle mobile mode when screen width is less than mobileBreakPoint\n minColumns: 1, // the minimum columns the grid must have\n minRows: 2, // the minimum height of the grid, in rows\n maxRows: 100,\n defaultSizeX: 1, // the default width of a gridster item, if not specifed\n defaultSizeY: 1, // the default height of a gridster item, if not specified\n minSizeX: 1, // minimum column width of an item\n maxSizeX: null, // maximum column width of an item\n minSizeY: 1, // minumum row height of an item\n maxSizeY: null, // maximum row height of an item\n resizable: {\n enabled: true,\n handles: ['n', 'e', 's', 'w', 'ne', 'se', 'sw', 'nw'],\n start: function (event, $element, widget) { console.log('resize-start'); console.log(widget); console.log($element); }, // optional callback fired when resize is started,\n resize: function (event, $element, widget) { console.log('resize'); console.log(widget); console.log($element); }, // optional callback fired when item is resized,\n stop: function (event, $element, widget) { console.log('resize-stop'); console.log(widget); console.log($element); } // optional callback fired when item is finished resizing\n },\n draggable: {\n enabled: true, // whether dragging items is supported\n // handle: '.my-class', // optional selector for drag handle\n start: function (event, $element, widget) { console.log('drag-start'); console.log(widget); console.log($element); }, // optional callback fired when drag is started,\n drag: function (event, $element, widget) { console.log('drag'); console.log(widget); console.log($element); }, // optional callback fired when item is moved,\n stop: function (event, $element, widget) { console.log('drag-stop'); console.log(widget); console.log($element); } // optional callback fired when item is finished dragging\n }\n\n };\n return newDashboard;\n }", "function addBarChartGate() {\n let oneGateObj = {\n \"title\" : $(\"#barchart_gate_title_id\").val(),\n \"remDays\" : $(\"#barchart_gate_remaining_id\").val(),\n \"actDays\" : $(\"#barchart_gate_actual_id\").val(),\n \"avgDays\" : $(\"#barchart_gate_avg_days_id\").val()\n }\n barGates.push(oneGateObj);\n if(numOfBarGates === currBarGateNum){\n document.getElementById(\"barchart_next_gate_btn\").style.display = 'none';\n document.getElementById(\"barchart_create_chart_btn\").style.display = 'inline-block';\n }\n else{\n currBarGateNum++;\n clearAllBarInputTextFields();\n }\n\n resetBarInputBooleanvalues();\n checkForAllBarGateChartInputs();\n}", "async function createDashboardNodesPlot() {\r\n\tvar canvas = document.getElementById('dashboard-nodes-plot');\r\n\tif (canvas != null || canvas != undefined) {\r\n\t\tvar ctx = canvas.getContext('2d');\r\n\t\tctx.clearRect(0, 0, canvas.width, canvas.height);\r\n\t\tvar xl = await getNodesName();\r\n\t\tvar yl = await getTotalSamplesFromNodes();\r\n\t\tvar backgroundColors;\r\n\r\n\t\tif (colorArray.length >= nodesPayload.length) {\r\n\t\t\tbackgroundColors = colorArray;\r\n\t\t} else {\r\n\t\t\tbackgroundColors = await getNodesBackgroundColors();\r\n\t\t}\r\n\r\n\t\tif (charts.dashboard.nodes != undefined) {\r\n\t\t\tcharts.dashboard.nodes.destroy();\r\n\t\t}\r\n\r\n\t\tcharts.dashboard.nodes = new Chart(ctx, {\r\n\t\t\ttype: 'pie',\r\n\t\t\tdata: {\r\n\t\t\t\tlabels: xl,\r\n\t\t\t\tdatasets: [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlabel: '# of samples',\r\n\t\t\t\t\t\tdata: yl,\r\n\t\t\t\t\t\tbackgroundColor: backgroundColors,\r\n\t\t\t\t\t\toptions: {\r\n\t\t\t\t\t\t\tlegendItemClick: function (e) {\r\n\t\t\t\t\t\t\t\tconsole.log(\r\n\t\t\t\t\t\t\t\t\t'Clicked an item with text: ' + e.text\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\ttooltips: {\r\n\t\t\t\t\t\t\t\tcallbacks: {\r\n\t\t\t\t\t\t\t\t\tlabel: function (tooltipItem) {\r\n\t\t\t\t\t\t\t\t\t\treturn tooltipItem.yLabel;\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},\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tborderWidth: 1,\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 createGraphUI() {\n var vertexNames = document.getElementById(\"numV\").value.split(\",\");\n currentGraph = new Graph(vertexNames);\n showGraph();\n}", "function updateAmountGraph() {\n amountChartData.data.datasets[0].data = [];\n\n amountChartData.data.datasets[0].data.push(keg.level);\n\n amountChartData.update();\n\n console.log(amountChartData);\n}", "function plotGraph(vh1,vh2,ph1,ph2,th1,th2) {\n\t\tvar chart = new CanvasJS.Chart(\"chartContainer\", {\n\t\t\n\t\t\t\n\t\t\n\ttitle:{\n\t\t\n\t\ttext: \"vs Total Head (in cm)\",\n\t\t\n\t\n\t},\n\taxisY:[{\n\t\ttitle: \"Pressure Head (in cm)\",\n\t\tlineColor: \"#C24642\",\n\t\ttickColor: \"#C24642\",\n\t\tlabelFontColor: \"#C24642\",\n\t\ttitleFontColor: \"#C24642\",\n\t\t\n\t},\n\t{\n\t\ttitle: \"Velocity Head (in cm)\",\n\t\tlineColor: \"#369EAD\",\n\t\ttickColor: \"#369EAD\",\n\t\tlabelFontColor: \"#369EAD\",\n\t\ttitleFontColor: \"#369EAD\"\n\t\t\n\t}],\n\t\n\ttoolTip: {\n\t\tshared: true\n\t},\n\tlegend: {\n\t\tcursor: \"pointer\",\n\t\titemclick: toggleDataSeries\n\t},\n\tdata: [{\n\t\ttype: \"line\",\n\t\tname: \"Velocity Head\",\n\t\tcolor: \"#369EAD\",\n\t\tshowInLegend: true,\n\t\taxisYIndex: 1,\n\t\tdataPoints: [\n\t\t\t{ x: th1, y: vh1 }, \n\t\t\t{ x: th2, y: vh2 }\n\t\t\t\n\t\t]\n\t},\n\t{\n\t\ttype: \"line\",\n\t\tname: \"Pressure Head\",\n\t\tcolor: \"#C24642\",\n\t\taxisYIndex: 0,\n\t\tshowInLegend: true,\n\t\tdataPoints: [\n\t\t\t{ x: th1, y: ph1 }, \n\t\t\t{ x: th2 , y: ph2 }\n\t\t]\n\t},\n\t{\n\t\t\n\t}]\n});\nchart.render();\n\nfunction toggleDataSeries(e) {\n\tif (typeof (e.dataSeries.visible) === \"undefined\" || e.dataSeries.visible) {\n\t\te.dataSeries.visible = false;\n\t} else {\n\t\te.dataSeries.visible = true;\n\t}\n\te.chart.render();\n}\n}", "function makeChart() {\n //get the data for the chart and put it in the appropriate places\n //in the chartData and chartOptions objects\n const data = getData(currentSubject, currentMaxWordLength);\n chartData.datasets[0].data = data.BFS;\n chartData.datasets[1].data = data.DFS;\n chartOptions.scales.yAxes[0].scaleLabel.labelString = data.yAxisLabel;\n\n if (resultsChart) {\n resultsChart.destroy();\n }\n\n //create (or recreate) the chart\n const chartContext = $(\"#results-graph\")[0].getContext('2d');\n const chartConfig = {\"type\": \"line\",\n \"data\": chartData,\n \"options\": chartOptions};\n resultsChart = new Chart(chartContext, chartConfig);\n }", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Color');\n data.addColumn('number', 'Ranking');\n\n data.addRows(graphData);\n\n // Set chart options\n var options = {\n title: 'T-Shirt Rankings',\n height: 600,\n legend: {position: 'none'},\n vAxis: {format:'#'}\n };\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "function initializeSiteLayout(GraphAlgorithmConstructor) {\n\n $(\"button\").button();\n $(\"#te_button_gotoDrawGraph\").click(function() { $(\"#tabs\").tabs(\"option\", \"active\", 1);});\n $(\"#te_button_gotoIdee\").click(function() { $(\"#tabs\").tabs(\"option\", \"active\", 3);});\n $(\"#ti_button_gotoDrawGraph\").click(function() { $(\"#tabs\").tabs(\"option\", \"active\", 1);});\n $(\"#ti_button_gotoAlgorithm\").click(function() { $(\"#tabs\").tabs(\"option\", \"active\", 2);});\n $(\"#tw_Accordion\").accordion({heightStyle: \"content\"});\n \n graphEditorTab = new GraphEditorTab(new GraphEditor(d3.select(\"#tg_canvas_graph\")),$(\"#tab_tg\"));\n graphEditorTab.init();\n \n algorithmTab = new AlgorithmTab(new GraphAlgorithmConstructor(d3.select(\"#ta_canvas_graph\"),d3.select(\"#ta_canvas_graph2\")),$(\"#tab_ta\"));\n algorithmTab.init();\n \n $(\"#tabs\").tabs({\n beforeActivate: function(event, ui) {\n var id = ui.oldPanel[0].id;\n if(id == \"tab_tg\") { /** graph editor tab */\n graphEditorTab.deactivate();\n }else if(id == \"tab_ta\") { /** graph algorithm tab */\n algorithmTab.deactivate();\n }\n },\n activate: function(event, ui) {\n var id = ui.newPanel[0].id;\n if(id == \"tab_tg\") {\n graphEditorTab.activate();\n } else if(id == \"tab_ta\") {\n algorithmTab.activate();\n }\n }\n });\n\n svgHack();\n svgGraphCanvasDownloadable();\n}", "function addDataTimeline(chart, dataElement) {\n dataset = {\n label: dataElement.type,\n data: dataElement.data.data,\n title: dataElement.data.title,\n pointRadius: 7,\n backgroundColor: dataElement.background,\n borderColor: dataElement.border,\n };\n chart.data.datasets.push(dataset);\n chart.update();\n}", "#generateStateOverviewPlots () {\n const overviewMaternalHealthSelected = this.#controlPanel.overview.maternalHealthSelected;\n // enable the right plots\n this.#selectOverviewPlot(overviewMaternalHealthSelected);\n if (overviewMaternalHealthSelected == \"Maternal Deaths\" || overviewMaternalHealthSelected == \"Maternity Care Deserts\"){\n this.#generateMaternalDeathsPlot();\n }\n else {\n // set chart title\n document.getElementById(\"chart-title\").innerHTML = `${this.#controlPanel.getBroadbandSelected()} and ${this.#controlPanel.getMaternalHealthSelected()} by ${this.#capitalizeGeoLevel()}`;\n // If the identifier is not known, resort to a default value.\n const scatterLayout = {\n xaxis: {\n title: {\n text: this.broadbandTitlePart,\n },\n },\n yaxis: {\n title: {\n text: this.maternalHealthTitlePart,\n }\n },\n shapes: [\n {\n type: 'line',\n x0: this.cutoffs[1],\n y0: 0,\n x1: this.cutoffs[1],\n yref: 'paper',\n y1: 1,\n line: {\n color: 'grey',\n width: 1.5,\n dash: 'dot'\n }\n },\n {\n type: 'line',\n x0: 0,\n y0: this.cutoffs[0],\n x1: 1,\n xref: 'paper',\n y1: this.cutoffs[0],\n line: {\n color: 'grey',\n width: 1.5,\n dash: 'dot'\n }\n },\n ],\n legend: {\n bordercolor: '#B0BBD0',\n borderwidth: 1,\n orientation: 'h',\n yanchor: 'bottom',\n y: 1.02,\n xanchor: 'right',\n x: 0.75\n },\n };\n\n const boxLayout = {\n hovermode: false,\n xaxis: {\n title: {\n text: 'Categorizations',\n },\n },\n yaxis: {\n title: {\n text: this.maternalHealthTitlePart,\n }\n },\n legend: {\n bordercolor: '#B0BBD0',\n borderwidth: 1,\n orientation: 'h',\n yanchor: 'bottom',\n y: 1.02,\n xanchor: 'right',\n x: 0.75\n },\n boxmode: 'group',\n };\n\n // Initialize data structures for plots.\n const county_categorization_color_mapping_temp = [...county_categorization_color_mapping, county_categorization_color_mapping_unknowns[1], WITHHELD_COLOR];\n const county_categorization_color_mapping_light_temp = [...county_categorization_color_mapping_light, county_categorization_color_mapping_unknowns[1], WITHHELD_COLOR];\n const boxBorderColors = [\"#68247F\", \"#02304B\", \"#6E3C0C\", \"#274200\", \"#0F0F0F\", \"#474747\", WITHHELD_COLOR];\n this.chart_data = [];\n this.box_data = [];\n\n for (const [i, cat] of [\"Double Burden\", \"Opportunity\", \"Single Burden\", \"Milestone\", \"Unreliable\", WITHHELD_COLOR].entries()) {\n this.chart_data.push({\n x: [],\n y: [],\n mode: 'markers',\n type: 'scatter',\n name: cat,\n text: [],\n hovertemplate: '<i>Broadband</i>: %{x}' + '<br><i>Health</i>: %{y}<br>',\n marker: { color: county_categorization_color_mapping_temp[i], }\n });\n this.box_data.push({\n // https://github.com/plotly/plotly.js/issues/3830\n // Setting offsetgroup fixes issue where boxes become skinny.\n offsetgroup: '1',\n y: [],\n type: 'box',\n name: cat,\n fillcolor: county_categorization_color_mapping_temp[i],\n marker: { color: boxBorderColors[i], }\n });\n if (this.mapIsSplit) {\n this.chart_data.push({\n x: [],\n y: [],\n mode: 'markers',\n type: 'scatter',\n name: cat,\n text: [],\n hovertemplate: '<i>Broadband</i>: %{x}' + '<br><i>Health</i>: %{y}<br>',\n marker: {\n color: county_categorization_color_mapping_temp[i],\n symbol: \"circle-open\"\n }\n });\n this.box_data.push({\n offsetgroup: '2',\n y: [],\n type: 'box',\n name: cat,\n marker: {\n color: county_categorization_color_mapping_temp[i],\n },\n fillcolor: county_categorization_color_mapping_light_temp[i],\n line: {\n color: county_categorization_color_mapping_temp[i],\n }\n });\n }\n }\n\n // Load data into the plots.\n for (const el of this.data.state_data) {\n if (el[\"state_categorization\"] === undefined || el[\"state_categorization\"] === null || el[\"state_categorization\"] < 0) continue;\n let category = this.mapIsSplit ? 2 * (el[\"state_categorization\"] - 1) : el[\"state_categorization\"] - 1;\n if (el[\"health_status\"] == \"unreliable\") {\n category = this.mapIsSplit ? 8 : 4;\n } else if (this.#controlPanel.displayWithheld() && el[\"broadband\"] === -9999.0) {\n category = this.mapIsSplit ? 10 : 5;\n } else if (this.#controlPanel.getMaternalHealthSelected() == \"Mental Health Provider Shortage\"){\n if (el[\"health\"] < 0){\n continue;\n }\n }\n this.chart_data[category][\"x\"].push(Number(el[\"broadband\"]));\n this.chart_data[category][\"y\"].push(Number(el[\"health\"]));\n\n this.box_data[category][\"y\"].push(Number(el[\"health\"]));\n if (this.mapIsSplit) {\n // Populate the data for the second map with the same data as the first map. Eventually, this will change.\n category += 1;\n this.chart_data[category][\"x\"].push(Number(el[\"broadband\"]));\n this.chart_data[category][\"y\"].push(Number(el[\"health\"]));\n\n this.box_data[category][\"y\"].push(Number(el[\"health\"]));\n }\n }\n\n Plotly.newPlot(\"maternalHealthSecondPlot\", this.chart_data, scatterLayout,\n { displaylogo: false, responsive: true, displayModeBar: true });\n Plotly.newPlot(\"maternalHealthFirstPlot\", this.box_data, boxLayout,\n { displaylogo: false, responsive: true, displayModeBar: true });\n\n this.makePlotsAccessible();\n }\n }", "function createChartArea() {\n var chartArea = $(\"<div></div\").attr(\"id\", \"chartarea\");\n\n $(\"#chartcontainer\").append(chartArea);\n $(\"#chartarea\").css( {\n \"border-color\": \"black\",\n \"border-style\": \"none none solid solid\",\n \"border-width\": \"2px\",\n \"display\": \"flex\",\n \"flex-direction\": \"column\",\n \"height\": \"80%\",\n \"justify-content\": \"flex-end\",\n \"left\": \"15%\",\n \"margin\": \"0\",\n \"position\": \"absolute\",\n \"width\": \"80%\"\n });\n}", "function renderGraph() {\n // Initialize arrays\n var line_data = new Object();\n var tags = form_tags(SINGLEGRAPH_FORM);\n for (var i=0;i<tags.length;i++) {\n if (SINGLEGRAPH_IGNORE_TAGS.indexOf(tags[i]) === -1) {\n line_data[tags[i]] = new Array();\n }\n }\n \n // Calculate timestamps\n var start_timestamp = Number(moment(START_MONTH+\"-\"+START_YEAR, \"MM-YYYY\").unix() * 1000);\n var end_timestamp = Number(moment());\n\n // Parse each month\n var month_count = monthDifference(start_timestamp, end_timestamp);\n var month = Number(START_MONTH);\n var year = Number(START_YEAR);\n for (var i=0;i<month_count;i++) {\n\n // Append data\n var ts1 = Number(moment(month+\"-\"+year, \"MM-YYYY\").unix() * 1000);\n var ts2 = Number(moment((month+1)+\"-\"+year, \"MM-YYYY\").unix() * 1000);\n\n if (form_isLocationBound(SINGLEGRAPH_FORM)) {\n var loc = document.getElementById('static_location').value;\n if (loc !== \"\") {\n var doc = collection_findOne(form_name(SINGLEGRAPH_FORM), {location:Number(loc), timestamp:{$gt:ts1,$lt:ts2}});\n }\n } else {\n var doc = collection_findOne(form_name(SINGLEGRAPH_FORM), {timestamp:{$gt:ts1,$lt:ts2}});\n }\n \n for (var j=0;j<tags.length;j++) {\n if (SINGLEGRAPH_IGNORE_TAGS.indexOf(tags[j]) === -1) {\n if (doc && doc[tags[j]]) {\n line_data[tags[j]].push([ts1 + 86400000, Number(doc[tags[j]])]);\n } else {\n line_data[tags[j]].push([ts1 + 86400000, 0]);\n }\n }\n }\n\n // update the counter\n month++;\n if (month > GLOBAL_MONTHS.length) {\n month = 1;\n year++;\n }\n }\n\n // Now we have all data and labels so we can display the chart\n $('.chartContainer2').highcharts('StockChart', {\n rangeSelector: {selected:4,inputDateFormat:'%b %Y',inputEditDateFormat:'%b %Y'},\n xAxis:{gridLineWidth:1,type:'datetime',tickInterval:30*24*3600000,labels:{formatter:function() {return Highcharts.dateFormat(\"%b %Y\", this.value);}}},\n title: {text:''},\n legend: {enabled:true},\n chart: {type: 'spline'},\n tooltip: {\n headerFormat: '<span style=\"font-size:10px\">{point.key}</span><table>',\n pointFormat: '<tr><td style=\"color:{series.color};padding:0\">{series.name}: </td>' +\n '<td style=\"padding:0\"><b>{point.y:.1f} EUR</b></td></tr>',\n footerFormat: '</table>',\n shared: true,\n useHTML: true\n },\n series:buildSeries(tags, line_data)\n });\n}", "function drawGraph (opts) {\n \n // Clone the options, so the 'options' variable always keeps intact.\n o = Flotr._.extend(Flotr._.clone(options), opts || {});\n \n // Return a new graph.\n return Flotr.draw(\n container,\n [ d1 ],\n o\n );\n }", "async function createDashboardSensorsPlot() {\r\n\tvar canvas = document.getElementById('dashboard-sensors-plot');\r\n\tif (canvas != null || canvas != undefined) {\r\n\t\tvar ctx = canvas.getContext('2d');\r\n\t\tctx.clearRect(0, 0, canvas.width, canvas.height);\r\n\t\tvar xl = await getSensorsCode();\r\n\t\tvar yl = await getTotalSamplesFromSensors();\r\n\t\tvar backgroundColors;\r\n\r\n\t\tif (colorArray.length >= nodesPayload.length) {\r\n\t\t\tbackgroundColors = colorArray;\r\n\t\t} else {\r\n\t\t\tbackgroundColors = await getNodesBackgroundColors();\r\n\t\t}\r\n\r\n\t\tif (charts.dashboard.sensors != undefined) {\r\n\t\t\tcharts.dashboard.sensors.destroy();\r\n\t\t}\r\n\r\n\t\tcharts.dashboard.sensors = new Chart(ctx, {\r\n\t\t\ttype: 'doughnut',\r\n\t\t\tdata: {\r\n\t\t\t\tlabels: xl,\r\n\t\t\t\tdatasets: [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdata: yl,\r\n\t\t\t\t\t\tbackgroundColor: colorArray,\r\n\t\t\t\t\t\tborderWidth: 1,\r\n\t\t\t\t\t\toptions: {\r\n\t\t\t\t\t\t\tanimation: true,\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t},\r\n\t\t\t\t],\r\n\t\t\t},\r\n\t\t});\r\n\t}\r\n}", "function createGraphs(dataArray) {\n tempData = [];\n humData = [];\n distanceData = [];\n\n if (dataArray != null) {\n dataArray.forEach(function (data) {\n tempData.push([Date.parse(data.created), data.content.weather_readings.temperature]);\n humData.push([Date.parse(data.created), data.content.weather_readings.humidity]);\n distanceData.push([Date.parse(data.created), data.content.ultrasonic_distance]);\n });\n\n tempData.sort();\n humData.sort();\n distanceData.sort();\n }\n\n loadChart(\"temperature\", \"Temperature\", \"Degrees\", \"PIBOMETER\", tempData);\n loadChart(\"humidity\", \"Humidity\", \"Water Content\", \"PIBOMETER\", humData);\n loadChart(\"distance\", \"Distance Set off\", \"CM\", \"PIBOMETER\", distanceData);\n}", "function show_graph(arrayOfDataMulti,cat,cus_legends)\n\t{\n\t\t\t$('#mygraph').html('');\n\t\t\t\n\t\t\tif(cat == 1)\n\t\t\t{\n\t\t\t\t\t$('#mygraph').jqBarGraph({\n\t\t\t\t\t\tdata: arrayOfDataMulti,\n\t\t\t\t\t\tcolors: ['#242424','#437346','#97D95C'],\n\t\t\t\t\t\twidth: 600,\n\t\t\t\t\t\tlegendWidth: 200,\n\t\t\t\t\t\tlegend: true,\n\t\t\t\t\t\tlegends: cus_legends,\n\t\t\t\t\t\tbarSpace: 20\n\t\t\t\t\t}); \n\t\t\t}\n\t\t\t\n\t\t\telse if(cat == 2)\n\t\t\t{\n\t\t\t\t\t$('#mygraph').jqBarGraph({\n\t\t\t\t\t\tdata: arrayOfDataMulti,\n\t\t\t\t\t\tcolors: ['#242424','#437346','#97D95C'],\n\t\t\t\t\t\twidth: 600,\n\t\t\t\t\t\tlegendWidth: 200,\n\t\t\t\t\t\tlegend: true,\n\t\t\t\t\t\tlegends: cus_legends,\n\t\t\t\t\t\tbarSpace: 20,\n\t\t\t\t\t\ttype: 'multi'\n\t\t\t\t\t}); \n\t\t\t}\n\t}", "async function drawChart(chartType = 'StackedBarChart') {\n try {\n const authKey = document.getElementById('chartAuthKey').value;\n const response = await fetch('/dashboard/data', { headers: { Authorization: `Bearer ${authKey}` } });\n const dataJson = await response.json();\n\n // extract and removed invalid or null _id from array\n const _invalidId = dataJson.findIndex((mo) => !mo._id);\n if (_invalidId > -1) {\n dataJson.splice(_invalidId, 1);\n }\n\n document.getElementById('chartArea').style.display = 'block';\n document.getElementById('chartLogin').style.display = 'none';\n // find the largest ai array length of MOs\n let maxAiLength = 0;\n let maxAiIndex = 0;\n dataJson.forEach((mo, i) => {\n if (mo.ai.length > maxAiLength) {\n maxAiLength = mo.ai.length;\n maxAiIndex = i;\n }\n });\n const aiArray = [];\n dataJson[maxAiIndex].ai.forEach((ai) => {\n aiArray.push(ai.shortName);\n });\n const chartArray = [['Genre', 'gcp', 'links', ...aiArray]];\n\n // loop through each mo and set data for chart\n dataJson.forEach((mo) => {\n const dataArr = Array(maxAiLength + 3).fill(0);\n dataArr[0] = mo.accountName;\n dataArr[1] = mo.gcpCount;\n dataArr[2] = mo.linksCount;\n // loop throught AI\n mo.ai.forEach((ai) => {\n dataArr[chartArray[0].indexOf(ai.shortName)] = ai.count;\n });\n chartArray.push(dataArr);\n });\n\n // Create the data table.\n const options = {\n // width: '100%',\n // height: '100%',\n legend: { position: 'bottom', maxLines: 3 },\n // bar: { groupWidth: '75%' },\n // isStacked: false,\n logScale: true,\n title: '',\n width: '100%',\n height: '100%',\n axisTitlesPosition: 'out',\n isStacked: false,\n pieSliceText: 'percentage',\n // colors: ['#0598d8', '#f97263'],\n chartArea: {\n left: '25%',\n top: '1%',\n height: '90%',\n width: '100%',\n },\n vAxis: {\n title: '',\n },\n hAxis: {\n title: 'GS1 Resolver Results',\n },\n };\n\n if (chartType === 'StackedBarChart') {\n chartType = 'BarChart';\n options.isStacked = true;\n }\n if (chartType === 'ColumnChart') {\n options.chartArea.left = '5%';\n // options.chartArea.width = 1000;\n // const ele = document.getElementById('chart-container');\n // ele.style.overflowX = 'scroll';\n // ele.style.overflowY = 'hidden';\n // ele.style.width = 1000;\n }\n const data = google.visualization.arrayToDataTable(chartArray);\n // const chart = new google.visualization.BarChart(document.getElementById('chart_div'));\n const chart = new google.visualization[chartType](document.getElementById('chart_div'));\n chart.draw(data, options);\n } catch (e) {\n document.getElementById('chartArea').style.display = 'none';\n document.getElementById('chartLogin').style.display = 'block';\n document.getElementById('invalidAuthKey').innerHTML = 'Entered Auth Key is Invalid';\n }\n}", "function drawGraph(field, tablename, buckets, interval, startTime, metric,\n\t\textraMetric,find, plot, refresh, sqlElement) {\n\n\tvar barOptions = {\n\t\tshow : true,\n\t\talign : \"center\",\n\t\tbarWidth : interval\n\t};\n\n\tvar thePlot = null;\n\n\tfunction onDataReceived(series) {\n\t\tconsole.log(series);\n\t\tvar n;\n\t\tif (buckets == 0) {\n\t\t\tn = 1;\n\t\t\tbarOptions.barWidth = 0;\n\t\t} else {\n\t\t\tn = buckets;\n\t\t}\n\n\t\t// series.lines = { show: true, steps: true, fill: true };\n\t\tseries.label = field;\n\t\tseries.bars = barOptions;\n\t\tseries.points = {\n\t\t\tshow : true\n\t\t};\n\n\t\tvar options = {\n\t\t\txaxis : {\n\t\t\t\tmode : \"time\",\n\t\t\t\ttimeformat : \"%H:%M\\n%d/%m\",\n\t\t\t\tzoomRange : null,\n\t\t\t\tpanRange : null\n\t\t\t},\n\t\t\tyaxis : {\n\t\t\t\tzoomRange : false,\n\t\t\t\tpanRange : false\n\t\t\t},\n\t\t\tgrid : {\n\t\t\t\thoverable : true,\n\t\t\t\tclickable : true\n\t\t\t},\n\t\t\tzoom : {\n\t\t\t\tinteractive : true\n\t\t\t},\n\t\t\tpan : {\n\t\t\t\tinteractive : true\n\t\t\t}\n\t\t// ,colors: [\"#d18b2c\", \"#dba255\",\"#dba255\", \"#919733\",\"#919733\"]\n\t\t};\n\t\tvar finishTime = startTime + interval * n;\n\t\tif (thePlot != null) {\n\t\t\toptions.xaxis.min = thePlot.getAxes().xaxis.min;\n\t\t\toptions.xaxis.max = thePlot.getAxes().xaxis.max;\n\t\t\tif (buckets == 0)\n\t\t\t\tbarOptions.barWidth = 1;\n\t\t\telse\n\t\t\t\tbarOptions.barWidth = (options.xaxis.max - options.xaxis.min)\n\t\t\t\t\t\t/ n;\n\t\t} else {\n\t\t\toptions.xaxis.min = startTime;\n\t\t\toptions.xaxis.max = finishTime;\n\t\t}\n\n\t\tvar xStart = options.xaxis.min;\n\t\tvar xFinish = options.xaxis.max;\n\n\t\tvar meanGraph = {\n\t\t\tlabel : \"mean\",\n\t\t\tdata : [ [ xStart, series.stats.MEAN ],\n\t\t\t\t\t[ xFinish, series.stats.MEAN ] ],\n\t\t\tlines : {\n\t\t\t\tshow : true\n\t\t\t}\n\t\t};\n\t\tconsole.log(series.stats);\n\t\tvar metricValue = series.stats[extraMetric];\n\t\tconsole.log(\"extraMetric=\" + metricValue);\n\t\tvar extraMetricGraph = {\n\t\t\tlabel : extraMetric.toLowerCase(),\n\t\t\tdata : [ [ xStart, metricValue ], [ xFinish, metricValue ] ],\n\t\t\tlines : {\n\t\t\t\tshow : true\n\t\t\t}\n\t\t};\n\t\tvar sdUpperGraph = {\n\t\t\tlabel : \"mean+sd\",\n\t\t\tdata : [\n\t\t\t\t\t[ xStart,\n\t\t\t\t\t\t\tseries.stats.MEAN + series.stats.STANDARD_DEVIATION ],\n\t\t\t\t\t[ xFinish,\n\t\t\t\t\t\t\tseries.stats.MEAN + series.stats.STANDARD_DEVIATION ] ],\n\t\t\tlines : {\n\t\t\t\tshow : true\n\t\t\t}\n\t\t};\n\t\tvar sdLowerGraph = {\n\t\t\tlabel : \"mean-sd\",\n\t\t\tdata : [\n\t\t\t\t\t[ xStart,\n\t\t\t\t\t\t\tseries.stats.MEAN - series.stats.STANDARD_DEVIATION ],\n\t\t\t\t\t[ xFinish,\n\t\t\t\t\t\t\tseries.stats.MEAN - series.stats.STANDARD_DEVIATION ] ],\n\t\t\tlines : {\n\t\t\t\tshow : true\n\t\t\t}\n\t\t};\n\n\t\tfunction showTooltip(x, y, contents) {\n\t\t\t$('<div id=\"tooltip\">' + contents + '</div>').css({\n\t\t\t\tposition : 'absolute',\n\t\t\t\tdisplay : 'none',\n\t\t\t\ttop : y + 5,\n\t\t\t\tleft : x + 5,\n\t\t\t\tborder : '1px solid #fdd',\n\t\t\t\tpadding : '2px',\n\t\t\t\t'background-color' : '#fee',\n\t\t\t\topacity : 0.80\n\t\t\t}).appendTo(\"body\").fadeIn(200);\n\t\t}\n\n\t\tvar previousPoint = null;\n\n\t\tif (metric == \"COUNT\")\n\t\t\tthePlot = $.plot(plot, [ series, extraMetricGraph ], options);\n\t\telse\n\t\t\tthePlot = $.plot(plot, [ series, meanGraph, sdLowerGraph,\n\t\t\t\t\tsdUpperGraph, extraMetricGraph ], options);\n\t\tvar panning = false;\n\t\tplot.bind('plotpan', function(event, p) {\n\t\t\tpanning = true;\n\t\t});\n\t\t// refresh the graph once stopped panning\n\t\tplot.unbind(\"mouseup\");\n\t\tplot.bind(\"mouseup\", function(event, pos, item) {\n\t\t\tif (panning)\n\t\t\t\trefresh.click();\n\t\t\tpanning = false;\n\t\t});\n\t\tplot.unbind(\"plothover\");\n\t\tplot.bind(\"plothover\", function(event, pos, item) {\n\t\t\t$(\"#x\").text(pos.x.toFixed(2));\n\t\t\t$(\"#y\").text(pos.y.toFixed(2));\n\n\t\t\t// if ($(\"#enableTooltip:checked\").length > 0) {\n\t\t\tif (item) {\n\t\t\t\tif (previousPoint != item.dataIndex) {\n\t\t\t\t\tpreviousPoint = item.dataIndex;\n\n\t\t\t\t\t$(\"#tooltip\").remove();\n\t\t\t\t\tvar x = item.datapoint[0].toFixed(2), y = item.datapoint[1]\n\t\t\t\t\t\t\t.toFixed(2);\n\n\t\t\t\t\tshowTooltip(item.pageX, item.pageY, item.series.label\n\t\t\t\t\t\t\t+ \" = \" + y);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$(\"#tooltip\").remove();\n\t\t\t\tpreviousPoint = null;\n\t\t\t}\n\t\t\t// }\n\t\t});\n\t\tplot.unbind(\"plotclick\");\n\t\tplot.bind(\"plotclick\", function(event, pos, item) {\n\t\t\tif (item) {\n\t\t\t\t// $(\"#clickdata\").text(\"You clicked point \" + item.dataIndex +\n\t\t\t\t// \" in \" + item.series.label + \".\");\n\t\t\t\tvar x = item.datapoint[0].toFixed(2);\n\t\t\t\t// var y = item.datapoint[1].toFixed(2);\n\n\t\t\t\t// plotObject.highlight(item.series, item.datapoint);\n\t\t\t\tvar gap = 300000;\n\t\t\t\tvar startT = Math.floor(Number(x) - gap);\n\t\t\t\tvar finishT = Math.floor(Number(x) + gap);\n\t\t\t\twindow.open('log?start=' + startT\n\t\t\t\t\t\t+ '&finish=' + finishT , 'logWindow',\n\t\t\t\t\t\t'');\n\t\t\t}\n\t\t});\n//\t\tvar scrolling = false;\n//\t\t\n//\t\tplot.scroll(function(event){\n//\t\t\tscrolling = true;\n//\t\t\tconsole.log(\"scrolling\");\n//\t\t\tsetInterval(function() {\n//\t\t\t\tscrolling = false;\n//\t\t\t},500);\n//\t\t\tsetInterval(function() {\n//\t\t\t\tif (!scrolling)\n//\t\t\t\t\trefresh.click();\n//\t\t\t},1000);\n//\t\t});\n\t}\n\n\tfunction refreshGraph(startTime, interval, buckets) {\n\n\t\tvar dataurl = \"data?table=\" + tablename + \"&field=\" + field + \"&start=\"\n\t\t\t\t+ startTime + \"&interval=\" + interval + \"&buckets=\" + buckets\n\t\t\t\t+ \"&metric=\" + metric;\n\t\tif (find !== \"null\") dataurl += \"&text=\"+find;\n\t\tconsole.log(\"dataurl=\" + dataurl);\n\n\t\t$.ajax({\n\t\t\turl : dataurl,\n\t\t\tmethod : 'GET',\n\t\t\tdataType : 'json',\n\t\t\tsuccess : onDataReceived,\n\t\t\terror : function(request, textStatus, errorThrown) {\n\t\t\t\tconsole.log(errorThrown);\n\t\t\t\t$(\"#error\").text(errorThrown);\n\t\t\t},\n\t\t\ttimeout : 120000\n\t\t});\n\t}\n\n\trefreshGraph(startTime, interval, buckets);\n\trefresh.click(function(event) {\n\t\tevent.preventDefault();\n\t\tvar xaxis = thePlot.getAxes().xaxis;\n\t\tvar newStartTime = Math.floor(xaxis.min);\n\t\tvar newInterval = xaxis.max - xaxis.min;\n\t\tif (buckets > 0)\n\t\t\tnewInterval = newInterval / buckets;\n\t\trefreshGraph(newStartTime, newInterval, buckets);\n\t});\n\n}", "function updateCharts() {\n\n // generate the age chart\n ageChart = AmCharts.makeChart(\"age-graph\", {\n \"theme\": \"none\",\n \"type\": \"serial\",\n \"legend\": {\n \"equalWidths\": false,\n \"position\": \"top\",\n \"valueAlign\": \"left\",\n \"valueWidth\": 100,\n },\n \"dataProvider\": generateAgeChartData(),\n \"valueAxes\": [{\n \"position\": \"left\",\n \"title\": \"Fist of Five Rating\",\n }],\n \"startDuration\": 1,\n \"graphs\": generateGraphs(),\n \"plotAreaFillAlphas\": 0.1,\n \"categoryField\": \"age\",\n \"categoryAxis\": {\n \"gridPosition\": \"start\"\n },\n \"export\": {\n \"enabled\": true\n }\n });\n\n // generate the ethnicity chart\n ethnicityChart = AmCharts.makeChart(\"ethnicity-graph\", {\n \"theme\": \"none\",\n \"type\": \"serial\",\n \"legend\": {\n \"equalWidths\": false,\n \"position\": \"top\",\n \"valueAlign\": \"left\",\n \"valueWidth\": 100,\n },\n \"dataProvider\": generateEthnicityChartData(),\n \"valueAxes\": [{\n \"position\": \"left\",\n \"gridCount\": 10,\n // \"autoGridCount\": \"true\",\n // \"min\": 0,\n // \"max\": 100,\n \"title\": \"Fist of Five Rating\",\n }],\n \"startDuration\": 1,\n \"graphs\": generateGraphs(),\n \"plotAreaFillAlphas\": 0.1,\n \"categoryField\": \"ethnicity\",\n \"categoryAxis\": {\n \"gridPosition\": \"start\"\n },\n \"export\": {\n \"enabled\": true\n }\n });\n\n // generate the ethnicity chart\n genderChart = AmCharts.makeChart(\"gender-graph\", {\n \"theme\": \"none\",\n \"type\": \"serial\",\n \"legend\": {\n \"equalWidths\": false,\n \"position\": \"top\",\n \"valueAlign\": \"left\",\n \"valueWidth\": 100,\n },\n \"dataProvider\": generateGenderChartData(),\n \"valueAxes\": [{\n \"position\": \"left\",\n \"title\": \"Fist of Five Rating\",\n }],\n \"startDuration\": 1,\n \"graphs\": generateGraphs(),\n \"plotAreaFillAlphas\": 0.1,\n \"categoryField\": \"gender\",\n \"categoryAxis\": {\n \"gridPosition\": \"start\"\n },\n \"export\": {\n \"enabled\": true\n }\n });\n }", "function setUpGraph() {\n chart = new google.visualization.LineChart(document.getElementById('graph'));\n data = new google.visualization.DataTable();\n data.addColumn('number', 'Year');\n data.addRows(years.length);\n years.forEach(function (value, index) {\n data.setCell(index, 0, value);\n });\n}", "function createDashboardIr(data, data2) {\n\n /*\n * Loading all Units os Assessment and use this for populating\n * select box which will control the whole layout and all the visualizations\n * on this page\n */\n // Load all Unit of Assessment options\n var uoas = dataManager.loadAllUoAs(data);\n\n // Load all City options\n var cities = dataManager.loadAllCities(data);\n\n // Populate the select boxes with the options\n (0, _populateCities2.default)(cities);\n\n // Get the current city from the select box\n var selectBoxCity = document.getElementById('selector-city');\n var selectedCity = 'Aberdeen';\n var selectedUoa = 'Business and Management Studies';\n\n // Load all universities\n var universities = dataManager.loadAllUniversitiesInCity(data, selectedCity);\n var selectedUni = universities[0];\n\n /*\n * Creating the first visualization, which is a map of the UK,\n * with the universities of the selected city and a selected field (Unit\n * of Assessment) which are passed on as an argument from the selectbox\n */\n var mapMarkers = dataManager.getLocationByCity(data, selectedCity);\n var hierarchical = new _hierarchical2.default(data2, data, selectedUoa, selectedUni, 'ShowUniversity', true);\n\n var barChart = new _hBarChart2.default(data, dataManager.getUoaByUniversity(data, selectedUni), selectedUoa, selectedUni, 'StackUoa');\n\n // Create the map\n var map = new _map2.default(mapMarkers, 'mean');\n map.createMap();\n map.render();\n\n // Create the hierarchical sunburst chart\n hierarchical.createChart();\n\n // Create a horizontal stacked bar chart\n barChart.createChart();\n\n // Listen for changes on the City selectbox and get the selected value\n selectBoxCity.addEventListener('change', function (event) {\n selectedCity = selectBoxCity.options[selectBoxCity.selectedIndex].value;\n console.log(selectedCity);\n\n // Load all universities\n universities = dataManager.loadAllUniversitiesInCity(data, selectedCity);\n selectedUni = universities[0];\n\n // Reload the map with the new dataset\n map.reload(dataManager.getLocationByCity(data, selectedCity));\n\n // Reload the map with the new dataset\n barChart.reload(selectedUni, selectedUoa, data, dataManager.getUoaByUniversity(data, selectedUni), 'StackUoa');\n });\n}", "function generateGraphs() {\n return [{\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BZDVkZmI0YzAtNzdjYi00ZjhhLWE1ODEtMWMzMWMzNDA0NmQ4XkEyXkFqcGdeQXVyNzYzODM3Mzg@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"It\",\n \"type\": \"column\",\n \"valueField\": \"It\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BNDAxMTZmZGItZmM2NC00M2E1LWI1NmEtZjhhODM2MGU0ZmJlXkEyXkFqcGdeQXVyNzkwMjQ5NzM@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"The Hangover\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.5,\n \"valueField\": \"The Hangover\"\n }, {\n \"balloonText\": \"<img src='https://ia.media-imdb.com/images/M/MV5BMTk3OTM5Njg5M15BMl5BanBnXkFtZTYwMzA0ODI3._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"The Notebook\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.45,\n \"valueField\": \"The Notebook\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BYzE5MjY1ZDgtMTkyNC00MTMyLThhMjAtZGI5OTE1NzFlZGJjXkEyXkFqcGdeQXVyNjU0OTQ0OTY@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Deadpool\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.4,\n \"valueField\": \"Deadpool\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BMGE1ZTQ0ZTEtZTEwZS00NWE0LTlmMDUtMTE1ZWJiZTYzZTQ2XkEyXkFqcGdeQXVyNTAyODkwOQ@@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Bad Boys\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.35,\n \"valueField\": \"Bad Boys\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BY2I1NWE2NzctNzNkYS00Nzg5LWEwZTQtN2I3Nzk3MTQwMDY2XkEyXkFqcGdeQXVyMTQxNzMzNDI@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Caddyshack\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.3,\n \"valueField\": \"Caddyshack\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BMzNmY2IwYzAtNDQ1NC00MmI4LThkOTgtZmVhYmExOTVhMWRkXkEyXkFqcGdeQXVyMTk5NDA3Nw@@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Die Hard\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.25,\n \"valueField\": \"Die Hard\"\n }, {\n \"balloonText\": \"<img src='https://m.media-amazon.com/images/M/MV5BMTg1MTY2MjYzNV5BMl5BanBnXkFtZTgwMTc4NTMwNDI@._V1_SX300.jpg'style='vertical-align:bottom; margin-right: 10px; width:38px; height:61px;'><span style='font-size:14px; color:#000000;'><b>[[value]]</b></span>\",\n \"fillAlphas\": 0.9,\n \"lineAlpha\": 0.2,\n \"title\": \"Black Panther\",\n \"type\": \"column\",\n \"clustered\": false,\n \"columnWidth\": 0.2,\n \"valueField\": \"Black Panther\"\n }];\n }", "function drawGraph(){\n // Bar chart\n if (!isFirstGraph){\n myChart.destroy();\n }\n isFirstGraph = false;\n myChart = new Chart($(\".myChart\"), {\n maintainAspectRatio: true,\n responsive: true,\n type: 'bar',\n data: {\n labels: defects,\n datasets: [\n {\n label: packhouse1_Name,\n data: packhouse1_Data,\n backgroundColor: 'rgba(120, 181, 67, 0.8)',\n pointColor: 'rgba(68, 83, 91, 1)',\n highlightFill: '#fff',\n },\n {\n label: packhouse2_Name,\n data: packhouse2_Data,\n backgroundColor: 'rgba(68, 83, 91, 1)',\n pointColor: 'rgba(68, 83, 91, 1)',\n highlightFill: '#fff',\n },\n {\n label: packhouse3_Name,\n data: packhouse3_Data,\n backgroundColor: 'rgba(28, 160, 255, 0.8)',\n pointColor: 'rgba(68, 83, 91, 1)',\n highlightFill: '#fff',\n }\n ]\n },\n options: {\n legend: { display: false },\n title: {\n display: true,\n fontSize: 25,\n },\n scales : {\n xAxes : [ {\n gridLines : {\n display : false\n },\n scaleLabel : {\n fontSize: 25,\n display : true,\n labelString : 'The types of defect for the fruit'\n },\n ticks: {\n fontSize: 15\n }\n } ],\n yAxes : [ {\n scaleLabel : {\n fontSize: 25,\n display : true,\n labelString : yAxisLabel\n },\n ticks: {\n fontSize: 15\n }\n } ]\n }\n }\n });\n }", "function drawChart() {\n\n\t// Create the data table.\n\tvar data = new google.visualization.DataTable();\n\n\tvar sites = JSON.parse(localStorage.sites);\n\n\t/* Sort sites by time spent */\n\tvar sortedSites = new Array();\n\tvar totalTime = 0;\n\tfor(site in sites) {\n\t\tsortedSites.push([site, sites[site]]);\n\t\ttotalTime += sites[site];\n\t}\n\tsortedSites.sort(function(a, b) {\n\t\treturn b[1] - a[1];\n\t});\n\t/* Show only the top 15 sites by default */\n\tvar max = 15;\n\tif(document.location.href.indexOf(\"show=all\") != -1) {\n\t\tmax = sortedSites.length;\n\t}\n\n\tdata.addColumn('string', 'url');\n\tdata.addColumn('number', 'Energy');\n\n\tfor(var index = 0; ((index < sortedSites.length) && (index < max)); index++) {\n\t\tvar site = sortedSites[index][0];\n\t\tvar title = JSON.parse(localStorage.tabTitles)[site];\n\n\t\tdata.addRows([[title, (sites[site].toFixed(6) * power.toFixed(2))]]);\n\t}\n\n\t// Set chart options\n\tvar options = {\n\t\t'title' : 'Energy Breakdown',\n\t\t'width' : 500,\n\t\t'height' : 250,\n\t\t'colors' : ['green'],\n\t\t'vAxis.textPosition' : 'in'\n\t};\n\n\t// Instantiate and draw our chart, passing in some options.\n\tvar chart = new google.visualization.BarChart(document.getElementById('chart_div'));\n\tchart.draw(data, options);\n}", "constructor(props){\n\t\tsuper(props)\n\t\tthis.createGraphChart = this.createGraphChart.bind(this)\n\t}", "function graph_load () {\n $(\".power-graph-footer\").show();\n var interval = 1800;\n var intervalms = interval * 1000;\n view.start = Math.ceil(view.start / intervalms) * intervalms;\n view.end = Math.ceil(view.end / intervalms) * intervalms;\n\n if (feeds[\"use_kwh\"] != undefined && feeds[\"solar_kwh\"] != undefined) solarpv_mode = true;\n var import_kwh = feed.getdata(feeds[\"import_kwh\"].id, view.start, view.end, interval, 0, 0);\n\n var use_kwh = [];\n if (solarpv_mode) use_kwh = feed.getdata(feeds[\"use_kwh\"].id, view.start, view.end, interval, 0, 0);\n var solar_kwh = [];\n if (solarpv_mode) solar_kwh = feed.getdata(feeds[\"solar_kwh\"].id, view.start, view.end, interval, 0, 0);\n data = {};\n\n data[\"agile\"] = []\n data[\"outgoing\"] = []\n if (config.app.region != undefined && regions_import[config.app.region.value] != undefined) {\n //Add 30 minutes to each reading to get a stepped graph\n agile = feed.getdataremote(regions_import[config.app.region.value], view.start, view.end, interval);\n for (var z in agile) {\n data[\"agile\"].push(agile[z]);\n data[\"agile\"].push([agile[z][0] + (intervalms - 1), agile[z][1]]);\n }\n\n outgoing = feed.getdataremote(regions_outgoing[config.app.region.value], view.start, view.end, interval);\n for (var z in outgoing) {\n data[\"outgoing\"].push(outgoing[z]);\n data[\"outgoing\"].push([outgoing[z][0] + (intervalms - 1), outgoing[z][1]]);\n }\n }\n // Invert export tariff\n for (var z in data[\"outgoing\"]) data[\"outgoing\"][z][1] *= -1;\n\n\n data[\"use\"] = [];\n data[\"import\"] = [];\n data[\"import_cost\"] = [];\n data[\"export\"] = [];\n data[\"export_cost\"] = [];\n data[\"solar_used\"] = []\n data[\"solar_used_cost\"] = [];\n\n var total_cost_import = 0\n var total_kwh_import = 0\n var total_cost_export = 0\n var total_kwh_export = 0\n var total_cost_solar_used = 0\n var total_kwh_solar_used = 0\n\n this_halfhour_index = -1;\n // Add last half hour\n var this_halfhour = Math.floor((new Date()).getTime() / 1800000) * 1800000\n for (var z = 1; z < import_kwh.length; z++) {\n if (import_kwh[z][0] == this_halfhour) {\n import_kwh[z + 1] = [this_halfhour + 1800000, feeds[\"import_kwh\"].value]\n this_halfhour_index = z\n if (solarpv_mode) {\n use_kwh[z + 1] = [this_halfhour + 1800000, feeds[\"use_kwh\"].value]\n solar_kwh[z + 1] = [this_halfhour + 1800000, feeds[\"solar_kwh\"].value]\n }\n break;\n }\n }\n\n if (import_kwh.length > 1) {\n for (var z = 1; z < import_kwh.length; z++) {\n let time = import_kwh[z - 1][0];\n\n if (solarpv_mode) {\n // ----------------------------------------------------\n // Solar PV agile outgoing\n // ----------------------------------------------------\n // calculate half hour kwh\n let kwh_use = 0;\n let kwh_import = 0;\n let kwh_solar = 0;\n\n if (use_kwh[z] != undefined && use_kwh[z - 1] != undefined) kwh_use = (use_kwh[z][1] - use_kwh[z - 1][1]);\n if (import_kwh[z] != undefined && import_kwh[z - 1] != undefined) kwh_import = (import_kwh[z][1] - import_kwh[z - 1][1]);\n if (solar_kwh[z] != undefined && solar_kwh[z - 1] != undefined) kwh_solar = (solar_kwh[z][1] - solar_kwh[z - 1][1]);\n\n // limits\n if (kwh_use < 0.0) kwh_use = 0.0;\n if (kwh_import < 0.0) kwh_import = 0.0;\n if (kwh_solar < 0.0) kwh_solar = 0.0;\n\n // calc export & self consumption\n let kwh_solar_used = kwh_use - kwh_import;\n let kwh_export = kwh_solar - kwh_solar_used;\n\n // half hourly datasets for graph\n data[\"use\"].push([time, kwh_use]);\n data[\"import\"].push([time, kwh_import]);\n data[\"export\"].push([time, kwh_export * -1]);\n data[\"solar_used\"].push([time, kwh_solar_used]);\n\n // energy totals\n total_kwh_import += kwh_import\n total_kwh_export += kwh_export\n total_kwh_solar_used += kwh_solar_used\n\n // costs\n let cost_import = data.agile[2 * (z - 1)][1] * 0.01;\n let cost_export = data.outgoing[2 * (z - 1)][1] * 0.01 * -1;\n\n // half hourly datasets for graph\n data[\"import_cost\"].push([time, kwh_import * cost_import]);\n data[\"export_cost\"].push([time, kwh_export * cost_export * -1]);\n data[\"solar_used_cost\"].push([time, kwh_solar_used * cost_import]);\n\n // cost totals\n total_cost_import += kwh_import * cost_import\n total_cost_export += kwh_export * cost_export\n total_cost_solar_used += kwh_solar_used * cost_import\n } else {\n // ----------------------------------------------------\n // Import mode only\n // ----------------------------------------------------\n let kwh_import = 0;\n if (import_kwh[z] != undefined && import_kwh[z - 1] != undefined) kwh_import = (import_kwh[z][1] - import_kwh[z - 1][1]);\n if (kwh_import < 0.0) kwh_import = 0.0;\n data[\"import\"].push([time, kwh_import]);\n total_kwh_import += kwh_import\n let cost_import = data.agile[2 * (z - 1)][1] * 0.01;\n data[\"import_cost\"].push([time, kwh_import * cost_import]);\n total_cost_import += kwh_import * cost_import\n }\n }\n }\n\n var unit_cost_import = (total_cost_import / total_kwh_import);\n\n var out = \"\";\n out += \"<tr>\";\n out += \"<td>Import</td>\";\n out += \"<td>\" + total_kwh_import.toFixed(1) + \" kWh</td>\";\n out += \"<td>£\" + total_cost_import.toFixed(2) + \"</td>\";\n out += \"<td>\" + (unit_cost_import * 100 * 1.05).toFixed(1) + \"p/kWh (inc VAT)</td>\";\n out += \"</tr>\";\n\n if (solarpv_mode) {\n var unit_cost_export = (total_cost_export / total_kwh_export);\n out += \"<tr>\";\n out += \"<td>Export</td>\";\n out += \"<td>\" + total_kwh_export.toFixed(1) + \" kWh</td>\";\n out += \"<td>£\" + total_cost_export.toFixed(2) + \"</td>\";\n out += \"<td>\" + (unit_cost_export * 100 * 1.05).toFixed(1) + \"p/kWh (inc VAT)</td>\";\n out += \"</tr>\";\n\n var unit_cost_solar_used = (total_cost_solar_used / total_kwh_solar_used);\n out += \"<tr>\";\n out += \"<td>Solar self consumption</td>\";\n out += \"<td>\" + total_kwh_solar_used.toFixed(1) + \" kWh</td>\";\n out += \"<td>£\" + total_cost_solar_used.toFixed(2) + \"</td>\";\n out += \"<td>\" + (unit_cost_solar_used * 100 * 1.05).toFixed(1) + \"p/kWh (inc VAT)</td>\";\n out += \"</tr>\";\n\n var unit_cost_solar_combined = ((total_cost_solar_used + total_cost_export) / (total_kwh_solar_used + total_kwh_export));\n out += \"<tr>\";\n out += \"<td>Solar + Export</td>\";\n out += \"<td>\" + (total_kwh_solar_used + total_kwh_export).toFixed(1) + \" kWh</td>\";\n out += \"<td>£\" + (total_cost_solar_used + total_cost_export).toFixed(2) + \"</td>\";\n out += \"<td>\" + (unit_cost_solar_combined * 100 * 1.05).toFixed(1) + \"p/kWh (inc VAT)</td>\";\n out += \"</tr>\";\n }\n\n $(\"#octopus_totals\").html(out);\n}", "function ChartsBarchart() {\n}", "create() {\n if (this.cellmonitor.view !== 'tasks') {\n throw new Error('SparkMonitor: Drawing tasks graph when view is not tasks');\n }\n this.clearRefresher();\n const container = this.cellmonitor.displayElement.find('.taskcontainer').empty()[0];\n const tasktrace = {\n x: this.taskChartDataX,\n y: this.taskChartDataY,\n fill: 'tozeroy',\n type: 'scatter',\n mode: 'none',\n fillcolor: '#00aedb',\n name: 'Active Tasks',\n };\n const executortrace = {\n x: this.executorDataX,\n y: this.executorDataY,\n fill: 'tozeroy',\n type: 'scatter',\n mode: 'none',\n fillcolor: '#F5C936',\n name: 'Executor Cores',\n };\n const jobtrace = {\n x: this.jobDataX,\n y: this.jobDataY,\n text: this.jobDataText,\n type: 'scatter',\n mode: 'markers',\n fillcolor: '#F5C936',\n // name: 'Jobs',\n showlegend: false,\n marker: {\n symbol: 23,\n color: '#4CB5AE',\n size: 1,\n },\n };\n const data = [executortrace, tasktrace, jobtrace];\n const layout = {\n // title: 'Active Tasks and Executors Cores',\n // showlegend: false,\n margin: {\n t: 30, // top margin\n l: 30, // left margin\n r: 30, // right margin\n b: 60, // bottom margin\n },\n xaxis: {\n type: 'date',\n // title: 'Time',\n },\n yaxis: {\n fixedrange: true,\n },\n dragmode: 'pan',\n shapes: this.shapes,\n legend: {\n orientation: 'h',\n x: 0,\n y: 5,\n // traceorder: 'normal',\n font: {\n family: 'sans-serif',\n size: 12,\n color: '#000',\n },\n // bgcolor: '#E2E2E2',\n // bordercolor: '#FFFFFF',\n // borderwidth: 2\n },\n };\n this.taskChartDataBufferX = [];\n this.taskChartDataBufferY = [];\n this.executorDataBufferX = [];\n this.executorDataBufferY = [];\n this.jobDataBufferX = [];\n this.jobDataBufferY = [];\n this.jobDataBufferText = [];\n const options = { displaylogo: false, scrollZoom: true };\n Plotly.newPlot(container, data, layout, options);\n this.taskChart = container;\n if (!this.cellmonitor.allcompleted) this.registerRefresher();\n }", "function appendAxes() {\n graphImg\n .append(\"g\")\n .call(xAxis)\n .attr(\"class\", \"xAxis\")\n .attr(\n \"transform\",\n \"translate(0,\" + (displayHeight - margin - labelArea) + \")\"\n );\n graphImg\n .append(\"g\")\n .call(yAxis)\n .attr(\"class\", \"yAxis\")\n .attr(\"transform\", \"translate(\" + (margin + labelArea) + \", 0)\");\n }", "function createGraph(allPipe, allLead, allOpp, allSale, allCurrentPipe, allLost) {\n $('#pipelineName').show();\n $('#conversionName').show();\n $('#pipeLead').width((allLead / allCurrentPipe) * 800);\n $('#pipeOpportunity').width((allOpp / allCurrentPipe) * 800);\n $('#pipeSale').width((allSale / allCurrentPipe) * 800);\n $('#leadText').width((allLead / allCurrentPipe) * 800);\n $('#blankopp').width((allOpp / allCurrentPipe) * 800);\n $('#blankLead').width((allLead / allCurrentPipe) * 800);\n $('#oppText').width((allOpp / allCurrentPipe) * 800);\n $('#saleText').width((allSale / allCurrentPipe) * 800);\n // Calculate the widths for conversion rate\n var total = allLost + allSale;\n $('#wonOpp').width((allSale / total) * 660);\n $('#lostOpp').width((allLost / total) * 660);\n}", "function createGraphs(dayPredData, date){\n var dataGraphNames = ['Temperatura (°C)', 'Humedad Relativa (%)', 'Prob Precipitación (%)', 'Viento (km/h)'];\n var tempValues = getTempArrayDataForGraph(dayPredData.temperatura);\n var humRelValues = getHumRelArrayDataForGraph(dayPredData.humedadRelativa);\n var [graphLabels, probPrecValues] = getProbPrecArrayDataForGraph(dayPredData.probPrecipitacion);\n var [vientoDirs, vientoValues] = getVientoArrayDataForGraph(dayPredData.viento);\n var canvas = document.getElementById(\"tempPredGraph\").getContext('2d');\n var tempPredGraph = new Chart(canvas, {\n type: 'line',\n data: {\n labels: graphLabels,\n datasets: [{\n label: dataGraphNames[0],\n fill: false,\n data: tempValues,\n borderColor: '#FF7E0C',\n pointBorderWidth: 3,\n pointRadius: 5,\n borderWidth: 1\n },\n {\n label: dataGraphNames[1],\n fill: false,\n data: humRelValues,\n borderColor: '#79A2FB',\n pointBorderWidth: 3,\n pointRadius: 5,\n borderWidth: 1\n },\n {\n label: dataGraphNames[2],\n fill: false,\n data: probPrecValues,\n borderColor: '#25ACFF',\n pointBorderWidth: 3,\n pointRadius: 5,\n borderWidth: 1\n },\n {\n label: dataGraphNames[3],\n fill: false,\n data: vientoValues,\n borderColor: '#4BC69B',\n pointBorderWidth: 3,\n pointRadius: 5,\n borderWidth: 1\n }],\n\n },\n options: {\n responsive: true,\n maintainAspectRatio: false,\n scales: {\n xAxes: [{\n scaleLabel: {\n display: true,\n labelString: 'Horas',\n fontSize: 15\n },\n ticks: {\n beginAtZero: true\n }\n }],\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n },\n title: {\n display: true,\n text: date,\n fontSize: 25\n },\n tooltips: {\n callbacks: {\n label: function(tooltipItem, data) {\n var label = data.datasets[tooltipItem.datasetIndex].label + \": \" + tooltipItem.value;\n if(data.datasets[tooltipItem.datasetIndex].label == dataGraphNames[3]){\n label = data.datasets[tooltipItem.datasetIndex].label + \" → Dirección: \" + vientoDirs[tooltipItem.datasetIndex] + \". Velocidad: \" + tooltipItem.value + \" km/h\";\n }\n return label;\n }\n }\n }\n }\n });\n }", "function showGraph(inputStockName){\n\t\t\t//since there is no more yql historical data just show that in writing\n\t\t\tdocument.getElementById(\"chartText\").innerHTML =\"Last year's performance is unavailable, yahoo no longer supports historical stock data :(\";\n\t\t\treturn;\n\n\tdocument.getElementById(\"chartdiv\").style.backgroundColor = \"white\";\n\tdocument.getElementById(\"chartdiv\").style.boxShadow =\"0px 3px 3px 3px #888888\";\n\tvar chart = AmCharts.makeChart(\"chartdiv\", {\n\t\t\"fontFamily\":\"Kefa\",\n\t\t\"fontSize\": 14,\n \"type\": \"serial\",\n \"theme\": \"patterns\",\n \"marginRight\": 40,\n \"marginLeft\": 40,\n \"autoMarginOffset\": 20,\n \"dataDateFormat\": \"YYYY-MM-DD\",\n \"valueAxes\": [{\n \"id\": \"v1\",\n \"axisAlpha\": 0,\n \"position\": \"left\",\n \"ignoreAxisWidth\":true\n }],\n \"balloon\": {\n \"borderThickness\": 1,\n \"shadowAlpha\": 0\n },\n \"graphs\": [{\n \"id\": \"g1\",\n \"balloon\":{\n \"drop\":true,\n \"adjustBorderColor\":false,\n \"color\":\"#ffffff\",\n \"type\":\"smoothedLine\"\n },\n \"fillAlphas\":0.2,\n \"bullet\": \"round\",\n \"bulletBorderAlpha\": 1,\n \"bulletColor\": \"#FFFFFF\",\n \"bulletSize\": 5,\n \"hideBulletsCount\": 50,\n \"lineThickness\": 2,\n \"title\": \"red line\",\n \"useLineColorForBulletBorder\": true,\n \"valueField\": \"value\",\n \"balloonText\": \"<span style='font-size:12px;'>[[value]]</span>\"\n }],\n\n \"chartCursor\": {\n \"valueLineEnabled\": false,\n \"valueLineBalloonEnabled\": false,\n \"cursorAlpha\":0,\n \"zoomable\":false,\n \"valueZoomable\":false,\n \"valueLineAlpha\":0\n },\n \"valueScrollbar\":{\n \"autoGridCount\":true,\n \"color\":\"#000000\",\n \"scrollbarHeight\":50\n },\n \"categoryField\": \"date\",\n \"categoryAxis\": {\n \"parseDates\": true,\n \"dashLength\": 1,\n \"minorGridEnabled\": true\n },\n\n \"dataProvider\": chartData[inputStockName],\n \"titles\": [\n\t\t{\n\t\t\t\"text\": inputStockName + \" Chart\",\n\t\t\t\"size\": 20\n\t\t}\n\t]\n});\nchart.invalidateSize();\n\t }", "function ChartPlus(source_url, div_target, chart_type) {\n\n this.url = source_url\n this.div_target = div_target\n this.chart_type = chart_type\n var self = this\n\n this.drawChart = function() {\n var jsonData = $.ajax({\n url: self.url,\n dataType: \"json\",\n async: false\n }).responseText;\n\n // Create our data table out of JSON data loaded from server.\n var data = new google.visualization.DataTable(jsonData);\n var json = jQuery.parseJSON(jsonData)\n\n var clonedDiv = $('#chart_box_template').clone();\n clonedDiv.attr(\"id\", self.div_target);\n //clonedDiv.show();\n $('#charts').append(clonedDiv);\n\n if (json.header.title != undefined)\n clonedDiv.find(\".chart-title\").html(json.header.title );\n\n if (json.header.subtotal != undefined)\n clonedDiv.find(\".chart-subtotal\").html(json.header.subtotal );\n\n // Instantiate and draw our chart, passing in some options.\n if (self.chart_type == \"line\") {\n var chart = new google.visualization.LineChart(clonedDiv.find(\".panel-body\")[0]);\n }\n else if (self.chart_type == \"pie\") {\n var chart = new google.visualization.PieChart(clonedDiv.find(\".panel-body\")[0]);\n }\n else if (self.chart_type == \"bar\") {\n var chart = new google.visualization.BarChart(clonedDiv.find(\".panel-body\")[0]);\n }\n chart.draw(data, {width: 500, height: 400});\n }\n\n google.charts.setOnLoadCallback(this.drawChart);\n}", "function visualData() {\n $(\"#chart\").remove();\n $(\".containerChart\").append('<canvas id=\"chart\">');\n var canvas = document.getElementById(\"chart\");\n var ctx = canvas.getContext(\"2d\");\n\n Chart.defaults.global.defaultFontColor = \"black\";\n var myChart = new Chart(ctx, {\n type: \"line\",\n data: {\n labels: weeklyDate, //what is listed as the x axis value\n datasets: [\n {\n label: currentCompany,\n data: weeklyValue,\n backgroundColor: \"rgba(0, 0, 0, 1)\",\n borderColor: \"rgba(0, 0, 0, 1)\",\n borderWidth: 3,\n fill: false,\n },\n ],\n },\n options: {\n scales: {\n yAxes: [\n {\n ticks: {\n // beginAtZero: true\n callback: function (value, index, values) {\n return \"$\" + value;\n },\n },\n },\n ],\n },\n },\n });\n }", "function drawSubscriberGraph(fragmentId, query, aggregateRes) {\r\n var aggregate = aggregateRes.aggregate;\r\n var maxUsage = aggregateRes.maxUsage;\r\n\r\n var colors = $.map(query.usageTypes, function (tp) { return tp.color; });\r\n var usedUsageTypes = [];\r\n var currentMaxUsage = 0;\r\n\r\n var elem = $(fragmentId + \" .chart\").get(0);\r\n $(fragmentId + \" .chart\").empty();\r\n\r\n var entireGraphWidth = Math.floor($(fragmentId).innerWidth() - 20);\r\n\r\n var width = $(fragmentId).innerWidth() * mainGraphWidth;\r\n width = Math.floor(width);\r\n\r\n var entireGraphHeight = Math.floor(($(\"#top\").height() - $(\".ui-tabs-nav\").outerHeight()));\r\n var height = ($(\"#top\").height() - $(\".ui-tabs-nav\").outerHeight()) * mainGraphHeight;\r\n height = Math.floor(height);\r\n\r\n var r = new Raphael(elem, entireGraphWidth, entireGraphHeight);\r\n\r\n function hoverIn() {\r\n var text = \"\", txtDx = 35, txtDy = 35;\r\n var Complementarycolor = \"dddddd\";\r\n for (var tp in this.aggr) {\r\n text += tp + \": \" + this.aggr[tp] + \"\\n\";\r\n }\r\n if (width < (this.x + 100)) {\r\n txtDx = -cellWidth;\r\n }\r\n if (height < (this.y + 50)) {\r\n txtDy = -cellHeight + 10;\r\n }\r\n this.text = r.text(this.x + txtDx, this.y + txtDy, text).attr(defaultFont);\r\n var bbox = this.text.getBBox();\r\n Complementarycolor = findComplementaryColor(clr.color);\r\n this.rect = r.rect(bbox.x - 5, bbox.y - 5, bbox.width + 10, bbox.height + 10).attr(\"fill\", \"#\" + clr.color);\r\n this.text.attr(\"fill\", \"#\" + Complementarycolor).toFront();\r\n }\r\n function hoverOut() {\r\n this.rect.remove();\r\n this.text.remove();\r\n }\r\n\r\n var x = (width - leftGutter) / axisX.length,\r\n y = (height - bottomgutter) / axisY.length;\r\n\r\n //draw y axis\r\n for (var i = 0; i < axisY.length; i++) {\r\n r.text(25, (y * (i + 0.5)) + 5, axisY[i]).attr(defaultFont);\r\n }\r\n //draw x axis\r\n for (i = 0; i < axisX.length; i++) {\r\n if (i == 10 || i == 11 || (i >= 13 && i <= 21)) {\r\n r.text(leftGutter + x * i + 15, height - 5, axisX[i]).attr(defaultFont);\r\n } else if ((i >= 1) && (i <= 9)) {\r\n r.text(leftGutter + x * i + 20, height - 5, axisX[i]).attr(defaultFont);\r\n }\r\n else {\r\n r.text(leftGutter + x * i + 10, height - 5, axisX[i]).attr(defaultFont);\r\n }\r\n }\r\n\r\n var cellHeight = Math.floor((height - bottomgutter) / 7);\r\n var cellWidth = Math.floor((width - leftGutter) / 24);\r\n var maxRadius = Math.min(cellHeight, cellWidth) / 2;\r\n var correctionFactor = 0;\r\n //draw circles\r\n //TODO change hover function\r\n for (var day = 0; day < 7; day++) {\r\n for (var hour = 0; hour < 24; hour++) {\r\n var circles = aggregate[day][hour];\r\n var pom = 0;\r\n var toDraw = [];\r\n for (var usgType in circles) {\r\n var val = maxRadius * circles[usgType] / maxUsage;\r\n var clr = $.grep(query.usageTypes, function (ut) { return ut.usageType == usgType; })[0];\r\n if (clr === undefined) {\r\n clr = { color: colors[pom] };\r\n }\r\n pom++;\r\n toDraw.push({\r\n usgType: usgType,\r\n color: clr.color,\r\n radius: val\r\n });\r\n }\r\n\r\n toDraw.sort(function (a, b) {\r\n return b.radius - a.radius;\r\n });\r\n if(hour>=7 && hour<=12){\r\n correctionFactor += hour * 0.1;\r\n }\r\n else if(hour>12 && hour<22){\r\n correctionFactor += hour * 0.02;\r\n }\r\n\r\n for (i = 0; i < toDraw.length; i++) {\r\n var tooltipSettings = {\r\n aggr: aggregate[day][hour],\r\n x: leftGutter + 25 + hour * cellWidth,\r\n y: cellHeight / 2 + day * cellHeight\r\n };\r\n r.circle(\r\n leftGutter + 25 + hour * cellWidth + correctionFactor,\r\n cellHeight / 2 + day * cellHeight + 5,\r\n toDraw[i].radius\r\n ).attr(\r\n \"fill\", \"#\" + toDraw[i].color\r\n ).hover(\r\n hoverIn,\r\n hoverOut,\r\n tooltipSettings,\r\n tooltipSettings\r\n );\r\n }\r\n }\r\n correctionFactor = 0;\r\n }\r\n\r\n drawSumOfDataThroughDaySubscriberGraph(r, fragmentId, query, aggregateRes, width);\r\n drawSumOfDataThroughHoursSubscriberGraph(r, fragmentId, query, aggregateRes, height + 5);\r\n drawLegend(r, query, width, height);\r\n}", "@action.bound refreshChart() {\n this.newChart();\n }", "function newDashboard() {\r\n\t\t\treturn $izendaRsQuery.query('newcrs', ['DashboardDesigner'], {\r\n\t\t\t\tdataType: 'json'\r\n\t\t\t},\r\n\t\t\t// custom error handler:\r\n\t\t\t{\r\n\t\t\t\thandler: function () {\r\n\t\t\t\t\treturn 'Failed to create new dashboard';\r\n\t\t\t\t},\r\n\t\t\t\tparams: []\r\n\t\t\t});\r\n\t\t}" ]
[ "0.6496089", "0.6370459", "0.6365461", "0.6352829", "0.6338957", "0.63205457", "0.6247306", "0.6183056", "0.6176735", "0.6126419", "0.606333", "0.604698", "0.6016476", "0.59790146", "0.59727335", "0.5968875", "0.59336907", "0.59187734", "0.58724236", "0.58718795", "0.5847641", "0.57842326", "0.5766701", "0.5766701", "0.57550865", "0.57549596", "0.57475746", "0.5739126", "0.5726901", "0.570666", "0.57059467", "0.56942666", "0.56713843", "0.5662977", "0.5655946", "0.5653316", "0.56291944", "0.56291944", "0.5627671", "0.5626154", "0.56240994", "0.5617541", "0.56165636", "0.561622", "0.56116277", "0.5596969", "0.55945", "0.55812293", "0.55705166", "0.5568434", "0.55600697", "0.5557367", "0.55556256", "0.5552228", "0.55469877", "0.5542343", "0.5541925", "0.5537612", "0.5532039", "0.5526724", "0.55265856", "0.5523314", "0.5521636", "0.5501271", "0.5496478", "0.5493855", "0.549272", "0.54894257", "0.54864365", "0.5472141", "0.54675454", "0.54670227", "0.5465991", "0.5464376", "0.54628927", "0.54625034", "0.54604137", "0.5459914", "0.54507613", "0.54491854", "0.5447021", "0.54448307", "0.5441489", "0.54400444", "0.543726", "0.54371643", "0.54368925", "0.54282904", "0.54280573", "0.5422942", "0.5420092", "0.54152524", "0.541234", "0.54032034", "0.54026943", "0.54021096", "0.53951776", "0.53842", "0.5379788", "0.5379034" ]
0.63741547
1
This function is used to remove a graph from a dashboard
static async removeGraph(email, dashboardID, graphID) { let query = 'DELETE FROM Graph as g WHERE (g.dashboardid in ( SELECT d.id from dashboard as d WHERE (d.email = $1) AND (d.id = $2))) AND (g.ID = $3);'; return new Promise((resolve, reject) => { Database.sendQuery(query, [email, dashboardID, graphID]) .then((result) => resolve(result.rows)) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dashboard_clear() {\n d3.select(\"#dashboard\").selectAll(\"svg\").remove();\n}", "function removeChart() {\n chart.destroy();\n }", "function removePlots() {\n d3.selectAll(\".nodes\").remove();\n d3.selectAll(\".link\").remove();\n d3.selectAll(\".axis-label\").remove();\n }", "function removeData(graph) {\n //Clears all datasets\n graph.data.datasets = [];\n\n //Updates the chart to display to changes\n graph.update();\n}", "function removeGraph() {\n filtro = \"\";\n $(\"svg\").remove();\n}", "function removePlots() {\n d3.selectAll(\".nodes\").remove();\n d3.selectAll(\".link\").remove();\n}", "function graphRemove() {\r\n svg.selectAll(\"*\").remove();\r\n d3nodes = [];\r\n d3links = [];\r\n}", "function removePlot(sensor){\n d3.selectAll(\".dots-\" + sensor).remove();\n d3.select(\"#route-\" + sensor).remove();\n d3.selectAll(\"#carIcon-\" + sensor).remove();\n\n }", "removeGraphData() {\n this.PieGraph.data.labels = [];\n this.PieGraph.data.datasets.forEach((dataset) => {\n dataset.data = [];\n });\n this.PieGraph.update();\n }", "function clearGraph() {\n graph.paper.clear();\n\n graph.$el.find('ul').remove();\n graph.$el.find('.elroi-point-flag').remove();\n graph.$el.find('.elroi-point-label').remove();\n }", "function remove() {\n\t\tif (graphContainer) {\n\t\t\t// Select the parent element because the graph container is a group (e.g. for zooming)\n\t\t\td3.select(graphContainer.node().parentNode).remove();\n\t\t}\n\t}", "function remove() {\n\t\tif (graphContainer) {\n\t\t\t// Select the parent element because the graph container is a group (e.g. for zooming)\n\t\t\td3.select(graphContainer.node().parentNode).remove();\n\t\t}\n\t}", "function removeOldChart() {\n var oldChart = document.getElementById('DB')\n if (oldChart != undefined) {\n var parent = oldChart.parentNode\n parent.removeChild(oldChart)\n }\n\n}", "function updatePlots(){\n// delete plot that is in div stats\n Plotly.deleteTraces('stats',0)\n}", "function cleargraphs(){\n d3.selectAll(\".graph\").selectAll(\"*\").remove();\n // $(\"#graphparam1\").text(\"\");\n $(\"#graphparam2\").text(\"\");\n}", "function ClearChart() {\n d3.select('svg').remove();\n}", "function removeTab(evt){ //accept either the span event object or the panel\n var $span = $(evt.target);\n var panelRef = $span.parent().children(\"a\").attr(\"href\");\n var panelId = panelRef.substr(1);\n destroyChartMap(panelId);\n $(panelRef).remove();\n $span.parent().remove();\n delete panelGraphs[panelId];\n $graphTabs.tabs('refresh'); //tell JQUI to sync up\n if($graphTabs.find(\"li\").length == 0){\n editingPanelId = null; //dissociate the chart from the this edit session\n $(\"#btnEditGraphTop\").attr(\"disabled\",\"disabled\");\n $(\"button.add-to-graph\").attr(\"disabled\",\"disabled\");\n lastTabAnchorClicked.click();\n } else {\n $('#graph-tabs a:last').click();\n }\n $(\"#graph_title\").attr('value','');\n}", "reset_graphs() {\n d3.selectAll(\".sourcegraph-container\").remove()\n }", "function clearGraph() {\n if (interval) {\n clearInterval(interval)\n interval = null\n }\n if (chart) {\n chart.destroy()\n chart = null\n }\n}", "function destroyGraph(fieldX, fieldY) {\n //Delete the elements\n $(\"div.graph-expand[name='\" + fieldX + \"-\" + fieldY + \"']\").remove();\n $(\"div.graph[name='\" + fieldX + \"-\" + fieldY + \"']\").remove();\n}", "function clearGraph(svg) {\n\t\t//console.log(\"clearing the barchart...\");\n\t while (svg.lastChild) {\n\t svg.removeChild(svg.lastChild);\n\t }\n\t}", "function DeleteCharts() {\n var chartDiv = document.getElementById('chart-div');\n chartDiv.innerHTML = '';\n}", "function deleteGraph(idNum){//remove() the div with same counter number\n $(\"#graph\"+idNum).remove();\n $(\"#banner\"+idNum).remove();\n\n //find and delete the id num of the graph deleted from opengraphsNum\n for(var i=0;i<opengraphsNum.length;i++){\n if(idNum == opengraphsNum[i]) opengraphsNum.splice(i,1);\n }\n\n //display the graph at the bottom if none of the graphs are opened\n if(idNum == opengraphsNum[opengraphsNum.length - 1]) {\n console.log(\"opengraphs = \" + opengraphs);\n var num = opengraphsNum[opengraphsNum.length - 1];\n $(\"#graph\" + num).css(\"display\", \"block\");\n $(\"#banner\" + num).css(\"backgroundColor\", \"orange\");\n opengraphs = 1;\n console.log(\"idNum = \" + idNum);\n console.log(\"openGraphsNum = \" + num);\n }\n opengraphs = 0;\n\n}", "remove () {\r\n\t\tvar svg = d3.select(this.element);\r\n\t\tsvg.selectAll('*').remove();\r\n\t}", "function clearIt() {\n\tPlotly.newPlot(visDiv, [{\n\t\ty: [],\n\t\ttype: 'scattergl',\n\t\tmode: 'lines',\n\t\tline: { color: '#00f' },\n\t\tname: 'Vis'\n\t}], { title: 'Visual Light' });\n\tPlotly.newPlot(irDiv, [{\n\t\ty: [],\n\t\ttype: 'scattergl',\n\t\tmode: 'lines',\n\t\tline: { color: '#f00' },\n\t\tname: 'IR'\n\t}], { title: 'Infra red Light' });\n\n\tPlotly.newPlot(ps1Div, [{\n\t\ty: [],\n\t\ttype: 'scattergl',\n\t\tmode: 'lines',\n\t\tline: { color: '#f00' },\n\t\tname: 'PS1'\n\t}], { title: 'Proximity 1' });\n\tPlotly.newPlot(ps2Div, [{\n\t\ty: [],\n\t\ttype: 'scattergl',\n\t\tmode: 'lines',\n\t\tline: { color: '#0f0' },\n\t\tname: 'PS2'\n\t}], { title: 'Proximity 2' });\n\tPlotly.newPlot(ps3Div, [{\n\t\ty: [],\n\t\ttype: 'scattergl',\n\t\tmode: 'lines',\n\t\tline: { color: '#00f' },\n\t\tname: 'PS3'\n\t}], { title: 'Proximity 3' });\n}", "function removeData(chart, timeline) {\n chart.data.datasets[0].data = data_traffic_chart[timeline];\n chart.update();\n}", "function removePointInfo()\r\n{\r\n chartGroup.removeChild(currentNodeInfo);\r\n currentNodeInfo = null;\r\n}", "function removeData(chart) {\n let dataLength = chart.data.datasets[0].data.length;\n for(let i = 0; i < dataLength; i++){\n chart.data.datasets[0].data.pop();\n chart.data.labels.pop();\n }\n chart.update();\n}", "removeDayOverview () {\n this.items\n .selectAll ('.item-block')\n .transition ()\n .duration (this.settings.transition_duration)\n .ease (d3.easeLinear)\n .style ('opacity', 0)\n .attr ('x', (d, i) => {\n return i % 2 === 0 ? -this.settings.width / 3 : this.settings.width / 3;\n })\n .remove ();\n this.labels.selectAll ('.label-time').remove ();\n this.labels.selectAll ('.label-project').remove ();\n this.hideBackButton ();\n }", "function removeSVGElements() {\n pieChart.selectAll(\"circle\").remove();\n pieChart.selectAll(\"path\").remove();\n}", "function cleaner() {\n svg.selectAll(\"path\").data([]).exit().remove();\n svg.selectAll(\"g\").data([]).exit().remove();\n document.getElementById('controls').innerHTML = '';\n document.getElementById('stats').innerHTML = '';\n}", "function removeSvg() {\r\n $('table.newschart > tbody > tr > td.nval').removeClass(\"hideborder\");\r\n setPaths = false;\r\n $('svg').remove();\r\n}", "function clearDashboard() {\n \n while (dashboard.firstChild) {\n dashboard.removeChild(dashboard.firstChild);\n }\n}", "function clearArticles() {\r\n d3.select(\"body\").select(\"#articles-panel\").select(\"div\").remove();\r\n}", "function resetSpace(){\n\tvar bc = document.getElementById('barchartcanvas');\n\tvar lc = document.getElementById('linechartcanvas');\n\tvar dc = document.getElementById('doughnutchartcanvas');\n\tvar pc = document.getElementById('piechartcanvas');\n\tif(bc != undefined){\n\t\tbc.remove();\n\t}\n\tif(lc != undefined){\n\t\tlc.remove();\n\t}\n\tif(dc != undefined){\n\t\tdc.remove();\n\t}\n\tif(pc != undefined){\n\t\tpc.remove();\n\t}\n}", "function closeGraphEq() {\n document.getElementById(\"graphInfo\").style.display = \"none\";\n}", "clearDensityPlot () {\n // Clear density plot\n const canvas = this.axisElements['plot-density'].node()\n const context = canvas.getContext('2d')\n context.clearRect(0, 0, canvas.width, canvas.height)\n }", "function clearVis() {\n $('.content-container').remove();\n}", "function resetGraph() {\n\t\t\t\t\toverlay.animate({width: '747px'}, 0);\n\t\t\t\t\t$('.trends').remove();\n\t\t\t\t}", "removeMonthOverview () {\n this.items\n .selectAll ('.item-block-month')\n .selectAll ('.item-block-rect')\n .transition ()\n .duration (this.settings.transition_duration)\n .ease (d3.easeLinear)\n .style ('opacity', 0)\n .attr ('x', (d, i) => {\n return i % 2 === 0 ? -this.settings.width / 3 : this.settings.width / 3;\n })\n .remove ();\n this.labels.selectAll ('.label-day').remove ();\n this.labels.selectAll ('.label-week').remove ();\n this.hideBackButton ();\n }", "function clear() {\n if (!scene)\n return;\n\n if (chartGrid) {\n scene.remove(chartGrid);\n chartGrid = undefined;\n }\n if (chartAxis) {\n scene.remove(chartAxis);\n chartAxis = undefined;\n }\n if (chartAxisLabels)\n chartAxisLabels.children.length = 0;\n if (chartMesh) {\n scene.remove(chartMesh);\n chartMesh = undefined;\n }\n }", "clearGraph() {\n this.functionArray = [];\n\n this.ctx.fillStyle = \"black\";\n this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);\n this.ctx.fillStyle = \"white\";\n this.setAxis();\n\n document.getElementById(\"inputX\").value = \"\";\n document.getElementById(\"details\").innerHTML = \"\";\n let base_address = window.location.href.toString();\n let end_uri = base_address.indexOf(\"?\");\n if (end_uri > -1) base_address = base_address.slice(0, end_uri);\n window.history.replaceState(null, null, base_address);\n }", "function removeData(chart) {\n chart.data.labels.shift();\n chart.data.datasets.forEach(function (dataset) {\n dataset.data.shift();\n });\n chart.update();\n }", "function clearSearchesVisualization(){\n g.selectAll('*').remove();\n }", "_destroyChart () {\n if (this.chart) {\n // TODO: remove events once they're implemented\n // if (this.chart.off) {\n // this.chart.off();\n // }\n delete this.chart;\n }\n }", "function removerDatos(chart) {\n chart.data.datasets.forEach((dataset) => {\n dataset.label = 'Numero de ventas';\n });\n chart.data.datasets.forEach((dataset) => {\n dataset.data = [0, 0, 0, 0];\n });\n chart.update();\n}", "function onRemove(){\n \n var data_points = chart.options.data[0].dataPoints;\n var isRemoved = false;\n for(var i = 0; i < data_points.length; i++){\n var assets = data_points[i].assets;\n if( data_points[i].exploded ){\n for( var j = 0; j < assets.length; j++){\n if( assets[j].exploded ){\n // remove the asset\n data_points[i].y -= assets[j].y;\n assets.splice(j, 1);\n isRemoved = true;\n // break the loop\n break;\n }\n }\n\n // we should check whether or not an asset is removed, if not, we should delete the all type\n // we also should check whether data_points[i].length > 0, if not, we should delete that type as well\n if( !isRemoved || assets.length == 0){\n data_points.splice(i, 1);\n // update the subchart\n sub_chart.options.title.text = \"\";\n sub_chart.options.data[0].dataPoints = [];\n\n isRemoved = true;\n }\n\n // break the loop\n break;\n }\n }\n\n // if no element is removed\n if( !isRemoved){\n alert( \"You need to choose an asset in order to delete it!\");\n }\n\n // render\n chart.render();\n sub_chart.render();\n}", "function cleardisplay(){\n $('.textbox-row').closest('.row-fluid').remove();\n $(\".firstDiv\").remove();\n $('.side-labels').empty();\n $(\".start-row\").empty();\n $(\".chart-container\").remove();\n $(\".continue-row\").remove();\n chart = [];\n }", "function empty_graph(){\n\tglobal_graph = new bbop.model.graph();\n\tfocus_nodes = {};\n\tjQuery(demo_output_elt).empty();\n }", "deleteOverlay() {\n d3.selectAll(\".overlay\").remove();\n }", "function removeIfNoAction(ex) {\n var linkId = ex.currentTarget.id;\n setTimeout(function(){\n var id = '';\n if(linkId === chartMap.classMetricsLine.linkId) {\n id = chartMap.classMetricsLine.container;\n } else if(linkId === chartMap.classMetricsBar.linkId ) {\n id = chartMap.classMetricsBar.container;\n } else if(linkId === chartMap.memberDoughnut.linkId ) {\n id = chartMap.memberDoughnut.container;\n } else if(linkId === chartMap.memberSummaryNumbers.linkId /*'addMemberSummary'*/) {\n id = chartMap.memberSummaryNumbers.container; // 'tileContainerMemberSummary';\n } else if(linkId === chartMap.membershipPie.linkId /*'addMembershipsPie'*/){\n id = chartMap.membershipPie.container; //'tileContainerMembershipPie';\n } else if(linkId === chartMap.sineWaveLine.linkId){\n id = chartMap.sineWaveLine.container;\n } else if(linkId === chartMap.fake1.linkId){\n id = chartMap.fake1.container;\n } else if(linkId === chartMap.fake2.linkId){\n id = chartMap.fake2.container;\n } else if(linkId === chartMap.fake3.linkId){\n id = chartMap.fake3.container;\n } else if(linkId === chartMap.fake4.linkId){\n id = chartMap.fake4.container;\n }\n var item = $('#' + id);\n if(item && item[0] && item[0].tile && item[0].tile.isTemp){\n //console.log('removeIfNoAction() - removing: ' + id);\n // kill draggable\n try{\n Draggable.get('#' + id).kill();\n }catch(e){}\n item.remove();\n var removeIdx = loadedCharts.indexOf(id);\n if(removeIdx != -1) {\n loadedCharts.splice(removeIdx, 1);\n }\n //toggleOptionButton(id, true);\n layoutInvalidated();\n }\n\n }, 2000);\n}", "delete() {\n this.removeAllConnections()\n \n let parent = this.getParent()\n let diagram = this.getDiagram()\n \n if (parent) {\n parent.removeChild(this)\n } else {\n diagram.removePane(this)\n }\n \n this.redrawAllConnectionsInDiagram()\n }", "destroy() {\n d3.select(this.el).selectAll('svg').remove();\n }", "remove(){\n this.removeViews(Object.keys(this.views));\n this.el.innerHTML = null;\n this.layouts[this.layout].isRendered = false;\n this.layout = null;\n }", "function resetGraph(){\n document.getElementById(\"exitText\").addEventListener('click', function(event){\n d3.selectAll(\".graph > *\").remove();\n map.getView().setZoom(2.4);\n\n });\n}", "function empty_graph(){\n\tgraph = new model.graph();\n\tfocus_nodes = {};\n\tjQuery('#grcon').empty();\n\tjQuery('#color_exp').empty();\n }", "disposeChart() {\n if (this.chart) {\n this.chart.dispose();\n this.chart = null;\n logger.debug(`ParticipantScore: disposed of chart - ${this.props.graphType}`);\n }\n }", "function clear() {\r\n d3.select(\"#timelapse-chart\").remove();\r\n d3.select(\"#pause-button\").node().innerHTML = \"Pausar\";\r\n d3.select(\"#filters-div-container\").attr(\"class\", \"hidden\");\r\n}", "function removeAllDrawers() {\n if ($.size_chart_drawer) {\n $.appIndex.remove($.size_chart_drawer);\n }\n}", "removeGlobalOverview () {\n this.items\n .selectAll ('.item-block-year')\n .transition ()\n .duration (this.settings.transition_duration)\n .ease (d3.easeLinear)\n .style ('opacity', 0)\n .remove ();\n this.labels.selectAll ('.label-year').remove ();\n }", "removeWeekOverview () {\n this.items\n .selectAll ('.item-block-week')\n .selectAll ('.item-block-rect')\n .transition ()\n .duration (this.settings.transition_duration)\n .ease (d3.easeLinear)\n .style ('opacity', 0)\n .attr ('x', (d, i) => {\n return i % 2 === 0 ? -this.settings.width / 3 : this.settings.width / 3;\n })\n .remove ();\n this.labels.selectAll ('.label-day').remove ();\n this.labels.selectAll ('.label-week').remove ();\n this.hideBackButton ();\n }", "function destroy(){\n\t\tif(!_.isUndefined(svg) && _.isFunction(svg.style))\n\t\tsvg\n\t .style('background-color', 'none');\n\t}", "function clearDataDisplay() {\n body.removeChild(data_display);\n}", "function removeHSVG() {\n d3.select(\"#heatmap\").remove();\n\n} // end removeSVG", "function removeOpenArrowBox(){\n const openChart=document.querySelector(\".arrow_box\");\n if(openChart)\n document.body.removeChild(openChart);\n }", "clear() {\n const svg = select(this.base);\n svg.selectAll(\"g\").remove();\n }", "function clearPieCharts() {\n\t$(\"#pies\").children().remove();\n\t$(\"#text text:last\").remove();\n}", "removeFigure(){\n\n this[figure] = null;\n }", "update () {\r\n\t\tvar svg = d3.select(this.element);\r\n\t\tsvg.selectAll('*').remove();\r\n\t\tthis.drawChart();\r\n\t}", "clearDosePlot () {\n // Clear dose plot\n this.axisElements['plot-dose'].selectAll('g.dose-contour').remove()\n }", "function graphClear(){\r\n for( var j = 0 ; j < 6 ; j++){\r\n for( var i = 0 ; i < 600 ; i++ ) graphData[j].sample[i] = 2048;\r\n }\r\n graphCount = 0;\r\n graphInverter.onPaint(graphData);\r\n}", "remove_stdev_series(chart) {\n if (\n chart.stdev_up_series != undefined &&\n chart.stdev_down_series != undefined\n )\n chart.ref.removeSeries(chart.stdev_up_series);\n chart.ref.removeSeries(chart.stdev_down_series);\n chart.stdev_up_series = undefined;\n chart.stdev_down_series = undefined;\n }", "function clearChart() {\r\n d3.selectAll(\r\n \".alert.alert-danger.alert-dismissible.lineChart.clearChart\"\r\n ).classed(\"aleph-hide\", false);\r\n\r\n d3.selectAll(\".aleph-alert-line-clearChart\").html(\r\n \"Are you sure you want to <span class='spanBold'>clear</span> the chart? This action cannot be undone.\"\r\n );\r\n\r\n return;\r\n}", "deleteGraph(graph) {\n return this.removeMatches(null, null, null, graph);\n }", "deleteGraph(graph) {\n return this.removeMatches(null, null, null, graph);\n }", "function clearChart() {\n localStorage.removeItem('results');\n $('#highscore-chart').innerHTML = '';\n}", "function removeAll(){\n d3.selectAll(\".announcementText\").remove() \n d3.selectAll(\".circle\").remove()\n d3.selectAll(\".lastfmurl\").remove()\n d3.selectAll(\".artistname\").remove()\n d3.selectAll(\".axis\").remove()\n d3.selectAll(\".radio\").remove()\n}", "function resetGraph(){\n\t\n\tliveGraph.destroy();\n\tdps.splice(0,dps.length);\n\tindex.splice(0,index.length);\n\tconsole.log(index.length);\n\tconsole.log(dps.length);\n\tdataNum=0;\n\tliveGraph =new Chart(chart, {\n\ttype: 'line',\n\t\tdata:fullData,\n\t\toptions:{\n\t\t\ttitle:{\n\t\t\t\tdisplay:true,\n\t\t\t\ttext: 'Force Gauge Mesurements'\n\t\t\t},\n\t\t\t\n\t\t\tlegend:{\n\t\t\t\tdisplay:true,\n\t\t\t\tposition:'right'\n\t\t\t},\n\t\t\tscales:{\n\t\t\t\tyAxes:[{\n\t\t\t\t\tticks:{\n\t\t\t\t\t\tbeginAtZero:true\n\t\t\t\t\t},\n\t\t\t\t\tscaleLabel:{\n\t\t\t\t\t\tdisplay:true,\n\t\t\t\t\t\t\tlabelString:'Force(N)'\n\t\t\t\t\t}\n\t\t\t\t}],\n\t\t\t\txAxes:[{\n\t\t\t\t\tticks:{\n\t\t\t\t\t\tbeginAtZero:true\n\t\t\t\t\t},\n\t\t\t\t\tscaleLabel:{\n\t\t\t\t\t\tdisplay:true,\n\t\t\t\t\t\t\tlabelString:'Number of Points'\n\t\t\t\t\t}\n\t\t\t\t}]\n\t\t\t}\n\t}\n\t});\n\t\n}", "removeAxes(){\n if(this.axes == null){\n return;\n }\n\n var object = this.scene.getObjectById(this.axes.id);\n\n if(object != null){\n this.scene.remove(object);\n this.axes = null\n }\n }", "componentWillUnmount() {\r\n this.chart.destroy();\r\n }", "function deleteOverlays() {\r\n clearOverlays();\r\n mm.markers = [];\r\n}", "function updateChart(datain,CTY,TYPE) {\r\n\r\n// Removes the chart\r\n\r\nvar graph = d3.select(\"svg\").remove();\r\n\r\ngenChart(datain[0],datain[1], datain[2],CTY,TYPE); \r\n \r\n}", "function removeImage () {\n vis.selectAll('image').attr('xlink:href', null)\n vis2.selectAll('image').attr('xlink:href', null)\n }", "destroy() {\n this.panel.remove();\n }", "function hide() {\n\t\tdashboardContent.empty();\n\n\t}", "remove_widget(widget_id) {\n delete this.data[widget_id];\n }", "function removeCluster(map) {\n var overlayPane = d3.select(map.getPanes().overlayPane);\n overlayPane.selectAll('.cluster').remove();\n }", "deleteInstanceData(workList) {\n\n this.updateGraphInfoBar();\n this.stopLayout();\n\n if (!workList || workList.length == 0) {\n return;\n }\n\n IIDXHelper.progressBarCreate(this.progressDiv, \"progress-info progress-striped active\");\n IIDXHelper.progressBarSetPercent(this.progressDiv, 0, \"\");\n this.busy(true);\n\n var vNodesLostEdgesList = [];\n var vEdgesToDelete = [];\n \n var i = 0;\n // first pass: remove edges\n for (var w of workList) {\n var vEdgeList = this.networkHash[ExploreTab.MODE_INSTANCE].body.data.edges.get();\n if (w.length == 2) {\n // delete edges\n var domainUri = w[0];\n var predicateUri = w[1];\n // for all edges\n for (vEdge of vEdgeList) {\n\n if (++i % 100 == 1) {\n var percent = 0 + 40 * i++ / (workList.length * vEdgeList.length);\n\n //console.log(\"first pass \" + percent + \"%\");\n IIDXHelper.progressBarSetPercent(this.progressDiv, percent, \"Removing_edges\");\n }\n\n // for all potential matches\n\n var spo = vEdge.id.split(',');\n // if predicate matches\n if (spo[1] == predicateUri) {\n // if fromNode is a member of domainUri\n var fromNode = this.networkHash[ExploreTab.MODE_INSTANCE].body.data.nodes.get(spo[0]);\n if (fromNode.group.split(\",\").indexOf(domainUri) > -1) {\n vNodesLostEdgesList.push(vEdge.from);\n vNodesLostEdgesList.push(vEdge.to);\n vEdgesToDelete.push(vEdge);\n }\n }\n }\n }\n }\n this.networkHash[ExploreTab.MODE_INSTANCE].body.data.edges.remove(vEdgesToDelete);\n\n // count edges for each node\n var edgeCountHash = {};\n for (var vEdge of this.networkHash[ExploreTab.MODE_INSTANCE].body.data.edges.get()) {\n //console.log(\"edge hash\");\n edgeCountHash[vEdge.from] = (edgeCountHash[vEdge.from] ? edgeCountHash[vEdge.from] : 0) + 1;\n edgeCountHash[vEdge.to] = (edgeCountHash[vEdge.to] ? edgeCountHash[vEdge.to] : 0) + 1;\n }\n\n // second pass: remove nodes (must also have no edges)\n i=0;\n for (var w of workList){\n //console.log(\"remove nodes\");\n // delete nodes\n if (w.length == 1) {\n var classUri = w[0];\n var vNodeList = this.networkHash[ExploreTab.MODE_INSTANCE].body.data.nodes.get();\n for (var vNode of vNodeList) {\n\n if (++i % 200 == 1) {\n var percent = 40 + 40 * i++ / (workList.length * vNodeList.length);\n IIDXHelper.progressBarSetPercent(this.progressDiv, percent, \"Removing_nodes\");\n }\n\n if (vNode.group == classUri) {\n // simple single-class exact match if no edges remain\n if (!(vNode.id in edgeCountHash)) {\n this.networkHash[ExploreTab.MODE_INSTANCE].body.data.nodes.remove(vNode.id);\n }\n } else if (vNode.group.indexOf(classUri) > -1) {\n // remove class from multi-class nodes\n vNode.group = vNode.group.split(\",\").filter(function(uri, x) {return x != uri;}.bind(this, classUri)).toString();\n this.networkHash[ExploreTab.MODE_INSTANCE].body.data.nodes.update(vNode);\n }\n }\n }\n }\n\n var vNodesToRemove = [];\n var vNodesLostEdgesSet = new Set(vNodesLostEdgesList);\n // third pass: remove orphan nodes\n var selectedClasses = this.oTree.getSelectedClassNames();\n i=0;\n for (var vNodeId of vNodesLostEdgesSet) {\n if (++i % 200 == 1) {\n var percent = 80 + 20 * i / vNodesLostEdgesSet.size;\n //console.log(\"third pass \" + percent + \"%\");\n IIDXHelper.progressBarSetPercent(this.progressDiv, percent, \"Removing_orphans\");\n }\n var vNode = this.networkHash[ExploreTab.MODE_INSTANCE].body.data.nodes.get(vNodeId);\n // remove iff still exists, only one class, class is not selected in oTree, no edges\n if (vNode && vNode.group.split(\",\").length == 1 && !(vNode.id in edgeCountHash) && selectedClasses.indexOf(vNode.group) == -1) {\n vNodesToRemove.push(vNode);\n }\n }\n this.networkHash[ExploreTab.MODE_INSTANCE].body.data.nodes.remove(vNodesToRemove);\n\n IIDXHelper.progressBarSetPercent(this.progressDiv, 100);\n IIDXHelper.progressBarRemove(this.progressDiv);\n this.busy(false);\n this.updateGraphInfoBar();\n this.startLayout();\n }", "function plot_destroy(plot_id) {\n\tif (! plot_is_showed(plot_id)) {\n\t\tconsole.log('Broken plot_destroy');\n\t\treturn;\n\t}\n\tplots[plot_id]['chart'].destroy();\n\tdelete plots[plot_id]['chart'];\n}", "function closeGraphSideBar() {\n document.getElementById(\"graphsidebar\").style.width = \"0\";\n}", "deconstruct () {\r\n this.removeChild(this.title)\r\n\r\n for (let button of this.buttons) {\r\n this.removeChild(button)\r\n }\r\n\r\n for (let axis of this.axis) {\r\n this.removeChild(axis)\r\n }\r\n }", "componentWillUnmount() {\n this.chart.destroy();\n }", "function removeElements() {\n d3.selectAll('.svg-tooltip').remove();\n d3.selectAll('.y-axis').remove();\n d3.selectAll('.tooltip-container').remove();\n d3.selectAll('.title-container').remove();\n console.log('removed elements');\n }", "removeYearOverview () {\n this.items\n .selectAll ('.item-circle')\n .transition ()\n .duration (this.settings.transition_duration)\n .ease (d3.easeLinear)\n .style ('opacity', 0)\n .remove ();\n this.labels.selectAll ('.label-day').remove ();\n this.labels.selectAll ('.label-month').remove ();\n this.hideBackButton ();\n }", "function hideBarChart() {\n // hide bars, display background\n $('#bars').replaceWith(background);\n}", "function removeEdges(map) {\n var overlayPane = d3.select(map.getPanes().overlayPane);\n overlayPane.selectAll('.edges').remove();\n }", "destroy() {\n clearInterval(this.poll);\n this.chart.destroy();\n }", "componentWillUnmount() {\n this.state.charts.forEach( function (chart) {\n chart.ref.destroy();\n });\n }", "function removeParent() {\n this.removeEventListener(\"click\", removeParent, false);\n const index = Object.keys(dataSet).indexOf(this.id);\n delete dataSet[this.id];\n myBarchart.colors.splice(index, 1);\n this.parentNode.remove();\n $('span[draggable=\"true\"]').eq(index).remove();\n for(let index of myBarchart.colors.keys()) {\n dragger[index].setAttribute(\"color-id\", index);\n }\n freshCanvas();\n myBarchart.draw();\n}", "function clearChart() {\n\tfor(var i = 0; i < 3; i++) {\n\t\tchart.data.datasets[i].data = []\n\t\tchart.data.datasets[i].label = ''\n\t}\n\tchart.data.labels = []\n\tdocument.getElementById('message').innerHTML = ''\n\tchart.options.scales.yAxes[0].scaleLabel.labelString = ''\n\tchart.options.scales.yAxes[1].scaleLabel.labelString = ''\n\tdocument.getElementById('chartSelect').selectedIndex = 0\n\tdocument.getElementById('studySelect').selectedIndex = 0\n\tdocument.getElementById('compareSelect').selectedIndex = 0\n}" ]
[ "0.7502893", "0.74222326", "0.73481625", "0.7343071", "0.7281553", "0.71578777", "0.7153525", "0.714955", "0.7134828", "0.7095677", "0.7078533", "0.7078533", "0.70490766", "0.70324016", "0.70142543", "0.69382024", "0.6936596", "0.68561965", "0.6814677", "0.6782755", "0.6727833", "0.66762555", "0.6647753", "0.6579945", "0.65603095", "0.65352345", "0.652601", "0.6503042", "0.6480315", "0.6462853", "0.6436216", "0.6405724", "0.64029664", "0.63759166", "0.63727", "0.6331329", "0.63298815", "0.6292605", "0.6291653", "0.6287694", "0.62645507", "0.626347", "0.62469536", "0.6242252", "0.6229137", "0.6216605", "0.6192726", "0.6181108", "0.617922", "0.61782706", "0.61658037", "0.6162816", "0.61343133", "0.6125064", "0.61245626", "0.61012566", "0.6089425", "0.6086316", "0.6067647", "0.6060401", "0.60580426", "0.60546285", "0.6048146", "0.60477185", "0.60334504", "0.6031792", "0.6028879", "0.6024973", "0.60237753", "0.6012967", "0.59943795", "0.59834224", "0.5980643", "0.59792435", "0.59792435", "0.5977087", "0.59654325", "0.5956135", "0.59516025", "0.593409", "0.5930537", "0.59289116", "0.592455", "0.5918221", "0.5906622", "0.5900441", "0.5898031", "0.58962566", "0.5892214", "0.5888824", "0.5887664", "0.58831775", "0.58769965", "0.5862363", "0.585972", "0.58560205", "0.5854004", "0.58535814", "0.58462954", "0.5845707" ]
0.66567785
22
This function is used to remove a graph from a dashboard
static async updateGraph(email, dashboardID, graphID, fields, data) { data = data.map((item, i) => (i < fields.length && (fields[i] === 'metadata' || fields[i] === 'options') ? JSON.stringify(item) : item)); let query = `UPDATE Graph as g SET ${fieldUpdates(fields, data, 3)} WHERE ( g.dashboardid in ( SELECT d.id from dashboard as d WHERE (d.email = $1) AND (d.id = $2)) ) AND (g.ID = $3) RETURNING *;`; return new Promise((resolve, reject) => { Database.sendQuery(query, [email, dashboardID, graphID, ...data]) .then((result) => { // console.log(result); if (result.rows.length > 0) resolve(result.rows[0]); else reject(result); }) .catch((result) => reject(result)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dashboard_clear() {\n d3.select(\"#dashboard\").selectAll(\"svg\").remove();\n}", "function removeChart() {\n chart.destroy();\n }", "function removePlots() {\n d3.selectAll(\".nodes\").remove();\n d3.selectAll(\".link\").remove();\n d3.selectAll(\".axis-label\").remove();\n }", "function removeData(graph) {\n //Clears all datasets\n graph.data.datasets = [];\n\n //Updates the chart to display to changes\n graph.update();\n}", "function removeGraph() {\n filtro = \"\";\n $(\"svg\").remove();\n}", "function removePlots() {\n d3.selectAll(\".nodes\").remove();\n d3.selectAll(\".link\").remove();\n}", "function graphRemove() {\r\n svg.selectAll(\"*\").remove();\r\n d3nodes = [];\r\n d3links = [];\r\n}", "function removePlot(sensor){\n d3.selectAll(\".dots-\" + sensor).remove();\n d3.select(\"#route-\" + sensor).remove();\n d3.selectAll(\"#carIcon-\" + sensor).remove();\n\n }", "removeGraphData() {\n this.PieGraph.data.labels = [];\n this.PieGraph.data.datasets.forEach((dataset) => {\n dataset.data = [];\n });\n this.PieGraph.update();\n }", "function clearGraph() {\n graph.paper.clear();\n\n graph.$el.find('ul').remove();\n graph.$el.find('.elroi-point-flag').remove();\n graph.$el.find('.elroi-point-label').remove();\n }", "function remove() {\n\t\tif (graphContainer) {\n\t\t\t// Select the parent element because the graph container is a group (e.g. for zooming)\n\t\t\td3.select(graphContainer.node().parentNode).remove();\n\t\t}\n\t}", "function remove() {\n\t\tif (graphContainer) {\n\t\t\t// Select the parent element because the graph container is a group (e.g. for zooming)\n\t\t\td3.select(graphContainer.node().parentNode).remove();\n\t\t}\n\t}", "function removeOldChart() {\n var oldChart = document.getElementById('DB')\n if (oldChart != undefined) {\n var parent = oldChart.parentNode\n parent.removeChild(oldChart)\n }\n\n}", "function updatePlots(){\n// delete plot that is in div stats\n Plotly.deleteTraces('stats',0)\n}", "function cleargraphs(){\n d3.selectAll(\".graph\").selectAll(\"*\").remove();\n // $(\"#graphparam1\").text(\"\");\n $(\"#graphparam2\").text(\"\");\n}", "function ClearChart() {\n d3.select('svg').remove();\n}", "function removeTab(evt){ //accept either the span event object or the panel\n var $span = $(evt.target);\n var panelRef = $span.parent().children(\"a\").attr(\"href\");\n var panelId = panelRef.substr(1);\n destroyChartMap(panelId);\n $(panelRef).remove();\n $span.parent().remove();\n delete panelGraphs[panelId];\n $graphTabs.tabs('refresh'); //tell JQUI to sync up\n if($graphTabs.find(\"li\").length == 0){\n editingPanelId = null; //dissociate the chart from the this edit session\n $(\"#btnEditGraphTop\").attr(\"disabled\",\"disabled\");\n $(\"button.add-to-graph\").attr(\"disabled\",\"disabled\");\n lastTabAnchorClicked.click();\n } else {\n $('#graph-tabs a:last').click();\n }\n $(\"#graph_title\").attr('value','');\n}", "reset_graphs() {\n d3.selectAll(\".sourcegraph-container\").remove()\n }", "function clearGraph() {\n if (interval) {\n clearInterval(interval)\n interval = null\n }\n if (chart) {\n chart.destroy()\n chart = null\n }\n}", "function destroyGraph(fieldX, fieldY) {\n //Delete the elements\n $(\"div.graph-expand[name='\" + fieldX + \"-\" + fieldY + \"']\").remove();\n $(\"div.graph[name='\" + fieldX + \"-\" + fieldY + \"']\").remove();\n}", "function clearGraph(svg) {\n\t\t//console.log(\"clearing the barchart...\");\n\t while (svg.lastChild) {\n\t svg.removeChild(svg.lastChild);\n\t }\n\t}", "function DeleteCharts() {\n var chartDiv = document.getElementById('chart-div');\n chartDiv.innerHTML = '';\n}", "static async removeGraph(email, dashboardID, graphID) {\n\t\tlet query = 'DELETE FROM Graph as g WHERE (g.dashboardid in ( SELECT d.id from dashboard as d WHERE (d.email = $1) AND (d.id = $2))) AND (g.ID = $3);';\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tDatabase.sendQuery(query, [email, dashboardID, graphID])\n\t\t\t\t.then((result) => resolve(result.rows))\n\t\t\t\t.catch((result) => reject(result));\n\t\t});\n\t}", "function deleteGraph(idNum){//remove() the div with same counter number\n $(\"#graph\"+idNum).remove();\n $(\"#banner\"+idNum).remove();\n\n //find and delete the id num of the graph deleted from opengraphsNum\n for(var i=0;i<opengraphsNum.length;i++){\n if(idNum == opengraphsNum[i]) opengraphsNum.splice(i,1);\n }\n\n //display the graph at the bottom if none of the graphs are opened\n if(idNum == opengraphsNum[opengraphsNum.length - 1]) {\n console.log(\"opengraphs = \" + opengraphs);\n var num = opengraphsNum[opengraphsNum.length - 1];\n $(\"#graph\" + num).css(\"display\", \"block\");\n $(\"#banner\" + num).css(\"backgroundColor\", \"orange\");\n opengraphs = 1;\n console.log(\"idNum = \" + idNum);\n console.log(\"openGraphsNum = \" + num);\n }\n opengraphs = 0;\n\n}", "remove () {\r\n\t\tvar svg = d3.select(this.element);\r\n\t\tsvg.selectAll('*').remove();\r\n\t}", "function clearIt() {\n\tPlotly.newPlot(visDiv, [{\n\t\ty: [],\n\t\ttype: 'scattergl',\n\t\tmode: 'lines',\n\t\tline: { color: '#00f' },\n\t\tname: 'Vis'\n\t}], { title: 'Visual Light' });\n\tPlotly.newPlot(irDiv, [{\n\t\ty: [],\n\t\ttype: 'scattergl',\n\t\tmode: 'lines',\n\t\tline: { color: '#f00' },\n\t\tname: 'IR'\n\t}], { title: 'Infra red Light' });\n\n\tPlotly.newPlot(ps1Div, [{\n\t\ty: [],\n\t\ttype: 'scattergl',\n\t\tmode: 'lines',\n\t\tline: { color: '#f00' },\n\t\tname: 'PS1'\n\t}], { title: 'Proximity 1' });\n\tPlotly.newPlot(ps2Div, [{\n\t\ty: [],\n\t\ttype: 'scattergl',\n\t\tmode: 'lines',\n\t\tline: { color: '#0f0' },\n\t\tname: 'PS2'\n\t}], { title: 'Proximity 2' });\n\tPlotly.newPlot(ps3Div, [{\n\t\ty: [],\n\t\ttype: 'scattergl',\n\t\tmode: 'lines',\n\t\tline: { color: '#00f' },\n\t\tname: 'PS3'\n\t}], { title: 'Proximity 3' });\n}", "function removeData(chart, timeline) {\n chart.data.datasets[0].data = data_traffic_chart[timeline];\n chart.update();\n}", "function removePointInfo()\r\n{\r\n chartGroup.removeChild(currentNodeInfo);\r\n currentNodeInfo = null;\r\n}", "function removeData(chart) {\n let dataLength = chart.data.datasets[0].data.length;\n for(let i = 0; i < dataLength; i++){\n chart.data.datasets[0].data.pop();\n chart.data.labels.pop();\n }\n chart.update();\n}", "removeDayOverview () {\n this.items\n .selectAll ('.item-block')\n .transition ()\n .duration (this.settings.transition_duration)\n .ease (d3.easeLinear)\n .style ('opacity', 0)\n .attr ('x', (d, i) => {\n return i % 2 === 0 ? -this.settings.width / 3 : this.settings.width / 3;\n })\n .remove ();\n this.labels.selectAll ('.label-time').remove ();\n this.labels.selectAll ('.label-project').remove ();\n this.hideBackButton ();\n }", "function removeSVGElements() {\n pieChart.selectAll(\"circle\").remove();\n pieChart.selectAll(\"path\").remove();\n}", "function cleaner() {\n svg.selectAll(\"path\").data([]).exit().remove();\n svg.selectAll(\"g\").data([]).exit().remove();\n document.getElementById('controls').innerHTML = '';\n document.getElementById('stats').innerHTML = '';\n}", "function removeSvg() {\r\n $('table.newschart > tbody > tr > td.nval').removeClass(\"hideborder\");\r\n setPaths = false;\r\n $('svg').remove();\r\n}", "function clearDashboard() {\n \n while (dashboard.firstChild) {\n dashboard.removeChild(dashboard.firstChild);\n }\n}", "function clearArticles() {\r\n d3.select(\"body\").select(\"#articles-panel\").select(\"div\").remove();\r\n}", "function resetSpace(){\n\tvar bc = document.getElementById('barchartcanvas');\n\tvar lc = document.getElementById('linechartcanvas');\n\tvar dc = document.getElementById('doughnutchartcanvas');\n\tvar pc = document.getElementById('piechartcanvas');\n\tif(bc != undefined){\n\t\tbc.remove();\n\t}\n\tif(lc != undefined){\n\t\tlc.remove();\n\t}\n\tif(dc != undefined){\n\t\tdc.remove();\n\t}\n\tif(pc != undefined){\n\t\tpc.remove();\n\t}\n}", "function closeGraphEq() {\n document.getElementById(\"graphInfo\").style.display = \"none\";\n}", "clearDensityPlot () {\n // Clear density plot\n const canvas = this.axisElements['plot-density'].node()\n const context = canvas.getContext('2d')\n context.clearRect(0, 0, canvas.width, canvas.height)\n }", "function resetGraph() {\n\t\t\t\t\toverlay.animate({width: '747px'}, 0);\n\t\t\t\t\t$('.trends').remove();\n\t\t\t\t}", "function clearVis() {\n $('.content-container').remove();\n}", "removeMonthOverview () {\n this.items\n .selectAll ('.item-block-month')\n .selectAll ('.item-block-rect')\n .transition ()\n .duration (this.settings.transition_duration)\n .ease (d3.easeLinear)\n .style ('opacity', 0)\n .attr ('x', (d, i) => {\n return i % 2 === 0 ? -this.settings.width / 3 : this.settings.width / 3;\n })\n .remove ();\n this.labels.selectAll ('.label-day').remove ();\n this.labels.selectAll ('.label-week').remove ();\n this.hideBackButton ();\n }", "function clear() {\n if (!scene)\n return;\n\n if (chartGrid) {\n scene.remove(chartGrid);\n chartGrid = undefined;\n }\n if (chartAxis) {\n scene.remove(chartAxis);\n chartAxis = undefined;\n }\n if (chartAxisLabels)\n chartAxisLabels.children.length = 0;\n if (chartMesh) {\n scene.remove(chartMesh);\n chartMesh = undefined;\n }\n }", "clearGraph() {\n this.functionArray = [];\n\n this.ctx.fillStyle = \"black\";\n this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);\n this.ctx.fillStyle = \"white\";\n this.setAxis();\n\n document.getElementById(\"inputX\").value = \"\";\n document.getElementById(\"details\").innerHTML = \"\";\n let base_address = window.location.href.toString();\n let end_uri = base_address.indexOf(\"?\");\n if (end_uri > -1) base_address = base_address.slice(0, end_uri);\n window.history.replaceState(null, null, base_address);\n }", "function removeData(chart) {\n chart.data.labels.shift();\n chart.data.datasets.forEach(function (dataset) {\n dataset.data.shift();\n });\n chart.update();\n }", "function clearSearchesVisualization(){\n g.selectAll('*').remove();\n }", "_destroyChart () {\n if (this.chart) {\n // TODO: remove events once they're implemented\n // if (this.chart.off) {\n // this.chart.off();\n // }\n delete this.chart;\n }\n }", "function removerDatos(chart) {\n chart.data.datasets.forEach((dataset) => {\n dataset.label = 'Numero de ventas';\n });\n chart.data.datasets.forEach((dataset) => {\n dataset.data = [0, 0, 0, 0];\n });\n chart.update();\n}", "function onRemove(){\n \n var data_points = chart.options.data[0].dataPoints;\n var isRemoved = false;\n for(var i = 0; i < data_points.length; i++){\n var assets = data_points[i].assets;\n if( data_points[i].exploded ){\n for( var j = 0; j < assets.length; j++){\n if( assets[j].exploded ){\n // remove the asset\n data_points[i].y -= assets[j].y;\n assets.splice(j, 1);\n isRemoved = true;\n // break the loop\n break;\n }\n }\n\n // we should check whether or not an asset is removed, if not, we should delete the all type\n // we also should check whether data_points[i].length > 0, if not, we should delete that type as well\n if( !isRemoved || assets.length == 0){\n data_points.splice(i, 1);\n // update the subchart\n sub_chart.options.title.text = \"\";\n sub_chart.options.data[0].dataPoints = [];\n\n isRemoved = true;\n }\n\n // break the loop\n break;\n }\n }\n\n // if no element is removed\n if( !isRemoved){\n alert( \"You need to choose an asset in order to delete it!\");\n }\n\n // render\n chart.render();\n sub_chart.render();\n}", "function cleardisplay(){\n $('.textbox-row').closest('.row-fluid').remove();\n $(\".firstDiv\").remove();\n $('.side-labels').empty();\n $(\".start-row\").empty();\n $(\".chart-container\").remove();\n $(\".continue-row\").remove();\n chart = [];\n }", "function empty_graph(){\n\tglobal_graph = new bbop.model.graph();\n\tfocus_nodes = {};\n\tjQuery(demo_output_elt).empty();\n }", "deleteOverlay() {\n d3.selectAll(\".overlay\").remove();\n }", "function removeIfNoAction(ex) {\n var linkId = ex.currentTarget.id;\n setTimeout(function(){\n var id = '';\n if(linkId === chartMap.classMetricsLine.linkId) {\n id = chartMap.classMetricsLine.container;\n } else if(linkId === chartMap.classMetricsBar.linkId ) {\n id = chartMap.classMetricsBar.container;\n } else if(linkId === chartMap.memberDoughnut.linkId ) {\n id = chartMap.memberDoughnut.container;\n } else if(linkId === chartMap.memberSummaryNumbers.linkId /*'addMemberSummary'*/) {\n id = chartMap.memberSummaryNumbers.container; // 'tileContainerMemberSummary';\n } else if(linkId === chartMap.membershipPie.linkId /*'addMembershipsPie'*/){\n id = chartMap.membershipPie.container; //'tileContainerMembershipPie';\n } else if(linkId === chartMap.sineWaveLine.linkId){\n id = chartMap.sineWaveLine.container;\n } else if(linkId === chartMap.fake1.linkId){\n id = chartMap.fake1.container;\n } else if(linkId === chartMap.fake2.linkId){\n id = chartMap.fake2.container;\n } else if(linkId === chartMap.fake3.linkId){\n id = chartMap.fake3.container;\n } else if(linkId === chartMap.fake4.linkId){\n id = chartMap.fake4.container;\n }\n var item = $('#' + id);\n if(item && item[0] && item[0].tile && item[0].tile.isTemp){\n //console.log('removeIfNoAction() - removing: ' + id);\n // kill draggable\n try{\n Draggable.get('#' + id).kill();\n }catch(e){}\n item.remove();\n var removeIdx = loadedCharts.indexOf(id);\n if(removeIdx != -1) {\n loadedCharts.splice(removeIdx, 1);\n }\n //toggleOptionButton(id, true);\n layoutInvalidated();\n }\n\n }, 2000);\n}", "delete() {\n this.removeAllConnections()\n \n let parent = this.getParent()\n let diagram = this.getDiagram()\n \n if (parent) {\n parent.removeChild(this)\n } else {\n diagram.removePane(this)\n }\n \n this.redrawAllConnectionsInDiagram()\n }", "destroy() {\n d3.select(this.el).selectAll('svg').remove();\n }", "function resetGraph(){\n document.getElementById(\"exitText\").addEventListener('click', function(event){\n d3.selectAll(\".graph > *\").remove();\n map.getView().setZoom(2.4);\n\n });\n}", "remove(){\n this.removeViews(Object.keys(this.views));\n this.el.innerHTML = null;\n this.layouts[this.layout].isRendered = false;\n this.layout = null;\n }", "function empty_graph(){\n\tgraph = new model.graph();\n\tfocus_nodes = {};\n\tjQuery('#grcon').empty();\n\tjQuery('#color_exp').empty();\n }", "disposeChart() {\n if (this.chart) {\n this.chart.dispose();\n this.chart = null;\n logger.debug(`ParticipantScore: disposed of chart - ${this.props.graphType}`);\n }\n }", "function clear() {\r\n d3.select(\"#timelapse-chart\").remove();\r\n d3.select(\"#pause-button\").node().innerHTML = \"Pausar\";\r\n d3.select(\"#filters-div-container\").attr(\"class\", \"hidden\");\r\n}", "function removeAllDrawers() {\n if ($.size_chart_drawer) {\n $.appIndex.remove($.size_chart_drawer);\n }\n}", "removeGlobalOverview () {\n this.items\n .selectAll ('.item-block-year')\n .transition ()\n .duration (this.settings.transition_duration)\n .ease (d3.easeLinear)\n .style ('opacity', 0)\n .remove ();\n this.labels.selectAll ('.label-year').remove ();\n }", "removeWeekOverview () {\n this.items\n .selectAll ('.item-block-week')\n .selectAll ('.item-block-rect')\n .transition ()\n .duration (this.settings.transition_duration)\n .ease (d3.easeLinear)\n .style ('opacity', 0)\n .attr ('x', (d, i) => {\n return i % 2 === 0 ? -this.settings.width / 3 : this.settings.width / 3;\n })\n .remove ();\n this.labels.selectAll ('.label-day').remove ();\n this.labels.selectAll ('.label-week').remove ();\n this.hideBackButton ();\n }", "function destroy(){\n\t\tif(!_.isUndefined(svg) && _.isFunction(svg.style))\n\t\tsvg\n\t .style('background-color', 'none');\n\t}", "function clearDataDisplay() {\n body.removeChild(data_display);\n}", "function removeHSVG() {\n d3.select(\"#heatmap\").remove();\n\n} // end removeSVG", "function removeOpenArrowBox(){\n const openChart=document.querySelector(\".arrow_box\");\n if(openChart)\n document.body.removeChild(openChart);\n }", "clear() {\n const svg = select(this.base);\n svg.selectAll(\"g\").remove();\n }", "function clearPieCharts() {\n\t$(\"#pies\").children().remove();\n\t$(\"#text text:last\").remove();\n}", "update () {\r\n\t\tvar svg = d3.select(this.element);\r\n\t\tsvg.selectAll('*').remove();\r\n\t\tthis.drawChart();\r\n\t}", "removeFigure(){\n\n this[figure] = null;\n }", "clearDosePlot () {\n // Clear dose plot\n this.axisElements['plot-dose'].selectAll('g.dose-contour').remove()\n }", "function graphClear(){\r\n for( var j = 0 ; j < 6 ; j++){\r\n for( var i = 0 ; i < 600 ; i++ ) graphData[j].sample[i] = 2048;\r\n }\r\n graphCount = 0;\r\n graphInverter.onPaint(graphData);\r\n}", "remove_stdev_series(chart) {\n if (\n chart.stdev_up_series != undefined &&\n chart.stdev_down_series != undefined\n )\n chart.ref.removeSeries(chart.stdev_up_series);\n chart.ref.removeSeries(chart.stdev_down_series);\n chart.stdev_up_series = undefined;\n chart.stdev_down_series = undefined;\n }", "function clearChart() {\r\n d3.selectAll(\r\n \".alert.alert-danger.alert-dismissible.lineChart.clearChart\"\r\n ).classed(\"aleph-hide\", false);\r\n\r\n d3.selectAll(\".aleph-alert-line-clearChart\").html(\r\n \"Are you sure you want to <span class='spanBold'>clear</span> the chart? This action cannot be undone.\"\r\n );\r\n\r\n return;\r\n}", "deleteGraph(graph) {\n return this.removeMatches(null, null, null, graph);\n }", "deleteGraph(graph) {\n return this.removeMatches(null, null, null, graph);\n }", "function clearChart() {\n localStorage.removeItem('results');\n $('#highscore-chart').innerHTML = '';\n}", "function removeAll(){\n d3.selectAll(\".announcementText\").remove() \n d3.selectAll(\".circle\").remove()\n d3.selectAll(\".lastfmurl\").remove()\n d3.selectAll(\".artistname\").remove()\n d3.selectAll(\".axis\").remove()\n d3.selectAll(\".radio\").remove()\n}", "function resetGraph(){\n\t\n\tliveGraph.destroy();\n\tdps.splice(0,dps.length);\n\tindex.splice(0,index.length);\n\tconsole.log(index.length);\n\tconsole.log(dps.length);\n\tdataNum=0;\n\tliveGraph =new Chart(chart, {\n\ttype: 'line',\n\t\tdata:fullData,\n\t\toptions:{\n\t\t\ttitle:{\n\t\t\t\tdisplay:true,\n\t\t\t\ttext: 'Force Gauge Mesurements'\n\t\t\t},\n\t\t\t\n\t\t\tlegend:{\n\t\t\t\tdisplay:true,\n\t\t\t\tposition:'right'\n\t\t\t},\n\t\t\tscales:{\n\t\t\t\tyAxes:[{\n\t\t\t\t\tticks:{\n\t\t\t\t\t\tbeginAtZero:true\n\t\t\t\t\t},\n\t\t\t\t\tscaleLabel:{\n\t\t\t\t\t\tdisplay:true,\n\t\t\t\t\t\t\tlabelString:'Force(N)'\n\t\t\t\t\t}\n\t\t\t\t}],\n\t\t\t\txAxes:[{\n\t\t\t\t\tticks:{\n\t\t\t\t\t\tbeginAtZero:true\n\t\t\t\t\t},\n\t\t\t\t\tscaleLabel:{\n\t\t\t\t\t\tdisplay:true,\n\t\t\t\t\t\t\tlabelString:'Number of Points'\n\t\t\t\t\t}\n\t\t\t\t}]\n\t\t\t}\n\t}\n\t});\n\t\n}", "removeAxes(){\n if(this.axes == null){\n return;\n }\n\n var object = this.scene.getObjectById(this.axes.id);\n\n if(object != null){\n this.scene.remove(object);\n this.axes = null\n }\n }", "componentWillUnmount() {\r\n this.chart.destroy();\r\n }", "function updateChart(datain,CTY,TYPE) {\r\n\r\n// Removes the chart\r\n\r\nvar graph = d3.select(\"svg\").remove();\r\n\r\ngenChart(datain[0],datain[1], datain[2],CTY,TYPE); \r\n \r\n}", "function deleteOverlays() {\r\n clearOverlays();\r\n mm.markers = [];\r\n}", "function removeImage () {\n vis.selectAll('image').attr('xlink:href', null)\n vis2.selectAll('image').attr('xlink:href', null)\n }", "destroy() {\n this.panel.remove();\n }", "function hide() {\n\t\tdashboardContent.empty();\n\n\t}", "remove_widget(widget_id) {\n delete this.data[widget_id];\n }", "function removeCluster(map) {\n var overlayPane = d3.select(map.getPanes().overlayPane);\n overlayPane.selectAll('.cluster').remove();\n }", "deleteInstanceData(workList) {\n\n this.updateGraphInfoBar();\n this.stopLayout();\n\n if (!workList || workList.length == 0) {\n return;\n }\n\n IIDXHelper.progressBarCreate(this.progressDiv, \"progress-info progress-striped active\");\n IIDXHelper.progressBarSetPercent(this.progressDiv, 0, \"\");\n this.busy(true);\n\n var vNodesLostEdgesList = [];\n var vEdgesToDelete = [];\n \n var i = 0;\n // first pass: remove edges\n for (var w of workList) {\n var vEdgeList = this.networkHash[ExploreTab.MODE_INSTANCE].body.data.edges.get();\n if (w.length == 2) {\n // delete edges\n var domainUri = w[0];\n var predicateUri = w[1];\n // for all edges\n for (vEdge of vEdgeList) {\n\n if (++i % 100 == 1) {\n var percent = 0 + 40 * i++ / (workList.length * vEdgeList.length);\n\n //console.log(\"first pass \" + percent + \"%\");\n IIDXHelper.progressBarSetPercent(this.progressDiv, percent, \"Removing_edges\");\n }\n\n // for all potential matches\n\n var spo = vEdge.id.split(',');\n // if predicate matches\n if (spo[1] == predicateUri) {\n // if fromNode is a member of domainUri\n var fromNode = this.networkHash[ExploreTab.MODE_INSTANCE].body.data.nodes.get(spo[0]);\n if (fromNode.group.split(\",\").indexOf(domainUri) > -1) {\n vNodesLostEdgesList.push(vEdge.from);\n vNodesLostEdgesList.push(vEdge.to);\n vEdgesToDelete.push(vEdge);\n }\n }\n }\n }\n }\n this.networkHash[ExploreTab.MODE_INSTANCE].body.data.edges.remove(vEdgesToDelete);\n\n // count edges for each node\n var edgeCountHash = {};\n for (var vEdge of this.networkHash[ExploreTab.MODE_INSTANCE].body.data.edges.get()) {\n //console.log(\"edge hash\");\n edgeCountHash[vEdge.from] = (edgeCountHash[vEdge.from] ? edgeCountHash[vEdge.from] : 0) + 1;\n edgeCountHash[vEdge.to] = (edgeCountHash[vEdge.to] ? edgeCountHash[vEdge.to] : 0) + 1;\n }\n\n // second pass: remove nodes (must also have no edges)\n i=0;\n for (var w of workList){\n //console.log(\"remove nodes\");\n // delete nodes\n if (w.length == 1) {\n var classUri = w[0];\n var vNodeList = this.networkHash[ExploreTab.MODE_INSTANCE].body.data.nodes.get();\n for (var vNode of vNodeList) {\n\n if (++i % 200 == 1) {\n var percent = 40 + 40 * i++ / (workList.length * vNodeList.length);\n IIDXHelper.progressBarSetPercent(this.progressDiv, percent, \"Removing_nodes\");\n }\n\n if (vNode.group == classUri) {\n // simple single-class exact match if no edges remain\n if (!(vNode.id in edgeCountHash)) {\n this.networkHash[ExploreTab.MODE_INSTANCE].body.data.nodes.remove(vNode.id);\n }\n } else if (vNode.group.indexOf(classUri) > -1) {\n // remove class from multi-class nodes\n vNode.group = vNode.group.split(\",\").filter(function(uri, x) {return x != uri;}.bind(this, classUri)).toString();\n this.networkHash[ExploreTab.MODE_INSTANCE].body.data.nodes.update(vNode);\n }\n }\n }\n }\n\n var vNodesToRemove = [];\n var vNodesLostEdgesSet = new Set(vNodesLostEdgesList);\n // third pass: remove orphan nodes\n var selectedClasses = this.oTree.getSelectedClassNames();\n i=0;\n for (var vNodeId of vNodesLostEdgesSet) {\n if (++i % 200 == 1) {\n var percent = 80 + 20 * i / vNodesLostEdgesSet.size;\n //console.log(\"third pass \" + percent + \"%\");\n IIDXHelper.progressBarSetPercent(this.progressDiv, percent, \"Removing_orphans\");\n }\n var vNode = this.networkHash[ExploreTab.MODE_INSTANCE].body.data.nodes.get(vNodeId);\n // remove iff still exists, only one class, class is not selected in oTree, no edges\n if (vNode && vNode.group.split(\",\").length == 1 && !(vNode.id in edgeCountHash) && selectedClasses.indexOf(vNode.group) == -1) {\n vNodesToRemove.push(vNode);\n }\n }\n this.networkHash[ExploreTab.MODE_INSTANCE].body.data.nodes.remove(vNodesToRemove);\n\n IIDXHelper.progressBarSetPercent(this.progressDiv, 100);\n IIDXHelper.progressBarRemove(this.progressDiv);\n this.busy(false);\n this.updateGraphInfoBar();\n this.startLayout();\n }", "function plot_destroy(plot_id) {\n\tif (! plot_is_showed(plot_id)) {\n\t\tconsole.log('Broken plot_destroy');\n\t\treturn;\n\t}\n\tplots[plot_id]['chart'].destroy();\n\tdelete plots[plot_id]['chart'];\n}", "function closeGraphSideBar() {\n document.getElementById(\"graphsidebar\").style.width = \"0\";\n}", "deconstruct () {\r\n this.removeChild(this.title)\r\n\r\n for (let button of this.buttons) {\r\n this.removeChild(button)\r\n }\r\n\r\n for (let axis of this.axis) {\r\n this.removeChild(axis)\r\n }\r\n }", "componentWillUnmount() {\n this.chart.destroy();\n }", "function removeElements() {\n d3.selectAll('.svg-tooltip').remove();\n d3.selectAll('.y-axis').remove();\n d3.selectAll('.tooltip-container').remove();\n d3.selectAll('.title-container').remove();\n console.log('removed elements');\n }", "removeYearOverview () {\n this.items\n .selectAll ('.item-circle')\n .transition ()\n .duration (this.settings.transition_duration)\n .ease (d3.easeLinear)\n .style ('opacity', 0)\n .remove ();\n this.labels.selectAll ('.label-day').remove ();\n this.labels.selectAll ('.label-month').remove ();\n this.hideBackButton ();\n }", "function hideBarChart() {\n // hide bars, display background\n $('#bars').replaceWith(background);\n}", "function removeEdges(map) {\n var overlayPane = d3.select(map.getPanes().overlayPane);\n overlayPane.selectAll('.edges').remove();\n }", "destroy() {\n clearInterval(this.poll);\n this.chart.destroy();\n }", "componentWillUnmount() {\n this.state.charts.forEach( function (chart) {\n chart.ref.destroy();\n });\n }", "function clearChart() {\n\tfor(var i = 0; i < 3; i++) {\n\t\tchart.data.datasets[i].data = []\n\t\tchart.data.datasets[i].label = ''\n\t}\n\tchart.data.labels = []\n\tdocument.getElementById('message').innerHTML = ''\n\tchart.options.scales.yAxes[0].scaleLabel.labelString = ''\n\tchart.options.scales.yAxes[1].scaleLabel.labelString = ''\n\tdocument.getElementById('chartSelect').selectedIndex = 0\n\tdocument.getElementById('studySelect').selectedIndex = 0\n\tdocument.getElementById('compareSelect').selectedIndex = 0\n}", "function removeParent() {\n this.removeEventListener(\"click\", removeParent, false);\n const index = Object.keys(dataSet).indexOf(this.id);\n delete dataSet[this.id];\n myBarchart.colors.splice(index, 1);\n this.parentNode.remove();\n $('span[draggable=\"true\"]').eq(index).remove();\n for(let index of myBarchart.colors.keys()) {\n dragger[index].setAttribute(\"color-id\", index);\n }\n freshCanvas();\n myBarchart.draw();\n}" ]
[ "0.75021344", "0.7423443", "0.7348459", "0.73439497", "0.72818744", "0.7158423", "0.715423", "0.71490955", "0.71360075", "0.7096893", "0.7078999", "0.7078999", "0.7049256", "0.70321274", "0.7014823", "0.6938647", "0.6936166", "0.68575794", "0.6815849", "0.678256", "0.67288655", "0.6675989", "0.6656774", "0.6648048", "0.6579464", "0.65607035", "0.65350497", "0.6526072", "0.6502692", "0.64806783", "0.64625394", "0.643545", "0.64050424", "0.64021295", "0.6376542", "0.6372454", "0.6332627", "0.63303155", "0.6292104", "0.62914914", "0.628744", "0.6264971", "0.62634504", "0.6247177", "0.6242158", "0.6228892", "0.62174356", "0.6192702", "0.61803585", "0.6179439", "0.6178151", "0.6163799", "0.61631346", "0.61334527", "0.6125907", "0.61240804", "0.61012083", "0.60910803", "0.6086479", "0.6068105", "0.6061111", "0.60577464", "0.60530233", "0.6047019", "0.6046993", "0.6032104", "0.6031267", "0.60293174", "0.60250604", "0.60236424", "0.6013903", "0.5995418", "0.5982886", "0.59810144", "0.5980117", "0.5980117", "0.5977035", "0.5964862", "0.5957409", "0.59512126", "0.5933713", "0.59304106", "0.59291106", "0.5923255", "0.5917952", "0.5905587", "0.5898074", "0.5897753", "0.5895235", "0.58920646", "0.5890002", "0.5886427", "0.5882875", "0.5876887", "0.58630556", "0.58603764", "0.5856181", "0.5853503", "0.58523756", "0.5846165", "0.58458364" ]
0.0
-1
This function is used to convert lists of fields and data into comma seperated field=data pairs
function fieldUpdates(fields, data, offset) { offset = offset || 0; let index = -1; fields = fields.filter((field, i) => { if (field === 'email') { index = i; return false; } else return true; }); if (index >= 0) data.splice(index, 1); let output = ''; for (let i = 0; i < fields.length && i < data.length; i++) { const d = i + offset + 1; output = output + ' ' + fields[i] + ' = $' + d + (i < fields.length - 1 && i < data.length - 1 ? ', ' : ''); } return output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "formatFields(fields, data) {\n let formattedData = [];\n // For every data returned from Neo4j\n for(let i = 0; i < data.length; i++) {\n let obj = {};\n // For every fields\n for(let j = 0; j < data[i]._fields.length; j++) {\n let key = fields[j];\n obj[key] = data[i]._fields[j];\n }\n formattedData.push(obj);\n }\n return this.wrapData(formattedData);\n }", "createFieldListString(fields) {\n if (!fields || !fields.length) return null;\n if (fields.length === 1) return `${fields[0]} field is`;\n const lastField = fields.pop();\n return fields.join(\", \") + ` & ${lastField} fields are`;\n }", "function serialize(fields, data) {\n var csv = '';\n\n if (typeof fields === 'string') fields = JSON.parse(fields);\n if (typeof data === 'string') data = JSON.parse(data);\n\n var hasHeader = fields instanceof Array && fields.length > 0;\n var dataKeyedByField = !(data[0] instanceof Array);\n\n // If there a header row, write it first\n if (hasHeader && _writeHeader) {\n for (var i = 0; i < fields.length; i++) {\n if (i > 0) csv += _delimiter;\n csv += safe(fields[i], i);\n }\n if (data.length > 0) csv += _newline;\n }\n\n // Then write out the data\n for (var row = 0; row < data.length; row++) {\n var maxCol = hasHeader ? fields.length : data[row].length;\n\n for (var col = 0; col < maxCol; col++) {\n if (col > 0) csv += _delimiter;\n var colIdx = hasHeader && dataKeyedByField ? fields[col] : col;\n csv += safe(data[row][colIdx], col);\n }\n\n if (row < data.length - 1) csv += _newline;\n }\n\n return csv;\n }", "function serialize(fields, data)\n\t\t{\n\t\t\tvar csv = \"\";\n\n\t\t\tif (typeof fields === 'string')\n\t\t\t\tfields = JSON.parse(fields);\n\t\t\tif (typeof data === 'string')\n\t\t\t\tdata = JSON.parse(data);\n\n\t\t\tvar hasHeader = fields instanceof Array && fields.length > 0;\n\t\t\tvar dataKeyedByField = !(data[0] instanceof Array);\n\n\t\t\t// If there a header row, write it first\n\t\t\tif (hasHeader)\n\t\t\t{\n\t\t\t\tfor (var i = 0; i < fields.length; i++)\n\t\t\t\t{\n\t\t\t\t\tif (i > 0)\n\t\t\t\t\t\tcsv += _delimiter;\n\t\t\t\t\tcsv += safe(fields[i], i);\n\t\t\t\t}\n\t\t\t\tif (data.length > 0)\n\t\t\t\t\tcsv += _newline;\n\t\t\t}\n\n\t\t\t// Then write out the data\n\t\t\tfor (var row = 0; row < data.length; row++)\n\t\t\t{\n\t\t\t\tvar maxCol = hasHeader ? fields.length : data[row].length;\n\n\t\t\t\tfor (var col = 0; col < maxCol; col++)\n\t\t\t\t{\n\t\t\t\t\tif (col > 0)\n\t\t\t\t\t\tcsv += _delimiter;\n\t\t\t\t\tvar colIdx = hasHeader && dataKeyedByField ? fields[col] : col;\n\t\t\t\t\tcsv += safe(data[row][colIdx], col);\n\t\t\t\t}\n\n\t\t\t\tif (row < data.length - 1)\n\t\t\t\t\tcsv += _newline;\n\t\t\t}\n\n\t\t\treturn csv;\n\t\t}", "function serialize(fields, data)\n\t\t{\n\t\t\tvar csv = \"\";\n\n\t\t\tif (typeof fields === 'string')\n\t\t\t\tfields = JSON.parse(fields);\n\t\t\tif (typeof data === 'string')\n\t\t\t\tdata = JSON.parse(data);\n\n\t\t\tvar hasHeader = fields instanceof Array && fields.length > 0;\n\t\t\tvar dataKeyedByField = !(data[0] instanceof Array);\n\n\t\t\t// If there a header row, write it first\n\t\t\tif (hasHeader)\n\t\t\t{\n\t\t\t\tfor (var i = 0; i < fields.length; i++)\n\t\t\t\t{\n\t\t\t\t\tif (i > 0)\n\t\t\t\t\t\tcsv += _delimiter;\n\t\t\t\t\tcsv += safe(fields[i], i);\n\t\t\t\t}\n\t\t\t\tif (data.length > 0)\n\t\t\t\t\tcsv += _newline;\n\t\t\t}\n\n\t\t\t// Then write out the data\n\t\t\tfor (var row = 0; row < data.length; row++)\n\t\t\t{\n\t\t\t\tvar maxCol = hasHeader ? fields.length : data[row].length;\n\n\t\t\t\tfor (var col = 0; col < maxCol; col++)\n\t\t\t\t{\n\t\t\t\t\tif (col > 0)\n\t\t\t\t\t\tcsv += _delimiter;\n\t\t\t\t\tvar colIdx = hasHeader && dataKeyedByField ? fields[col] : col;\n\t\t\t\t\tcsv += safe(data[row][colIdx], col);\n\t\t\t\t}\n\n\t\t\t\tif (row < data.length - 1)\n\t\t\t\t\tcsv += _newline;\n\t\t\t}\n\n\t\t\treturn csv;\n\t\t}", "function serialize(fields, data)\n\t\t{\n\t\t\tvar csv = '';\n\n\t\t\tif (typeof fields === 'string')\n\t\t\t\tfields = JSON.parse(fields);\n\t\t\tif (typeof data === 'string')\n\t\t\t\tdata = JSON.parse(data);\n\n\t\t\tvar hasHeader = fields instanceof Array && fields.length > 0;\n\t\t\tvar dataKeyedByField = !(data[0] instanceof Array);\n\n\t\t\t// If there a header row, write it first\n\t\t\tif (hasHeader && _writeHeader)\n\t\t\t{\n\t\t\t\tfor (var i = 0; i < fields.length; i++)\n\t\t\t\t{\n\t\t\t\t\tif (i > 0)\n\t\t\t\t\t\tcsv += _delimiter;\n\t\t\t\t\tcsv += safe(fields[i], i);\n\t\t\t\t}\n\t\t\t\tif (data.length > 0)\n\t\t\t\t\tcsv += _newline;\n\t\t\t}\n\n\t\t\t// Then write out the data\n\t\t\tfor (var row = 0; row < data.length; row++)\n\t\t\t{\n\t\t\t\tvar maxCol = hasHeader ? fields.length : data[row].length;\n\n\t\t\t\tfor (var col = 0; col < maxCol; col++)\n\t\t\t\t{\n\t\t\t\t\tif (col > 0)\n\t\t\t\t\t\tcsv += _delimiter;\n\t\t\t\t\tvar colIdx = hasHeader && dataKeyedByField ? fields[col] : col;\n\t\t\t\t\tcsv += safe(data[row][colIdx], col);\n\t\t\t\t}\n\n\t\t\t\tif (row < data.length - 1)\n\t\t\t\t\tcsv += _newline;\n\t\t\t}\n\n\t\t\treturn csv;\n\t\t}", "function serialize(fields, data)\n\t\t{\n\t\t\tvar csv = '';\n\n\t\t\tif (typeof fields === 'string')\n\t\t\t\tfields = JSON.parse(fields);\n\t\t\tif (typeof data === 'string')\n\t\t\t\tdata = JSON.parse(data);\n\n\t\t\tvar hasHeader = fields instanceof Array && fields.length > 0;\n\t\t\tvar dataKeyedByField = !(data[0] instanceof Array);\n\n\t\t\t// If there a header row, write it first\n\t\t\tif (hasHeader && _writeHeader)\n\t\t\t{\n\t\t\t\tfor (var i = 0; i < fields.length; i++)\n\t\t\t\t{\n\t\t\t\t\tif (i > 0)\n\t\t\t\t\t\tcsv += _delimiter;\n\t\t\t\t\tcsv += safe(fields[i], i);\n\t\t\t\t}\n\t\t\t\tif (data.length > 0)\n\t\t\t\t\tcsv += _newline;\n\t\t\t}\n\n\t\t\t// Then write out the data\n\t\t\tfor (var row = 0; row < data.length; row++)\n\t\t\t{\n\t\t\t\tvar maxCol = hasHeader ? fields.length : data[row].length;\n\n\t\t\t\tfor (var col = 0; col < maxCol; col++)\n\t\t\t\t{\n\t\t\t\t\tif (col > 0)\n\t\t\t\t\t\tcsv += _delimiter;\n\t\t\t\t\tvar colIdx = hasHeader && dataKeyedByField ? fields[col] : col;\n\t\t\t\t\tcsv += safe(data[row][colIdx], col);\n\t\t\t\t}\n\n\t\t\t\tif (row < data.length - 1)\n\t\t\t\t\tcsv += _newline;\n\t\t\t}\n\n\t\t\treturn csv;\n\t\t}", "function serialize(fields, data)\n\t\t{\n\t\t\tvar csv = '';\n\n\t\t\tif (typeof fields === 'string')\n\t\t\t\tfields = JSON.parse(fields);\n\t\t\tif (typeof data === 'string')\n\t\t\t\tdata = JSON.parse(data);\n\n\t\t\tvar hasHeader = fields instanceof Array && fields.length > 0;\n\t\t\tvar dataKeyedByField = !(data[0] instanceof Array);\n\n\t\t\t// If there a header row, write it first\n\t\t\tif (hasHeader && _writeHeader)\n\t\t\t{\n\t\t\t\tfor (var i = 0; i < fields.length; i++)\n\t\t\t\t{\n\t\t\t\t\tif (i > 0)\n\t\t\t\t\t\tcsv += _delimiter;\n\t\t\t\t\tcsv += safe(fields[i], i);\n\t\t\t\t}\n\t\t\t\tif (data.length > 0)\n\t\t\t\t\tcsv += _newline;\n\t\t\t}\n\n\t\t\t// Then write out the data\n\t\t\tfor (var row = 0; row < data.length; row++)\n\t\t\t{\n\t\t\t\tvar maxCol = hasHeader ? fields.length : data[row].length;\n\n\t\t\t\tfor (var col = 0; col < maxCol; col++)\n\t\t\t\t{\n\t\t\t\t\tif (col > 0)\n\t\t\t\t\t\tcsv += _delimiter;\n\t\t\t\t\tvar colIdx = hasHeader && dataKeyedByField ? fields[col] : col;\n\t\t\t\t\tcsv += safe(data[row][colIdx], col);\n\t\t\t\t}\n\n\t\t\t\tif (row < data.length - 1)\n\t\t\t\t\tcsv += _newline;\n\t\t\t}\n\n\t\t\treturn csv;\n\t\t}", "function serialize(fields, data)\n\t\t{\n\t\t\tvar csv = '';\n\n\t\t\tif (typeof fields === 'string')\n\t\t\t\tfields = JSON.parse(fields);\n\t\t\tif (typeof data === 'string')\n\t\t\t\tdata = JSON.parse(data);\n\n\t\t\tvar hasHeader = fields instanceof Array && fields.length > 0;\n\t\t\tvar dataKeyedByField = !(data[0] instanceof Array);\n\n\t\t\t// If there a header row, write it first\n\t\t\tif (hasHeader && _writeHeader)\n\t\t\t{\n\t\t\t\tfor (var i = 0; i < fields.length; i++)\n\t\t\t\t{\n\t\t\t\t\tif (i > 0)\n\t\t\t\t\t\tcsv += _delimiter;\n\t\t\t\t\tcsv += safe(fields[i], i);\n\t\t\t\t}\n\t\t\t\tif (data.length > 0)\n\t\t\t\t\tcsv += _newline;\n\t\t\t}\n\n\t\t\t// Then write out the data\n\t\t\tfor (var row = 0; row < data.length; row++)\n\t\t\t{\n\t\t\t\tvar maxCol = hasHeader ? fields.length : data[row].length;\n\n\t\t\t\tfor (var col = 0; col < maxCol; col++)\n\t\t\t\t{\n\t\t\t\t\tif (col > 0)\n\t\t\t\t\t\tcsv += _delimiter;\n\t\t\t\t\tvar colIdx = hasHeader && dataKeyedByField ? fields[col] : col;\n\t\t\t\t\tcsv += safe(data[row][colIdx], col);\n\t\t\t\t}\n\n\t\t\t\tif (row < data.length - 1)\n\t\t\t\t\tcsv += _newline;\n\t\t\t}\n\n\t\t\treturn csv;\n\t\t}", "function serialize(fields, data)\n\t\t{\n\t\t\tvar csv = '';\n\n\t\t\tif (typeof fields === 'string')\n\t\t\t\tfields = JSON.parse(fields);\n\t\t\tif (typeof data === 'string')\n\t\t\t\tdata = JSON.parse(data);\n\n\t\t\tvar hasHeader = fields instanceof Array && fields.length > 0;\n\t\t\tvar dataKeyedByField = !(data[0] instanceof Array);\n\n\t\t\t// If there a header row, write it first\n\t\t\tif (hasHeader && _writeHeader)\n\t\t\t{\n\t\t\t\tfor (var i = 0; i < fields.length; i++)\n\t\t\t\t{\n\t\t\t\t\tif (i > 0)\n\t\t\t\t\t\tcsv += _delimiter;\n\t\t\t\t\tcsv += safe(fields[i], i);\n\t\t\t\t}\n\t\t\t\tif (data.length > 0)\n\t\t\t\t\tcsv += _newline;\n\t\t\t}\n\n\t\t\t// Then write out the data\n\t\t\tfor (var row = 0; row < data.length; row++)\n\t\t\t{\n\t\t\t\tvar maxCol = hasHeader ? fields.length : data[row].length;\n\n\t\t\t\tfor (var col = 0; col < maxCol; col++)\n\t\t\t\t{\n\t\t\t\t\tif (col > 0)\n\t\t\t\t\t\tcsv += _delimiter;\n\t\t\t\t\tvar colIdx = hasHeader && dataKeyedByField ? fields[col] : col;\n\t\t\t\t\tcsv += safe(data[row][colIdx], col);\n\t\t\t\t}\n\n\t\t\t\tif (row < data.length - 1)\n\t\t\t\t\tcsv += _newline;\n\t\t\t}\n\n\t\t\treturn csv;\n\t\t}", "function serialize(fields, data, skipEmptyLines) {\n var csv = '';\n\n if (typeof fields === 'string') fields = JSON.parse(fields);\n if (typeof data === 'string') data = JSON.parse(data);\n\n var hasHeader = Array.isArray(fields) && fields.length > 0;\n var dataKeyedByField = !Array.isArray(data[0]);\n\n // If there a header row, write it first\n if (hasHeader && _writeHeader) {\n for (var i = 0; i < fields.length; i++) {\n if (i > 0) csv += _delimiter;\n csv += safe(fields[i], i);\n }\n if (data.length > 0) csv += _newline;\n }\n\n // Then write out the data\n for (var row = 0; row < data.length; row++) {\n var maxCol = hasHeader ? fields.length : data[row].length;\n\n var emptyLine = false;\n var nullLine = hasHeader ? Object.keys(data[row]).length === 0 : data[row].length === 0;\n if (skipEmptyLines && !hasHeader) {\n emptyLine =\n skipEmptyLines === 'greedy'\n ? data[row].join('').trim() === ''\n : data[row].length === 1 && data[row][0].length === 0;\n }\n if (skipEmptyLines === 'greedy' && hasHeader) {\n var line = [];\n for (var c = 0; c < maxCol; c++) {\n var cx = dataKeyedByField ? fields[c] : c;\n line.push(data[row][cx]);\n }\n emptyLine = line.join('').trim() === '';\n }\n if (!emptyLine) {\n for (var col = 0; col < maxCol; col++) {\n if (col > 0 && !nullLine) csv += _delimiter;\n var colIdx = hasHeader && dataKeyedByField ? fields[col] : col;\n csv += safe(data[row][colIdx], col);\n }\n if (row < data.length - 1 && (!skipEmptyLines || (maxCol > 0 && !nullLine))) {\n csv += _newline;\n }\n }\n }\n return csv;\n }", "function csvToMulti(CSV, sep, addFieldName, addFieldNameSep, addLineAfterField, addXSpaces, noMultiLines, bQuotes, csvFormat, nullIsNull) {\r\n var j = 0, k, col;\r\n var hdr;\r\n var s = \"\";\r\n var a = [];\r\n var x = 0;\r\n var v = \"\";\r\n var fheader = \"\";\r\n\r\n addXSpaces = addXSpaces || \"0\";\r\n if (isNaN(\"0\" + addXSpaces)) addXSpaces = \"0\";\r\n a = getFldPosArr(CSV);\r\n if(!CSV){return;}\r\n addFieldNameSep = addFieldNameSep || '';\r\n if (CSV.table.length === 0) return s;\r\n hdr = getCsvHeader(CSV);\r\n for (j = 0; j < CSV.table.length; j++) // each row\r\n {\r\n\r\n for (x = 0; x < a.length; x++) {\r\n fheader = \"\";\r\n k = a[x] - 1;\r\n if (k >= CSV.table[j].length) {\r\n v = \"\";\r\n }\r\n else {\r\n v = CSV.table[j][k] + \"\";\r\n if (v && noMultiLines) v = v.replace(/\\r\\n|\\r|\\n/g, ' ');\r\n }\r\n if (v && nullIsNull) v = v.replace(/^null$/gmi, '');\r\n v = doTransformations(v, k, CSV);\r\n if (csvFormat) {\r\n v = v.toCsv(sep, CSV.outputQuote, CSV.outputQuote, bQuotes);\r\n }\r\n\r\n if (addFieldName) {\r\n if (csvFormat) {\r\n if (k >= CSV.arHeaderRow.length) {\r\n fheader = (\"\".rpad(addXSpaces) + \"Field-\" + (k + 1)).toCsv(sep, CSV.outputQuote, CSV.outputQuote, bQuotes) + addFieldNameSep;\r\n }\r\n else {\r\n fheader = (\"\".rpad(addXSpaces) + CSV.arHeaderRow[k].replace(/\\r\\n|\\r|\\n/g, ' ')).toCsv(sep, CSV.outputQuote, CSV.outputQuote, bQuotes) + addFieldNameSep;\r\n }\r\n }\r\n else {\r\n if (k >= CSV.arHeaderRow.length) {\r\n fheader = \"\".rpad(addXSpaces) + \"Field-\" + (k + 1) + addFieldNameSep;\r\n }\r\n else {\r\n fheader = \"\".rpad(addXSpaces) + CSV.arHeaderRow[k].replace(/\\r\\n|\\r|\\n/g, ' ') + addFieldNameSep;\r\n }\r\n }\r\n }\r\n s += fheader + v + \"\\n\";\r\n if (addLineAfterField) s += \"\\n\";\r\n }\r\n if (!csvFormat) s += sep + \"\\n\";\r\n }\r\n return s;\r\n}", "function serialize(fields, data, skipEmptyLines)\n\t\t\t{\n\t\t\t\tvar csv = '';\n\n\t\t\t\tif (typeof fields === 'string')\n\t\t\t\t\tfields = JSON.parse(fields);\n\t\t\t\tif (typeof data === 'string')\n\t\t\t\t\tdata = JSON.parse(data);\n\n\t\t\t\tvar hasHeader = Array.isArray(fields) && fields.length > 0;\n\t\t\t\tvar dataKeyedByField = !(Array.isArray(data[0]));\n\n\t\t\t\t// If there a header row, write it first\n\t\t\t\tif (hasHeader && _writeHeader)\n\t\t\t\t{\n\t\t\t\t\tfor (var i = 0; i < fields.length; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (i > 0)\n\t\t\t\t\t\t\tcsv += _delimiter;\n\t\t\t\t\t\tcsv += safe(fields[i], i);\n\t\t\t\t\t}\n\t\t\t\t\tif (data.length > 0)\n\t\t\t\t\t\tcsv += _newline;\n\t\t\t\t}\n\n\t\t\t\t// Then write out the data\n\t\t\t\tfor (var row = 0; row < data.length; row++)\n\t\t\t\t{\n\t\t\t\t\tvar maxCol = hasHeader ? fields.length : data[row].length;\n\n\t\t\t\t\tvar emptyLine = false;\n\t\t\t\t\tvar nullLine = hasHeader ? Object.keys(data[row]).length === 0 : data[row].length === 0;\n\t\t\t\t\tif (skipEmptyLines && !hasHeader)\n\t\t\t\t\t{\n\t\t\t\t\t\temptyLine = skipEmptyLines === 'greedy' ? data[row].join('').trim() === '' : data[row].length === 1 && data[row][0].length === 0;\n\t\t\t\t\t}\n\t\t\t\t\tif (skipEmptyLines === 'greedy' && hasHeader) {\n\t\t\t\t\t\tvar line = [];\n\t\t\t\t\t\tfor (var c = 0; c < maxCol; c++) {\n\t\t\t\t\t\t\tvar cx = dataKeyedByField ? fields[c] : c;\n\t\t\t\t\t\t\tline.push(data[row][cx]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\temptyLine = line.join('').trim() === '';\n\t\t\t\t\t}\n\t\t\t\t\tif (!emptyLine)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (var col = 0; col < maxCol; col++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (col > 0 && !nullLine)\n\t\t\t\t\t\t\t\tcsv += _delimiter;\n\t\t\t\t\t\t\tvar colIdx = hasHeader && dataKeyedByField ? fields[col] : col;\n\t\t\t\t\t\t\tcsv += safe(data[row][colIdx], col);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (row < data.length - 1 && (!skipEmptyLines || (maxCol > 0 && !nullLine)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcsv += _newline;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn csv;\n\t\t\t}", "function reformatData(response,request, requestedFields) {\n console.log(\"In reformat data method\");\n \n //do not parse\n var formattedData = [];\n \n for(var i = 0; i < response.length; i++){\n var row = {'values': []};\n for(var m = 0; m < requestedFields.length; m++){\n var field = requestedFields[m];\n row.values.push(response[i][field]);\n }\n formattedData.push(row);\n }\n \n console.log(\"formattedData: \" + JSON.stringify(formattedData));\n \n \n \n return formattedData;\n}", "function format_users() {\n\tvar users_fields = [];\n\tusers_data.forEach(function (user) {\n\t\tvar fields = [];\n\t\tfields.push(user.email);\n\t\tfields.push(user.user_name);\n\t\tfields.push(user.name.first);\n\t\tfields.push(user.name.last);\n\t\tfields.push(\"u of t\");\t\t//university\n\t\tfields.push(\"CS\");\t\t// departmnet\n\t\tfields.push(user.password);\n\t\tfields.push(user.phone);\n\n \t// console.log(fields);\n\t\tusers_fields.push(fields);\n\t});\n\n\treturn users_fields;\n}", "parseData(data) {\n // Taken from https://gist.github.com/Jezternz/c8e9fafc2c114e079829974e3764db75\n const re = /(,|\\r?\\n|\\r|^)(?:\"([^\"]*(?:\"\"[^\"]*)*)\"|([^,\\r\\n]*))/gi;\n const result = [[]];\n let matches;\n\n while ((matches = re.exec(data))) {\n if (matches[1].length && matches[1] !== ',') result.push([])\n result[result.length - 1].push(\n matches[2] !== undefined ? matches[2].replace(/\"\"/g, '\"') : matches[3]\n )\n }\n\n result.pop(); // Delete last element, which is an empty row\n this.transformToObject(result);\n }", "function listSelectField(objSource) {\r\n var oSource = objSource;\r\n var strFields = \"\";\r\n var len = oSource.length;\r\n for (i = 0; i < len; i++) {\r\n if (oSource.item(i).selected == true) {\r\n value = oSource.item(i).value;\r\n text = oSource.item(i).text; \r\n strFields = strFields + text + \",\";\r\n }\r\n }\r\n if(strFields != \"\") {\r\n strFields = strFields.substring(0,strFields.length - 1);\r\n } \r\n return strFields\r\n}", "function transformToArray(inputData) {\n return inputData.replace(/(?:\\r\\n|\\r|\\n)/g, ',').replace(/ /g,'').split(',');\n }", "function wrapFields(fields) {\n return [{\"Field\": fields}];\n}", "function convertArrayOfObjectsToCSV(args) {\n var result, ctr, keys, columnDelimiter, lineDelimiter, data;\n data = args.data || null;\n if (data == null || !data.length) {\n return null;\n }\n columnDelimiter = args.columnDelimiter || ',';\n lineDelimiter = args.lineDelimiter || '\\n';\n keys = Object.keys(data[0]);\n result = '';\n result += keys.join(columnDelimiter);\n result += lineDelimiter;\n data.forEach(function (item) {\n ctr = 0;\n keys.forEach(function (key) {\n if (ctr > 0) result += columnDelimiter;\n\n result += item[key];\n ctr++;\n });\n result += lineDelimiter;\n });\n return result;\n }", "function mergeToStringUsingFor(elements, delimiter = ',') {\n\n}", "function splitFields(row) {\n return row.replace(/\"(.*)\"/, \"$1\").split('\",\"');\n}", "_fields2request(includeEmpty) {\n let result = [];\n\n for (const name of this.uniqueFieldNames) {\n var newName = name;\n\n // send clonables as list (even if there's only one field) and other fields as plain values\n let potentialClones = this.fields.filter(f =>\n f.name === name && (typeof f.value !== 'undefined') && (f.value !== \"\" || includeEmpty)\n );\n\n if (potentialClones.length === 0) continue;\n\n // encode ArrayBuffer as Base64 and change field name as a flag\n let encodeValue = (val) => {\n if (val instanceof ArrayBuffer) {\n newName = `_encoded_base64_${name}`;\n return btoa(String.fromCharCode(...new Uint8Array(val)));\n }\n else {\n return val;\n }\n };\n\n let value = potentialClones[0].clonable\n ? potentialClones.map(c => encodeValue(c.value)) // array for clonable fields\n : encodeValue(potentialClones[0].value) // or plain value otherwise\n // setting 'result' must be separate step as encodeValue() modifies 'newName'\n result[newName] = value;\n\n debug(`${name} = ${ potentialClones[0].clonable ? `[${result[newName]}]` : `\"${result[newName]}\"` }`);\n }\n return result;\n }", "function getList(objSource) {\r\n var oSource = objSource;\r\n var strFields = \"\";\r\n var len = oSource.length;\r\n for (i = 0; i < len; i++) {\r\n text = oSource.item(i).text; \r\n strFields = strFields + text + \",\";\r\n }\r\n if(strFields != \"\") {\r\n strFields = strFields.substring(0,strFields.length - 1);\r\n } \r\n return strFields\r\n}", "function convertArrayOfObjectsToCSV(args) {\n var result, ctr, keys, columnDelimiter, lineDelimiter, data;\n\n data = args.data || null;\n if (data == null || !data.length) {\n return null;\n }\n\n columnDelimiter = args.columnDelimiter || ';';\n lineDelimiter = args.lineDelimiter || '\\n';\n\n keys = Object.keys(data[0]);\n\n result = '';\n result += keys.join(columnDelimiter);\n result += lineDelimiter;\n\n data.forEach(function(item) {\n ctr = 0;\n keys.forEach(function(key) {\n if (ctr > 0) result += columnDelimiter;\n\n result += item[key];\n ctr++;\n });\n result += lineDelimiter;\n });\n\n return result;\n}", "function populateDataFields() {}", "function parseCSV(data) {\n\tvar allTextLines = [];\n\tvar fldHeading = [];\n\t// var fldData = [];\n\tvar i = null;\n\tvar x = 0;\n\n\tallTextLines = data.split(/\\r\\n|\\n/);\n\tfldHeading = allTextLines[0].split(',');\n\tconsole.log(fldHeading);\n\n\tfor (i = allTextLines.length - 1; i > 0; i--) {\n\t\tnflQBs[x] = allTextLines[i].split(',');\n\t\tx++;\n\t}\n\tconsole.log(nflQBs);\n\talertify.success(\"Data has been parsed.\");\n}", "function field_list_of_fixed_values(data,editable,config) {\n\tif (data == null) data = [];\n\ttyped_field_multiple.call(this, data, editable, config);\n}", "constructor(fields, data = {}) {\n fields.forEach((fieldDefinition) => {\n if (typeof fieldDefinition === \"string\") {\n this[fieldDefinition] = this.convertSimpleField(\n data[fieldDefinition],\n null\n );\n } else {\n // fieldDefinition must be an object\n let fieldName = fieldDefinition.name;\n let fieldType = fieldDefinition.type;\n let fieldIsList =\n typeof fieldDefinition.list !== \"undefined\"\n ? fieldDefinition.list\n : false;\n let fieldDefault =\n typeof fieldDefinition.default !== \"undefined\"\n ? this.getDefaultValue(fieldDefinition.default)\n : null;\n let fieldValue = data[fieldName];\n if (fieldIsList) {\n this[fieldName] = fieldValue\n ? fieldValue.map((item) =>\n this.convertField(fieldType, item, fieldDefault)\n )\n : fieldDefault;\n } else {\n this[fieldName] = this.convertField(\n fieldType,\n fieldValue,\n fieldDefault\n );\n }\n }\n });\n }", "function addCommaToField(element, item) {\n element.value = element.value + ', '\n}", "function normalizeDataItem(data,fieldName)\n{\n var returnArray = []; // empty array returned for no field or null value\n\n // make sure the target field exists and is non-null\n\n if(data.hasOwnProperty(fieldName) && data[fieldName] !== null) {\n\n\t// check to see if it is an object (multiple values)\n\t// (normally you'd need to check for null, because null also has typeof 'object'\n\t// but we already checked for null above)\n\t\n\tif(typeof data[fieldName] === 'object') {\n\t for(var prop in data[fieldName]) {\n\t\tif(data[fieldName].hasOwnProperty(prop)) {\n\t\t returnArray.push(data[fieldName][prop]);\n\t\t}\n\t }\n\t} else {\n\t returnArray.push(data[fieldName]); \t // single value\n\t}\n }\n return(returnArray);\n}", "function parseCSV(data) {\r\n\r\n let records = data.split('\\n'); //create array based on each line\r\n let results = [];\r\n\r\n for (let record of records) {\r\n results.push(record.split(',')); //create second level of array based on commas\r\n }\r\n\r\n let headers = results[0]; //get headers from first record (line)\r\n results.splice(0, 1); //remove headers line from results array\r\n\r\n let dataResult = [];\r\n let header1 = headers[0];\r\n let header2 = headers[1];\r\n header2 = header2.split(\" \");\r\n header2 = header2[0] + capitalize(header2[1]); //make it without spaces and camel case\r\n let header3 = headers[2];\r\n header3 = header3.split(\" \");\r\n header3 = header3[0] + capitalize(header3[1]); //make it without spaces and camel case\r\n let header4 = headers[3];\r\n\r\n\r\n for(let record of results) {\r\n let decorator = {}; //create an object for each record\r\n\r\n for(let field of record) {\r\n if(record.indexOf(field) === 0) { //get the header of each field and attach as a property to the values\r\n decorator[header1] = field; //assign value to each property according to headers given\r\n } else if(record.indexOf(field) === 1) {\r\n decorator[header2] = field;\r\n } else if(record.indexOf(field) === 2) {\r\n decorator[header3] = field;\r\n } else {\r\n decorator[header4] = field;\r\n }\r\n }\r\n dataResult.push(decorator);\r\n }\r\n return dataResult;\r\n}", "function pluckData(fields, data) {\n var newData = {};\n $.each(fields, function(i, field) {\n newData[field] = data[field];\n });\n return newData;\n}", "function processCSVData(data) {\r\n const headers = data.slice(0, data.indexOf(\"\\n\")).split(\",\");\r\n const rows = data.slice(data.indexOf(\"\\n\") + 1).split(\"\\n\");\r\n\r\n const array = rows.map((row) => {\r\n const values = row.split(\",\");\r\n const object = headers.reduce((obj, header, i) => {\r\n obj[header] = values[i];\r\n return obj;\r\n }, {});\r\n return object;\r\n });\r\n\r\n setCSVArray(array);\r\n }", "function arrangeData(data, callback) {\n var values = data.values;\n\n var fields = values.shift().map(function (field) {\n field = field.split(' ').join('_');\n field = field.replace(/[&\\/\\\\#,+()$~%.'\":*?<>\\{\\}]/g, '');\n field = field.substring(0, 60);\n return field;\n });\n fields = appendIndexes(fields, 30);\n callback(null, fields, values);\n}", "function printArrayFieldHelpers(prefix, fields) {\r\n return fields.filter(p => !p.isDuplicate && !p.emit && isArrayType(p.type)).map(p => {\r\n return prefix \r\n + templates.arrayFieldHelper\r\n .replace(\"[NAME]\", stringToUnionCase(p.name))\r\n .replace(\"[NAME_FOR_ARRAY]\", stringToUnionCase(p.name + \"A\"))\r\n .replace(\"[TYPE]\", escape(p.type))\r\n .replace(\"[ITEM_TYPE]\", escape(getArrayItemType(p.type)))\r\n .replace(\"[COMMENT]\", p.parentName ? (\"// \" + p.parentName) : \"\");\r\n }).filter(x => x.trim().length > 0).join(\"\\n\");\r\n}", "function formatFields(jsonArray) {\n var returnArray = [];\n jsonArray.forEach(function (tweet) {\n if (!Array.isArray(tweet.following)) {\n tweet.following = tweet.following.split(',');\n }\n if (!Array.isArray(tweet.coordinates)) {\n tweet.coordinates = tweet.coordinates.split(',');\n }\n if (!Array.isArray(tweet.hashtags)) {\n tweet.hashtags = tweet.hashtags.split(',');\n }\n returnArray.push(tweet)\n })\n return jsonArray\n }", "function removeComma(fld) {\r\n\tvar val = \"\";\r\n\tfor (i=0; i<fld.length ; i++) {\r\n\t\tif(fld.charAt(i) == \",\"){\r\n\t\t\tcontinue\r\n \t}\r\n\t\telse{\r\n\t\t\tval = val + fld.charAt(i)\r\n\t\t}\r\n\t}\r\n\treturn val;\r\n}", "function CSVToArray( strData, strDelimiter ){\n // Check to see if the delimiter is defined. If not,\n // then default to comma.\n sys.debug(\"Hitting CSVToArray with Data: \"+strData.substring(0,200)+\"...\")\n strDelimiter = (strDelimiter || \",\");\n\n // Create a regular expression to parse the CSV values.\n var objPattern = new RegExp(\n (\n // Delimiters.\n \"(\\\\\" + strDelimiter + \"|\\\\r?\\\\n|\\\\r|^)\" +\n\n // Quoted fields.\n \"(?:\\\"([^\\\"]*(?:\\\"\\\"[^\\\"]*)*)\\\"|\" +\n\n // Standard fields.\n \"([^\\\"\\\\\" + strDelimiter + \"\\\\r\\\\n]*))\"\n ),\n \"gi\"\n );\n\n\n // Create an array to hold our data. Give the array\n // a default empty first row.\n var arrData = [[]];\n\n // Create an array to hold our individual pattern\n // matching groups.\n var arrMatches = null;\n\n\n // Keep looping over the regular expression matches\n // until we can no longer find a match.\n while (arrMatches = objPattern.exec( strData )){\n\n // Get the delimiter that was found.\n var strMatchedDelimiter = arrMatches[ 1 ];\n\n // Check to see if the given delimiter has a length\n // (is not the start of string) and if it matches\n // field delimiter. If id does not, then we know\n // that this delimiter is a row delimiter.\n if (\n strMatchedDelimiter.length &&\n (strMatchedDelimiter != strDelimiter)\n ){\n\n // Since we have reached a new row of data,\n // add an empty row to our data array.\n arrData.push( [] );\n\n }\n\n\n // Now that we have our delimiter out of the way,\n // let's check to see which kind of value we\n // captured (quoted or unquoted).\n if (arrMatches[ 2 ]){\n\n // We found a quoted value. When we capture\n // this value, unescape any double quotes.\n var strMatchedValue = arrMatches[ 2 ].replace(\n new RegExp( \"\\\"\\\"\", \"g\" ),\n \"\\\"\"\n );\n\n } else {\n\n // We found a non-quoted value.\n var strMatchedValue = arrMatches[ 3 ];\n\n }\n\n\n // Now that we have our value string, let's add\n // it to the data array.\n arrData[ arrData.length - 1 ].push( strMatchedValue );\n }\n\n // Return the parsed data.\n return( arrData );\n}", "function join() {\n for (var _len = arguments.length, fields = Array(_len), _key = 0; _key < _len; _key++) {\n fields[_key] = arguments[_key];\n }\n\n return fields.join(' ');\n}", "function fixedToCsv(input, fieldDef, delimiter, bIncludeHeaders, bQuotes, nowrap, notrim) {\r\n var fa = fieldDef.split('|') || []; // the field definition array pos,length,heading\r\n var str = '';\r\n var line = '';\r\n var fld = [];\r\n var header = \"\";\r\n var array = input.split(/\\n|\\r|\\r\\n/gmi); // each input line\r\n var i, j;\r\n\r\n if (array[array.length - 1] == \"\") array.pop();\r\n\r\n if (bIncludeHeaders) {\r\n for (i = 0; i < fa.length; i++) {\r\n fld = fa[i].split(',');\r\n if (fld.length > 2) header = fld[2]; else header = \"F\" + (i + 1);\r\n if (bQuotes) {\r\n str += '\"' + header.replace(/\"/g, '\"\"') + '\"' + delimiter;\r\n }\r\n else {\r\n str += header.toCsv(delimiter, '\"') + delimiter;\r\n }\r\n }\r\n str = str.slice(0, -1 * delimiter.length) + \"\\n\";\r\n } // include csv header\r\n var p = 0;\r\n var len = 0;\r\n var head = \"\";\r\n for (i = 0; i < array.length; i++) { // each line\r\n line = \"\";\r\n if (array[i] == \"\") continue;\r\n for (j = 0; j < fa.length; j++) {\r\n fld = fa[j].split(',') || [];\r\n if (fld.length > 0) p = fld[0] - 1; else p = 0;\r\n if (fld.length > 1) len = fld[1]; else len = 0;\r\n if (fld.length > 2) head = fld[2]; else head = \"f\" + (j + 1);\r\n //if (bQuotes) line += '\"' + value.replace(/\"/g, '\"\"') + '\"' + delimiter;\r\n if (notrim) value = array[i].substr(p, len); else value = array[i].substr(p, len).trim();\r\n if (value == null) value = \"\"; else value += \"\";\r\n if (bQuotes) {\r\n line += '\"' + (\"\" + value).replace(/\"/g, '\"\"') + '\"' + delimiter;\r\n }\r\n else if (nowrap) {\r\n line += (\"\" + value) + delimiter;\r\n }\r\n else {\r\n line += (\"\" + value).toCsv(delimiter, '\"') + delimiter;\r\n }\r\n }\r\n line = line.slice(0, -1 * delimiter.length); // remove the last delimiter\r\n str += line + '\\n';\r\n }\r\n return str;\r\n}", "function calcMetaDataField_flatten(data,params,field)\n{\n var retArray = [];\n\n if(!field.hasOwnProperty('target')) {\n\tconsole.log('flatten in field ' + field.name + ' missing target (empty array returned)');\n } else {\n\n\t// if target exists, it will be an array of targets (at least one)\n\tfor(var i=0; i < field.target.length; i++) {\n\n\t let item = normalizeDataItem(data,field.target[i]); \t// item is normalized into array of values\n\t // for the given field (may be zero length)\n\t if(item.length != 0) {\n\t\tfor(var j=0; j < item.length; j++) {\n\n\t\t // flatten is often used for higher-level metadata, where the fields\n\t\t // of lower-levels are combined into an array by this machinery.\n\t\t // In this case, we can arrays of arrays for things like events,\n\t\t // or arrays of arrays of objects for things like imagemap points.\n\n\t\t if(Array.isArray(item[j])) { // flatten FIRST array level if it exists\n\t\t\tfor(var k=0; k < item[j].length; k++) {\n\t\t\t retArray.push(item[j][k]);\n\t\t\t}\n\t\t } else {\n\t\t\tretArray.push(item[j]); // otherwise, just use the current item\n\t\t }\n\t\t}\n\t }\n\t}\n }\n \n return(retArray);\n}", "function fn(input, data) {\n data = data.data;\n\n // if there was no private data passed into the helper, no metadata\n // was created, so just return the input\n if (!data) {\n return input + '\\n';\n }\n\n return input + ',' + data.first + ',' + data.rowEnd + ',' + data.rowStart + ',' +\n data.last + ',' + data.even + ',' + data.odd + '\\n';\n }", "function csv(array){\n\n // this is not a world class csv generator\n return array.map(function(item){\n return typeof(item) === 'string' ? \n item.replace(/[\\\",]/g,'') :\n item;\n }).join(',')\n}", "stringify(chunk) {\n var column, columns, containsEscape, containsQuote, containsRowDelimiter, containsdelimiter, csvrecord, delimiter, err, escape, field, header, i, j, l, len, m, options, quote, quoted, quotedMatch, quotedString, quoted_empty, quoted_match, quoted_string, record, record_delimiter, ref, ref1, regexp, shouldQuote, value;\n if (typeof chunk !== 'object') {\n return chunk;\n }\n ({columns, header} = this.options);\n record = [];\n // Record is an array\n if (Array.isArray(chunk)) {\n if (columns) {\n // We are getting an array but the user has specified output columns. In\n // this case, we respect the columns indexes\n chunk.splice(columns.length);\n }\n// Cast record elements\n for (i = j = 0, len = chunk.length; j < len; i = ++j) {\n field = chunk[i];\n [err, value] = this.__cast(field, {\n index: i,\n column: i,\n records: this.info.records,\n header: header && this.info.records === 0\n });\n if (err) {\n this.emit('error', err);\n return;\n }\n record[i] = [value, field];\n }\n } else {\n // Record is a literal object\n if (columns) {\n for (i = l = 0, ref = columns.length; (0 <= ref ? l < ref : l > ref); i = 0 <= ref ? ++l : --l) {\n field = get(chunk, columns[i].key);\n [err, value] = this.__cast(field, {\n index: i,\n column: columns[i].key,\n records: this.info.records,\n header: header && this.info.records === 0\n });\n if (err) {\n this.emit('error', err);\n return;\n }\n record[i] = [value, field];\n }\n } else {\n for (column in chunk) {\n field = chunk[column];\n [err, value] = this.__cast(field, {\n index: i,\n column: columns[i].key,\n records: this.info.records,\n header: header && this.info.records === 0\n });\n if (err) {\n this.emit('error', err);\n return;\n }\n record.push([value, field]);\n }\n }\n }\n csvrecord = '';\n for (i = m = 0, ref1 = record.length; (0 <= ref1 ? m < ref1 : m > ref1); i = 0 <= ref1 ? ++m : --m) {\n [value, field] = record[i];\n if (typeof value === 'string') {\n options = this.options;\n } else if (isObject(value)) {\n ({value, ...options} = value);\n if (!(typeof value === 'string' || value === void 0 || value === null)) {\n this.emit('error', Error(`Invalid Casting Value: returned value must return a string, null or undefined, got ${JSON.stringify(value)}`));\n return;\n }\n options = {...this.options, ...options};\n } else if (value === void 0 || value === null) {\n options = this.options;\n } else {\n this.emit('error', Error(`Invalid Casting Value: returned value must return a string, an object, null or undefined, got ${JSON.stringify(value)}`));\n return;\n }\n ({delimiter, escape, quote, quoted, quoted_empty, quoted_string, quoted_match, record_delimiter} = options);\n if (value) {\n if (typeof value !== 'string') {\n this.emit('error', Error(`Formatter must return a string, null or undefined, got ${JSON.stringify(value)}`));\n return null;\n }\n containsdelimiter = delimiter.length && value.indexOf(delimiter) >= 0;\n containsQuote = (quote !== '') && value.indexOf(quote) >= 0;\n containsEscape = value.indexOf(escape) >= 0 && (escape !== quote);\n containsRowDelimiter = value.indexOf(record_delimiter) >= 0;\n quotedString = quoted_string && typeof field === 'string';\n quotedMatch = quoted_match && typeof field === 'string' && quoted_match.filter(function(quoted_match) {\n if (typeof quoted_match === 'string') {\n return value.indexOf(quoted_match) !== -1;\n } else {\n return quoted_match.test(value);\n }\n });\n quotedMatch = quotedMatch && quotedMatch.length > 0;\n shouldQuote = containsQuote || containsdelimiter || containsRowDelimiter || quoted || quotedString || quotedMatch;\n if (shouldQuote && containsEscape) {\n regexp = escape === '\\\\' ? new RegExp(escape + escape, 'g') : new RegExp(escape, 'g');\n value = value.replace(regexp, escape + escape);\n }\n if (containsQuote) {\n regexp = new RegExp(quote, 'g');\n value = value.replace(regexp, escape + quote);\n }\n if (shouldQuote) {\n value = quote + value + quote;\n }\n csvrecord += value;\n } else if (quoted_empty || ((quoted_empty == null) && field === '' && quoted_string)) {\n csvrecord += quote + quote;\n }\n if (i !== record.length - 1) {\n csvrecord += delimiter;\n }\n }\n return csvrecord;\n }", "function getBulkData(){\n //Get value\n var value = $('input[type=\"hidden\"][name=\"bulk_subject\"]').val();\n var needsToBeCleaned = [\"[\",\"]\",\"\\\"\"];\n for (var i = 0; i < needsToBeCleaned.length; i ++){\n needsToBeCleaned = str_replace(needsToBeCleaned[i],'',value);\n }\n console.log(needsToBeCleaned.toString());\n return needsToBeCleaned.split(',');\n}", "function formatData(items) {\n\n const tempItem = items.map((item) => {\n\n const id = item.sys.id;\n\n const images = item.fields.images.map((image) => { return image.fields.file.url });\n\n const room = { ...item.fields, images, id };\n\n return room;\n\n });\n\n return tempItem;\n\n }", "function CSVtoArray(text) {\n\t\t\t\ttext = text\n\t\t\t\t\t.substring(1, text.length - 2)\n\t\t\t\t\t.replace(/^\"/, '')\n\t\t\t\t\t.replace(/\",$/, '')\n\t\t\t\t//\t.replace(/\"0\"/, null)\n\t\t\t\t\t.split('\",\"');\n\t\t\t\treturn text;\n\t\t\t}", "function checkMultipleFields( recordData, fields, position ) {\n for( var i in fields ) {\n if( recordData[fields[i]] ) {\n var val = getCleanCellValue( recordData[fields[i]], position );\n if( val ) {\n return val;\n }\n }\n }\n return '';\n }", "function pluck(array, fieldName) {\r\n var result = [];\r\n if (fieldName == \"nombre\") {\r\n array.forEach((array) => {\r\n result.push(\" \\\"\" + array.nombre + \"\\\"\");\r\n });\r\n } else if(fieldName == \"edad\") {\r\n array.forEach((array) => {\r\n result.push(\" \" + array.edad);\r\n });\r\n }\r\n console.log(result.toString());\r\n}", "toListString(arr) {\n\t\tif (!arr.length) return '';\n\t\tif (arr.length === 1) return arr[0];\n\t\tif (arr.length === 2) return `${arr[0]} and ${arr[1]}`;\n\t\treturn `${arr.slice(0, -1).join(\", \")}, and ${arr.slice(-1)[0]}`;\n\t}", "buildSelect(fields) {\n return fields && fields.length ?\n fields.join(',') :\n null;\n }", "makeCSV(content) {\n let csv = \"\";\n content.forEach((value) => {\n value.forEach((item, i) => {\n let innerValue = item === null ? \"\" : item.toString();\n let result = innerValue.replace(/\"/g, '\"\"');\n if (result.search(/(\"|,|\\n)/g) >= 0) {\n result = '\"' + result + '\"';\n }\n if (i > 0) {\n csv += \",\";\n }\n csv += result;\n });\n csv += \"\\n\";\n });\n return csv;\n }", "function stringifyArray(input){\n return input.join(',');\n}", "function arrayFormatter(list) {\n let out = [];\n for (let i = 0; i < list.length; i++) {\n if (i === list.length-2 && list.length > 1) {\n out.push(list[i]);\n out.push('and');\n out.push(list[i+1]);\n break;\n } else if (list.length > 1){\n out.push(list[i]+',');\n } else {\n out.push(list[i]);\n }\n }\n return(out.join(' '));\n }", "function parseResponseToFields(data, fieldContainer, wrapAround)\n{\t\n\twrapAround = wrapAround || {};\n\tif (data == null)\n\t\treturn;\n\tfieldContainer = $(fieldContainer);\n\t$.each(data, function(fieldName, fieldValue)\n\t{\t\n\t\tvar cell = fieldContainer.find(\".\" + fieldName).empty();\n\n\t\tif (!fieldValue)\n\t\t\treturn;\n\t\tif (fieldValue.constructor != Array)\n\t\t\tfieldValue = [fieldValue];\n\t\t\t\n\t\t$.each(fieldValue, function(index, value)\n\t\t{\n\t\t\tif (wrapAround[fieldName])\t//a WrapAround was provided! We expect HTML \n\t\t\t{\n\t\t\t\t\tcell.append($(wrapAround[fieldName]).text(value));\n\t\t\t}\n\t\t\telse //Simple text only\n\t\t\t{\n\t\t\t\tcell.text(value);\t\n\t\t\t}\t\t\n\t\t})\n\t})\n\n}", "function csvToJSONArray(CSV, options) {\r\n var j = 0, k, col;\r\n var hdr;\r\n var s = \"[\\n\";\r\n var a = [];\r\n var x = 0;\r\n var v = \"\";\r\n var h = \"\";\r\n var t = \"{\\n\";\r\n var emptyIsNull = false;\r\n\r\n if(!CSV){return;}\r\n a = getFldPosArr(CSV);\r\n if (CSV.table.length === 0) return s + \"]\";\r\n hdr = getCsvHeader(CSV);\r\n if (options.useFieldsData) {\r\n t += \" \\\"\" + (options.fldPropName || \"fields\") + \"\\\": [\";\r\n for (x = 0; x < a.length; x++) { // for each header\r\n k = a[x] - 1;\r\n if (k >= hdr.length) h = \"FIELD\" + k;\r\n else h = hdr[k];\r\n if (x > 0) t += \", \";\r\n t += h.enclose('\"');\r\n }\r\n t += \"],\\n\";\r\n t += \" \\\"\" + (options.dataPropName || \"data\") + \"\\\": \";\r\n }\r\n for (j = 0; j < CSV.table.length; j++) // for each record\r\n {\r\n if (a.length > 1) {\r\n s += \" [\";\r\n }\r\n for (x = 0; x < a.length; x++) { // for each field\r\n k = a[x] - 1;\r\n emptyIsNull = document.getElementById(\"chknull\" + (k + 1)) && document.getElementById(\"chknull\" + (k + 1)).checked;\r\n\r\n if (k >= CSV.table[j].length) v = \"\";\r\n else v = CSV.table[j][k];\r\n //if (k >= hdr.length) h = \"FIELD\"+k;\r\n //else h = hdr[k];\r\n v = doTransformations(v, k, CSV);\r\n\r\n if (!options.forceWrap && CSV.statsCnt[k] && (CSV.statsCnt[k].fieldType == \"N\" || CSV.statsCnt[k].fieldType == \"I\" || CSV.statsCnt[k].fieldType == \"B\")) {\r\n if (v.trim() != \"\") {\r\n v = v.toNumber() + \"\";\r\n if (v.left(1) == getDecimalChar()) v = \"0\" + v;\r\n if (v.left(2) == \"-\" + getDecimalChar()) v = \"-0\" + v.substr(1);\r\n s += v;\r\n }\r\n else\r\n s += 'null';\r\n }\r\n else if (!options.forceWrap && CSV.statsCnt[k] && (CSV.statsCnt[k].fieldType == \"L\")) {\r\n if (v.trim() != \"\") {\r\n s += v.toLocaleLowerCase();\r\n }\r\n else {\r\n s += 'null';\r\n }\r\n }\r\n else {\r\n if ((emptyIsNull && v == \"\") || (options.nullIsNull && (v.toUpperCase() == \"NULL\" || v === \"\\\\N\")))\r\n s += \"null\";\r\n else\r\n s += '\"' + v.toJson() + '\"';\r\n }\r\n s += (x < a.length - 1 ? ',' : '');\r\n } // for each field\r\n if (a.length > 1) {\r\n s += \" ]\";\r\n }\r\n if (j < CSV.table.length - 1) s += \",\";\r\n s += \"\\n\";\r\n } // for each record\r\n s += \"]\";\r\n if (options.useFieldsData) {\r\n s = t + s + \"\\n}\";\r\n }\r\n return s;\r\n}", "function setStringArrayFromObjectArrayFields(solrRecord, solrPropName, vprRecord, vprPropName, vprChildPropName1, vprChildPropName2, delimiter) {\n if ((_.isObject(solrRecord)) && (_.isObject(vprRecord)) && (_.isArray(vprRecord[vprPropName])) && (!_.isEmpty(vprRecord[vprPropName]))) {\n var list = mapUtil.filteredMap(vprRecord[vprPropName], function(item) {\n \tvar text = '';\n if ((_.isObject(item)) && (_.isString(item[vprChildPropName1])) && (!_.isEmpty(item[vprChildPropName1]))) {\n text = item[vprChildPropName1];\n }\n if ((_.isObject(item)) && (_.isString(item[vprChildPropName2])) && (!_.isEmpty(item[vprChildPropName2]))) {\n \tif (text.length > 0) {\n \t\ttext += delimiter;\n \t}\n text += item[vprChildPropName2];\n }\n\n if (text.length > 0) {\n \treturn text;\n } else {\n return null;\n }\n }, [null, undefined]);\n\n if (!_.isEmpty(list)) {\n solrRecord[solrPropName] = list;\n }\n }\n}", "function processLogCsvData( data, returndata ) {\r\n returndata = data.time1 + ',';\r\n returndata += (data.temp1).toFixed(2) + ',';\r\n returndata += (data.humi1).toFixed(2) + ',';\r\n returndata += (data.temp2).toFixed(2) + ',';\r\n returndata += (data.humi2).toFixed(2) + ',';\r\n returndata += (data.onew1).toFixed(2) + ',';\r\n returndata += (data.onew2).toFixed(2) + ',';\r\n returndata += (data.onew3).toFixed(2) + ',';\r\n returndata += (data.onew4).toFixed(2) + ',';\r\n returndata += (data.onew5).toFixed(2) + ',';\r\n returndata += (data.onew6).toFixed(2) + ',';\r\n returndata += (data.onew7).toFixed(2) + ',';\r\n returndata += (data.onew8).toFixed(2) + ',';\r\n returndata += (data.amps1).toFixed(2) + ',';\r\n returndata += (data.door1) + ','\r\n returndata += (data.door2) + '\\n'; \r\n return (returndata);\r\n}", "function validFields(v) {\n var outFields = []\n var legal = {name: 1, area: 1, photo: 1, type: 1, category: 1, visibility: 1}\n var inFields = v.split(',')\n inFields.forEach(function(f) { if (legal[f]) outFields.push(f) })\n return outFields.join(',')\n}", "static ToDelimited(tagCompound, delimiters, hasHeaders, makeTextReadible) {\n\t\tif (hasHeaders === null || hasHeaders === void 0) {\n\t\t\thasHeaders = true;\n\t\t}\n\t\tif (makeTextReadible === null || makeTextReadible === void 0) {\n\t\t\tmakeTextReadible = true;\n\t\t}\n\n\t\tlet s,\n\t\t\td1 = delimiters && delimiters[0] ? delimiters[0] : \",\",\n\t\t\td2 = delimiters && delimiters[1] ? delimiters[1] : \"|\";\n\n\t\tif (tagCompound instanceof Array) {\n\t\t\ts = tagCompound;\n\t\t} else {\n\t\t\ts = Transformer.ToHierarchy(tagCompound);\n\t\t}\n\n\t\tlet csv = !!hasHeaders ? \"ID,ParentID,TagType,Key,Ordinality,Value,Options\\n\" : \"\";\n\t\tfor (let i in s) {\n\t\t\tlet row = [\n\t\t\t\t+s[i].ID,\n\t\t\t\ts[i].ParentID === null ? null : +s[i].ParentID,\n\t\t\t\t+s[i].Tag.GetType(),\n\t\t\t\ts[i].Tag.GetKey().toString(),\n\t\t\t\t+s[i].Tag.GetOrdinality()\n\t\t\t];\n\t\t\tif (s[i].Tag instanceof Tag.TagCompound) {\n\t\t\t\trow.push(+s[i].Tag.Size());\n\t\t\t\trow.push(null);\n\t\t\t} else if (s[i].Tag instanceof Tag.TagList) {\n\t\t\t\trow.push(+s[i].Tag.Size());\n\t\t\t\trow.push(+s[i].Tag.GetContentType());\n\t\t\t} else if (\n\t\t\t\t!!makeTextReadible &&\n\t\t\t\ts[i].Tag instanceof Tag.TagString\n\t\t\t) {\n\t\t\t\trow.push(\n\t\t\t\t\ts[i].Tag.GetValues()\n\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t.replace(/,/g, \"|\")\n\t\t\t\t);\n\t\t\t\trow.push(null);\n\t\t\t} else if (\n\t\t\t\t!!makeTextReadible &&\n\t\t\t\ts[i].Tag instanceof Tag.TagCharacter\n\t\t\t) {\n\t\t\t\trow.push(\n\t\t\t\t\ts[i].Tag.GetValues()\n\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t.replace(/,/g, \"|\")\n\t\t\t\t);\n\t\t\t\trow.push(null);\n\t\t\t} else {\n\t\t\t\tif (s[i].Tag.GetValues().length > 0) {\n\t\t\t\t\trow.push(\n\t\t\t\t\t\ts[i].Tag.GetValues()\n\t\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t\t.replace(/,/g, \"|\")\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\trow.push(null);\n\t\t\t\t}\n\t\t\t\trow.push(null);\n\t\t\t}\n\n\t\t\tcsv += JSON.stringify(row)\n\t\t\t\t.replace(/null/gi, \"\")\n\t\t\t\t.replace(/\\[/gi, \"\")\n\t\t\t\t.replace(/\\]/gi, \"\");\n\n\t\t\tif (+i !== s.length - 1) {\n\t\t\t\t// Don't put a NEWLINE on the last row\n\t\t\t\tcsv += \"\\n\";\n\t\t\t}\n\t\t}\n\n\t\tcsv = csv.replace(/,/gi, d1).replace(/\\|/gi, d2);\n\n\t\treturn csv;\n\t}", "function addComma(theObj)\n{\n var data = theObj.value;\n\tvar len = data.length;\n\tif(len>3) {\n\t var rest = len%3;\n\t var commaCnt = (len - rest)/3;\n\t if(rest == 0) {\n temp = data.substr(0,3);\n\t\t commaCnt -- ;\n\t\t rest = 3 ;\n\t } else {\n temp = data.substr(0,rest);\n\t }\n\n for(i=0;i<commaCnt;i++) {\n temp = temp + \",\" + data.substr(rest,3);\n\t\trest+=3;\n\t }\n\t theObj.value = temp;\n\t}\n}", "function formatRows(rows){return rows.get().join(tmpRowDelim).split(tmpRowDelim).join(rowDelim).split(tmpColDelim).join(colDelim);}", "function transformData(datapoints, targetFields, valueField, timeField) {\n var data = datapoints.map(function (datapoint) {\n var time = parseInt(datapoint[timeField], 10) * 1000;\n var value = parseFloat(datapoint[valueField]);\n if (isNaN(value)) {\n value = null;\n }\n\n return {\n datapoint: datapoint,\n value: value,\n time: time\n };\n });\n data = _.sortBy(data, ['time']);\n\n return targetFields.reduce(function (acc, targetField) {\n var datapointsByTargetValue = data.reduce(function (vs, _ref) {\n var datapoint = _ref.datapoint,\n value = _ref.value,\n time = _ref.time;\n\n var target = datapoint[targetField];\n if (!target) {\n return vs;\n }\n\n if (!vs[target]) {\n vs[target] = [];\n }\n\n vs[target].push([value, time]);\n\n return vs;\n }, {});\n\n return [].concat(acc, _.map(datapointsByTargetValue, function (datapoints, target) {\n return {\n target: target,\n datapoints: datapoints\n };\n }));\n }, []);\n}", "function fields(fieldname, recs) {\n\tif (!recs.length) return [];\n\treturn [recs[0][fieldname]].concat(fields(fieldname, recs.slice(1)));\n}", "function delimitMultiArray(input,delimiter,rowdelimiter)\r\n{\r\n\tvar resultArray = new Array();\r\n\tvar recordArray = input.split(rowdelimiter);\r\n\tfor(var i=0;i<recordArray.length;i++)\r\n\t{\r\n\t\tresultArray[i] = recordArray[i].split(delimiter);\r\n\t}\r\n\treturn resultArray;\r\n}", "function CSVToArray( strData, strDelimiter ){\n // Check to see if the delimiter is defined. If not,\n // then default to comma.\n strDelimiter = (strDelimiter || \",\");\n\n // Create a regular expression to parse the CSV values.\n var objPattern = new RegExp(\n (\n // Delimiters.\n \"(\\\\\" + strDelimiter + \"|\\\\r?\\\\n|\\\\r|^)\" +\n\n // Quoted fields.\n \"(?:\\\"([^\\\"]*(?:\\\"\\\"[^\\\"]*)*)\\\"|\" +\n\n // Standard fields.\n \"([^\\\"\\\\\" + strDelimiter + \"\\\\r\\\\n]*))\"\n ),\n \"gi\"\n );\n\n\n // Create an array to hold our data. Give the array\n // a default empty first row.\n var arrData = [[]];\n\n // Create an array to hold our individual pattern\n // matching groups.\n var arrMatches = null;\n\n\n // Keep looping over the regular expression matches\n // until we can no longer find a match.\n while (arrMatches = objPattern.exec( strData )){\n\n // Get the delimiter that was found.\n var strMatchedDelimiter = arrMatches[ 1 ];\n\n // Check to see if the given delimiter has a length\n // (is not the start of string) and if it matches\n // field delimiter. If id does not, then we know\n // that this delimiter is a row delimiter.\n if (\n strMatchedDelimiter.length &&\n strMatchedDelimiter !== strDelimiter\n ){\n\n // Since we have reached a new row of data,\n // add an empty row to our data array.\n arrData.push( [] );\n\n }\n\n var strMatchedValue;\n\n // Now that we have our delimiter out of the way,\n // let's check to see which kind of value we\n // captured (quoted or unquoted).\n if (arrMatches[ 2 ]){\n\n // We found a quoted value. When we capture\n // this value, unescape any double quotes.\n strMatchedValue = arrMatches[ 2 ].replace(\n new RegExp( \"\\\"\\\"\", \"g\" ),\n \"\\\"\"\n );\n\n } else {\n\n // We found a non-quoted value.\n strMatchedValue = arrMatches[ 3 ];\n\n }\n\n\n // Now that we have our value string, let's add\n // it to the data array.\n arrData[ arrData.length - 1 ].push( strMatchedValue );\n }\n\n // Return the parsed data.\n return( arrData );\n}", "function CSVToArray( strData, strDelimiter ){\n // Check to see if the delimiter is defined. If not,\n // then default to comma.\n strDelimiter = (strDelimiter || \",\");\n\n // Create a regular expression to parse the CSV values.\n var objPattern = new RegExp(\n (\n // Delimiters.\n \"(\\\\\" + strDelimiter + \"|\\\\r?\\\\n|\\\\r|^)\" +\n\n // Quoted fields.\n \"(?:\\\"([^\\\"]*(?:\\\"\\\"[^\\\"]*)*)\\\"|\" +\n\n // Standard fields.\n \"([^\\\"\\\\\" + strDelimiter + \"\\\\r\\\\n]*))\"\n ),\n \"gi\"\n );\n\n\n // Create an array to hold our data. Give the array\n // a default empty first row.\n var arrData = [[]];\n\n // Create an array to hold our individual pattern\n // matching groups.\n var arrMatches = null;\n\n\n // Keep looping over the regular expression matches\n // until we can no longer find a match.\n while (arrMatches = objPattern.exec( strData )){\n\n // Get the delimiter that was found.\n var strMatchedDelimiter = arrMatches[ 1 ];\n\n // Check to see if the given delimiter has a length\n // (is not the start of string) and if it matches\n // field delimiter. If id does not, then we know\n // that this delimiter is a row delimiter.\n if (\n strMatchedDelimiter.length &&\n strMatchedDelimiter !== strDelimiter\n ){\n\n // Since we have reached a new row of data,\n // add an empty row to our data array.\n arrData.push( [] );\n\n }\n\n var strMatchedValue;\n\n // Now that we have our delimiter out of the way,\n // let's check to see which kind of value we\n // captured (quoted or unquoted).\n if (arrMatches[ 2 ]){\n\n // We found a quoted value. When we capture\n // this value, unescape any double quotes.\n strMatchedValue = arrMatches[ 2 ].replace(\n new RegExp( \"\\\"\\\"\", \"g\" ),\n \"\\\"\"\n );\n\n } else {\n\n // We found a non-quoted value.\n strMatchedValue = arrMatches[ 3 ];\n\n }\n\n\n // Now that we have our value string, let's add\n // it to the data array.\n arrData[ arrData.length - 1 ].push( strMatchedValue );\n }\n\n // Return the parsed data.\n return( arrData );\n}", "function jsonToCsv(objArray, delimiter, bIncludeHeaders, bQuotes, noMultiLines) {\r\n var array;\r\n var str = '';\r\n var line = '';\r\n var i, j;\r\n var index;\r\n var value;\r\n var columns = [];\r\n\r\n try { array = typeof objArray != 'object' ? JSON.parse(objArray) : objArray; }\r\n catch (e) { if (objArray.charAt(0) === \"[\" || objArray.charAt(0) === \"{\") array = eval(\"array=\" + objArray); else throw e; }\r\n\r\n if (!_.isObject(array) || array == null || _.isEmpty(array)) { // simple value or null or empty object\r\n line = \"\";\r\n str = \"\";\r\n if (bIncludeHeaders) {\r\n value = 'Field1';\r\n if (bQuotes) line = '\"' + value.replace(/\"/g, '\"\"') + '\"' + delimiter;\r\n else line = value.toCsv(delimiter, '\"');\r\n str += line + '\\n';\r\n }\r\n if (!(array && _.isObject(array) && _.isEmpty(array))) {\r\n if (array == null) value = \"\"; else value = array + \"\";\r\n if (noMultiLines) value = value.replace(/\\r\\n|\\r|\\n/g, ' ');\r\n str += (bQuotes ? '\"' : \"\") + (\"\" + value).toCsv(delimiter, '\"') + (bQuotes ? '\"' : \"\") + '\\n';\r\n }\r\n return str;\r\n }\r\n var depth = getJsonLevel(array);\r\n // If an Array - handle it separately [1,2,3]\r\n if ((depth == 2) && (_.isArray(array))) {\r\n if (bIncludeHeaders) {\r\n value = 'Field1';\r\n if (bQuotes) line += '\"' + value.replace(/\"/g, '\"\"') + '\"' + delimiter;\r\n else line += value.toCsv(delimiter, '\"');\r\n str += line + '\\n';\r\n }\r\n for (i = 0; i < array.length; i++) {\r\n var line = '';\r\n value = array[i];\r\n if (value == null) value = \"\"; else value += \"\";\r\n if (noMultiLines) value = value.replace(/\\r\\n|\\r|\\n/g, ' ');\r\n line += (bQuotes ? '\"' : \"\") + (\"\" + value).toCsv(delimiter, '\"') + (bQuotes ? '\"' : \"\");\r\n str += line + '\\n';\r\n }\r\n return str;\r\n }\r\n // If an Array of Arrays with just 2 level of arrays - handle it separately [ [1,2,3],[4,5,6] ]\r\n if ((depth == 3) && (_.isArray(array)) && (_.every(_.values(array), _.isArray))) {\r\n if (bIncludeHeaders) {\r\n // NOTE - I need to change this to determine columns at the end and readjust arrays to include maximum columns\r\n var head = array[0]; // header based on 1st array entry\r\n for (index in array[0]) {\r\n value = 'Field' + (index * 1 + 1);\r\n columns.push(value);\r\n if (bQuotes) line += '\"' + value.replace(/\"/g, '\"\"') + '\"' + delimiter;\r\n else line += value.toCsv(delimiter, '\"') + delimiter;\r\n }\r\n line = line.slice(0, -1);\r\n str += line + '\\n';\r\n }\r\n else { // need this to know # of fields\r\n for (index in array[0]) columns.push(index); // # of columns based on first array entry\r\n }\r\n for (i = 0; i < array.length; i++) { // for each array entry\r\n var line = '';\r\n for (j = 0; j < columns.length; j++) { // for each column\r\n value = array[i][j];\r\n if (value == null) value = \"\"; else value += \"\";\r\n if (noMultiLines) value = value.replace(/\\r\\n|\\r|\\n/g, ' ');\r\n line += (\"\" + value).toCsv(delimiter, '\"', '\"', bQuotes) + delimiter;\r\n }\r\n\r\n line = line.slice(0, -1 * delimiter.length);\r\n str += line + '\\n';\r\n }\r\n return str;\r\n } // 2 levels of arrays\r\n\r\n for (; ;) {\r\n // convert an object with 1 property with value of array to just an array (drop property)\r\n if (_.isObject(array)\r\n && !(_.isArray(array))\r\n && _.keys(array).length == 1\r\n && (_.isObject(_.values(array)[0])\r\n || (_.isArray(_.values(array)[0])\r\n && _.isObject(_.values(array)[0][0]))\r\n )) {\r\n array = _.values(array)[0];\r\n }\r\n else break;\r\n }\r\n\r\n if (_.isArray(array) == false && _.isObject(array) == true) {\r\n array = JSON.flatten(array);\r\n array = JSON.parse('[' + JSON.stringify(array) + ']');\r\n }\r\n\r\n // begin\r\n for (i = 0; i < array.length; i++) {\r\n for (j = 0; j < columns.length; j++) {\r\n value = array[i][columns[j]];\r\n if (_.isArray(value) == false && _.isObject(value) == true) {\r\n if (columns[j] in array[i]) array[i][columns[j]] = JSON.flatten(value);\r\n }\r\n }\r\n }\r\n // end\r\n\r\n if (_.isObject(array[0]) && _.every(_.values(array), _.isObject)) {\r\n if (bIncludeHeaders) {\r\n var head = array[0];\r\n if (bQuotes) {\r\n for (index in array[0]) {\r\n value = index + \"\";\r\n columns.push(value);\r\n line += '\"' + value.replace(/\"/g, '\"\"') + '\"' + delimiter;\r\n }\r\n } else {\r\n for (index in array[0]) {\r\n value = index + \"\";\r\n columns.push(value);\r\n line += value.toCsv(delimiter, '\"') + delimiter;\r\n }\r\n }\r\n line = line.slice(0, -1);\r\n str += line + '\\n';\r\n }\r\n else { // need this to know # of fields\r\n for (index in array[0]) columns.push(index);\r\n }\r\n }\r\n if (columns.length === 0 && _.isArray(array) == true) {\r\n str = \"\";\r\n if (bIncludeHeaders) {\r\n value = 'Field1';\r\n if (bQuotes) line += '\"' + value.replace(/\"/g, '\"\"') + '\"' + delimiter;\r\n else line += value.toCsv(delimiter, '\"');\r\n str += line + '\\n';\r\n }\r\n for (i = 0; i < array.length; i++) {\r\n var line = '';\r\n value = array[i];\r\n if (value == null) value = \"\";\r\n else value += \"\";\r\n if ((value + \"\").substring(0, 15) == \"[object Object]\") value = JSON.valueArray(array[i]).slice(0, -1);\r\n if (noMultiLines) value = value.replace(/\\r\\n|\\r|\\n/g, ' ');\r\n line += (bQuotes ? '\"' : \"\") + (\"\" + value).toCsv(delimiter, '\"') + (bQuotes ? '\"' : \"\");\r\n str += line + '\\n';\r\n }\r\n return str;\r\n }\r\n\r\n for (i = 0; i < array.length; i++) { // for each array entry\r\n var line = '';\r\n if (bQuotes) {\r\n for (j = 0; j < columns.length; j++) {\r\n value = array[i][columns[j]];\r\n if ((value + \"\").substring(0, 15) == \"[object Object]\") value = JSON.valueArray(array[i][columns[j]]).slice(0, -1);\r\n if (value == null) value = \"\"; else value += \"\";\r\n if (noMultiLines) value = value.replace(/\\r\\n|\\r|\\n/g, ' ');\r\n line += '\"' + value.replace(/\"/g, '\"\"') + '\"' + delimiter;\r\n }\r\n } else {\r\n for (j = 0; j < columns.length; j++) {\r\n value = array[i][columns[j]];\r\n if ((value + \"\").substring(0, 15) == \"[object Object]\") value = JSON.valueArray(array[i][columns[j]]).slice(0, -1);\r\n if (value == null) value = \"\"; else value += \"\";\r\n if (noMultiLines) value = value.replace(/\\r\\n|\\r|\\n/g, ' ');\r\n line += (\"\" + value).toCsv(delimiter, '\"') + delimiter;\r\n }\r\n }\r\n\r\n line = line.slice(0, -1 * delimiter.length);\r\n str += line + '\\n';\r\n }\r\n return str;\r\n}", "function fields(rawStr) {\n\n return rawStr.split(/[ \\t,]+/);\n \n}", "dataPrepare() {\n this.data = this.data.map(d => ({\n year: +d.year,\n numFires: +d.numFires.replaceAll(\",\", \"\"),\n totalAcres: +d.totalAcres.replaceAll(\",\", \"\"),\n }));\n }", "function Pluck(fields) {\n this.fields = Array.isArray(fields) ? fields : [];\n // for toString()\n this.id = this.fields.join(',');\n}", "jsonToCSV(data) {\n var csvData = [];\n //Header\n if (this.title != null) {\n csvData.push(this.parseExtraData(this.title, \"${data}\\r\\n\"));\n }\n //Fields\n for (let key in data[0]) {\n csvData.push(key);\n csvData.push(\",\");\n }\n csvData.pop();\n csvData.push(\"\\r\\n\");\n //Data\n data.map(function(item) {\n for (let key in item) {\n let escapedCSV = '=\\\"' + item[key] + '\\\"'; // cast Numbers to string\n if (escapedCSV.match(/[,\"\\n]/)) {\n escapedCSV = '\"' + escapedCSV.replace(/\\\"/g, '\"\"') + '\"';\n }\n csvData.push(escapedCSV);\n csvData.push(\",\");\n }\n csvData.pop();\n csvData.push(\"\\r\\n\");\n });\n //Footer\n if (this.footer != null) {\n csvData.push(this.parseExtraData(this.footer, \"${data}\\r\\n\"));\n }\n return csvData.join(\"\");\n }", "function deStupify(input)\n{\n input.forEach(function(record)\n {\n for (var field in record)\n {\n record[field] = record[field].S;\n }\n });\n return input;\n}", "function printFieldTypesForHelper(prefix, fields) {\r\n return fields.map(p => {\r\n var name = p.name;\r\n var compiledName = \"\";\r\n if (!p.emit && isArrayType(p.type)) {\r\n compiledName = '[<CompiledName(\"' + name + '\")>] ';\r\n name += \"A\";\r\n }\r\n return prefix \r\n + (p.isDuplicate ? \"// OVERWRITTEN \" : \"\") \r\n + templates.fieldTypeForHelper\r\n .replace(\"[DECORATOR]\", (p.emit ? '[<Emit(\"' + p.emit + '\")>] ' : compiledName))\r\n .replace(\"[NAME]\", stringToUnionCase(name))\r\n .replace(\"[TYPE]\", escape(p.type))\r\n .replace(\"[COMMENT]\", p.parentName ? (\"// \" + p.parentName) : \"\");\r\n }).filter(x => x.trim().length > 0).join(\"\\n\");\r\n}", "function doCollectStringValues(data, _, val) {\n if (Array.isArray(val)) return;\n if ('string' === typeof val) {\n data.push(val);\n } else if ('object' === typeof val) {\n data.push(...collectStringValues(val));\n }\n}", "function list6(names) {\n return names\n .map((item) => item.name)\n .join(', ')\n .replace(/,\\s([^,]+)$/, ' & $1');\n}", "function getEntriesFromList(list) {\n var entries = \"\";\n\n for (var i=0; i < list.options.length; i++) {\n if (i > 0) {\n entries += \",\";\n }\n entries += list.options[i].value;\n }\n return entries;\n }", "function makeArray(input_data) {\n var data_array = [];\n var data_string = input_data.asText(); //converts CSnap list object to a text string\n for (var i = 0; i < data_string.length; i++) {\n var val = \"\";\n while(data_string[i] !== \",\" && i < data_string.length) { //read through variable-length values until I hit a comma\n val += data_string[i];\n i++;\n }\n\n if(val !== \"\") {\n data_array.push(val);\n }\n }\n return data_array;\n }", "processCsvData(data) {\n const list = Object(_user_interfaces_common__WEBPACK_IMPORTED_MODULE_2__[\"csvToJson\"])(data) || [];\n const id = this._users.current.staff_id;\n list.forEach((el) => {\n el.name = el.name || `${el.first_name} ${el.last_name}`;\n const display = (el.name || `${Math.floor(Math.random() * 99999999)}`)\n .split(' ')\n .join('_')\n .toLowerCase();\n /* istanbul ignore else */\n if (!el.email) {\n el.email = `${display}+${id}@guest.com`;\n }\n el.visit_expected = !el.email.endsWith('place.tech');\n this.addUser(new _users_src_lib_user_class__WEBPACK_IMPORTED_MODULE_5__[\"User\"](el));\n });\n }", "function CSVToArray( strData, strDelimiter ){\n // Check to see if the delimiter is defined. If not,\n // then default to comma.\n strDelimiter = (strDelimiter || \",\");\n\n // Create a regular expression to parse the CSV values.\n let objPattern = new RegExp(\n (\n // Delimiters.\n \"(\\\\\" + strDelimiter + \"|\\\\r?\\\\n|\\\\r|^)\" +\n\n // Quoted fields.\n \"(?:\\\"([^\\\"]*(?:\\\"\\\"[^\\\"]*)*)\\\"|\" +\n\n // Standard fields.\n \"([^\\\"\\\\\" + strDelimiter + \"\\\\r\\\\n]*))\"\n ),\n \"gi\"\n );\n\n\n // Create an array to hold our data. Give the array\n // a default empty first row.\n let arrData = [[]];\n\n // Create an array to hold our individual pattern\n // matching groups.\n let arrMatches = null;\n\n\n // Keep looping over the regular expression matches\n // until we can no longer find a match.\n while (arrMatches = objPattern.exec( strData )){\n\n // Get the delimiter that was found.\n let strMatchedDelimiter = arrMatches[ 1 ];\n\n // Check to see if the given delimiter has a length\n // (is not the start of string) and if it matches\n // field delimiter. If id does not, then we know\n // that this delimiter is a row delimiter.\n if (\n strMatchedDelimiter.length &&\n strMatchedDelimiter !== strDelimiter\n ){\n\n // Since we have reached a new row of data,\n // add an empty row to our data array.\n arrData.push( [] );\n\n }\n\n let strMatchedValue;\n\n // Now that we have our delimiter out of the way,\n // let's check to see which kind of value we\n // captured (quoted or unquoted).\n if (arrMatches[ 2 ]){\n\n // We found a quoted value. When we capture\n // this value, unescape any double quotes.\n strMatchedValue = arrMatches[ 2 ].replace(\n new RegExp( \"\\\"\\\"\", \"g\" ),\n \"\\\"\"\n );\n\n } else {\n\n // We found a non-quoted value.\n strMatchedValue = arrMatches[ 3 ];\n\n }\n\n\n // Now that we have our value string, let's add\n // it to the data array.\n arrData[ arrData.length - 1 ].push( strMatchedValue );\n }\n\n // Return the parsed data.\n return( arrData );\n}", "parseFields(fields) {\n for (let index in fields) {\n let obj = fields[index];\n let name = \"\";\n let type = \"\";\n for (let prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n if (prop === \"name\") {\n name = obj[prop];\n }\n if (prop === \"type\") {\n type = obj[prop];\n }\n }\n }\n this.fieldTypes[name] = Number(type);\n }\n }", "function processFields (fields) {\n const rows = []\n let currentColumns = 0\n let row = []\n\n fields.forEach((field) => {\n const columns = getFieldColumns(field)\n if (columns + currentColumns > 12) {\n rows.push(row)\n currentColumns = 0\n row = []\n }\n row.push(field)\n currentColumns += columns\n })\n\n if (row.length > 0) {\n rows.push(row)\n }\n return rows\n}", "function list(val) {\n return val.split(',');\n}", "function formatData (data) {\n if (!data) return null;\n let dataObject = JSON.parse(data);\n const paramMeasurements = dataObject.map(element => {\n let m = {\n location: element['location'],\n value: Number(element['value']),\n unit: element['unit'],\n parameter: element['parameter'].replace(' ', ''),\n averagingPeriod: element['averagingPeriod'],\n date: sanitizeDate(element['date']),\n coordinates: element['coordinates'],\n attribution: element['attribution'],\n city: element['city']\n };\n if (m.parameter === 'SulfurDioxide') m.parameter = 'so2';\n return unifyParameters(m);\n });\n return paramMeasurements;\n}", "addFieldsToParam(searchParam) {\n let allFields = this.fields.split(',');\n allFields.push('Id');\n allFields.push('Name');\n let cleanFields = this.dedupeArray(allFields).join(',');\n searchParam.fieldsToQuery = cleanFields;\n }", "function createCSV() {\n let data = [[\n 'EmployerName',\n 'EventId',\n 'EventName',\n 'DisplayPriority',\n 'RewardType',\n 'PointsAwarded',\n 'RewardDescription',\n 'AllowSameDayDuplicates',\n 'IsOngoing',\n 'IsDisabled',\n 'ShowInProgram',\n 'IsSelfReport',\n 'DataFeedMode',\n 'Notify',\n 'ButtonText',\n 'TargetUrl',\n 'EventImageUrl',\n 'MaxOccurrences',\n 'StartDate',\n 'EndDate',\n 'ViewPages',\n 'Dimensions',\n 'ShortDescription',\n 'HtmlDescription',\n 'SubgroupId',\n 'Field1Name',\n 'Field1Value',\n 'Field2Name',\n 'Field2Value',\n 'Field3Name',\n 'Field3Value'\n ]];\n\n\n const employerName = $('#employerName').val();\n\n const eventName = $('#eventName').val();\n const eventId = $('#eventId').val();\n const pointsAwarded = $('#pointsAwarded').val();\n const maxOccurrences = $('#maxOccurrences').val();\n\n const cie = [\n employerName,\n eventId,\n '\"' + eventName + '\"',\n '',\n 'IncentivePoints',\n pointsAwarded.replace(',', ''),\n '',\n '1',\n '0',\n '0',\n '0',\n '0',\n '0',\n '0',\n '',\n '',\n '',\n maxOccurrences,\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n ''\n ];\n\n data.push(cie);\n\n return data;\n }", "function CSVToArray(strData, strDelimiter) {\r\n // Check to see if the delimiter is defined. If not,\r\n // then default to comma.\r\n strDelimiter = \",\";\r\n\r\n // Create a regular expression to parse the CSV values.\r\n var objPattern = new RegExp(\r\n (\r\n // Delimiters.\r\n \"(\\\\\" + strDelimiter + \"|\\\\r?\\\\n|\\\\r|^)\" +\r\n\r\n // Quoted fields.\r\n \"(?:\\\"([^\\\"]*(?:\\\"\\\"[^\\\"]*)*)\\\"|\" +\r\n\r\n // Standard fields.\r\n \"([^\\\"\\\\\" + strDelimiter + \"\\\\r\\\\n]*))\"),\r\n \"gi\");\r\n\r\n\r\n // Create an array to hold our data. Give the array\r\n // a default empty first row.\r\n var arrData = [\r\n []\r\n ];\r\n\r\n // Create an array to hold our individual pattern\r\n // matching groups.\r\n var arrMatches = null;\r\n\r\n\r\n // Keep looping over the regular expression matches\r\n // until we can no longer find a match.\r\n while (arrMatches = objPattern.exec(strData)) {\r\n\r\n // Get the delimiter that was found.\r\n var strMatchedDelimiter = arrMatches[1];\r\n\r\n // Check to see if the given delimiter has a length\r\n // (is not the start of string) and if it matches\r\n // field delimiter. If id does not, then we know\r\n // that this delimiter is a row delimiter.\r\n if (\r\n strMatchedDelimiter.length &&\r\n (strMatchedDelimiter != strDelimiter)) {\r\n\r\n // Since we have reached a new row of data,\r\n // add an empty row to our data array.\r\n arrData.push([]);\r\n\r\n }\r\n\r\n\r\n // Now that we have our delimiter out of the way,\r\n // let's check to see which kind of value we\r\n // captured (quoted or unquoted).\r\n if (arrMatches[2]) {\r\n\r\n // We found a quoted value. When we capture\r\n // this value, unescape any double quotes.\r\n var strMatchedValue = arrMatches[2].replace(\r\n new RegExp(\"\\\"\\\"\", \"g\"),\r\n \"\\\"\");\r\n\r\n } else {\r\n\r\n // We found a non-quoted value.\r\n var strMatchedValue = arrMatches[3];\r\n\r\n }\r\n\r\n\r\n // Now that we have our value string, let's add\r\n // it to the data array.\r\n arrData[arrData.length - 1].push(strMatchedValue);\r\n }\r\n\r\n // Return the parsed data.\r\n return (arrData);\r\n}", "function CSVToArray( strData, strDelimiter ){\n // Check to see if the delimiter is defined. If not,\n // then default to comma.\n strDelimiter = (strDelimiter || \",\");\n \n // Create a regular expression to parse the CSV values.\n var objPattern = new RegExp(\n (\n // Delimiters.\n \"(\\\\\" + strDelimiter + \"|\\\\r?\\\\n|\\\\r|^)\" +\n \n // Quoted fields.\n \"(?:\\\"([^\\\"]*(?:\\\"\\\"[^\\\"]*)*)\\\"|\" +\n \n // Standard fields.\n \"([^\\\"\\\\\" + strDelimiter + \"\\\\r\\\\n]*))\"\n ),\n \"gi\"\n );\n \n \n // Create an array to hold our data. Give the array\n // a default empty first row.\n var arrData = [[]];\n \n // Create an array to hold our individual pattern\n // matching groups.\n var arrMatches = null;\n \n \n // Keep looping over the regular expression matches\n // until we can no longer find a match.\n while (arrMatches = objPattern.exec( strData )){\n \n // Get the delimiter that was found.\n var strMatchedDelimiter = arrMatches[ 1 ];\n \n // Check to see if the given delimiter has a length\n // (is not the start of string) and if it matches\n // field delimiter. If id does not, then we know\n // that this delimiter is a row delimiter.\n if (\n strMatchedDelimiter.length &&\n (strMatchedDelimiter != strDelimiter)\n ){\n \n // Since we have reached a new row of data,\n // add an empty row to our data array.\n arrData.push( [] );\n \n }\n \n \n // Now that we have our delimiter out of the way,\n // let's check to see which kind of value we\n // captured (quoted or unquoted).\n if (arrMatches[ 2 ]){\n \n // We found a quoted value. When we capture\n // this value, unescape any double quotes.\n var strMatchedValue = arrMatches[ 2 ].replace(\n new RegExp( \"\\\"\\\"\", \"g\" ),\n \"\\\"\"\n );\n \n } else {\n \n // We found a non-quoted value.\n var strMatchedValue = arrMatches[ 3 ];\n \n }\n \n \n // Now that we have our value string, let's add\n // it to the data array.\n arrData[ arrData.length - 1 ].push( strMatchedValue );\n }\n \n // Return the parsed data.\n return( arrData );\n}", "function toString(data, keys, separator, excludeCSVHeader) {\n var dataString = '';\n if (data.length === 0) return dataString;\n\n var headCells = [];\n var rowCount = 0;\n keys.forEach(function (key) {\n if (key.row > rowCount) {\n rowCount = key.row;\n }\n // rowCount += (key.rowSpan + key.colSpan - 1);\n for (var index = 0; index < key.colSpan; index++) {\n headCells.push(key);\n }\n });\n\n var firstRow = excludeCSVHeader ? 1 : 0;\n\n var _loop = function _loop(i) {\n dataString += headCells.map(function (x) {\n if (x.row + (x.rowSpan - 1) === i) {\n return x.header;\n }\n if (x.row === i && x.rowSpan > 1) {\n return '';\n }\n }).filter(function (key) {\n return typeof key !== 'undefined';\n }).join(separator) + '\\n';\n };\n\n for (var i = firstRow; i <= rowCount; i++) {\n _loop(i);\n }\n\n keys = keys.filter(function (key) {\n return key.field !== undefined;\n });\n\n data.map(function (row) {\n keys.map(function (col, i) {\n var field = col.field,\n format = col.format,\n extraData = col.extraData;\n\n var value = typeof format !== 'undefined' ? format(row[field], row, extraData) : row[field];\n var cell = typeof value !== 'undefined' ? '\"' + value + '\"' : '';\n dataString += cell;\n if (i + 1 < keys.length) dataString += separator;\n });\n\n dataString += '\\n';\n });\n\n return dataString;\n}", "function toString(data, keys, separator, excludeCSVHeader) {\n var dataString = '';\n if (data.length === 0) return dataString;\n\n var headCells = [];\n var rowCount = 0;\n keys.forEach(function (key) {\n if (key.row > rowCount) {\n rowCount = key.row;\n }\n // rowCount += (key.rowSpan + key.colSpan - 1);\n for (var index = 0; index < key.colSpan; index++) {\n headCells.push(key);\n }\n });\n\n var firstRow = excludeCSVHeader ? 1 : 0;\n\n var _loop = function _loop(i) {\n dataString += headCells.map(function (x) {\n if (x.row + (x.rowSpan - 1) === i) {\n return x.header;\n }\n if (x.row === i && x.rowSpan > 1) {\n return '';\n }\n }).filter(function (key) {\n return typeof key !== 'undefined';\n }).join(separator) + '\\n';\n };\n\n for (var i = firstRow; i <= rowCount; i++) {\n _loop(i);\n }\n\n keys = keys.filter(function (key) {\n return key.field !== undefined;\n });\n\n data.map(function (row) {\n keys.map(function (col, i) {\n var field = col.field,\n format = col.format,\n extraData = col.extraData;\n\n var value = typeof format !== 'undefined' ? format(row[field], row, extraData) : row[field];\n var cell = typeof value !== 'undefined' ? '\"' + value + '\"' : '';\n dataString += cell;\n if (i + 1 < keys.length) dataString += separator;\n });\n\n dataString += '\\n';\n });\n\n return dataString;\n}", "function mergeToStringUsingWhile(elements, delimiter = ',') {\n\n}", "function splitFieldIntoAry() {\n var nullRefAry = [];\n var splitField = entityObj.splitField;\n var newRecrdObj = {};\n var recrdsObj = entityObj.curRcrds;\n\n for (var key in recrdsObj) { newRecrdObj[key] = splitFields(key); }\n\n if (nullRefAry.length > 0) { addNullReqRefs(); }\n\n entityObj.curRcrds = newRecrdObj;\n /**\n * Splits a specified field of each record into an array on commas.\n * @param {str} key Top key for an array of records sharing unqKey field\n */\n function splitFields(key) { // console.log(\"splitFields called. recrdsObj[key] = %O\", recrdsObj[key])\n var newRecrds = recrdsObj[key].map(function(recrd) {\n recrd[splitField] = recrd[splitField] === null ? procNullField(recrd, key) : splitAndTrimField(recrd);\n return recrd;\n });\n return newRecrds;\n }\n function splitAndTrimField(recrd) { //console.log(\"splitAndTrimField called. recrd = %O\", recrd);\n var collectionAry = recrd[splitField].split(\",\");\n var trimmedAry = collectionAry.map(function(valueStr){\n return valueStr.trim();\n });\n return trimmedAry;\n }\n function procNullField(recrd, key) {\n if (entityObj.reqRef !== undefined) {\n nullRefAry.push(recrd);\n return null;\n } else {\n return [];\n }\n }\n function addNullReqRefs() { //console.log(\"addNullReqRefs. nullRefAry = %O\", nullRefAry);\n nullRefAry.forEach(function(rcrd) { delete newRecrdObj[rcrd.citId] });\n entityObj.validationResults.rcrdsWithNullReqFields = {\n recordCnt: nullRefAry.length,\n recrds: nullRefAry,\n unqKey: entityObj.reqRef\n }\n }\n }", "function formatDataForTableBuilding(data) {\n var collectionToAppend = data.results.map((valueSet, idx) => [formatDate(valueSet.date.local), valueSet.location, valueSet.parameter, valueSet.value, valueSet.unit ])\n\n //console.log(collectionToAppend);\n return collectionToAppend;\n}", "function prepareRow(row){\n return _.map(row, function(item,key){\n // Escape double quotes inside and add double quotes around each item\n return '\"' +\n item\n .replace(/\"/g,'\\'')\n .replace(/\\n/g,'')\n .replace(/[\\u2018\\u2019]/g, '\\'')\n .replace(/[\\u201C\\u201D]/g, '\\'')\n + '\"';\n })\n .join(',')+'\\n';\n}", "function updateFieldsInRecords(fields, records, replacements) {\n // Use object-literal syntax (faster than alternative)\n var convertBody = 'return {' + fields.map(function(name) {\n var key = JSON.stringify(name);\n return key + ': ' + (replacements[name] ? 'replacements[' + key + '][i]' : 'rec[' + key + ']');\n }).join(', ') + '}';\n var convert = new Function('rec', 'replacements', 'i', convertBody);\n records.forEach(function(rec, i) {\n records[i] = convert(rec, replacements, i);\n });\n }", "function _restructureInfoList(infoList, dataType){\n\t\t\tvar templateClass,\n\t\t\t\tresInfoList = new Array(),\n\t\t\t\tgetValHandle;\n\t\t\tswitch(dataType){\n\t\t\tcase WOE_Setting._WOEColumnType.numeric:\n\t\t\t\ttemplateClass = WOE_Setting._WOENumericNode;\n\t\t\t\tgetValHandle = function(item, attr){\n\t\t\t\t\treturn WOE_Operator.getValueFromGrid(item[attr]);//alpine.flow.WorkFlowVariableReplacer.replaceVariable(WOE_Operator.getValueFromGrid(item[attr]));\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase WOE_Setting._WOEColumnType.text:\n\t\t\t\ttemplateClass = WOE_Setting._WOENominalNode;\n\t\t\t\tgetValHandle = function(item, attr){\n\t\t\t\t\tif(attr == WOE_Setting._WOENominalNode.optionalVal){// check if optional values then just return it. Because it already a Array\n\t\t\t\t\t\treturn item[attr];\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn WOE_Operator.getValueFromGrid(item[attr]);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tfor(var i = 0;i < infoList.length;i++){\n\t\t\t\tvar info = infoList[i],\n\t\t\t\t\tresInfo = {};\n\t\t\t\tfor(var fieldNameItem in templateClass){\n\t\t\t\t\tvar fieldName = templateClass[fieldNameItem];\n\t\t\t\t\tresInfo[fieldName] = getValHandle(info, fieldName);\n\t\t\t\t}\n\t\t\t\tresInfoList.push(resInfo);\n\t\t\t}\n\t\t\treturn resInfoList;\n\t\t}", "function convertTime(convertField, data) {\n for (var i = 0; i < convertField.length; i++) {\n var field = convertField[i];\n for (var j = 0; j < data.length; j++) {\n var originaltime = data[j][field];\n var originaltimeArray = originaltime.split(\"T\");\n var finaltime = \"\";\n for (var k = 0; k < originaltimeArray.length; k++) {\n finaltime = finaltime + originaltimeArray[k] + \" \";\n }\n data[j][field] = finaltime;\n }\n }\n }", "function csvLine(fields) {\n\t\tvar line = \"\";\n\t\tfields.forEach(function (field) {\n\t\t\tif (line.length > 0) line += \";\";\n\t\t\tline += typeof field === \"number\" ? field : '\"' + field.toString().replace(/\"/g, '\"\"') + '\"';\n\t\t});\n\t\tline += \"\\n\";\n\t\treturn line;\n\t}", "function formatData(strng){\n\twhile(strng.includes(',')){\n\t\tstrng = strng.replace(',', '.');\n\t}\n\treturn strng;\n}" ]
[ "0.6792498", "0.6451665", "0.6414086", "0.6320202", "0.6320202", "0.6308459", "0.6308459", "0.6308459", "0.6308459", "0.6308459", "0.5914448", "0.5824572", "0.579258", "0.57868624", "0.57794344", "0.5776861", "0.57339877", "0.5732398", "0.56852293", "0.56807995", "0.56510323", "0.5609867", "0.56042904", "0.5540834", "0.5510741", "0.5494464", "0.5489634", "0.5448715", "0.5440227", "0.54359466", "0.540151", "0.5396481", "0.5363872", "0.53423786", "0.5338799", "0.53382313", "0.5328909", "0.5312827", "0.53093857", "0.53074217", "0.5304885", "0.5297415", "0.52890706", "0.5278195", "0.5272642", "0.5270809", "0.5263571", "0.52613574", "0.5241477", "0.52373534", "0.52358204", "0.52196074", "0.52163285", "0.5188038", "0.51826894", "0.517704", "0.5164644", "0.51634634", "0.5161873", "0.5156724", "0.5148315", "0.5148206", "0.5134979", "0.51343507", "0.51256317", "0.5122299", "0.51163423", "0.51163423", "0.51102847", "0.51063573", "0.508901", "0.50888556", "0.5086387", "0.50859094", "0.5065389", "0.5050892", "0.5050284", "0.5047269", "0.50432974", "0.5039104", "0.5031004", "0.50297654", "0.50236255", "0.502204", "0.50192153", "0.5018947", "0.5011952", "0.5003839", "0.5002825", "0.4997091", "0.4997091", "0.4994724", "0.49915537", "0.49894437", "0.49871543", "0.49870262", "0.49843973", "0.49803954", "0.49777338", "0.49771053" ]
0.5865172
11
This function is used to return a error if any custom errors occurs.
function UndefinedResponseFromDBerror(querySql) { return { table: undefined, code: 99999, routine: 'undefinedResponseFromDatabase', hint: undefined, detail: 'Query Sent: ' + querySql, }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CustomError() {}", "get hasError() {\n return this._customError == null ? this._getDefaultError() : this._customError;\n }", "defineCustomErrors() {\n this.restifyErrors.InvalidTokenError = this.restifyErrors.makeConstructor('InvalidTokenError', {\n statusCode: 404,\n failureType: 'motion'\n });\n\n this.restifyErrors.BusinessError = this.restifyErrors.makeConstructor('BusinessError', {\n statusCode: 500,\n failureType: 'motion'\n });\n\n // this.restifyErrors.InvalidIdendifierError = this.restifyErrors.makeConstructor('InvalidIdendifierError', {\n // statusCode: 400,\n // failureType: 'motion'\n // });\n //\n // Ex.: ErrorHandler.throw('Your CPF is not valid', 'InvalidIdendifierError')\n }", "function MyError() {}", "function MyError() {}", "isError() { return this.type==Token.ERROR }", "isError() { return this.type==Token.ERROR }", "function VeryBadError() {}", "customFormatErrorFn(err){\n // original error will be set by express graphql when it detects an error i.e\n // thrown in the code (either by you or any 3rd party package)\n if(!err.originalError){\n return err;\n }\n const data = err.originalError.data;\n const message = err.message || \"An error occured\";\n const code = err.originalError.code || 500;\n return {\n message,\n data,\n code\n }\n\n }", "function CustomError(message) {\n this.message = message;\n this.name = \"CustomError\";\n }", "static get ERROR() { return 3 }", "function getError() {\n return _error;\n }", "function getError() {\n return _error;\n }", "function getError() {\n return _error;\n }", "function getError() {\n return _error;\n }", "function exportFn(){\n // if set, if this module is called as a function, the arguments will just be\n // passed along to this function\n var fn;\n \n // what we will export\n function errorsBase(){\n // if there is a base fn, call it\n if(typeof fn === 'function'){\n return fn.apply(this, arguments); // jshint ignore:line\n }\n \n // otherwise, we're done here\n }\n \n // need to be able to set the fn from plugins\n errorsBase.setFn = function setErrorsBaseFn(error_fn){\n fn = error_fn;\n };\n \n // used to create a new error type\n function extendError(constructor, error_name, default_message, status_code, safe_message) {\n /*jshint validthis:true */\n \n // check for optional constructor\n if(typeof constructor !== 'function'){\n safe_message = status_code;\n status_code = default_message;\n default_message = error_name;\n error_name = constructor;\n constructor = undefined;\n }\n \n if(!constructor){\n constructor = function CustomError(message, error, additional, field, base_error) {\n // call init (only thing required for a constructor). Only passing \"this\" is required.\n // but everything else should probably be handled\n return constructor._init(this, message, error, additional, field, base_error);\n };\n }\n \n var parent = (this !== errorsBase ? this : Error);\n \n // do we have inheritance handling?\n if(errorsBase.inherits){\n errorsBase.inherits(constructor, parent);\n }\n \n // add an _init function for the constructor\n Object.defineProperty(constructor, '_init', {\n value: function errorInit(inst, message, error, additional, field, generic_error) {\n // HACK: We don't want to need the \"new\" operator but we need the error to be an instanceof\n // the constructor. So, if called without the new operator, we create a new instance and \n // and pass something very unlikely to be passed (constructor as message) to flag that we \n // just want it to return\n if (message === constructor) return;\n // make sure we have an instanceof this constructor\n if (!(inst instanceof constructor)) inst = new constructor(constructor);\n \n // do we call super's constructor?\n if(errorsBase.inheritsSuper){\n parent.call(inst);\n }\n \n // set the message\n inst.message = message || default_message;\n \n // are messages passed safe?\n if (safe_message){\n inst.safe_message = inst.message;\n }\n \n // store the original error (used to mutate errors)\n if (error){\n inst.error = error;\n }\n \n // additional is optional and should be an object. If string, we assume it's a field\n if(typeof additional === 'string' && typeof field !== 'string'){\n generic_error = field;\n field = additional;\n additional = undefined;\n }\n \n // additional information passed?\n if (additional) {\n var addl = {};\n inst.additional = addl;\n for (var i in additional){\n addl[i] = additional[i];\n }\n }\n \n // field is optional\n if(typeof field !== 'string'){\n generic_error = field;\n field = undefined;\n } else {\n inst.field = field;\n }\n \n // generic_error?\n if(generic_error){\n inst.generic = true;\n }\n \n // do we have something for capturing stack traces?\n if(errorsBase.captureStackTrace){\n errorsBase.captureStackTrace(inst, constructor);\n }\n \n // return this error\n return inst;\n },\n enumerable: false\n });\n \n // add default toString method\n Object.defineProperty(constructor.prototype, 'toString', {\n value: function errorToString() { \n return this.name + ': ' + this.message; \n },\n enumerable: false,\n configurable: true\n });\n \n // set default values\n constructor.prototype.name = error_name;\n constructor.prototype.status_code = status_code || 500;\n constructor.prototype.safe_message = default_message;\n \n // want to be able to extend this error\n constructor.extend = extendError;\n \n // return the constructor\n return constructor;\n }\n \n \n // by default, should be able to add, extend, and rebase errors\n errorsBase.add = addError;\n errorsBase.extend = extendError;\n errorsBase.rebase = rebaseError;\n \n // return our errorsBase\n return errorsBase;\n}", "function _extendError(err) {\n\tif (!err) return err;\n\tif (err.statusCode === 404) err.noSuchContainer = true;\n\treturn err;\n}", "static get ERROR () { return 0 }", "function CustomError(message) {\n this.name = \"CustomError\";\n this.message = message || \"Default Custom Error Message\";\n Error.captureStackTrace(this, CustomError);\n}", "_error(msg) {\n msg += ` (${this._errorPostfix})`;\n const e = new Error(msg);\n return e;\n }", "error(error) {}", "function getErrorObj(){\n\t\t try{ throw Error(\"\")}catch(err){ return err }\n\t }", "error() {}", "errorByCode (code, info) {\n\t\tconst tag = Object.keys(this.errors).find(key => {\n\t\t\treturn this.errors[key].code === code;\n\t\t});\n\t\tif (tag) {\n\t\t\treturn this.error(tag, info);\n\t\t}\n\t\telse {\n\t\t\treturn this.error('???', info);\t// will return an UNKNOWN error, not ideal at all\n\t\t}\n\t}", "static get Unknown() {\n// Return new error...\n return new Error(\n 'MountingError: There was an unknown error during the mounting process.'\n )\n }", "error(code){\n switch (code) {\n case 400: return 'No such account or incorrect password'; break;\n case 401: return 'Account disabled'; break;\n case 402: return 'Permission denied'; break;\n case 403: return '2-step verification code required'; break;\n case 404: return 'Failed to authenticate 2-step verification code'; break;\n }\n // No specific error, so call super function\n return super.error(...arguments);\n }", "function getErrorObject(){\n try { throw Error('') } catch(err) { return err; }\n}", "function CustomError(type,message){\n\t\t\tthis.type=type;\n\t\t\tthis.message=message;\n\t\t}", "getError(errorCode) {\n return super.getError(errorCode);\n }", "static get notFoundError() {\n return getErrorObject('OFFER_NOT_FOUND', 404);\n }", "function CustomException(message) {\n const error = new Error(message);\n return error;\n}", "function error(){\n return \"Invaild e-mail or password!\";\n }", "function errorHandler(err, req, res, next) {\n // Checks if err is of type CustomError\n if (err instanceof custom_error_1.CustomError) {\n // Calls serializeErrors method, inserts results into errors object, sends back to user\n return res.status(err.statusCode).send(err.serializeError());\n }\n console.error(err);\n var _a = new unknown_error_1.UnknownError(), statusCode = _a.statusCode, serializeError = _a.serializeError;\n res.status(statusCode).send(serializeError());\n}", "jsonError() {\n return {\n status: this.code,\n error_code: 'NOT_FOUND',\n error_message: this.errorMessage,\n };\n }", "function verifyErrors() {\n let foundError = false;\n\n for(let error in field.validity) {\n // se não for customError\n // então verifica se tem erro\n if (field.validity[error] && !field.validity.valid) {\n foundError = error\n }\n }\n return foundError;\n }", "get error() {\r\n return this._error;\r\n }", "async getCodeError () {\n\t\tconst { objectId, objectType } = this.request.query;\n\t\tif (!objectId) {\n\t\t\tthrow this.errorHandler.error('parameterRequired', { info: 'objectId' });\n\t\t}\n\t\tif (!objectType) {\n\t\t\tthrow this.errorHandler.error('parameterRequired', { info: 'objectType' });\n\t\t}\n\n\t\tthis.codeError = await this.data.codeErrors.getOneByQuery(\n\t\t\t{\n\t\t\t\tobjectId,\n\t\t\t\tobjectType \n\t\t\t},\n\t\t\t{\n\t\t\t\thint: CodeErrorIndexes.byObjectId\n\t\t\t}\n\t\t);\n\t\tif (!this.codeError) {\n\t\t\tthrow this.errorHandler.error('notFound', { info: 'codeError' });\n\t\t}\n\t\tif (this.headerAccountId !== this.codeError.get('accountId')) {\n\t\t\tthrow this.errorHandler.error('readAuth', { reason: 'accountId given in the header does not match the object' });\n\t\t}\n\t}", "function verifyErrors() {\n let foundError = false;\n\n for(let error in field.validity) {\n // se não for customError\n // então verifica se tem erro\n if (field.validity[error] && !field.validity.valid ) {\n foundError = error\n }\n }\n return foundError;\n }", "function notSupportedError() {\n\t\treturn sendError(\"Not currently supported!\");\n\t}", "jsonError() {\n const error = {\n status: this.code,\n error_code: 'FORBIDDEN',\n };\n\n if (this.message) {\n error.error_message = this.message;\n }\n\n return error;\n }", "function verifyErrors() {\n let foundError = false;\n \n for (let error in field.validity) {\n // se não for customError\n // então verifica se tem error\n if (field.validity[error] && !field.validity.valid){\n foundError = error;\n }\n }\n \n return foundError;\n }", "function extendError(constructor, error_name, default_message, status_code, safe_message) {\n /*jshint validthis:true */\n \n // check for optional constructor\n if(typeof constructor !== 'function'){\n safe_message = status_code;\n status_code = default_message;\n default_message = error_name;\n error_name = constructor;\n constructor = undefined;\n }\n \n if(!constructor){\n constructor = function CustomError(message, error, additional, field, base_error) {\n // call init (only thing required for a constructor). Only passing \"this\" is required.\n // but everything else should probably be handled\n return constructor._init(this, message, error, additional, field, base_error);\n };\n }\n \n var parent = (this !== errorsBase ? this : Error);\n \n // do we have inheritance handling?\n if(errorsBase.inherits){\n errorsBase.inherits(constructor, parent);\n }\n \n // add an _init function for the constructor\n Object.defineProperty(constructor, '_init', {\n value: function errorInit(inst, message, error, additional, field, generic_error) {\n // HACK: We don't want to need the \"new\" operator but we need the error to be an instanceof\n // the constructor. So, if called without the new operator, we create a new instance and \n // and pass something very unlikely to be passed (constructor as message) to flag that we \n // just want it to return\n if (message === constructor) return;\n // make sure we have an instanceof this constructor\n if (!(inst instanceof constructor)) inst = new constructor(constructor);\n \n // do we call super's constructor?\n if(errorsBase.inheritsSuper){\n parent.call(inst);\n }\n \n // set the message\n inst.message = message || default_message;\n \n // are messages passed safe?\n if (safe_message){\n inst.safe_message = inst.message;\n }\n \n // store the original error (used to mutate errors)\n if (error){\n inst.error = error;\n }\n \n // additional is optional and should be an object. If string, we assume it's a field\n if(typeof additional === 'string' && typeof field !== 'string'){\n generic_error = field;\n field = additional;\n additional = undefined;\n }\n \n // additional information passed?\n if (additional) {\n var addl = {};\n inst.additional = addl;\n for (var i in additional){\n addl[i] = additional[i];\n }\n }\n \n // field is optional\n if(typeof field !== 'string'){\n generic_error = field;\n field = undefined;\n } else {\n inst.field = field;\n }\n \n // generic_error?\n if(generic_error){\n inst.generic = true;\n }\n \n // do we have something for capturing stack traces?\n if(errorsBase.captureStackTrace){\n errorsBase.captureStackTrace(inst, constructor);\n }\n \n // return this error\n return inst;\n },\n enumerable: false\n });\n \n // add default toString method\n Object.defineProperty(constructor.prototype, 'toString', {\n value: function errorToString() { \n return this.name + ': ' + this.message; \n },\n enumerable: false,\n configurable: true\n });\n \n // set default values\n constructor.prototype.name = error_name;\n constructor.prototype.status_code = status_code || 500;\n constructor.prototype.safe_message = default_message;\n \n // want to be able to extend this error\n constructor.extend = extendError;\n \n // return the constructor\n return constructor;\n }", "function errorsBase(){\n // if there is a base fn, call it\n if(typeof fn === 'function'){\n return fn.apply(this, arguments); // jshint ignore:line\n }\n \n // otherwise, we're done here\n }", "static error () {\n\t // TODO\n\t const relevantRealm = { settingsObject: {} };\n\n\t // The static error() method steps are to return the result of creating a\n\t // Response object, given a new network error, \"immutable\", and this’s\n\t // relevant Realm.\n\t const responseObject = new Response();\n\t responseObject[kState] = makeNetworkError();\n\t responseObject[kRealm] = relevantRealm;\n\t responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList;\n\t responseObject[kHeaders][kGuard] = 'immutable';\n\t responseObject[kHeaders][kRealm] = relevantRealm;\n\t return responseObject\n\t }", "function fixError(r, code) {\n return errors[r.code](r, code);\n }", "function CustomError (message, code) {\n Error.captureStackTrace(this, this.constructor);\n this.code = code;\n this.message = `${message} (${code})`;\n}", "get error() {\n return this._error;\n }", "function CustomError(message) {\n\tthis.message = message;\n\tthis.stack = (new Error()).stack; // `Error` provides stack trace\n}", "error (key, info) {\n\t\tif (!this.errors[key]) {\n\t\t\treturn {\n\t\t\t\tcode: 'UNKNOWN',\n\t\t\t\tmessage: 'Unknown error'\n\t\t\t}; // don't let this happen\n\t\t}\n\t\t// make a copy of the error object, we don't want to alter the original!\n\t\treturn Object.assign({}, this.errors[key], info);\n\t}", "function BaseErrorHandler() {\n\n }", "function fail() {\n return error('Something failed');\n }", "error(error) {\n return true;\n }", "error(...args) {\n return this.getInstance().error(...args);\n }", "onerror() {}", "onerror() {}", "function r(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function r(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function r(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function r(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function r(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function r(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function r(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "hasError(errorCode) {\n return super.hasError(errorCode);\n }", "isErr() {\n return true;\n }", "handleError$(err) {\n console.log(\"Handle error => \", err);\n return of(err).pipe(\n map(err => {\n const exception = { data: null, result: {} };\n const isCustomError = err instanceof CustomError;\n if (!isCustomError) {\n err = new DefaultError(err);\n }\n exception.result = {\n code: err.code,\n error: { ...err.getContent() }\n };\n return exception;\n })\n );\n }", "parseError(error) {\n if (error.code === 400 && (error.details && error.details.length)) {\n return {\n code: error.code,\n msg: get(error, 'details')[0] || 'Error',\n };\n }\n return error;\n }", "function getErrorObject() {\n try { throw Error('') } catch(err) { return err; }\n}", "isErr() {\n return false;\n }", "function Fl(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function signUpError() {\n\treturn { type: types.SIGNUP_ERROR_USER };\n}", "jsonError() {\n return {\n status: this.code,\n error_code: 'SERVER_ERROR',\n };\n }", "jsonError() {\n return {\n status: this.code,\n error_code: 'ALREADY_EXIST',\n error_message: this.errorMessage,\n };\n }", "function Nr(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function err(strm,errorCode){strm.msg=msg[errorCode];return errorCode;}", "onError(callback) {\n return this.__internal.addErrorCallback(callback)\n }", "lastDiagnosticAsError() {\n var _a, _b;\n let error = new Error((_b = (_a = this.diagnostics[this.diagnostics.length - 1]) === null || _a === void 0 ? void 0 : _a.message) !== null && _b !== void 0 ? _b : 'Unknown error');\n error.isDiagnostic = true;\n return error;\n }", "function getErrorType(value) {\n switch (Object.getPrototypeOf(value)) {\n case Error.prototype: return V.Error\n case EvalError.prototype: return V.EvalError\n case RangeError.prototype: return V.RangeError\n case ReferenceError.prototype: return V.ReferenceError\n case SyntaxError.prototype: return V.SyntaxError\n case TypeError.prototype: return V.TypeError\n case URIError.prototype: return V.URIError\n default: return V.CustomError\n }\n}", "jsonError() {\n return {\n status: this.code,\n error_code: 'BAD_REQUEST',\n error_message: this.errorMessage,\n };\n }", "function createBuiltInErrorInVm(name) {\n\t return {\n\t builtInError: true,\n\t name: name\n\t };\n\t}", "constructor (err,data) {\n \n // Calling parent constructor of base Error class.\n super(err);\n \n // Saving class name in the property of our custom error as a shortcut.\n this.data = data || {};\n\n // Capturing stack trace, excluding constructor call from it.\n Error.captureStackTrace(this, this.constructor);\n \n // You can use any additional properties you want.\n // I'm going to use preferred HTTP status for this error types.\n // `500` is the default value if not specified.\n }", "function SecuritySchemeError() {\n\t _ref = SecuritySchemeError.__super__.constructor.apply(this, arguments);\n\t return _ref;\n\t }", "static getError(state) {\n const { error } = state;\n return error;\n }", "function createInternalError() {\n return new errorObj(1000, 'Internal error occurred');\n}", "jsonError() {\n return {\n status: this.code,\n error_code: 'TOO_MANY_REQUESTS',\n error_message: this.errorMessage,\n };\n }", "function $r(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function handleCustomMessage(error) {\n return [{\n message: error.customMessage,\n field: error.path,\n type: error.type,\n }];\n}", "errorHandler$(err) {\n return Rx.Observable.of(err)\n .map(err => {\n const exception = { data: null, result: {} };\n const isCustomError = err instanceof CustomError;\n if(!isCustomError){\n err = new DefaultError(err)\n }\n exception.result = {\n code: err.code,\n error: {...err.getContent()}\n }\n return exception;\n });\n }", "function Lo(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function Lo(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function Lo(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "getError() {\n return this.error;\n }", "function _createJsonErrorObject(msg, pointer, httpCode, code, title, meta) {\n let error = {\n detail: msg,\n status: httpCode.toString(),\n title: title,\n code: 'IRIS_' + code.toString()\n };\n\n if (pointer) {\n error.source = {\n pointer: pointer\n };\n }\n\n if (meta) {\n error.meta = meta;\n }\n\n return error;\n}", "function Mi(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function sc_errorHook() {\n return __sc_errorHook;\n}", "function Bo(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function checkErrors(errors) {\n switch (errors) { case \"strict\": case \"pad\": case \"ignore\": return errors; }\n throw new RangeError(`unknown error handler name '${errors}'`);\n }", "error(message) {\n return this.sendMessage(MessageType.Error, message);\n }", "function verifyErrors() {\n\t\tlet foundError = false;\n\t\n \n for(let error in field.validity) {\n \t\t// se nao for customErorr\n \t\t//entao verifica se tem erro\n \t\tif( field.validity[error] && !field.validity.valid) {\n\n \t\t\tfoundError = error\n \t\t}\n }\n return foundError;\n\n }", "[custom]() {\n return `RestError: ${this.message} \\n ${errorSanitizer.sanitize(this)}`;\n }", "[custom]() {\n return `RestError: ${this.message} \\n ${errorSanitizer.sanitize(this)}`;\n }", "[custom]() {\n return `RestError: ${this.message} \\n ${errorSanitizer.sanitize(this)}`;\n }" ]
[ "0.8013928", "0.6957574", "0.6607771", "0.6607448", "0.6607448", "0.6575326", "0.6575326", "0.64419395", "0.6425787", "0.63371867", "0.6332238", "0.6323492", "0.6323492", "0.6323492", "0.6323492", "0.6322886", "0.62674284", "0.6251813", "0.62160426", "0.62103516", "0.62058824", "0.6195353", "0.61912584", "0.61717516", "0.61678797", "0.61333346", "0.6133253", "0.60892963", "0.60761285", "0.60719293", "0.60445493", "0.60439306", "0.6038042", "0.6025946", "0.6022077", "0.6020522", "0.60024405", "0.59768337", "0.5962573", "0.59524906", "0.59518987", "0.59501976", "0.5948618", "0.5944629", "0.59296894", "0.5925443", "0.5923522", "0.59201705", "0.5912128", "0.5903198", "0.59008133", "0.5898707", "0.58967525", "0.58950794", "0.58950794", "0.5894492", "0.5894492", "0.5894492", "0.5894492", "0.5894492", "0.5894492", "0.5894492", "0.5889522", "0.5880515", "0.5872841", "0.58658516", "0.5861943", "0.5858649", "0.5848655", "0.5838717", "0.5837964", "0.5817853", "0.5816005", "0.5814053", "0.5812017", "0.5795153", "0.5786264", "0.5779076", "0.5778159", "0.5767024", "0.5757257", "0.5755862", "0.57429117", "0.5739886", "0.5738145", "0.5713697", "0.5711728", "0.57097274", "0.57097274", "0.57097274", "0.57094395", "0.57068145", "0.57062715", "0.5704123", "0.57008857", "0.5699728", "0.5692039", "0.5689447", "0.56883466", "0.56883466", "0.56883466" ]
0.0
-1
! vuex v3.4.0 (c) 2020 Evan You
function i(t){var e=Number(t.version.split(".")[0]);if(e>=2)t.mixin({beforeCreate:r});else{var n=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[r].concat(t.init):r,n.call(this,t)}}function r(){var t=this.$options;t.store?this.$store="function"===typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFieldVuex() {\n return store.getters.dataField;\n }", "getProfileVuex() {\n return store.getters.dataProfile;\n }", "function vuexInit(){var options=this.$options;// store injection\n\tif(options.store){this.$store=options.store;}else if(options.parent&&options.parent.$store){this.$store=options.parent.$store;}}", "function vuexInit() {\n\t var options = this.$options;\n\t var store = options.store;\n\t var vuex = options.vuex;\n\t // store injection\n\t\n\t if (store) {\n\t this.$store = store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t // vuex option handling\n\t if (vuex) {\n\t if (!this.$store) {\n\t console.warn('[vuex] store not injected. make sure to ' + 'provide the store option in your root component.');\n\t }\n\t var state = vuex.state;\n\t var getters = vuex.getters;\n\t var actions = vuex.actions;\n\t // handle deprecated state option\n\t\n\t if (state && !getters) {\n\t console.warn('[vuex] vuex.state option will been deprecated in 1.0. ' + 'Use vuex.getters instead.');\n\t getters = state;\n\t }\n\t // getters\n\t if (getters) {\n\t options.computed = options.computed || {};\n\t for (var key in getters) {\n\t defineVuexGetter(this, key, getters[key]);\n\t }\n\t }\n\t // actions\n\t if (actions) {\n\t options.methods = options.methods || {};\n\t for (var _key in actions) {\n\t options.methods[_key] = makeBoundAction(this.$store, actions[_key], _key);\n\t }\n\t }\n\t }\n\t }", "function U(He){Le&&(He._devtoolHook=Le,Le.emit('vuex:init',He),Le.on('vuex:travel-to-state',function(Ne){He.replaceState(Ne)}),He.subscribe(function(Ne,je){Le.emit('vuex:mutation',Ne,je)}))}", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexlocal() {\n return store => {\n // 判断是否有本地缓存如果有就取本地缓存的如果没有就取自身初始值\n let local = JSON.parse(localStorage.getItem('myVuex')) || store.replaceState(state)\n store.replaceState(local); // 替换state的数据\n store.subscribe((mutation,state) => { // 监听\n // 替换之前先取一次防止数据丢失\n let newstate = JSON.parse(JSON.stringify(state))\n localStorage.setItem('myVuex',JSON.stringify(newstate))\n })\n }\n}", "function vuexInit () {\n\t var options = this.$options\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = typeof options.store === 'function'\n\t ? options.store()\n\t : options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "users() {\n return this.$store.getters.users\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "getTokenVuex() {\n return store.getters.jwt;\n }", "function vuexInit () {\r\n var options = this.$options;\r\n // store injection\r\n if (options.store) {\r\n this.$store = typeof options.store === 'function'\r\n ? options.store()\r\n : options.store;\r\n } else if (options.parent && options.parent.$store) {\r\n this.$store = options.parent.$store;\r\n }\r\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }" ]
[ "0.67712444", "0.66986936", "0.66612864", "0.6331386", "0.63084495", "0.6247302", "0.6247302", "0.6247302", "0.62384593", "0.6236988", "0.61336607", "0.6127329", "0.606848", "0.60579044", "0.60579044", "0.60579044", "0.60579044", "0.60579044", "0.6051181", "0.60426307", "0.6028476", "0.5966807", "0.5966807", "0.5966807", "0.5966807", "0.5966807", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055" ]
0.0
-1
A callback function for logging out the current user
signOut() { /* Sign out the user, and update the state */ console.log('Signing out'); firebase.auth().signOut(); this.updateParent({ currentUser: null, points: '', name: '' }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "logOut() {\n authContextApi.logOut();\n }", "function _onLogout() {\n\t sitools.userProfile.LoginUtils.logout();\n\t}", "logoutUser() {\n // Only call change user if the elevio library has been loaded.\n this._callIfElevioIsLoaded('logoutUser');\n }", "logOutCurrentUser() {\n var self = this;\n self.auth.signOut();\n }", "function _logOutUser () {\n \tserverRequestService.serverRequest(PROJET_HEADER_CTRL_API_OBJECT.logout, 'GET');\n }", "function logOut(){\n clearCurrentUser();\n showLoggedOutView();\n}", "handleLogout() {\n UserService.logOut();\n }", "function logoutUser(){\n FB.logout(function(response) {\n // user is now logged out\n statusChangeCallback(response);\n });\n}", "logout() {\n\t\tUser.users.splice(User.users.indexOf(this), 1); // Remove user from memory.\n\t\t\n\t\tglobals.onLogout(this);\n\t\t\n\t\tthis.#connection.off(\"data\");\n\t\tthis.#connection.off(\"logout\");\n\t\tthis.#connection.leave(\"users\");\n\t\tthis.#connection.on(\"login\", data => User.tryLogin(this.#connection, data));\n\n\t\tthis.#connection.alert({msg:\"Logged out\", type:\"info\"});\n\t\tprint(`Web-CLI user has (been) logged out.`, `User-ID: ${this.id}`, `(Connection-ID: ${this.#connection.id})`);\n\t}", "function userLogout(req,cb){\n log.info(\"user logout: \" + req.user.email);\n users.destroyToken(req.body['token'], cb);\n}", "onLogoutClicked() {\n AuthActions.logoutUser();\n }", "function sign_out() {}", "function log_out() {\n if (is_logged_in()) {\n remove_param('last_sync');\n remove_param('last_sync_user');\n set_cookie(\"user\", \"\");\n clean_db(function() { window.location = \"index.html\"; });\n }\n}", "handleSignOut() {\n // Sign out the user -- this will trigger the onAuthStateChanged() method\n\n }", "logout() {\n _handleUserLogout();\n userDb.logout(this.user);\n this.userId = null;\n }", "function handleLogout() {\n\t\ttry {\n\t\t\t//Resetting the user info\n\t\t\tuserContext.setUserInfo({ username: \"\", id: \"\" });\n\n\t\t\t//Changing authenticated to false\n\t\t\tuserContext.setIsAuthenticated(false);\n\n\t\t\t//Deleting the JWT from local storage;\n\t\t\tlocalStorage.removeItem(\"auth-token\");\n\t\t} catch (error) {\n\t\t\tconsole.log(error.message);\n\t\t}\n\t}", "function logout() {\n\tcurrent_user_profile_picture_path = \"\";\n\tregisterUserRole(\"anonymous\");\n\tdxRequestInternal(getServerRootPath()+\"api/global_functions/logoutCurrentAccount\",\n\t\t{AuthenticationToken:getAuthenticationToken()},\n\t\tfunction(data_obj) {\n\t\t\tif (data_obj.LogoutResult === true) {\n\t\t\t\tif (!isNative()) {\n\t\t\t\t\tloadUserRoleLandingPage(\"anonymous\");\n\t\t\t\t} else {\n\t\t\t\t\tloadUserRoleLandingPage(\"native_landing\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Could not logout user: \"+JSON.stringify(data_obj));\n\t\t\t}\n\t\t},\n\t\tfunction(data_obj) {\n\t\t\tthrow new Error(\"Could not logout user: \"+JSON.stringify(data_obj));\n\t\t})\n}", "logout(cb) {\n this.authenticated = false;\n cb();\n }", "function LogOut(e){\n console.log(\"triggered\");\n db.auth().signOut();\n \n}", "function processUserLogOut() {\n $.ajax({\n url: \"/api/auth/logout\",\n type: \"POST\"\n })\n .done(function (data) {\n window.location = \"/site/login\";\n })\n .fail(function (data, textStatus, errorThrown) {\n window.location = \"/site/login\";\n });\n\n return false;\n }", "logout() { Backend.auth.logout(); }", "function userLogout(){\r\n delCookie();\r\n}", "function logoutUser() {\n auth.logout()\n .then(() => {\n sessionStorage.clear();\n showInfo('Logout successful.');\n userLoggedOut();\n }).catch(handleError);\n }", "logOut(e) {\n\t\t// prevent default behavior\n\t\te.preventDefault();\n\n\t\t// authenticate login\n\t\tauth.logout( (loggedOut) => {\n\t\t\t// if we register the user\n\t\t\tif (loggedOut) {\n\t\t\t\t// send us to their profile page\n\t\t\t\tthis.context.router.push({pathname: '/'})\n\t\t\t}\n\t\t})\n\t}", "function logout() {\n _basicLogin.logout();\n _handleSuccessLogin(null);\n}", "function logout() {\n console.log(\"logging out user\");\n FirebaseAuth.getInstance().signOut();\n}", "function logout() {\n auth.signOut();\n}", "function logOut() {\n $.post('core/action-design.php', {\n 'act': 'logout'\n })\n .success(function(data) {\n login = false;\n info('<label style=\"color:green\">Success for Logout</label>');\n });\n }", "logout() {\n\t\tgetRequest(\"/user/logout\");\n\t\tthis.setState({ user: { loginname: \"\", score: \"\", title: \"\" } });\n\t}", "function logout(cb) {\n ref.unauth();\n cb();\n }", "function loggedOut(){\n var $login = $('.login');\n switchTheme($login, 'c');\n $('.ui-btn-text', $login).text($login.data('text-login'));\n $login.attr('onclick', 'auth.login(true)');\n }", "onLogout() {\n\t\tlocalStorage.removeItem('userToken');\n\t}", "function logOut(){\n auth.signOut().then(()=>{\n setUser(\"\")\n })\n }", "logOut() {\n var event = new CustomEvent(\"authoff\");\n document.dispatchEvent(event);\n }", "logOut() {\n var event = new CustomEvent(\"authoff\");\n document.dispatchEvent(event);\n }", "function logout(callback) {\n\tsendRequest({ request: 'logout' }, callback);\n}", "function logoutUser(){\n updateViewToLoggedOut();\n}", "logoutUser() {\n // Attempts to logout of the current account\n firebase.auth().signOut().then(function() {\n // Removes the users information from the session storage\n sessionStorage.setItem('userName', null);\n sessionStorage.setItem('isAdmin', null); \n sessionStorage.setItem('uid', null);\n sessionStorage.setItem('email', null); \n window.alert(\"You have signed out successfully\");\n }).catch(function(error) {\n // Alerts the user of the error\n window.alert(error.message);\n });\n }", "function logout() {\n window.Lemonade.Mirror.send('logout', CookieManager.getCookie('loggedIn_user'), CookieManager.getCookie('loggedIn_session'));\n\n Store.AuthStore.dispatch(Auth.LOGOUT_ACTION());\n CookieManager.removeCookie('loggedIn');\n CookieManager.removeCookie('loggedIn_user');\n CookieManager.removeCookie('loggedIn_session');\n}", "function onSignOut() {\n console.log('>onSignOut');\n //showSignedOutUserControls();\n}", "function signOut() {\n localStorage.removeItem('curUser');\n}", "logout () {\n\n }", "function logout() {\r\n return auth().signOut();\r\n }", "function logoff() {\n authService.logout().then(function (response) {\n $state.go('home');\n }, function (err) {\n vm.signupErrorMsg = \"Sorry, there was an error loging you out. Try again\";\n });\n }", "function logOut (req, res, next) {\n if (req.user){\n req.logout();\n res.redirect('/');\n }\n}", "function logout() {\n console.log(\"logout() called\");\n\n var message = {\n \"email\": sessionStorage.email\n };\n\n var request = new TwiddlerRequest(\"POST\", \"/sign_out\",\n message, logoutHandler);\n request.send();\n}", "function handleLogout(user) {\n setLoginStatus(false)\n ls.removeItem('token')\n ls.removeItem('user_id')\n }", "logOut(){\n firebase.auth().signOut();\n }", "function handleLogout(e) {\r\n console.log('i am loging out');\r\n const resetUser = {\r\n username: '',\r\n password: '',\r\n remember: false,\r\n };\r\n setUser(resetUser);\r\n }", "function Logout() {\n localStorage.removeItem('user_id')\n}", "onOk() {\n\t\t\t\t\t\t\t\t\tsetLoggingOut(true)\n\t\t\t\t\t\t\t\t\tlogout()\n\t\t\t\t\t\t\t\t\t\t.then(res => {\n\t\t\t\t\t\t\t\t\t\t\t// window.spDebug(\"logout success\")\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t.catch(err => {\n\t\t\t\t\t\t\t\t\t\t\tconsole.error(err)\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t.then(() => {\n\t\t\t\t\t\t\t\t\t\t\tsetLoggingOut(false)\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"logout, set account null\")\n\t\t\t\t\t\t\t\t\t\t\tstorageManager.set(\"account\", null)\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t}", "on_logout() {\n\n // logout\n auth.signOut().then(res => {\n\n alert(\"Has cerrado tu sesión\");\n\n }).catch(error => {\n\n console.log(error);\n\n });\n\n }", "logOut() {\n let confirmLogout = window.confirm(\"Are you sure you want to log-out?\");\n if (confirmLogout) {\n Cookies.remove('application_user_data');\n this.setState({loggedInCookie: false})\n this.props.resetState();\n }\n this.props.updateDisplayMessage(null);\n }", "function logOut() {\n //reset all fields in extension context's global state\n let ctx = getExtensionContext();\n ctx.globalState.update(Constants_1.GLOBAL_STATE_USER_ID, undefined);\n ctx.globalState.update(Constants_1.GLOBAL_STATE_USER_TEAM_ID, undefined);\n ctx.globalState.update(Constants_1.GLOBAL_STATE_USER_TEAM_NAME, undefined);\n ctx.globalState.update(Constants_1.GLOBAL_STATE_USER_IS_TEAM_LEADER, false);\n ctx.globalState.update(Constants_1.GLOBAL_STATE_USER_NICKNAME, undefined);\n ctx.globalState.update(Constants_1.GLOBAL_STATE_USER_TEAM_MEMBERS, undefined);\n console.log(\"Logging out: \" + extensionContext.globalState);\n vscode_1.window.showInformationMessage(\"Goodbye!\");\n //reload treeview content to reflect the logout event\n vscode_1.commands.executeCommand(\"MenuView.refreshEntry\");\n vscode_1.commands.executeCommand(\"LeaderView.refreshEntry\");\n vscode_1.commands.executeCommand(\"DailyMetric.refreshEntry\");\n vscode_1.commands.executeCommand(\"TeamMenuView.refreshEntry\");\n}", "function logout() {\n var user = $stamplay.User().Model;\n user.logout();\n }", "logout(){\n\t\tvar self = this;\n\t\t\n\t\tUserHttpService.logout().then(function () {\n\t\t\tself.setState({\n\t\t\t\tuserSession: null\n\t\t\t}, function (){\n\t\t\t\t//redirect to the home page\n\t\t\t\tthis.props.history.push(\"/\");\n\t\t\t});\n\t\t});\t\n\t}", "doLogout() {\n this.user = null;\n }", "function handleLogout(){\n /**\n * Send request to backend\n */\n request.user.logout(function(result) {\n console.log(result);\n if (result === constants.RESPONSE_CODES.SUCCESS) {\n /**\n * Reset on success\n */\n request.user.dataSources = [\n {\n id: 9999,\n email: '[email protected]',\n sourceurl: 'https://services.odata.org/V2/Northwind/Northwind.svc',\n sourcetype: 0,\n sourcename: 'Northwind',\n islivedata: 'true',\n }\n ];\n props.handlePageType('home');\n props.setDashboardIndex('');\n props.setDashboardStage('dashboardHome');\n props.setIsAddingDashboard(false);\n props.setExploreStage('dataConnection');\n dispatch({ isLoggedIn: false }); \n logoutSuccessNotification('bottomRight');\n }\n });\n }", "function logout() {\n\n }", "function logout() {\n localStorage.removeItem('user');\n}", "logout() {\n deprecate('The elevio.logout function is being deprecated please use elevio.logoutUser instead', false, {\n id: 'ember-elevio.logout',\n until: '1.0.0'\n });\n\n this.logoutUser();\n }", "onLogOut() {\r\n this.controller.remove();\r\n this.controller = null;\r\n this.login.logOut();\r\n }", "function logout (argv, cb) {\n var args = argv._;\n fhreq.POST(fhreq.getFeedHenryUrl(), \"box/srv/1.1/act/sys/auth/logout\", function (err, remoteData, raw, response) {\n var user = fhc.config.get('username');\n if(err) return cb(err);\n ini.del('cookie');\n ini.del('username');\n ini.del(keys.KEY_ID);\n ini.save(function(err){\n // remove from targets\n var targ = fhc.config.get(\"feedhenry\");\n targets.removeTarget(targ, user);\n logout.message = \"Successfully logged out of \" + targ;\n return cb(err, remoteData);\n });\n });\n}", "function logout() {\n return async (ctx) => {\n const { username } = ctx.request.body;\n\n log.info('[Auth/logout] username', username);\n\n ctx.logout();\n\n ctx.status = 200;\n };\n}", "logout() {\n localStorage.removeItem(\"user\");\n }", "function logout() {\r\n authenticationService.logout();\r\n toastr.success('Goodbye!');\r\n }", "logout() {\n localStorage.removeItem('user');\n }", "function logOut() {\n FB.logout();\n buttonView('logOut')\n }", "function logUserOut(){\n\tif(sessionStorage.getItem(\"firstName\")){\n\t\tgenerateGoodbyeJumbotron();\n\t\tsessionStorage.clear();\n\t}\n\telse{\n\t\tloadJumbotron();\n\t}\n\tloadNavbar();\n\tgenerateCarousels();\n}", "function Logout()\n {\n // if the user is local account type, clear the local storage and redirect the url to root\n if (localStorage.getItem(\"logintype\")==\"localaccount\")\n {\n localStorage.clear()\n history.push(\"/\");\n }\n else {\n // implement the google logout function\n var auth2 = gapi.auth2.getAuthInstance();\n\t auth2.signOut().then(function () {\n \tconsole.log('User signed out.');\n\n \t// push the url to root on sign out\n history.push(\"/\");\n\t });\n\n\t // Disconnecting and revoking login session\n\t auth2.disconnect();\n\t}\n }", "function fnLogOut() {\n /* Conditional Statement to confirm if the user really wants to log out\n Introduction the Switch Conditional Statement\t\n This checks from a list of known possibilities before making a decision\n or, goes to the \"default\" if all else fails choice\n Using the built-in .confirm() Method, we can ask a question\n with two possible responses: true or false\n Our Switch waits for their interaction, then captures true/false\n then deals with it. \n Pro tip: try putting the most common possibility first\n */\n switch (window.confirm(\"Are you sure you want to log out?\")) {\n case true:\n console.log(\"They DO want to log out\");\n // Clear the Log In form of the last User that logged in\n $elFormLogIn[0].reset();\n // Mark that the current user logged out\n localStorage.setItem(\"whoIsLogged\", \"\");\n // To-do: Save any unsaved comic data\n // Then move from the current screen to the Welcome screen\n $(\":mobile-pagecontainer\").pagecontainer(\"change\", \"#pgWelcome\", { \"transition\": \"slidedown\" });\n break;\n case false:\n console.log(\"They DO NOT want to log out\");\n break;\n case \"maybe\":\n console.log(\"They might want to want to log out\");\n break;\n default:\n console.log(\"We don't know what they want\");\n break;\n } // END Switch to confirm logging out\n } // END fnLogOut()", "function logout(context) {\n userModel.logout()\n .then(function () {\n sessionStorage.clear();\n handler.showInfo(`Logout successful.`);\n context.redirect('#/home');\n })\n }", "signOut(){\n /* Sign out the user, and update the state */\n\n }", "function logout() {\n\tuserService.logout();\n\treturn { type: userConstants.LOGOUT };\n}", "function Logout()\n {\n\n //elimino las cookies\n $.session.remove(\"EmailUser\");\n $.session.remove(\"PasswordUser\");\n detectLogin();\n\n\n }", "function logout() {\n\n /* Cleanning up user's history */\n PStorage.drop();\n PStorage.init(function () {\n PStorage.set('logout', JSON.stringify({\n lat: userModel.get('latitude'),\n lon: userModel.get('longitude')\n }), function () {\n facebookConnectPlugin.logout(function () {\n location.reload();\n });\n\n });\n });\n}", "function logOut() {\n firebase\n .auth()\n .signOut()\n .then(\n function() {\n console.log(\"Sign-out successful\");\n },\n function(error) {\n // An error happened.\n }\n );\n}", "function handleLogOut(){\r\n var xhttp = new XMLHttpRequest();\r\n let token = localStorage.getItem(\"sessTok\");\r\n\r\n // Callback\r\n xhttp.onreadystatechange = function(){\r\n if(this.readyState == 4 && this.status == 204){\r\n localStorage.setItem(\"sessTok\", null);\r\n localStorage.setItem(\"userName\", null);\r\n location.replace('login.html');\r\n }\r\n };\r\n\r\n xhttp.open(\"POST\", \"http://fa19server.appspot.com/api/Users/logout?access_token=\" + token, true);\r\n xhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\r\n xhttp.send();\r\n}", "function authLogout() {\n\t\tif (getAuthCookie() !== null)\n\t\t\trequest('GET', tools.urlLogout, authLogoutSuccess, authLogoutError);\n\t}", "function logout()\n {\n\n }", "logout(callback) {\n super.del(this.baseUrl + '/v1/logout', {}, callback);\n }", "onLoggedOut() {\n localStorage.removeItem('user');\n localStorage.removeItem('token');\n this.props.setUser(null);\n window.open('/', '_self');\n }", "function logoutUser() {\n\t\tauth.logout()\n\t\t\t.then(() => {\n\t\t\t\tsessionStorage.clear();\n\t\t\t\tshowInfo('Logout successful.');\n\t\t\t\tuserLoggedOut();\n\t\t\t\tshowView('SignIn');\n\t\t\t}).catch(handleError);\n\t}", "function logout(request, isManual, whereAmI, onSuccess) {\n\n}", "function logOut() {\n localStorage.removeItem('idToken');\n localStorage.removeItem('username');\n localStorage.removeItem('profilePicture');\n localStorage.removeItem('userId');\n window.location.href='http://clrksanford.github.io/date-night/';\n}", "function handleLogout() {\n window.localStorage.clear();\n setToken(\"\");\n setCurrentUser({});\n history.push('/');\n }", "function logout()\n {\n setUserData({\n token: undefined,\n user: undefined\n })\n localStorage.setItem(\"auth-token\", \"\")\n }", "function doLogOut() {\n\t\tif(!UserContext.isUserAuthenticated()) {\n\t\t\treturn;\n\t\t}\n\n\t\tresetStatus();\n\t\t$scope.status.loading = true;\n\n\t\tUserContext.logOutUser($stateParams.sessionEnded)\n\t\t\t.finally(function () {\n\t\t\t\tresetStatus();\n\t\t\t\t$scope.status.active = true;\n\t\t\t\tif($stateParams.sessionEnded){\n\t\t\t\t\t$scope.status.sessionEnded = true;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$scope.status.loggedOut = true;\n\t\t\t\t}\n\n\n\t\t\t});\n\t\treturn true;\n\t}", "function handleSignoutClick() {\n auth2.signOut();\n}", "logout() {\n this.authenticated = false;\n\n localStorage.removeItem('user');\n }", "function exit_user(){\n window.location.href='/logout'\n}", "function logOut() {\n localStorage.removeItem('id_token')\n showWelcome()\n}", "function handleSignOut(event) {\n GoogleAuth.signOut();\n logoutHandler;\n }", "function logout() {\n $log.debug(\"logout called\");\n return $auth.logout();\n }", "function logout(event) {\n localStorage.removeItem(\"username\");\n checkLocalStorage();\n}", "logout () {\n API.User.Logout(AppStorage.getAuthToken())\n .then(() => {\n AppDispatcher.handleAction({\n actionType: 'CLEAR_SESSION'\n })\n AppStorage.clearAll()\n browserHistory.push('/')\n })\n .catch(error => {\n AppSignal.sendError(error)\n AppDispatcher.handleAction({\n actionType: 'CLEAR_SESSION'\n })\n AppStorage.clearAll()\n browserHistory.push('/')\n })\n }", "function logout() {\n userService.logout();\n return { type: userConstants.LOGOUT };\n}", "onLoggedOut() {\n\t\tlocalStorage.clear();\n\t\tthis.setState({\n\t\t\tuser: null,\n\t\t});\n\t}", "function logOut() {\n\t// Check to make sure that there is a user signed in\n\tif (profile) {\n\t\t// Sign the user out\n\t\tfirebase.auth().signOut().then(function() {\n\t\t\t// logout was successfull\n\t\t\t// updateProfile();\n\t\t}).catch(function(error) {\n\t\t\talert(\"Error logging out: \" + error);\n\t\t});\n\t\t// Reload the page\n\t\tlocation.reload();\n\t}\n}", "function Logout(){\n AuthenticationService.ClearCredentials();\n $state.go('Login');\n }", "logOut({\n commit\n }) {\n commit('SET_CURRENT_USER', null)\n }" ]
[ "0.78584677", "0.78573793", "0.7797249", "0.774198", "0.769203", "0.7674748", "0.76706636", "0.76639867", "0.7661032", "0.76554364", "0.7653651", "0.76401776", "0.7607831", "0.7564663", "0.7535144", "0.75282425", "0.7520898", "0.7500509", "0.7499519", "0.74872684", "0.74849313", "0.745628", "0.74349904", "0.74330395", "0.7415232", "0.74063915", "0.74045116", "0.7345866", "0.7326561", "0.7321527", "0.7315086", "0.73123986", "0.73079395", "0.7306905", "0.7306905", "0.7306058", "0.73017865", "0.72663325", "0.7259283", "0.7248963", "0.72456807", "0.7244085", "0.72372496", "0.723053", "0.7222518", "0.72176534", "0.7216611", "0.72073144", "0.71757907", "0.7175249", "0.7173933", "0.7173587", "0.7165843", "0.7141961", "0.71416146", "0.7140655", "0.713763", "0.7131727", "0.7131581", "0.71233845", "0.7114473", "0.71144176", "0.7113807", "0.711266", "0.7111572", "0.71082354", "0.7108137", "0.71027726", "0.7100921", "0.71002966", "0.70987535", "0.7087738", "0.7085713", "0.7082762", "0.7081794", "0.7077329", "0.7076192", "0.70730686", "0.70715237", "0.70710963", "0.7069235", "0.7068002", "0.7065529", "0.7062385", "0.70535296", "0.70501196", "0.70469785", "0.704537", "0.70433503", "0.7037998", "0.7032774", "0.7030732", "0.7030465", "0.70227444", "0.7019502", "0.70175445", "0.7011621", "0.7010966", "0.7004563", "0.7002371", "0.6994125" ]
0.0
-1
500 algo fatal 404 no se encotro 200 exitoso
function index(req,res){ const stat = fs.statSync('./index.html') res.writeHead(200,{ "Content-Type":"text/html", "Content-Lenght":stat.size }) const readStream = fs.createReadStream('./index.html'); readStream.pipe(res) //res.write("index"); //res.end(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function f404(data,res) {\n res.setHeader('Content-Type', 'application/json');\n res.status(404);\n res.end(JSON.stringify({\"error\":-1,\"message\":\"404\"}));\n}", "function notFound() {\n statusCode = 404;\n outputFile = \"404.html\";\n }", "function handle404(request, response) {\n response.status(404).send(\"No Api found! Try again.\");\n}", "function notFoundHandler (ctx) {\n ctx.status = 404\n}", "function notFoundHandler(req, res, next) {\n res.status(404).json(responseGenerator(null, 404, \"Not found\"));\n}", "function pageNotFound( request, response ) {\n response.send( `<p>Error: Page not found. URL = ${request.url}</p>` );\n}", "function error404(response){\n\tresponse.writeHead(404, {\"Content-Type\": \"text/plain\"})\n\tresponse.write(\"Error 404: Page not found.\");\n\tresponse.end();\n}", "function send404 ( response ) {\n\n\tresponse.writeHead( 404, { 'Content-Type ' : 'text/plain' } );\n\tresponse.write( 'Error 404 : resource not found, sorry mate' );\n\tresponse.end();\n}", "async function notfoundpage(response, url) {//404 page goes here\r\n response.writeHead(404);\r\n response.write('404 page not , code: ', url);\r\n console.error('File not found: ', url)\r\n}", "function pageNotFound(res) {\r\n\r\n fs.readFile(__dirname + '/PageNotFound.html', function (err, content) {\r\n\r\n // restituisco il file\r\n res.writeHead(404) ;\r\n res.end(content) ;\r\n }) ;\r\n}", "function send404(response){\n response.writeHead(404,{'Content-Type':'text/plain'});\n response.write('Error 404:resource not found.');\n response.end();\n}", "function send404(response){\n response.writeHead(404, {'content-type': 'text/plain'});\n response.write('Error 404: Not found little guy');\n response.end();\n}", "function notFound(req,h){\n return h.view('404',{},{layout: 'error-layout'}).code(404)\n}", "error404(req, res) {\n res.notFound();\n }", "function not_found(res, msg) {\n res.writeHead(404, {\n \"Content-Type\":\"application/json\"\n });\n var json = {\n error:true,\n message:msg\n };\n res.write(JSON.stringify(json), 'utf-8');\n res.end();\n}", "function show_404(req, res) {\n res.writeHead(404, {\"Content-Type\": \"text/plain\"});\n res.write(\"You r doing it rong!\");\n res.end();\n}", "function respondErr(err){\r\n\t\t\tconsole.log(\"Handling error: \",err);\r\n\t\t\tif(err.code===\"ENOENT\"){\r\n\t\t\t\tserve404();\r\n\t\t\t}else{\r\n\t\t\t\trespond(500,err.message);\r\n\t\t\t}\r\n\t\t}", "function send404(req, res) {\n res.writeHead(404, {'Content-Type': 'application/json'});\n res.write(JSON.stringify({message: 'not found', url: req.url}));\n res.end();\n}", "function notFound(res)\n{\n res.send('<h1>Page not found.</h1>', 404);\n}", "function show_404(req, res) {\n res.writeHead(404, {\"Content-Type\": \"text/plain\"});\n res.write(\"You are doing it wrong!\");\n res.end();\n}", "function send404(res) {\r\n\tres.writeHead(404, {'Content-Type': 'text/plain'});\r\n\tres.write('Error 404: resource not found.');\r\n\tres.end();\r\n}", "function notFoundErrorHandler(err, req, res, next) {\n res.status(404)\n res.send(\"error - Resource not found \");\n}", "function throwNotFound() {\n var error = new Error()\n error.statusCode = 404\n throw error\n}", "function serve404(){\r\n\t\t\tfs.readFile(ROOT+\"/404.html\",\"utf8\",function(err,data){\r\n\t\t\t\tif(err)respond(500,err.message);\r\n\t\t\t\telse respond(404,data);\r\n\t\t\t});\r\n\t\t}", "function notFoundRouteHandler(req, res) {\n res.status(500).send(\"Sorry, something went wrong\");\n}", "function erroHandler(err, request, response, next) {\n response.status(500).send(\"Server Error! Please Try again later!!\");\n}", "function respondErr(err){\n\t\tconsole.log(\"Handling error: \",err);\n\t\tif(err.code===\"ENOENT\"){\n\t\t\tserve404();\n\t\t}else{\n\t\t\trespond(500,err.message);\n\t\t}\n\t}", "function fof(req, res, next) {\n var err = new Error('Not Found');\n err.status = 404;\n next(err);\n}", "function send404(res) {\n res.writeHead(404);\n res.write('404');\n res.end();\n}", "function notPageFound(req, res){\n res.write(\"No se ha encontrado la pagina solicitada.\");\n res.end();\n}", "function send404(response) {\r\n\tresponse.writeHead(404, {'Content-Type': 'text/plain'});\r\n\tresponse.write('Error 404: resource not found.');\r\n\tresponse.end();\r\n}", "function respondErr(err){\r\n\t\tconsole.log(\"Handling error: \",err); //Print error info to console\r\n\t\t//Serve404 if ENOENT otherwise, responde 500 with error message\r\n\t\tif(err.code===\"ENOENT\")\r\n\t\t\tserve404();\r\n\t\telse\r\n\t\t\trespond(500,err.message);\r\n\t}", "notFound(data, cb) {\n cb(404);\n }", "function notFound(req, res){\n res.status(400);\n res.send('Not valid endpoint.');\n}", "function throw404Error(err, req, res, next) {\n\n\t\tvar ERROR_404_MESSAGE = i18n.get('server_404');\n\n\t\tres.status(404);\n\t\terr.message = err.message || ERROR_404_MESSAGE;\n\t\tredirectError(err, req, res, next);\n\t}", "function send404(response) {\n response.writeHead(404, {\"Content-type\" : \"text/plain\"}); // return plain text\n response.write(\"Error 404: resource not found\"); // text content\n response.end();\n}", "function pageNotFound(req, res){\n\t// res.send(\"<h1>404 page not found<h1>\");\n\treturn res.render('404');\n}", "function notFoundHandler(req, res, next) {\n next(createError(404, \"Your requested content was not found!\"));\n}", "function notFoundHandler(req, res, next) {\n next(createError(404, \"Your requested content was not found!\"));\n}", "static routeNotFound(res) {\n res.writeHead(404, {'Content-Type': 'text/html'});\n res.write('Not Found');\n res.end();\n }", "route404Handler(req, res, next) {\n const err = new Error('Not Found');\n err.status = 404;\n next(err);\n }", "function send404 (response) {\n response.writeHead (404, {'Content-Type': 'text/plain'});\n response.write ('Error 404: resource not found.');\n response.end();\n}", "function error(err) {\n res.statusCode = err.status || 500;\n res.end(err.message);\n }", "function serve404()\r\n\t{\r\n\t\tvar url = ROOT + \"/404.html\"; //url path to 404.html\r\n\t\t//Serve 404 if it exists\r\n\t\tfs.readFile(url,\"utf8\",function(err,data)\r\n\t\t{ //async\r\n\t\t\tif(err)respond(500,err.message);\r\n\t\t\trespond(404,data);\r\n\t\t});\r\n\t}", "function notFound(req, res){\n res.writeHead(404, {\"Content-Type\": \"text/html\"});\n res.write(\"404 Not Found\");\n res.end();\n}", "function notFound(req, res, next) {\n res.status(404);\n const error = new Error('Not Found data - ' + req.originalUrl);\n next(error);\n}", "function send404Response(response){\n\tresponse.writeHead(404, {\"Content-Type\" : \"text/plain\"});\n\tresponse.write(\"Error 404: Page not found\");\n\tresponse.end();\n}", "function response404(res)\n{\n res.render(\"response404\");\n}", "function render404Page(res) {\n // TODO make this fancier\n res.writeHead(404);\n res.write('Not found :-(');\n res.end();\n}", "function notFound(request, response) {\n response.status(404).send({\n success: false,\n message: '404: cannot find route'\n });\n}", "function _500(err, req, res, next) {\n // treat as 404\n if (err.message\n && (~err.message.indexOf('not found')\n || (~err.message.indexOf('Cast to ObjectId failed')))) {\n return next();\n }\n\n console.error(err.stack);\n // error page\n res.status(500).render('500', { error: err.stack });\n}", "function display404(url, req, res) {\n res.writeHead(404, {\n 'Content-Type': 'text/html'\n });\n res.write(\"<h1>404 Not Found </h1>\");\n res.end(\"The page you were looking for: \" + url + \" can not be found \");\n}", "function catch404Errors(req, res, next) {\n const err = new Error('Not Found');\n err.status = 404;\n next(err);\n}", "function send404(response) {\n\tresponse.writeHead(404, { 'Content-Type': 'text/plain' });\n\tresponse.write('Error 404: Resource not found.');\n\tresponse.end();\n}", "function notFound(req, res) {\n res.writeHead(404);\n res.write('Not found');\n res.end();\n}", "function fail (err, res){ // Funcion para definir o encausar un error cuando no sabemos que paso\n\tres.statusCode = 500 \t// Asigna un codigo de respuesta al error\n\tres.setHeader('Content-Type', 'text/plain') // Prepara el browser para recibir un texto plano\n\tres.end(err.message) // Sirve el error en el browser.\n}", "function fail (err, res){ // Funcion para definir o encausar un error cuando no sabemos que paso\n\tres.statusCode = 500 \t// Asigna un codigo de respuesta al error\n\tres.setHeader('Content-Type', 'text/plain') // Prepara el browser para recibir un texto plano\n\tres.end(err.message) // Sirve el error en el browser.\n}", "function notFoundHandler() {\n \n }", "function myRequestHandler(request, response){\n //if /found\n // statusCode 200, you found it\n //else\n // statusCode 404, not found :(\n}", "handle (error,{response}) {\n response.status(404).json({\n messages:'No Data Found!'\n })\n }", "function notFound(req, res, err, cb) {\n console.log(err);\n err.body = {code: 404,message:'Endpoint wasn\\'t found on server'};\n res.send(err);\n return cb();\n}", "function handleNotFound(req, res) {\n logService.log(`Path not found - ${req.url}`, \"info\");\n \n res.writeHead(404, \"Not found\", { \"Content-Type\": \"application/json\" });\n res.end(JSON.stringify({ error: \"Not found\" }));\n}", "function devolverError(err) {\n res.header('Connection', 'close');\n res.status = 500;\n res.writeHead(500, { \"Content-Type\": \"application/json\" });\n res.write(JSON.stringify({ status: err.codError, descStatus: err.message }));\n res.end();\n }", "function fileNotFound(res) {\n return () => {\n res.status(404).sendFile(path.join(settings.path.dist, 'error.html'));\n };\n}", "function customUrlNotFound() {\n return function raiseUrlNotFoundError(req, res) {\n var path = require('path');\n var error = new Error('Cannot ' + req.method + ' ' + req.url);\n error.status = 404;\n res.sendFile(path.join(__dirname, '../../', 'client/404.html'));\n };\n}", "function fileNotFound(req, res) {\n let url = req.url;\n res.type(\"text/plain\");\n res.status(404);\n res.send(\"Cannot find \" + url);\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason)\n res.status(code || 500).json({\"error\": message})\n }", "function bad(message){ \n console.log(message); \n res.writeHead(200); \n res.end(message); \n }", "static serverError(message, res) {\n res.writeHead(500, {'Content-Type': 'text/html'});\n res.write(message);\n res.end();\n }", "function notFound(req, res) {\n res.status(404).send('Sorry, this route does not exist.');\n}", "function returnError(req, res) {\n res.writeHead(502, {'Content-Type': 'text/plain'});\n res.write('Bad Gateway for: ' + req.url);\n res.end();\n}", "function fileNotFound(req, res) {\n let url = req.url;\n res.type('text/plain');\n res.status(404);\n res.send('Cannot find ' + url);\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({ \"success\": true, \"error\": message });\n}", "function handleError(res, reason, message, code) {\n console.log(`ERROR: ${reason}`);\n res.status(code || 500).json({ error: message });\n }", "function notFound (response, filePath) {\n response.writeHead(404)\n response.end('404 Not Found' +\n '\\n\\n' + filePath +\n '\\n\\n(rollup-plugin-serve)', 'utf-8')\n}", "function handleError(res, reason, message,code) {\n\tconsole.log(\"ERROR: \" + reason);\n\tres.status(code || 500).json({\"error\": message});\n}", "function sendFileNotFound(res) {\n\n res.writeHead(\n 404,\n { \"content-type\" : \"text/plain\" }\n );\n res.end(\"File Not Found!!\");\n\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n }", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n }", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n }", "function notFound(req, res) {\n res.status(404).render('404.ejs')\n}", "static errIfNonexistent(company){\n if(!company){\n let err = new Error('No such company')\n err.status = 404;\n throw err\n }\n }", "function handleError(res, reason, message, code) {\r\n console.log(\"ERROR: \" + reason);\r\n res.status(code || 500).json({\"error\": message});\r\n}", "function handleError(res, reason, message, code) {\r\n console.log(\"ERROR: \" + reason);\r\n res.status(code || 500).json({\"error\": message});\r\n}", "function handleError( res, reason, message, code ) {\n\tconsole.log( 'ERROR: ' + reason );\n\tres.status( code || 500 ).json({ error: message });\n}", "function handleError(res, reason, message, code) {\n\tconsole.log(\"ERROR: \" + reason);\n\tres.status(code || 500).json({ \"error\": message });\n}", "_notFound() {\r\n console.error('NOT FOUND');\r\n }", "function sendThisError(err, req, res, next) {\n res.status(500).json({\n status: 'an error has occurred',\n message: err.message\n })\n}", "function sendFileNotFound(res, filename, err) {\n console.log('fnf: ' + filename);\n (typeof Log !== 'undefined') && Log.http('404 - ' + filename);\n res.writeHead(404, {'Content-Type': 'text/plain'});\n res.write('404 Not Found: ' + filename + ' (' + err + ')\\n');\n res.end();\n}", "function handleError(res, reason, message, code) {\n\n console.log(\"ERROR: \" + reason);\n\n res.status(code || 500).json({\n\n \"error\": message\n\n });\n\n }", "function responseHtmlError(response) {\n response.writeHead(400);\n response.end();\n}", "function error (res, code, bool, message) {\n res.status(code)\n res.json({\n success: bool,\n message: message\n })\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function http404 (req, res, next) {\n if (req.swagger && req.swagger.api && !req.swagger.path) {\n util.debug(\n 'Client requested path \"%s\", which is not defined in the Swagger API. Returning HTTP 404 (Not Found)',\n req.path\n );\n throw ono({ status: 404 }, \"Resource not found: %s\", req.path);\n }\n\n next();\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}" ]
[ "0.74265224", "0.73839957", "0.71973926", "0.7029802", "0.70157045", "0.6952865", "0.69446653", "0.69146496", "0.6905965", "0.68862236", "0.687699", "0.6872372", "0.6809381", "0.68077534", "0.68045896", "0.67982876", "0.67867714", "0.6784783", "0.6783668", "0.67831796", "0.677994", "0.6769546", "0.67632395", "0.674765", "0.67434114", "0.67432743", "0.6739922", "0.6738617", "0.6724809", "0.67125833", "0.6702967", "0.6697552", "0.6674265", "0.666232", "0.66545403", "0.6623606", "0.66189396", "0.6607561", "0.6607561", "0.6600966", "0.6598194", "0.6588752", "0.6583484", "0.6561849", "0.6560162", "0.6551773", "0.6550816", "0.65452677", "0.6544356", "0.65331924", "0.6530164", "0.65235656", "0.6522488", "0.6502006", "0.6501307", "0.6477608", "0.6477608", "0.6477066", "0.6443291", "0.64202857", "0.6415347", "0.64147824", "0.64016527", "0.639262", "0.63667685", "0.63660246", "0.63340455", "0.632712", "0.63222307", "0.6315243", "0.6315176", "0.6306542", "0.6304311", "0.63037634", "0.62899375", "0.6282462", "0.62817", "0.62796086", "0.62796086", "0.62796086", "0.6278367", "0.6265188", "0.6257051", "0.6257051", "0.6253161", "0.6244389", "0.62414676", "0.62318283", "0.6221093", "0.62116635", "0.6210957", "0.6205415", "0.6204024", "0.6204024", "0.6204024", "0.6204024", "0.61943436", "0.61891073", "0.61891073", "0.61891073", "0.61891073" ]
0.0
-1
update only on end
onFinishChange ( f ) { if( this.isSpace ) return; this.callback = null; this.endCallback = f; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update(){}", "update(){}", "update(){}", "async update() {}", "updated() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "function update() {}", "update(startingData) {}", "afterUpdate() {}", "update () {}", "_update() {\n }", "function update() {\n // ... no implementation required\n }", "updateToAll() {}", "update(dt) {\n logID(1007);\n }", "update()\n {\n \n }", "refreshUpdateStatus() {}", "update() {\n //Apply changes\n super.update()\n //Remove if expired\n if (this.cycle <= 0) {\n this.destroy()\n }\n }", "endUpdate() {\r\n\r\n }", "function refresh(){\n setUpdate(!update)\n }", "update() { }", "update() { }", "static postUpdate() {\n return false;\n }", "function update() {\n\t\t\n\t}", "update(delta) {}", "async function UpdateNew() {}", "update() {\n this.poll();\n }", "readAfterUpdate() {\n\t\tthis.enableSubmit();\n\t}", "readAfterUpdate() {\n\t\tthis.enableSubmit();\n\t}", "suspendChangesTracking() {\n this.crudIgnoreUpdates++;\n }", "runUpdate() {\n this.utils.log(\"\");\n this.utils.log(\"******************* Running update ******************* \");\n this.utils.log(\"\");\n\n // Reset update flags\n this.updateTweets = false;\n this.updateStatus = false;\n\n // Process any new tweets before performing other operations\n this.checkTrackedTweets().then(() => {\n // Process any mentions\n this.checkMentions().then(() => {\n // Save the status file if needed\n if (this.updateTweets || this.updateStatus) {\n this.dataHandler.saveStatus(this.botStatus);\n }\n });\n\n // Post a normal tweet\n this.actionHandler.postTweet(this.generator.generateResponse());\n\n });\n }", "update() {\n this.forceUpdate();\n }", "update() {\n this.forceUpdate();\n }", "update() {\n this.checkIfWon();\n }", "update() {\n this._updated = true;\n let now = new Date().getTime();\n if (now > this._lastDumpTime + this._interval) {\n try {\n this.dump();\n }\n catch (ex) {\n // Todo: decide what to do\n }\n }\n }", "update()\n\t{ \n\t\tthrow new Error(\"update() method not implemented\");\n\t}", "willUpdate(options) {\n console.log('willUpdate ejecutado!', options);\n }", "firstUpdated() {}", "update() {\n // ...\n }", "function update(data) {\n console.log('+++ TODO');\n }", "update(data) {\n this.data = data || this.data;\n this._updateID++;\n }", "update(id) {\n\n }", "update() {\n // Subclasses should override\n }", "update() {\n \n }", "doUpdate() {\n if (!this.interval) return;\n this.viss.forEach(v => v.doUpdate());\n }", "update () {\n /* istanbul ignore else */\n if (this.lazy) {\n this.dirty = true;\n } else if (this.sync) {\n this.run();\n } else {\n queueWatcher(this);\n }\n }", "suspendChangesTracking() {\n this.crudIgnoreUpdates++;\n }", "update(dt) {\n\n }", "update() {\n }", "update() {\n }", "update() {\n }", "updated(e){}", "enableUpdating(_requestedUpdate) {\n }", "async update() {\n throw new Error(\"Operation not supported.\");\n }", "update(t) {}", "function update(){\n keepResources()\n keepPopulation();\n keepProtection();\n keepPolitics();\n keepTech();\n}", "function updateroster() {\n\n}", "handleUpdateFinished() {\n if(this.isLoop) {\n this.curTime = 0;\n }\n else {\n this.pause();\n }\n\n this.invokeResetter();\n }", "onSaveUpdates() {\n\t\t\t\n\t\t\t// Some kind of bug here due to multiple components, this might be the best way around it\n\t\t\tif (!this._oODataModel.oMetadata) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._setBusy(true);\n\n\t\t\t// Submit changes*/\n\t\t\tthis._oODataModel.submitChanges({\n\t\t\t\tsuccess: (oData) => {\n\t\t\t\t\tthis._setBusy(false);\n\t\t\t\t\tthis._handleBatchResponseAndReturnErrorFlag(oData);\n\t\t\t\t\tthis._resetODataModel();\n\t\t\t\t},\n\t\t\t\terror: this._handleSimpleODataError.bind(this)\n\t\t\t});\n\n\t\t}", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "updated(){\n console.log('Updated');\n }", "firstUpdated(e){}", "_runAfterUpdateCallbacks() {\n var self = this;\n var callbacks = self._afterUpdateCallbacks;\n self._afterUpdateCallbacks = [];\n callbacks.forEach((c) => {\n c();\n });\n }", "update() {\n this.dataChanged = true;\n this.persons.all = undefined;\n this.jobTitles.all = undefined;\n this.updateFiltered();\n this.updateTimed();\n }", "async update_() {\n if (this.lockingUpdate_) {\n if (this.pendingUpdate_) {\n return;\n }\n this.pendingUpdate_ = (async () => {\n while (this.lockingUpdate_) {\n try {\n await this.lockingUpdate_;\n } catch (e) {\n // Ignore exception from waiting for existing update.\n }\n }\n this.lockingUpdate_ = this.pendingUpdate_;\n this.pendingUpdate_ = null;\n await this.doUpdate_();\n this.lockingUpdate_ = null;\n })();\n } else {\n this.lockingUpdate_ = (async () => {\n await this.doUpdate_();\n this.lockingUpdate_ = null;\n })();\n }\n }", "update(now) {\n throw new Error('You have to implement the \"update\" method!');\n }", "function update(time)\n {\n\t //console.log(\"UPDATE\");\n\t // calculation\n }", "update() {\n throw new Error(\"Not Implemented\");\n }", "function nextUpdate() {\n\tUPDATING = false;\n\trefreshTimeout = setTimeout(function(){ \n\t\tstartDrawingData(); \n\t}, UPDATE_INTERVAL * 1000);\n}", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n // make the task archive constarined within a max value\n if(this.decision_archive.length > DATA_POINTS){\n this.decision_archive.splice(0, 1);\n }\n /**\n * here we need to add the resting \n * similar to working. resting should also get a timer\n */\n if (this.playerWorking) {\n this.playerTimer++;\n $('#timer').html(this.playerTimer);\n this.setInfo();\n }\n\n if (this.working && !this.isPlayer) {\n\n this.workingTimer -= timeUpdate();\n this.setInfo();\n if (this.workingTimer <= 0) {\n this.has_swapped = false;// reset to false, very IMPORTANT otherwise the agent will always be called to do a swapped task\n this.swap_task = '';\n this.working = false;\n this.currentTask = '';\n this.done_for_the_day = true;\n this.setInfo();\n }\n }\n }", "setUpdating() {\n const lastUpdateRequest = this.data.lastUpdateRequest || 0;\n const lastUpdate = this.data.lastUpdate || 0;\n\n this.updating = (lastUpdate < lastUpdateRequest);\n }", "onUpdate(cb) {\n if (typeof cb === \"function\") {\n this._onUpdate = cb;\n }\n }", "function startUpdate(){\n updating = true;\n }", "async update() {\n this.emit('updating');\n for (let retry = 0; retry < UPDATE_RETRIES; retry++) {\n Log('update:', retry);\n try {\n if (await this.connect()) {\n await this.read();\n return true;\n }\n }\n catch (e) {\n Log(e);\n Log('error during update');\n this._validated = false;\n this.detach();\n }\n }\n return false;\n }", "updated(_changedProperties) { }", "function updateValues () {\n setInterval(function () {\n console.log('Starts updating job');\n\n getAllCoins()\n .then(function (object) {\n console.log('Finished updating');\n return saveToDatabase(object);\n })\n .catch(function (err) {\n console.log(err);\n });\n\n }, 60000);\n}", "update() {\n }", "update() {\n }", "beginUpdate() {\r\n\r\n }", "function update() {\n \n}", "function queueFinal(){\n clearTimeout(lastUpdateTimeout)\n lastUpdateTimeout = setTimeout(doLastUpdate, 50)\n }" ]
[ "0.75757736", "0.75757736", "0.75757736", "0.7292816", "0.71981156", "0.7174234", "0.7174234", "0.7174234", "0.7174234", "0.7174234", "0.7174234", "0.7174234", "0.7174234", "0.7174234", "0.7042504", "0.70152956", "0.6973664", "0.69539815", "0.6872313", "0.67903", "0.676963", "0.67522705", "0.6730468", "0.6585651", "0.65673953", "0.65650177", "0.6550638", "0.65425634", "0.65425634", "0.65209955", "0.6471463", "0.64258355", "0.64070207", "0.640092", "0.638388", "0.638388", "0.63668096", "0.6353676", "0.6335871", "0.6335871", "0.63158774", "0.63133276", "0.6303458", "0.6301164", "0.62986374", "0.6271534", "0.62699485", "0.6255256", "0.62502116", "0.6249003", "0.623442", "0.62297183", "0.6226406", "0.6220329", "0.621451", "0.6213684", "0.6213684", "0.6213684", "0.62127566", "0.61982507", "0.61856645", "0.6183773", "0.6181738", "0.6170454", "0.61453056", "0.6141344", "0.61391556", "0.61391556", "0.61391556", "0.61391556", "0.61391556", "0.61391556", "0.61391556", "0.61377287", "0.61375767", "0.61349654", "0.61163694", "0.6108245", "0.61044496", "0.6090045", "0.608774", "0.6083358", "0.6072464", "0.6072464", "0.6072464", "0.6072464", "0.6072464", "0.6072464", "0.6072464", "0.6072146", "0.6058749", "0.6048873", "0.6036877", "0.6035022", "0.60303974", "0.6029972", "0.6012301", "0.6012301", "0.60111946", "0.6010217", "0.6005481" ]
0.0
-1
! vuex v3.4.0 (c) 2020 Evan You
function r(t){var e=Number(t.version.split(".")[0]);if(e>=2)t.mixin({beforeCreate:r});else{var n=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[r].concat(t.init):r,n.call(this,t)}}function r(){var t=this.$options;t.store?this.$store="function"===typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFieldVuex() {\n return store.getters.dataField;\n }", "getProfileVuex() {\n return store.getters.dataProfile;\n }", "function vuexInit(){var options=this.$options;// store injection\n\tif(options.store){this.$store=options.store;}else if(options.parent&&options.parent.$store){this.$store=options.parent.$store;}}", "function vuexInit() {\n\t var options = this.$options;\n\t var store = options.store;\n\t var vuex = options.vuex;\n\t // store injection\n\t\n\t if (store) {\n\t this.$store = store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t // vuex option handling\n\t if (vuex) {\n\t if (!this.$store) {\n\t console.warn('[vuex] store not injected. make sure to ' + 'provide the store option in your root component.');\n\t }\n\t var state = vuex.state;\n\t var getters = vuex.getters;\n\t var actions = vuex.actions;\n\t // handle deprecated state option\n\t\n\t if (state && !getters) {\n\t console.warn('[vuex] vuex.state option will been deprecated in 1.0. ' + 'Use vuex.getters instead.');\n\t getters = state;\n\t }\n\t // getters\n\t if (getters) {\n\t options.computed = options.computed || {};\n\t for (var key in getters) {\n\t defineVuexGetter(this, key, getters[key]);\n\t }\n\t }\n\t // actions\n\t if (actions) {\n\t options.methods = options.methods || {};\n\t for (var _key in actions) {\n\t options.methods[_key] = makeBoundAction(this.$store, actions[_key], _key);\n\t }\n\t }\n\t }\n\t }", "function U(He){Le&&(He._devtoolHook=Le,Le.emit('vuex:init',He),Le.on('vuex:travel-to-state',function(Ne){He.replaceState(Ne)}),He.subscribe(function(Ne,je){Le.emit('vuex:mutation',Ne,je)}))}", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexlocal() {\n return store => {\n // 判断是否有本地缓存如果有就取本地缓存的如果没有就取自身初始值\n let local = JSON.parse(localStorage.getItem('myVuex')) || store.replaceState(state)\n store.replaceState(local); // 替换state的数据\n store.subscribe((mutation,state) => { // 监听\n // 替换之前先取一次防止数据丢失\n let newstate = JSON.parse(JSON.stringify(state))\n localStorage.setItem('myVuex',JSON.stringify(newstate))\n })\n }\n}", "function vuexInit () {\n\t var options = this.$options\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = typeof options.store === 'function'\n\t ? options.store()\n\t : options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "users() {\n return this.$store.getters.users\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "getTokenVuex() {\n return store.getters.jwt;\n }", "function vuexInit () {\r\n var options = this.$options;\r\n // store injection\r\n if (options.store) {\r\n this.$store = typeof options.store === 'function'\r\n ? options.store()\r\n : options.store;\r\n } else if (options.parent && options.parent.$store) {\r\n this.$store = options.parent.$store;\r\n }\r\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }" ]
[ "0.67712444", "0.66986936", "0.66612864", "0.6331386", "0.63084495", "0.6247302", "0.6247302", "0.6247302", "0.62384593", "0.6236988", "0.61336607", "0.6127329", "0.606848", "0.60579044", "0.60579044", "0.60579044", "0.60579044", "0.60579044", "0.6051181", "0.60426307", "0.6028476", "0.5966807", "0.5966807", "0.5966807", "0.5966807", "0.5966807", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055", "0.5941055" ]
0.0
-1
Based on createExtBadge() in ../../utils/common.js.
renderBadge() { return html` <div class="TWPT-badge"> <md-icon>repeat</md-icon> </div> `; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bsBadge(){return _callWithEmphasis(this, oj.span, 'badge', 'default', arguments)}", "function badges(badge) {\r\n return e('img', {\r\n key: badge.id\r\n , src: badge.image\r\n , className: 'badge'\r\n , alt: badge.name\r\n , style: { width: '25px', height: '25px' }\r\n })\r\n }", "function badgeImg(link, name) { return ' '; }", "function RT_Badge(userOpts) {\n\t\n\tthis.$badge = null;\n\tthis.z = 0;\n\tthis.opts = {\n\t\tcontainer : $(\"body\")[0],\n\t\tposition : \"topright\",\n\t\ttheme : \"red\",\n\t\toffsetX : -10,\n\t\toffsetY : -10,\n\t\tanimate : \"blink\",\n\t\tshape : \"round\",\n\t\tx : 0\n\t};\n\n\t// add the badge to the page\n\tthis.apply = function(userOpts) {\n\t\tthis.opts = $.extend(this.opts,userOpts);\n\t\tvar $container = $(this.opts.container);\n\t\t\n\t\tif(!this.$badge) {\n\t\t\tthis.$badge = $(\"<div class='rt_badge'></div>\");\n\t\t\t// determine where to put the badge\n\t\t\tvar left = $container.offset().left;\n\t\t\tvar top = $container.offset().top;\n\t\t\tthis.$badge.css({\n\t\t\t\tleft:left + $container.outerWidth() + this.opts.offsetX, \n\t\t\t\ttop:top + this.opts.offsetY\n\t\t\t});\n\t\t\tif(this.opts.shape == \"square\") this.$badge.addClass(\"square\");\n\t\t\t$(\"body\").append(this.$badge);\n\t\t\t\n\t\t\t// update badge info\n\t\t\tthis.update(this.opts.x);\n\t\t\t\n\t\t}\n\t\t\t\t\n\t}\n\t// blink the object\n\tthis.blink = function() {\n\t\tif(this.$badge.css(\"display\") == \"none\") {\n\t\t\tthis.$badge.stop().fadeIn().fadeOut().fadeIn();\n\t\t} else {\n\t\t\tthis.$badge.stop().fadeOut().fadeIn();\n\t\t}\n\t}\n\t\n\t// show the object\n\tthis.show = function() {\n\t\tswitch(this.opts.animate) {\n\t\t\tcase \"blink\":\n\t\t\t\tthis.z ? this.blink() : this.hide();\n\t\t\t\tbreak;\n\t\t\tcase \"none\":\n\t\t\tdefault:\n\t\t\t\tthis.z ? this.$badge.show() : this.hide();\n\t\t\t\tbreak;\n\t\t}\n\t}\n\t\n\t// hide it\n\tthis.hide = function() {\n\t\tif(this.$badge) {\n\t\t\tthis.$badge.fadeOut();\n\t\t}\n\t}\n\t\n\t// update the text\n\tthis.update = function(x) {\n\t\tthis.opts = $.extend(this.opts,userOpts);\n\t\tif(this.$badge) {\n\t\t\t// allow for +1 and -1\n\t\t\tx = x.toString();\n\t\t\tvar y = parseInt(x.substr(1,x.length));\n\t\t\tif(x.charAt(0) == \"+\") {\n\t\t\t\tthis.z += y;\n\t\t\t} else if(x.charAt(0) == \"-\") {\n\t\t\t\t// protect against neg numbers\n\t\t\t\tthis.z = this.z <= 0 ? 0 : this.z - y;\n\t\t\t} else {\n\t\t\t\tthis.z = parseInt(x);\n\t\t\t}\n\t\t\t// set the text\n\t\t\tthis.$badge.text(this.z);\n\t\t\t// show the badge\n\t\t\tthis.show();\n\t\t \n\t\t // if there is no badge, add it\n\t\t } else {\n\t\t \tthis.apply({x : x});\n\t\t }\n\t}\n\t\n}", "function setBadge(...args) {\nif (navigator.setExperimentalAppBadge) {\n navigator.setExperimentalAppBadge(...args);\n } else if (window.ExperimentalBadge) {\n window.ExperimentalBadge.set(...args);\n }\n}", "function Badge(_ref) {\n var className = _ref.className,\n type = _ref.type,\n children = _ref.children,\n props = objectWithoutProperties(_ref, [\"className\", \"type\", \"children\"]);\n\n return React__default.createElement(\n \"span\",\n { className: classnames(\"badge\", defineProperty({}, \"badge-\" + type, type), className) },\n children\n );\n}", "get badge() {\n const text = this.metadata?.annotations?.[CLUSTER_BADGE.TEXT];\n\n if (!text) {\n return undefined;\n }\n\n const color = this.metadata?.annotations[CLUSTER_BADGE.COLOR] || '#7f7f7f';\n const iconText = this.metadata?.annotations[CLUSTER_BADGE.ICON_TEXT] || '';\n\n return {\n text,\n color,\n textColor: textColor(parseColor(color)),\n iconText: iconText.substr(0, 2)\n };\n }", "updateNotificationBadge() {\n if (this.bannerMsgs.length < 2) {\n this.notificationBadge.classList.add('hidden');\n } else if (this.bannerMsgs.length > 9) {\n this.notificationBadge.classList.remove('hidden');\n this.notificationBadge.textContent = '∞';\n } else {\n this.notificationBadge.classList.remove('hidden');\n this.notificationBadge.textContent = this.bannerMsgs.length.toString();\n }\n }", "function showBadge() {\n myNotificationCount++;\n chrome.browserAction.setBadgeText({\n text: myNotificationCount.toString()\n });\n }", "function addBadges(badgeCollect, badgeNum, badgeTitle, imgurID) {\n //since the badges are child of childs, just search innerHTML for original-title=\"Broadcaster\"\n //or similar. Basically use the same method that I did for my original greasemonkey script at this point.\n //I've narrowed it down to badges so that the message doesn't screw up my detection.\n\n let badgeCSS = \"customTTVBadge\" + badgeNum;\n\n if(badgeCollect.innerHTML.indexOf(badgeCSS) === -1) {\n let tempBadge = document.createElement(\"a\");\n tempBadge.setAttribute(\"target\", \"_blank\");\n tempBadge.setAttribute(\"rel\", \"noopener\");\n \n tempBadge.innerHTML = \"<img class=\\\"badge-img tooltip custom-badge-img \" + badgeCSS + \"\\\" src=\\\"https://i.imgur.com/\" + imgurID + \"\\\" title=\\\"\" + badgeTitle + \"\\\">\";\n \n badgeCollect.appendChild(tempBadge);\n }\n}", "function renderBadge(xrd) {\n xrd = xrd || getXRD();\n this.each(function (i, el){\n el.innerHTML = ['',\n '<div class=\"oexchange-enabled\">',\n (hasSaved(xrd) ?\n '<a class=\"oexchange-enabled-btn\" href=\"'+consoleUrl+'\" target=\"_blank\">Customize</a>'\n : \n '<a class=\"oexchange-enabled-btn\" href=\"#\" onclick=\"jQuery.oex.openDialog(\\''+xrd+'\\');return false\">Save</a>'),\n 'This site is <a href=\"'+oexUrl+'\" target=\"_blank\">OExchange Enabled</a>.</div>'].join('');\n });\n return this;\n }", "function setBadge(options){\n chrome.browserAction.setIcon({tabId : options.tabId , path : options.iconsPaths} , function(){\n if (chrome.runtime.lastError) {\n return;\n }\n chrome.browserAction.setBadgeText({text : options.text , tabId : options.tabId});\n chrome.browserAction.setBadgeBackgroundColor({color : options.color});\n });\n\n}", "function duringBreakExtension() {\n //Show time on icon badge \n chrome.browserAction.setBadgeBackgroundColor({\n color: \"red\"\n });\n chrome.browserAction.setBadgeText({\n text: Vars.Timer\n });\n}", "function setBadge(...args) {\n if (navigator.setAppBadge) {\n navigator.setAppBadge(...args);\n } else if (navigator.setExperimentalAppBadge) {\n navigator.setExperimentalAppBadge(...args);\n } else if (window.ExperimentalBadge) {\n window.ExperimentalBadge.set(...args);\n }\n}", "function _updateBadgeText() {\n\t\t// delay setting a little to make sure range check is good\n\t\tchrome.alarms.create('setBadgeText', {when: Date.now() + 250});\n\t}", "function addNotification(icon) {\n // Get the app\n let app = icon.parentElement;\n // Get the badge\n let badge = app.getElementsByClassName('badge')[0];\n // Get the badge count\n let badgeCount = getBadgeCount(badge);\n // Increate by between 1 and 3\n badgeCount = badgeCount + 1 + Math.floor(Math.random() * 3);\n // Set the badge\n setBadgeCount(icon, badgeCount);\n // Start a new timer\n addNotificationTimer(icon);\n}", "function updateBadgeNumber(tabId, count) {\n var ctx = document.createElement('canvas').getContext('2d'),\n image = new Image(32, 32),\n hasAds = count !== -1,\n title = hasAds ? (count + ' sponsored ad' + (count > 1 ? 's' : '') + ' hidden.') : 'No ads.'\n\n image.onload = function() {\n ctx.drawImage(image, 0, 0, 32, 32)\n browser.browserAction.setTitle({tabId: tabId, title: title});\n browser.browserAction.setIcon({tabId: tabId, imageData: ctx.getImageData(0,0,32,32), path: 'images/icon32.png'})\n browser.browserAction.setBadgeText({tabId: tabId, text: hasAds ? count.toString() : ''})\n browser.browserAction.setBadgeBackgroundColor({tabId: tabId, color: '#3D5A98' })\n }\n\n image.src = browser.runtime.getURL('images/icon32.png')\n}", "function createBadge() {\n badges = game.add.physicsGroup();\n var badge = badges.create(750, 400, 'badge');\n badge.animations.add('spin');\n badge.animations.play('spin', 10, true);\n}", "getBadgeClasses() {\r\n let classes = \"badge m-1 badge-\";\r\n classes += (this.props.counter.value === 0) ? \"warning\" : \"primary\";\r\n return classes;\r\n }", "function createBadge() {\n badges = game.add.physicsGroup();\n let badge = badges.create(750, 400, 'badge');\n badge.animations.add('spin');\n badge.animations.play('spin', 10, true);\n}", "function updateBadge(tabId){\n\tvar badgeText = String(Object.keys(tabStorage[tabId].requests).length);\n\tconsole.log(tabStorage[tabId]);\n\tif(badgeText == '0'){\n\t\tbadgeText = '';\n\t\tchrome.browserAction.setIcon({'path':'images/grey_icon.png'});\n\t}else{\n\t\tchrome.browserAction.setIcon({'path':'images/black_icon.png'});\n\t}\n\tchrome.browserAction.setBadgeText({text:badgeText});\n}", "function Badge(_ref) {\n var size = _ref.size,\n type = _ref.type,\n children = _ref.children;\n var badgeType = 'entityOnline';\n\n if (type === 'user') {\n if (children) {\n badgeType = 'userChecked';\n } else {\n badgeType = 'userOnline';\n }\n }\n\n var styleConfig = sizeClasses[size][badgeType];\n return React.createElement(\"div\", {\n className: styles.badge,\n style: {\n // EntityAvatar badges stick out by one third of their diameter.\n // UserAvatar badges have custom positions in the style object.\n top: badgeType === 'entityOnline' ? -(styleConfig.size / 3) : styleConfig.top,\n right: badgeType === 'entityOnline' ? -(styleConfig.size / 3) : styleConfig.right,\n width: styleConfig.size,\n height: styleConfig.size\n }\n }, children);\n}", "function popupSendBgBadgeUpdateRequest() {\n\tvar message = {\n\t\tsrc: \"en_popup\",\n\t\ttitle: \"REQ_UPDATE_BADGE\"\n\t};\n\n\tchrome.runtime.sendMessage(message, function (response) {\n\t\tconsole.log(response.title);\n\t});\n}", "function renderLicenseBadge(data) {\n\n}", "getBadgeClasses() {\n let classes = \"badge m-2 badge-\";\n classes += this.props.counter.value === 0 ? \"warning\" : \"light\";\n return classes;\n }", "function renderLicenseBadge(license) {}", "function renderLicenseBadge(license) {}", "function renderLicenseBadge(license) {}", "function renderLicenseBadge(license) {}", "function renderLicenseBadge(license) {}", "function renderLicenseBadge(license) {}", "function renderLicenseBadge(license) {}", "function renderLicenseBadge(license) {}", "function renderLicenseBadge(license) {}", "function renderLicenseBadge(license) {}", "function badgeToggle(color, text){\n chrome.browserAction.setBadgeBackgroundColor({color:color});\n chrome.browserAction.setBadgeText({text: text});\n}", "function IconWithBadge({name, badgeCount, color, size}) {\n return (\n <View style={{width: 24, height: 24, margin: 5}}>\n <Image\n source={require('../images/home.png')}\n style={{\n height: 20,\n width: 20,\n // position: 'absolute',\n // right: 20\n }}\n />\n {badgeCount > 0 && (\n <View\n style={{\n // On React Native < 0.57 overflow outside of parent will not work on Android, see https://git.io/fhLJ8\n position: 'absolute',\n right: -6,\n top: -3,\n backgroundColor: 'red',\n borderRadius: 6,\n width: 12,\n height: 12,\n justifyContent: 'center',\n alignItems: 'center',\n }}>\n <Text style={{color: 'white', fontSize: 10, fontWeight: 'bold'}}>\n {badgeCount}\n </Text>\n </View>\n )}\n </View>\n );\n}", "getBadgeClasses() {\n\t\tlet classes = \"badge m-2 badge-\";\n\t\tclasses += (this.props.counter.value === 0) ? \"warning\" : \"primary\";\n\t\treturn classes;\n\t}", "function setBadgeCount(icon, count) {\n // Get the app\n let app = icon.parentElement;\n // Get the badge\n let badge = app.getElementsByClassName('badge')[0];\n // Set the badge to the count\n badge.innerHTML = count;\n // If the count is zero, hide the badge with opacity,\n // otherwise make it visible\n if (count === 0) {\n badge.style.opacity = '0';\n }\n else {\n console.log('here');\n badge.style.opacity = '1';\n }\n}", "function changeBadge(badge, msg, type='badge-secondary') {\n badge\n .removeClass()\n .addClass('badge')\n .addClass(type)\n .text(msg)\n .fadeIn(300);\n}", "function renderLicenseBadge(license) { }", "function iconClicked(e) {\n // Get the icon element from the target of the event\n let icon = e.target;\n // Get the overall app div (the parent)\n let app = icon.parentElement;\n // Get the badge element by class name (we use [0] to get the first, and only\n // element in the returned set of elements - there's only one badge)\n let badge = app.getElementsByClassName('badge')[0];\n // Get the badge count\n let badgeCount = getBadgeCount(badge);\n // Reduce the badge count by one\n badgeCount--;\n // Don't let the badge count drop below 0\n if (badgeCount < 0) {\n badgeCount = 0;\n }\n // Set the new badge count on the badge\n setBadgeCount(badge, badgeCount);\n}", "getBadgeClasses() {\n let classes = \"badge m-2 badge-\";\n // Appends either warning or primary to the end of classes depending on its value === 0 or not\n classes += this.props.counter.value === 0 ? \"primary\" : \"default\";\n return classes;\n }", "function createBadge(item) {\n var output = \"\";\n\n // create the output\n output += \"<div class='characterSheetItemFormatter' style='height:110px'>\";\n output += \"<div class='characterSheetHeader' style='float:left; width: 125px'>\";\n output += \"<b>\" + item.name + \"</b></div>\";\n output += \"<div class='characterSheetHeader' style='width: 125px; height: 80px; \";\n output += \"text-align: center; display: table-cell; vertical-align: middle; margin:auto'>\";\n output += \"<img src='\" + item.image;\n output += \"' onmouseover=\\'showToolTip(\\\"\";\n output += \"<b>\" + item.name + \"</b><br>\" + item.description;\n output += \"\\\");\\' onmouseout=\\\"hideToolTip()\\\" onclick=\\\"removeToolTip();\\\" \";\n output += \"style=\\\"cursor: pointer; \\\"\";\n output += \"' /></div></div>\";\n \n return output;\n}", "function setBadgeText(number) {\n chrome.browserAction.setBadgeText({ text: format(number).toString() });\n chrome.browserAction.setTitle({ title: number.toString() });\n}", "function applyBadgeText(_text, _color) {\n chrome.browserAction.setBadgeBackgroundColor({ color: _color });\n chrome.browserAction.setBadgeText({text: _text});\n\n // Set the time when we did the last update \n setTitle('Last refreshed: ' + new Date().toLocaleTimeString()); \n}", "function generateBadge(label, value) {\n const format = {\n text: [label, value],\n colorscheme: 'red',\n template: 'flat'\n }\n\n badge(format, (svg, err) => {\n if (err) {\n process.stdout.write('Error generating build size badge', err)\n } else {\n save(svg, label)\n }\n })\n}", "getDynamicBadges() {\n let classes = \"badge m-2 badge-\";\n classes += this.state.value === 0 ? \"warning\" : \"primary\";\n return classes;\n }", "getBadgeClasses() {\n let classes = \"badge m-2 badge-\";\n //prettier-ignore\n classes += (this.state.count === 0) ? \"warning\" : \"primary\";\n return classes;\n }", "get legendItemBadgeTemplate() {\r\n return this.i.legendItemBadgeTemplate;\r\n }", "function update_badge(busy_event)\n {\n clearTimeout(badge_clear_timeout);\n if (busy_event.type === \"busy-begin\")\n {\n browser.browserAction.setBadgeText({ text: \"⌛\" });\n }\n else\n {\n badge_clear_timeout = setTimeout(() =>\n {\n browser.browserAction.setBadgeText({ text: \"\" });\n }, MINIMUM_BUSY_BADGE_DISPLAY_DURATION);\n }\n }", "function updateBadge (tabId) {\n let tab = tabStore[tabId];\n if (!tab) {\n chrome.browserAction.setBadgeText({ text: '' });\n return;\n }\n chrome.browserAction.setBadgeText({\n text: String(tab.time)\n // will not work: `tabId: realTab.id`\n });\n chrome.browserAction.setBadgeBackgroundColor({\n color: tab.reloaded ? BADGE_ACTIVE_COLOR : BADGE_REG_COLOR\n });\n}", "getBadgeClasses() {\n //if count is 0 display in yellow else display in blue\n let classes = \"badge m-2 badge-\";\n classes += this.props.counter.value === 0 ? \"warning\" : \"primary\";\n return classes;\n }", "function createFloatingBadge(mode, status, ht = 160) {\n const iconUrl = \"https://kkapuria3.github.io/images/KK.png\";\n const iconUrl1 = \"https://i.pinimg.com/600x315/cd/28/16/cd28168e19f7fdf9c666edd083921129.jpg\"\n const iconUrl2 = \"https://brandlogovector.com/wp-content/uploads/2020/07/Discord-Logo-Icon-Small.png\"\n const iconUrl3 = \"https://img.icons8.com/cotton/2x/source-code.png\"\n\n const script = document.createElement('script');\n\n const $container = document.createElement(\"div\");\n const $bg = document.createElement(\"div\");\n\n const $link = document.createElement(\"a\");\n const $link1 = document.createElement(\"a\");\n const $link2 = document.createElement(\"a\");\n const $link3 = document.createElement(\"a\");\n\n const $img = document.createElement(\"img\");\n const $img1 = document.createElement(\"img\");\n const $img2 = document.createElement(\"img\");\n const $img3 = document.createElement(\"img\");\n\n const $text = document.createElement(\"P\");\n const $BAGDE_BORDER = document.createElement(\"P\");\n const $mode = document.createElement(\"P\");\n const $status1 = document.createElement(\"P\");\n\n script.setAttribute('type', 'text/javascript');\n script.setAttribute('src', 'https://cdn.jsdelivr.net/npm/[email protected]/brython.min.js');\n\n $link.setAttribute(\"href\", \"https://github.com/kkapuria3\");\n $link.setAttribute(\"target\", \"_blank\");\n $link.setAttribute(\"title\", \"RefreshNoBot\");\n\n $link1.setAttribute(\"href\", \"https://www.buymeacoffee.com/kapuriakaran\");\n $link1.setAttribute(\"target\", \"_blank\");\n $link1.setAttribute(\"title\", \"Buy Dev a Coffee\");\n\n $link2.setAttribute(\"href\", \"https://discord.gg/UcxcyxS5X8\");\n $link2.setAttribute(\"target\", \"_blank\");\n $link2.setAttribute(\"title\", \"Join Discord\");\n\n $link3.setAttribute(\"href\", \"https://www.buymeacoffee.com/kapuriakaran\");\n $link3.setAttribute(\"target\", \"_blank\");\n $link3.setAttribute(\"title\", \"View Source Code\");\n\n $img.setAttribute(\"src\", iconUrl);\n $img1.setAttribute(\"src\", iconUrl1);\n $img2.setAttribute(\"src\", iconUrl2);\n $img3.setAttribute(\"src\", iconUrl3);\n var MAIN_TITLE = (\"Open Source Amazon-Bot v1.1-beta ◻️ TESTMODE: \" + TESTMODE + \" ◻️ ITEM KEYWORD: \" + AMAZON_PRODUCT_ID + \" ◻️ CUTOFF PRICE : \" + CUTOFF_PRICE);\n $BAGDE_BORDER.innerText = (\"------------------------------------------------------------------------------------------------------------------------------------ \");\n $text.innerText = MAIN_TITLE;\n $mode.innerText = mode;\n $status1.innerText = status;\n\n $container.style.cssText = \"position:fixed;left:0;bottom:0;width:950px;height:\" + ht + \"px;background: black; border: 1px solid #FFF\";\n $bg.style.cssText = \"position:absolute;left:-100%;top:0;width:60px;height:350px;background:#1111;box-shadow: 0px 0 10px #060303; border: 1px solid #FFF;\";\n $link.style.cssText = \"position:absolute;display:block;top:11px;left: 10px; z-index:10;width: 30px;height:30px;border-radius: 1px;overflow:hidden;\";\n $link1.style.cssText = \"position:absolute;display:block;top:40px;left: 0px; z-index:10;width: 50px;height:50px;border-radius: 0px;overflow:hidden;\";\n $link2.style.cssText = \"position:absolute;display:block;top:70px;left: 0px; z-index:10;width: 50px;height:50px;border-radius: 0px;overflow:hidden;\";\n $link3.style.cssText = \"position:absolute;display:block;top:118px;left: 12px; z-index:10;width: 25px;height:25px;border-radius: 0px;overflow:hidden;\";\n $img.style.cssText = \"display:block;width:100%\";\n $img1.style.cssText = \"display:block;width:100%\";\n $img2.style.cssText = \"display:block;width:100%\";\n $img3.style.cssText = \"display:block;width:100%\";\n $text.style.cssText = \"position:absolute;display:block;top:3px;left: 50px;background: transperant; color: white;\";\n $BAGDE_BORDER.style.cssText = \"position:absolute;display:block;top:22px;left: 50px;background: transperant; color: green;\";\n $mode.style.cssText = \"position:absolute;display:block;top:43px;left: 50px;background: transperant; color: white;\";\n $status1.style.cssText = \"position:absolute;display:block;top:64px;left: 50px;background: transperant; color: white;\";\n //\n //\n $link.appendChild($img);\n $link1.appendChild($img1);\n $link2.appendChild($img2);\n $link3.appendChild($img3);\n $container.appendChild(script);\n $container.appendChild($bg);\n $container.appendChild($link);\n $container.appendChild($link1);\n $container.appendChild($link2);\n $container.appendChild($link3);\n $container.appendChild($text);\n $container.appendChild($BAGDE_BORDER);\n $container.appendChild($mode);\n $container.appendChild($status1)\n return $container;\n }", "updateBadge() {\n var numberOfUnwatchedLessons = this.lessons.filter(lesson => {\n return lesson.watched == false;\n }).length;\n\n Chrome.changeBadgeValue(numberOfUnwatchedLessons.toString());\n }", "constructor() {\n\t\tthis.nbBadge = 0;\n\t\tthis.nbBadgePerChannel = new Map();\n\t}", "get badges() {\n return new BadgesApi_1.BadgesApi(this);\n }", "function update_badge() {\n chrome.storage.local.get(\"reviews_available\", function(data) {\n if (data.reviews_available) {\n chrome.browserAction.setBadgeText({ text: String(data.reviews_available) });\n } else {\n chrome.browserAction.setBadgeText({ text: \"\" });\n }\n });\n}", "function updateStatus(){\n var maxTime=0;\n //limit number of logs\n while(nestorLogs.length>100){\n nestorLogs.shift();\n }\n for(var i=0;i<nestorLogs.length;i++){\n maxTime=Math.max(maxTime,nestorLogs[i].nestorTime)\n }\n if(nestorLogs.length>0){\n chrome.browserAction.setBadgeBackgroundColor({color:NestorLog.getScoreColor(maxTime)})\n //chrome.browserAction.setIcon({path :\"img/nestor-happy.png\"});\n chrome.browserAction.setBadgeText({text:String(nestorLogs.length)});\n }else{\n //chrome.browserAction.setIcon({path :\"img/nestor-happy.png\"});\n chrome.browserAction.setBadgeText({text:\"\"});\n }\n\n}", "function setBadge(count) {\n if (process.platform === 'darwin' ||\n (process.platform === 'linux' && app.isUnityRunning())) {\n log(`setBadge: ${count}`)\n app.setBadgeCount(Number(count))\n }\n}", "function warningBadge(time) {\n let initTime = time * 60;\n chrome.action.setBadgeBackgroundColor({ color: '#FF6700' });\n countDown(initTime);\n}", "function renderLicenseBadge(data) {\n switch(data.licenseResponse){\ncase 'MIT':\n badge = 'https://img.shields.io/badge/License-MIT-yellow.svg'\n return (badge)\n break;\n case 'Apache':\n badge = 'https://img.shields.io/badge/License-Apache-blue.svg'\n return (badge)\n break;\n case 'Apache-2.0':\n badge = 'https://img.shields.io/badge/License-Apache%202.0-blue.svg'\n return (badge)\n break;\n case 'MPL-2.0':\n badge = 'https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg'\n return (badge)\n break;\n case 'EPL-1.0': \n badge = 'https://img.shields.io/badge/License-EPL%201.0-red.svg'\n case 'BSD-2-Clause':\n badge = 'https://img.shields.io/badge/License-BSD%202--Clause-orange.svg'\n return (badge)\n break;\n case 'BSD-3-Clause':\n badge = 'https://img.shields.io/badge/License-BSD%203--Clause-blue.svg' \n return (badge)\n break;\n default:\n badge = {} \n return (badge)\n }}", "function refreshBadge() {\n curTime--; //first we decrement the time given bc we've waited a sec\n //console.log('leak testing', interval, 'interval ', curTime)\n\n //gotta assess how much time is remaining for our user's period\n if (curTime > 86400) {\n let tempTime = Math.floor(curTime / 86400);\n badgeText = `>${tempTime}d`\n } else if (curTime > 3600) {\n let tempTime = Math.floor(curTime / 3600);\n badgeText = `>${tempTime}h`;\n } else if (curTime > 120) {\n let tempTime = Math.floor(curTime / 60);\n badgeText = `>${tempTime}m`\n } else if (curTime === 2) {\n chrome.action.setBadgeText({ text: '' });\n intervalStorage.clearAll();\n } else if (curTime === 1) {\n chrome.action.setBadgeText({ text: '' });\n intervalStorage.clearAll();\n } else if (curTime <= 0) {\n intervalStorage.clearAll();\n } else {\n badgeText = `${curTime}s`;\n }\n\n //then update the badge with how much time they have left if there's time remaining\n if (curTime > 2) chrome.action.setBadgeText({ text: badgeText });\n //console.log('counting down time, ', curTime);\n }", "function updateNotificationBadge(numNotifications) {\n $(\".dropdown .notification-badge\").html(numNotifications);\n }", "function updateBadgeText() {\n if (showTabCount()) {\n var val = tabs.filter(includeTab).length;\n\n chrome.browserAction.setBadgeText({text: val + \"\"});\n } else {\n chrome.browserAction.setBadgeText({text: \"\"});\n }\n}", "function identify_badges() {\n jQuery.each($('.bandBadge'), function(i) {\n this.json = json[i];\n this.queue = [new Song(this.json[\"bName\"],\n this.json[\"aName\"],\n this.json[\"sName\"],\n this.json[\"sPath\"],\n this.json[\"bPic\"])];\n badges[i] = this;\n\n });\n }", "function activateBadge(time) {\n let initTime = time * 60;\n chrome.action.setBadgeBackgroundColor({ color: '#F00' }); //can add callback function if you want to cascade\n countDown(initTime);\n}", "function updateBadge(badge, current, total) {\n if (badge.length === 0) {\n return;\n }\n\n badge.removeClass(\"green-background yellow-background red-background\");\n\n if (!isNaN(parseFloat(current))) {\n badge.text(current + \" / \" + total);\n if (current > total) {\n badge.addClass(\"green-background\");\n } else if (current === total) {\n badge.addClass(\"green-background\");\n } else if (current > 0) {\n badge.addClass(\"yellow-background\");\n } else {\n badge.addClass(\"red-background\");\n }\n } else {\n badge.html(\"&ndash; / \" + total)\n }\n}", "function renderLicenseBadge() {\n if (!id || id == \"None\") {\n return '';\n } else {\n return `![Badge](https://img.shields.io/badge/License-${id.replace(/-/g, '%20')}-orange)`;\n }\n}", "function updateBadgeView(){\n\tif(userLevelBadge1 == 0){\n\t\tbadge1.image = IMAGE_PATH+'badges/greyscale/exforge.png';\n\t} else {\n\t\tbadge1.image = IMAGE_PATH+'badges/exforge.png';\n\t}\n\t\t\n\tif(userLevelBadge1 == 0){\n\t\tstar1.image = IMAGE_PATH+'stars/star_0.png';\n\t} else if(userLevelBadge1 == 1){\n\t\tstar1.image = IMAGE_PATH+'stars/star_1.png';\n\t} else if(userLevelBadge1 == 2){\n\t\tstar1.image = IMAGE_PATH+'stars/star_2.png';\n\t} else if(userLevelBadge1 == 3){\n\t\tstar1.image = IMAGE_PATH+'stars/star_3.png';\n\t}\n\t\n\tif(userLevelBadge2 == 0){\n\t\tbadge2.image = IMAGE_PATH+'badges/greyscale/science.png';\n\t} else {\n\t\tbadge2.image = IMAGE_PATH+'badges/science.png';\n\t}\n\t\n\tif(userLevelBadge2 == 0){\n\t\tstar2.image = IMAGE_PATH+'stars/star_0.png';\n\t} else if(userLevelBadge2 == 1){\n\t\tstar2.image = IMAGE_PATH+'stars/star_1.png';\n\t} else if(userLevelBadge2 == 2){\n\t\tstar2.image = IMAGE_PATH+'stars/star_2.png';\n\t} else if(userLevelBadge2 == 3){\n\t\tstar2.image = IMAGE_PATH+'stars/star_3.png';\n\t}\n\t\n\tif(userLevelBadge3 == 0){\n\t\tbadge3.image = IMAGE_PATH+'badges/greyscale/geo.png';\n\t} else {\n\t\tbadge3.image = IMAGE_PATH+'badges/geo.png';\n\t}\n\t\n\tif(userLevelBadge3 == 0){\n\t\tstar3.image = IMAGE_PATH+'stars/star_0.png';\n\t} else if(userLevelBadge3 == 1){\n\t\tstar3.image = IMAGE_PATH+'stars/star_1.png';\n\t} else if(userLevelBadge3 == 2){\n\t\tstar3.image = IMAGE_PATH+'stars/star_2.png';\n\t} else if(userLevelBadge3 == 3){\n\t\tstar3.image = IMAGE_PATH+'stars/star_3.png';\n\t}\n\t\n\tif(userLevelBadge4 == 0){\n\t\tbadge4.image = IMAGE_PATH+'badges/greyscale/history.png';\n\t} else {\n\t\tbadge4.image = IMAGE_PATH+'badges/history.png';\n\t}\n\t\n\tif(userLevelBadge4 == 0){\n\t\tstar4.image = IMAGE_PATH+'stars/star_0.png';\n\t} else if(userLevelBadge4 == 1){\n\t\tstar4.image = IMAGE_PATH+'stars/star_1.png';\n\t} else if(userLevelBadge4 == 2){\n\t\tstar4.image = IMAGE_PATH+'stars/star_2.png';\n\t} else if(userLevelBadge4 == 3){\n\t\tstar4.image = IMAGE_PATH+'stars/star_3.png';\n\t}\n\t\n\tif(userLevelBadge5 == 0){\n\t\tbadge5.image = IMAGE_PATH+'badges/greyscale/sports.png';\n\t} else {\n\t\tbadge5.image = IMAGE_PATH+'badges/sports.png';\n\t}\n\t\n\tif(userLevelBadge5 == 0){\n\t\tstar5.image = IMAGE_PATH+'stars/star_0.png';\n\t} else if(userLevelBadge5 == 1){\n\t\tstar5.image = IMAGE_PATH+'stars/star_1.png';\n\t} else if(userLevelBadge5 == 2){\n\t\tstar5.image = IMAGE_PATH+'stars/star_2.png';\n\t} else if(userLevelBadge5 == 3){\n\t\tstar5.image = IMAGE_PATH+'stars/star_3.png';\n\t}\n\t\n\t//lifestyle\n\tif(userLevelBadge6 == 0){\n badge6.image = IMAGE_PATH+'badges/greyscale/lifestyle.png';\n } else {\n badge6.image = IMAGE_PATH+'badges/lifestyle.png';\n }\n \n if(userLevelBadge6 == 0){\n star6.image = IMAGE_PATH+'stars/star_0.png';\n } else if(userLevelBadge6 == 1){\n star6.image = IMAGE_PATH+'stars/star_1.png';\n } else if(userLevelBadge6 == 2){\n star6.image = IMAGE_PATH+'stars/star_2.png';\n } else if(userLevelBadge6 == 3){\n star6.image = IMAGE_PATH+'stars/star_3.png';\n }\n}", "function setUpdateBadge(period) {\n //\tfor(hero in window.stats){\n //\t\tif(checkUpdate(hero, period)){\n ////\t\t\t$(\"#\" + hero).addClass(\"update\");\n ////\t\t\t$(\"#\" + hero + \"> .update\").text(\"U\");\n //\t\t\t$(\"#\" + hero + \" > span:nth-child(1)\").css(\"visibility\", \"visible\");\n //\t\t} else {\n //\n ////\t\t\t$(\"#\" + hero).removeClass(\"update\");\n //\t\t\t$(\"#\" + hero + \" > span:nth-child(1)\").css(\"visibility\", \"hidden\");\n //\t\t}\n //\t}\n\n for (hero in window.stats) {\n var updateNum = getStat(hero, 'update', period);\n updateNum = parseInt(updateNum);\n if (updateNum >= 1) {\n $('#' + hero + ' > span:nth-child(1)').text('+' + updateNum);\n //\t\t\t$(\"#\" + hero + \" > span:nth-child(1)\").text(updateNum + \"경기\");\n } else {\n $('#' + hero + ' > span:nth-child(1)').text('');\n }\n }\n}", "function handleBadgeClick(e){\n\tif(SOUNDS_MODE){\n\t\taudioClick.play();\t\n\t}\n\t\n\tTi.API.warn('handleBadgeClick() for '+e.source.badge);\n\t\n\tmtbImport(\"stars_details.js\");\n\tviewStarsDetails.fireEvent('updateUI', {badge:e.source.badge});\n}", "function renderLicenseBadge(license) {\n return '#LicenseBadge\\n\\nhttps://img.shields.io/github/issues/soobin-lim/homework9.git';\n}", "function countDown(time) {\n //received time should be our time in seconds because we multiply by 60 in our badges\n let curTime = time;\n let badgeText;\n\n //before initiating our interval we do an assessment of how much time is left\n //so that we can initiate the badge.\n if (curTime > 86400) {\n let tempTime = Math.floor(curTime / 86400);\n badgeText = `>${tempTime}d`\n } else if (curTime > 3600) {\n let tempTime = Math.floor(curTime / 3600);\n badgeText = `>${tempTime}h`;\n } else if (curTime > 120) {\n let tempTime = Math.floor(curTime / 60);\n badgeText = `>${tempTime}m`\n } else {\n badgeText = `${curTime}s`;\n }\n\n chrome.action.setBadgeText({ text: badgeText });\n\n //even though i have a named function going into intervals,\n //apparently chrome extension likes them to be wrapped in a function\n //now that I have this cute interval storage we'll use that\n let interval = setInterval(function () { refreshBadge() }, 1000);\n intervalStorage.intervals.add(interval);\n console.log('created new interval', intervalStorage.intervals);\n //including this inside of the countdown function so that it has access\n //to the variables curtime and interval to shut off the interval\n function refreshBadge() {\n curTime--; //first we decrement the time given bc we've waited a sec\n //console.log('leak testing', interval, 'interval ', curTime)\n\n //gotta assess how much time is remaining for our user's period\n if (curTime > 86400) {\n let tempTime = Math.floor(curTime / 86400);\n badgeText = `>${tempTime}d`\n } else if (curTime > 3600) {\n let tempTime = Math.floor(curTime / 3600);\n badgeText = `>${tempTime}h`;\n } else if (curTime > 120) {\n let tempTime = Math.floor(curTime / 60);\n badgeText = `>${tempTime}m`\n } else if (curTime === 2) {\n chrome.action.setBadgeText({ text: '' });\n intervalStorage.clearAll();\n } else if (curTime === 1) {\n chrome.action.setBadgeText({ text: '' });\n intervalStorage.clearAll();\n } else if (curTime <= 0) {\n intervalStorage.clearAll();\n } else {\n badgeText = `${curTime}s`;\n }\n\n //then update the badge with how much time they have left if there's time remaining\n if (curTime > 2) chrome.action.setBadgeText({ text: badgeText });\n //console.log('counting down time, ', curTime);\n }\n}", "function updateBadge(lrSlope){\n fetch(K_INDEX_URL)\n .then(function(response) {\n response.text().then(function (text) {\n // Determine badge color based on Kp Index\n chrome.browserAction.setBadgeBackgroundColor({color: K_INDEX_COLOR_GRADIENTS[parseInt(text)]});\n\n // Display linear regression slope value as badge text.\n chrome.browserAction.setBadgeText({text: lrSlope.toString().substring(0, 4)});\n });\n }); \n}", "function renderLicenseBadge(data) {\n let licenseBadge;\n switch (data.license) {\n case \"Apache 2.0\":\n licenseBadge =\n \"![badge](https://img.shields.io/badge/License-Apache_2.0-blue?style=plastic)\";\n break;\n case \"GNU 3.0\":\n licenseBadge =\n \"![badge](https://img.shields.io/badge/License-GNU_3.0-blue?style=plastic)\";\n break;\n case \"MIT\":\n licenseBadge =\n \"![badge](https://img.shields.io/badge/License-MIT-blue?style=plastic)\";\n break;\n case \"Mozilla\":\n licenseBadge =\n \"![badge](https://img.shields.io/badge/License-Mozilla-blue?style=plastic)\";\n break;\n case \"None\":\n licenseBadge = \"\";\n break;\n }\n return licenseBadge;\n}", "function badge (badgeId, displaySrc, displayDest, textBadge) {\n if (document.getElementById(badgeId).style.display === displaySrc) {\n document.getElementById(badgeId).innerHTML = textBadge\n document.getElementById(badgeId).style.display = displayDest\n }\n}", "function renderLicenseBadge(license) {\n\n return ` ${license}`\n }", "function BadgeStatus(props) {\n let button =\n !props.badge.active && props.badge.awarded ? (\n <Button variant=\"contained\" color=\"primary\" className={useStyles.button}>\n activate\n {/* This Button uses a Font Icon, see the installation instructions in the docs. */}\n\n </Button>\n ) : (\n <Button variant=\"contained\" color=\"secondary\" className={useStyles.button}>\n active\n </Button>\n );\n\n if (!props.badge.awarded) {\n button = null;\n }\n\n return (\n <div>\n\n <Card className={useStyles.card}>\n <CardHeader\n title={props.badge.active ? \"Active Badge\" : \"Earning Badge\"}\n />\n\n <CardContent>\n\n <center>\n <BadgeIcon badge={props.badge} />\n <p>{props.badge.name}</p>\n </center>\n\n {button}\n </CardContent>\n\n </Card>\n\n </div>\n );\n}", "static get BADGE_WIDTH() { return 18; }", "function DiscountBadge({ listPrice, sellingPrice, label = '', children }) {\n const percent = calculateDiscountTax(listPrice, sellingPrice)\n const shouldShowPercentage = percent && percent >= 0.01\n\n return (\n <div className={`${styles.discountContainer} relative dib`}>\n {shouldShowPercentage ? (\n <div\n className={`${styles.discountInsideContainer} t-mini white absolute right-0 pv2 ph3 bg-emphasis z-1`}\n >\n <IOMessage id={label}>\n {labelValue => (\n <>\n {!labelValue && '-'}\n <FormattedNumber value={percent} style=\"percent\" />{' '}\n {labelValue && ' '}\n {labelValue && <span>{labelValue}</span>}\n </>\n )}\n </IOMessage>\n </div>\n ) : null}\n {children}\n </div>\n )\n}", "function cancelBadge() {\n myNotificationCount = 0;\n chrome.browserAction.setBadgeText({\n text: ''\n });\n }", "function licenseBadge(license){\n if (license !== \"none\"){\n return `![badgeImage](https://img.shields.io/badge/license-${license}-blue)`\n }\n else {\n return \"\"\n }\n}", "deriveIcon(announcementLevel) {\n let iconName = \"\";\n if (announcementLevel.indexOf(\"Low\") > -1) { iconName = \"ms-Icon--star\"; }\n else if (announcementLevel.indexOf(\"Medium\") > -1) { iconName = \"ms-Icon--infoCircle\"; }\n else if (announcementLevel.indexOf(\"High\") > -1) { iconName = \"ms-Icon--alert\"; }\n return \"<i class=\\\"ms-Icon \" + iconName + \"\\\" aria-hidden=\\\"true\\\"></i>\";\n }", "function badgeStruct(badgeURL,badgeTitle, badgeDescription){\n \"use strict\";\n this.badgeURL = badgeURL;\n this.badgeTitle = badgeTitle;\n this.badgeDescription = badgeDescription;\n}", "exec() {\n this.handleMessages();\n if (this.window.emails.length == 0) {\n chrome.browserAction.setBadgeText({\n text: \"\",\n });\n }\n chrome.browserAction.setBadgeBackgroundColor({ color: \"#4285f4\" });\n }", "getBadgeClass() {\n let classes = \"badge m-2 badge-\"; //declared a classes var that conatins the style attributes\n //console.log(this.props.counters.value, classes);\n classes += this.props.counters.value === 0 ? \"warning\" : \"primary\"; // here it checks if count===0 then give warning atrr otherwise primary attri\n return classes;\n }", "function showPayToPassTimerBadge(site) {\n\n clearInterval(passInterval);\n\n passInterval = setInterval(function () {\n passIntervalFuction();\n }, 1000);\n\n var passIntervalFuction = function () {\n if (site && !Vars.TimerRunnig) {\n var remainingTime = getSitePassRemainingTime(site);\n if (remainingTime) {\n chrome.browserAction.setBadgeBackgroundColor({\n color: \"#F18E02\"\n });\n var timeString = BROWSER === \"Mozilla Firefox\" ? shortTimeString(remainingTime) : remainingTime;\n chrome.browserAction.setBadgeText({\n text: timeString\n });\n } else {\n if (Vars.Timer != Consts.POMODORO_DONE_TEXT) {\n chrome.browserAction.setBadgeText({\n text: ''\n });\n }\n clearInterval(passInterval);\n }\n } else {\n if (Vars.Timer != Consts.POMODORO_DONE_TEXT) {\n chrome.browserAction.setBadgeText({\n text: ''\n });\n }\n clearInterval(passInterval);\n }\n }\n\n\n}", "function renderLicenseBadge(license) {\n let x = \"\";\n switch(license){\n case \"Apache\":\n x = 'https://img.shields.io/badge/License-Apache%202.0-blue.svg';\n break;\n case \"MIT\":\n x = 'https://img.shields.io/badge/License-MIT-yellow.svg';\n break;\n case \"IBM\": \n x = 'https://img.shields.io/badge/License-IPL%201.0-blue.svg';\n break;\n case \"BSD\": \n x = 'https://img.shields.io/badge/License-IPL%201.0-blue.svg';\n break;\n case \"None\": \n x = '';\n break;\n default: \n x = \"\";\n }\n return x;\n \n}", "render() {\n return (\n <div>\n <span className = {this.stylingBadge()}> {this.formatCount()} </span>\n <button onClick={this.increaseValue} className = \"btn btn-secondary btn-sm\" >Increment</button>\n </div>\n ); }", "function update_tag(accepted, total_count, tag_name, accepted_count) {\r\n if(accepted_count > 0) {\r\n var badge_type = 3;\r\n\t if(accepted_count >= 100) {\r\n\t badge_type = 2;\r\n\t }\r\n\t if(accepted_count >= 400) {\r\n\t badge_type = 1;\r\n\t }\r\n accepted.tag_stats[accepted.tag_stats.length] = [tag_name, accepted_count, badge_type, total_count];\r\n update_answer_tags(accepted);\r\n }\r\n }", "function sendStatusBadge (req, res, opts) {\n opts = opts || {}\n\n res.setHeader(\"Cache-Control\", \"no-cache\")\n\n req.session.get(\"session/access-token\", function (err, authToken) {\n manifest.getManifest(req.params.user, req.params.repo, authToken, function (err, manifest) {\n if (err) {\n return res.status(404).sendFile(badgePath(getDepsType(opts), \"unknown\", opts.retina, req.query.style, opts.extension))\n }\n\n brains.getInfo(manifest, opts, function (err, info) {\n if (err) {\n return res.status(500).sendFile(badgePath(getDepsType(opts), \"unknown\", opts.retina, req.query.style, opts.extension))\n }\n\n res.sendFile(badgePath(getDepsType(opts), info.status, opts.retina, req.query.style, opts.extension))\n })\n })\n })\n}", "function clearBadge() {\n if (navigator.clearAppBadge) {\n navigator.clearAppBadge();\n } else if (navigator.clearExperimentalAppBadge) {\n navigator.clearExperimentalAppBadge();\n } else if (window.ExperimentalBadge) {\n window.ExperimentalBadge.clear();\n }\n}", "function clearBadge() {\n if (navigator.clearExperimentalAppBadge) {\n navigator.clearExperimentalAppBadge();\n } else if (window.ExperimentalBadge) {\n window.ExperimentalBadge.clear();\n }\n}", "function LicenseBadge(license) {\n let badge = ' ';\n\n switch (license) {\n case 'GNU AGPLv3':\n badge = '[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)';\n break;\n case 'GNU GPLv3':\n badge = '[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)';\n break;\n case 'GNU LGPLv3':\n badge = '[![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0)';\n break;\n case 'Mozilla Public License 2.0':\n badge = '[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)';\n break;\n case 'Apache License 2.0':\n badge = '[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)';\n break;\n case 'MIT License':\n badge = '[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)';\n break;\n case 'Boost Software License 1.0':\n badge = '[![License](https://img.shields.io/badge/License-Boost%201.0-lightblue.svg)](https://www.boost.org/LICENSE_1_0.txt)';\n break;\n case 'The Unlicense':\n badge = '[![License: Unlicense](https://img.shields.io/badge/license-Unlicense-blue.svg)](http://unlicense.org/)';\n break;\n default:\n break;\n\n }\n return badge;\n}", "function setBadgeNoAuth() {\n setBadge({\n 'text': '?',\n 'color': '#9E9E9E',\n 'title': 'Click to authorize Gmail',\n });\n}", "static tickUiUpdate() {\n // Fill badge data\n let updateParcel = {\n text: \"\",\n color: \"#d352ad\",\n tooltip: \"\"\n };\n\n this.setUpdateObjTexts(updateParcel);\n\n // Apply to UI\n if (this.networkOk) {\n this.applyBadgeConfig(updateParcel);\n }\n\n this.updatePopupUi(updateParcel);\n }", "function GoAlert (props) {\n return Object(_lib__WEBPACK_IMPORTED_MODULE_0__[\"GenIcon\"])({\"tag\":\"svg\",\"attr\":{\"viewBox\":\"0 0 16 16\"},\"child\":[{\"tag\":\"path\",\"attr\":{\"fillRule\":\"evenodd\",\"d\":\"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z\"}}]})(props);\n}", "function resetBadge() {\r\n // if (typeof ParsePushPlugin !== 'undefined' && ionic.Platform.isIOS())\r\n // ParsePushPlugin.resetBadge(\r\n // () => $log.info('notification badge reset'),\r\n // error => $log.error('error resetting badge ' + JSON.stringify(error))\r\n // )\r\n }", "function duringBreak() {\n //Show time on icon badge \n chrome.browserAction.setBadgeBackgroundColor({\n color: \"blue\"\n });\n var timeString = BROWSER === \"Mozilla Firefox\" ? shortTimeString(Vars.Timer) : Vars.Timer;\n chrome.browserAction.setBadgeText({\n text: timeString\n });\n}" ]
[ "0.72280043", "0.6696833", "0.6563537", "0.65335816", "0.6476954", "0.6445614", "0.63880754", "0.6345181", "0.631854", "0.6311262", "0.63029355", "0.6267263", "0.6238235", "0.6208521", "0.620324", "0.62012196", "0.61797166", "0.6177162", "0.6149762", "0.61466306", "0.6139552", "0.6126799", "0.61165524", "0.6100504", "0.6100425", "0.6081599", "0.6081599", "0.6081599", "0.6081599", "0.6081599", "0.6081599", "0.6081599", "0.6081599", "0.6081599", "0.6081599", "0.602641", "0.601291", "0.59950894", "0.5982085", "0.5981865", "0.59663045", "0.5952557", "0.5918325", "0.5907121", "0.5900441", "0.58896226", "0.58797836", "0.5870327", "0.58496326", "0.5799385", "0.578532", "0.57826567", "0.5756909", "0.5750607", "0.5744913", "0.57352954", "0.57283306", "0.5722851", "0.5716599", "0.57054496", "0.5696125", "0.56861174", "0.56843907", "0.56758344", "0.5663273", "0.563512", "0.5604211", "0.56036437", "0.5563816", "0.5556993", "0.5517655", "0.5516963", "0.5514352", "0.550203", "0.5501511", "0.5498998", "0.54985887", "0.5488549", "0.5459804", "0.5433614", "0.5427742", "0.5426853", "0.54227823", "0.54131436", "0.5409174", "0.5399138", "0.5396753", "0.5385116", "0.5382892", "0.5382083", "0.53791654", "0.53784364", "0.5377982", "0.5376504", "0.5375928", "0.5360493", "0.53452396", "0.5339954", "0.53370565", "0.53281254" ]
0.6456855
5
async/await syntax for promises
async function checkUserExists(req, res, next) { try { const user = await UsersService.getById( req.app.get("db"), req.params.user_id ); if (!user) return res.status(404).json({ error: `User doesn't exist` }); res.user = user; next(); } catch (error) { next(error); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function myPromise (){\n return \"This is my promise\"\n}", "async function ej3() {\n var res = await prom();\n console.log(res);\n}", "async function asyncAwait() {\n const a = await promise1;\n const b = await promise2;\n\n return [a, b];\n}", "async function asyncFuncExample(){\n let resolvedValue = await myPromise();\n console.log(resolvedValue);\n }", "async function myfunc() {\n let promise = new Promise((resolve, reject) => {\n setTimeout(() => resolve(\"okk\"), 2000);\n });\n\n const result = await promise;\n // await makes it wait till the promise resolves and after the promise is resolved\n // after that it assigns the data returned from the promise to result\n return result;\n}", "async function test() {}", "async doSomethingAsync() {\n // Note the use of const\n const result = await Promise.resolve(42);\n }", "async function cool() {\n let promise = new Promise(function(resolve, reject) {\n setTimeout(() => resolve('All done!'), 1000);\n });\n\n let result = await promise;\n return result;\n}", "async function async_await(duration) {\n let promise = new Promise((resolve, reject) => {\n setTimeout(() => resolve(\"done!\"), duration)\n });\n\n let result = await promise; // wait till the promise resolves\n return result\n}", "async method(){}", "async function MyAsyncFn () {}", "async function callWithPromise() {\n const name = await call.withPromise('This is', 'asynchronism');\n console.log(name);\n}", "function f() {\n let promise = Promise.resolve(1);\n let result = await promise; // SyntaxError: await is only valid in async function\n}", "async function noAwait() {\n let value = myPromise();\n console.log(value);\n}", "async function asyncFn(){\n\n return 1;\n}", "async function asyncPromiseAll() {\n //PLACE YOUR CODE HERE:\n}", "async function printDataAsyncAwait() {\n let p = promiseFunction();\n const beta = await p;\n console.log(beta);\n}", "async function asyncAwait() {\n try {\n let result = await cekHariKerja(\"sabtu\");\n console.log(`${result} adalah hari kerja`);\n } catch (error) {\n console.log(error.message);\n }\n}", "async function f(){\n return something\n}", "async function foo() {\n return 1\n}", "async function asyncAwaitFn(str) {\n return await new Promise((resolve, reject) => {\n setTimeout(() => {\n resolve(str)\n }, 1000);\n })\n}", "async function main() {\n // await in front of whatever is resolved from a fct and then returned into a const for instance\n const name = await myPromise;\n name;\n}", "async function simpleReturn() {\n return 1;\n}", "async function miAsyncFunction()\n{\n try \n { //Esto de acá sería como el then de la async function miAsyncFunction() \n const promesa = await miPromesa; //espera el resultado de la promesa satisfecha (resolved)\n console.log(`Este es el valor de la promesa ${promesa}`);\n } //Esto de acá sería como el catch de la async function miAsyncFunction() \n catch (error) {\n console.log(\"La pecheaste\"); \n }\n}", "async function executeHardAsync() {\n const r1 = await fetchUrlData(apis[0]);\n const r2 = await fetchUrlData(apis[1]);\n}", "async function myFunc() {\n const promise = new Promise((resolve, reject) => {\n setTimeout(() => resolve('Hello'), 1000);\n });\n\n const res = await promise; // Wait until the promise is resolved\n\n return res;\n}", "function wrapInPromiseAsync(asyncFunc){\r\n var promise = new Promise(async((resolve, reject) => {\r\n resolve(await(asyncFunc()));\r\n }));\r\n return promise;\r\n}", "async function getValueWithAsync() {\n console.log('calling function');\n const value = await getPromise(5);\n console.log(`async result: ${value}`);\n}", "async function asyncFunction(arg) {\r\n return arg;\r\n}", "async function miFuncionConPromesa ()\r\n{\r\n return 'saludos con promesa y async';\r\n}", "async function getResult() {\n try {\n const result = await addWithPromise(2)\n console.log(\"Using promise with async and await:\", result);\n }\n catch (err) {\n console.log(err)\n }\n}", "async function cobaAsync() {\n\n try {\n const coba = await cobaPromise();\n console.log(coba);\n } catch (error) {\n console.error(error);\n }\n}", "async function executar(){\n await esperarPor(2000)\n console.log('Async 1');\n\n await esperarPor(2000)\n console.log('Async 2');\n\n await esperarPor(2000)\n console.log('Async 3');\n\n}", "async function helloAgain() {\n return await Promise.resolve(\"Oh Hello\");\n}", "async function start() {\n return await Promise.resolve(\"async await\");\n}", "async function func() {\n return 1;\n}", "async function getRecipesAW(){\n\t\t//waits till the promise is fulfilled and then stores the resolved value in the variable ie. Ids ,recipe ,related here\n\t\tconst Ids = await getIds; \n\t\tconsole.log(Ids);\n\t\tconst recipe=await getRecipe(Ids[2]);\n\t\tconsole.log(recipe);\n\t\tconst related = await getRelated('Jonas');\n\t\tconsole.log(related);\n\t\t\n\t\treturn recipe; //async function also returns a promise always!\n\t}", "async function fn(){ //This is the newer way of doing an async function\n return 'hello';\n}", "async function miFuncionConPromesa(){\n return \"Saludos con promeso y async\";\n}", "_asyncWrapper(result) {\r\n if (typeof result === 'object' && 'then' in result) {\r\n return result;\r\n } else {\r\n return new Promise(function(resolve) {\r\n resolve(result);\r\n });\r\n }\r\n }", "async function getRecipeAW() { // the function always return a Promises\n //the await will stop executing the code at this point until the Promises is full filled\n // the await can be used in only async function\n const id = await getID;\n console.log(id)\n console.log('here 2');\n const recipe = await getRecipe(id[1]);\n console.log(recipe);\n const related = await getRelated('Publisher');\n console.log(related);\n\n return recipe;\n}", "async function getDetailsAsync(){\n const details = await getDetails(\"Here is your details from ASYNC AWAIT\");\n\n console.log(details);\n}", "async function getPromiseAsync() {\n try {\n const data = await createPromise(5);\n // console.log('Testing async function ${data}'); the wrong quotes selected for string literals,back-tick required\n console.log(`Testing async function ${data}`);\n } catch (error) {\n console.log(\"Error\", error);\n }\n}", "async function executeAsyncTask() {\n const valueA = await functionA()\n const valueB = await functionB(valueA)\n return function3(valueA, valueB)\n}", "function myAsyncOperation() {\n return new Promise((resolve, reject) => {\n doSomethingAsynchronous((err, value) => {\n if (err) reject(err);\n else resolve(value);\n });\n });\n}", "async function getData() {\n let promise = new Promise((resolve, reject) => {\n setTimeout(() => resolve('done'), 3000);\n });\n\n //Add await\n let result = await promise;\n console.log(result);\n}", "async function ABC() {\n \n let promise = new Promise((resolve, reject) => {\n setTimeout(() => resolve('Done'), 1000)\n });\n\n let result = await promise;\n\n alert(result);\n}", "function getDataAndDoSomethingAsync() {\n getDataAsync()\n .then((data) => {\n doSomethingHere(data);\n })\n .catch((error) => {\n throw error;\n });\n}", "async function wrapperForAsyncFunc() {\n const result1 = await AsyncFunction1();\n console.log(result1);\n const result2 = await AsyncFunction2();\n console.log(result2);\n}", "async function asyncFn() {\n return value;\n }", "async function asyncFn() {\n return value;\n }", "static async method(){}", "async function executeMpromise(){\n \n try{\n const val=await myPromiseFunc(10);\n console.log(val);\n }\n catch(error){\n console.log(\"Error\",err);\n }\n}", "async function fetchAsync(func) { // eslint-disable-line no-unused-vars\r\n const response = await func();\r\n return response;\r\n}", "async function WrapperForAsyncFunc() {\n const result = await AsyncFunction();\n console.log(result);\n}", "async function f2() {\n var y = await 20;\n console.log(y); // 20\n}", "async function fetchAsyncSave(func, data) { // eslint-disable-line no-unused-vars\r\n const response = await func(data);\r\n return response;\r\n}", "do(func) {\n return async && data instanceof Promise\n ? using(data.then(func), async)\n : using(func(data), async)\n }", "async function main() {\n let promise = fs.promise.readFile('asdf')\n .catch(e => fs.promise.readFile(__filename))\n\n let data = await promise\n console.log(String(data))\n}", "execute() {\n return __awaiter(this, void 0, void 0, function* () {\n return { value: 'test_response' };\n });\n }", "async fetchAsync() {\n // await response of fetch call\n let response = await fetch(this.restApiUrl + this.params);\n // only proceed once promise is resolved\n return await response.json();\n }", "async function executeSeqWithForAwait(urls) {\n const responses = [];\n const promises = urls.map((url) => {\n return fetchUrlDataWithAsyncAwait(url);\n });\n\n for await (const res of promises) {\n console.log(res);\n responses.push(res);\n }\n console.log(responses);\n}", "async function getGoogle() {\n const response = await Future.promise(fetchGoogle);\n \n console.log(response);\n}", "function __awaiter(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(t){o(t)}}function a(e){try{c(n.throw(e))}catch(t){o(t)}}function c(e){e.done?i(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())}))}", "async function wait()\n{\n let answer = await isEven(42)\n console.log(answer)\n}", "async function named_async_resolve() {\n return 42;\n }", "async function fivePromise() {\n return 5;\n}", "async function init(){\n await createPostPromise({title:'post six',body:'this is post six'})\n .then(getPosts)\n .catch(err=>console.log(err))\n}", "function doStuffSync() {\n return Promise.resolve('foo')\n // return Promise.reject('nok')\n}", "async function f() {\n return Promise.resolve(1);\n}", "async function getAsync() {\n return new Promise(function (resolve, reject) {\n setTimeout(() => resolve('Request Completed'), 1000)\n // setTimeout(() => reject(new Error('Time Out not able to process')))\n })\n}", "async function concurrent() {\n const firstPromise = firstAsyncThing();\n const secondPromise = secondAsyncThing();\n console.log(await firstPromise, await secondPromise);\n }", "async function funcionConPromesaYAwait(){\n let miPromesa = new Promise((resolved) => {\n resolved(\"Promesa con await\"); \n });\n\n //Ya no es necesario utilizar .then() sino que con await va a recibir el valor\n // y se va a mostrar en consola \n console.log( await miPromesa );\n}", "function demoOfAsyncAwait(){\n\tfunction mockRequest(second){\n\t const args = [...arguments];\n\t [second,...params] = args;\n\t return new Promise((resolve,reject)=>{\n\t setTimeout(function() {resolve(params)},second*1000);\n\t })\n\t};\n\t //继发,依次执行\n\t async function jifa(){\n\t const a= await mockRequest(1,1,2);\n\t const b= await mockRequest(1,1,2);\n\t const c= await mockRequest(1,1,2);\n\t return [...a,...b,...c];\n\t};\n\t //jifa().then(a=>console.log(a));\n\t \n\t //并发,同时执行\n\t async function wrong_bingfa(){\n\t return Promise.all([await mockRequest(3,1,2),\n\t await mockRequest(3,1,2),\n\t await mockRequest(3,1,2)])\n\t .then(([a,b,c])=>[...a,...b,...c]);\n\t }\n\t //wrong_bingfa()依然是继发执行\n\t async function bingfa(){\n\t const [a,b,c]= await Promise.all([mockRequest(3,10,2),\n\t mockRequest(3,10,2),\n\t mockRequest(3,10,2)]);\n\t return [...a,...b,...c];\n\t\t }\n\t//bingfa().then(a=>console.log(a));\n\t \n\t async function bingfa2(){\n\t const arr=[[4,11,2],[4,11,2],[4,11,2]].map(async item=>{\n\t return await mockRequest(...item);\n\t });\n\t //!!!!!!!! items of 'arr' are Promise instances, not Array instances.\n\t const res=[];\n\t for(const p of arr){\n\t res.push(await p);\n\t }\n\t [a,b,c]=res;\n\t return [...a,...b,...c];\n\t }\n\t/*上面代码中,虽然map方法的参数是async函数,但它是并发执行的,\n\t因为只有async函数内部是继发执行,外部不受影响。\n\t后面的for..of循环内部使用了await,因此实现了按顺序输出。\n*/\n\tbingfa2().then(a=>console.log(a));\n}", "async function doSomething() {\n // resolve is callback function\n //reject is a callback\n\n logger.log('2: function is called');\n return new Promise((resolve, reject) => {\n\n\n // read from the database.. example\n // the following timeout function is asynchronus block of code\n setTimeout(function () {\n // anonymous function that simulates reading from the database\n resolve(\"3:reading from the database\")\n\n\n // error scenarios\n // var error= new Error(\" connection failed with the database\")\n // reject(error);\n }, 3000);\n });\n\n\n\n}", "async function getMessageAsync(){ // async / await makes async code to look like sync \n try{\n let res1 = await promise1;\n let res2 = await promise2; // wating for the promise to be resolved/rejected \n console.log(res1 + \" \" + res2);\n }catch(err){ \n console.error(err, 22); // if there is errors / rejections it will be handled here \n }\n}", "async function wrapperForAsyncFunc(){\n const [result1, result2] = await Promise.all([\n AsyncFunction1(),\n AsyncFunction2()\n ]);\n console.log(result1, result2)\n}", "function asyncHelper () {\n\tlet f, r\n\tconst prm = new Promise((_f, _r)=>{f = _f, r = _r})\n\tfunction done(...x){\n\t\treturn x.length === 0 ? f() : r(x[0])\n\t}\n\tdone.then = prm.then.bind(prm)\n\tdone.catch = prm.catch.bind(prm)\n\tdone.finally = prm.finally.bind(prm)\n\treturn done\n}", "function __awaiter(n,e,t,o){return new(t||(t=Promise))((function(r,l){function a(n){try{s(o.next(n))}catch(e){l(e)}}function i(n){try{s(o.throw(n))}catch(e){l(e)}}function s(n){var e;n.done?r(n.value):(e=n.value,e instanceof t?e:new t((function(n){n(e)}))).then(a,i)}s((o=o.apply(n,e||[])).next())}))}", "async function doWork() {\n const response = await makeRequest('osu');\n console.log('response received')\n const finalResponse = await addSomething(response);\n console.log(finalResponse);\n\n}", "async function waiting() {\n const firstValue = await firstAsyncThing();\n const secondValue = await secondAsyncThing();\n console.log(firstValue, secondValue);\n }", "function __awaiter(n,e,t,o){return new(t||(t=Promise))((function(r,i){function a(n){try{s(o.next(n))}catch(e){i(e)}}function l(n){try{s(o.throw(n))}catch(e){i(e)}}function s(n){var e;n.done?r(n.value):(e=n.value,e instanceof t?e:new t((function(n){n(e)}))).then(a,l)}s((o=o.apply(n,e||[])).next())}))}", "function parseAwait() {\n parseMaybeUnary();\n}", "async function asynFunc() {\r\n await createPost(\"title#3\", \"body#3\");\r\n getPosts();\r\n}", "async function thenify(fn) {\n return await new Promise(function(resolve, reject) {\n function callback(err, res) {\n if (err) return reject(err);\n return resolve(res);\n }\n\n fn(callback);\n });\n}", "async function f() {\n return 1;\n }", "async function f() {\n return 1;\n }", "async function doWork() {\n // use try catch to handle any errors with the promise\n try {\n // await says that the code should wait for this code to finish before executing the next thing\n const response = await makeRequest('Google')\n console.log('Response received')\n const processedResponse = await makeRequest(response)\n console.log(processedResponse)\n // catch will be used if promise rejects instead of resolves\n } catch(err) {\n console.log(err)\n }\n}", "async function fetchUser() {\n return \"abc\";\n}", "async function getExample() {\n let output = await getCompanies();\n return output;\n // let a = getCompanyName();\n // let b = a.then(function(resultA) {\n // // some processing\n // return getCompanies();\n // });\n // let c = b.then(function(resultB) {\n // // some processing\n // return getStreetAddress();\n // });\n\n // let d = c.then(function(resultC) {\n // // some processing\n // return getCityState();\n // });\n // return Promise.all([a, b,c,d ]).then(function([resultA, resultB, resultC, resultD]) {\n // // more processing\n // console.log(' resultB=', resultB);\n // console.log(' resultA=', resultA);\n // console.log(' resultC=', resultC);\n // console.log(' resultD=', resultD);\n\n\n // let output = _.merge(resultA, resultB, resultC, resultD);\n\n // console.log('110- output =', output );\n \n // return output; \n \n // });\n}", "async function printDataAsyncAwait() {\n const data = await promiseFunction();\n console.log(data);\n}", "async function main() {\n // create the promises first\n var call1 = myApiClient(1)\n var call2 = myApiClient(2)\n\n // then wait for them\n var response1 = await call1\n var response2 = await call2\n\n // do something with the responses\n var message = response1['message'] + ' ' + response2['message']\n console.log(message)\n}", "async function awaitFetchData() {\n let returnedData = await fetchData();\n console.log(returnedData);\n}", "async function onClickAsyncAwait() {\n try {\n console.time('Measuring time');\n\n const valueOne = await taskOne();\n const valueTwo = await taskTwo();\n const valueThree = await taskThree();\n\n console.timeEnd('Measuring time');\n } catch (error) {\n //console.log(error);\n }\n\n}", "function async(makeGenerator){\n return function () {\n var generator = makeGenerator.apply(this, arguments);\n\n function handle(result){\n // result => { done: [Boolean], value: [Object] }\n if (result.done) return Promise.resolve(result.value);\n\n return Promise.resolve(result.value).then(function (res){\n return handle(generator.next(res));\n }, function (err){\n return handle(generator.throw(err));\n });\n }\n\n try {\n return handle(generator.next());\n } catch (ex) {\n return Promise.reject(ex);\n }\n }\n}", "async function func2() {\n return Promise.resolve(1);\n}", "async function waitForMyPromise() {\n const promise = new Promise((resolve) => {\n setTimeout(() => {\n resolve('done!!!');\n }, 1000)\n });\n\n const result = await promise;\n console.log('my promise is', result);\n}", "async function helloWorld(){\n console.log(\"Were going to say something, but you have to wait 1.5 seconds\")\n await wait(1500);\n return(\n console.log(\"Hello world!\"),\n console.log(\"Congrats on waiting for the promise to fulfill, that took 1.5 seconds\")\n );\n }", "function asyncGate() {\n const pendingPromises = {};\n\n return async function execute(key, f) {\n if(pendingPromises[key]) {\n return await pendingPromises[key];\n }\n\n pendingPromises[key] = f();\n\n try {\n return await pendingPromises[key];\n } finally {\n delete pendingPromises[key];\n }\n }\n}", "function asyncThing(value) {\n return new Promise((resolve, reject) => {\n setTimeout(() => resolve(value), 100)\n })\n}", "async function myFn() {\n // wait\n}" ]
[ "0.72386634", "0.69835025", "0.69809437", "0.6958902", "0.6888303", "0.6882806", "0.6815461", "0.68067724", "0.680313", "0.67948866", "0.6715514", "0.6714994", "0.67125434", "0.66478854", "0.6603291", "0.65852815", "0.6578061", "0.6571049", "0.6568094", "0.65576184", "0.65276235", "0.6506458", "0.65033776", "0.6499894", "0.64883995", "0.64842284", "0.64710444", "0.6466672", "0.6459288", "0.6440648", "0.64329183", "0.64060295", "0.6405136", "0.6401427", "0.6394893", "0.6388165", "0.6364658", "0.6359287", "0.63398296", "0.6320866", "0.631611", "0.6302814", "0.6302674", "0.6302643", "0.6298326", "0.6293477", "0.6284039", "0.62830794", "0.62777483", "0.6274168", "0.6274168", "0.62710536", "0.62639445", "0.62588805", "0.62501967", "0.6239892", "0.623802", "0.6236222", "0.6233548", "0.62329376", "0.62282956", "0.62273806", "0.62217844", "0.62208045", "0.621623", "0.6215414", "0.6211713", "0.62069166", "0.620495", "0.62004775", "0.6193849", "0.6192677", "0.6192654", "0.61908627", "0.6181336", "0.618068", "0.6176622", "0.6175187", "0.61716115", "0.6163709", "0.6162577", "0.6154384", "0.61353207", "0.61248136", "0.61152565", "0.6111991", "0.6111991", "0.61114186", "0.6110532", "0.61005163", "0.6095543", "0.60949194", "0.60932785", "0.60822195", "0.6080382", "0.6072513", "0.6055904", "0.6048635", "0.6046146", "0.6046143", "0.6041157" ]
0.0
-1
A middleware providing ActiveRules Authorization. Built on top of Passport.
function middleware(app, settings) { return function (conn) { return conn.call(app); }; // End the main return function }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function authMiddleWare() {\n return function(req, res, next) {\n console.log(req.headers);\n if (req.headers['authorization']) {\n let token = req.headers['authorization'];\n\n try {\n let verifed = JWT.verify(token, SECRET);\n\n if (verifed.username === 'santRaju') {\n next();\n } else {\n throw 'unauthorized';\n }\n } catch (err) {\n res.json({\n status: 403,\n success: false,\n message: 'unauthorized access'\n });\n }\n } else {\n res.json({\n status: 403,\n success: false,\n message: 'unauthorized access'\n });\n }\n };\n}", "function authMiddleware(req, res, next, options = {}) {\n\n // Match the auth header with RegExp\n let bearer = /Bearer (.+)/.exec(req.headers.authorization);\n\n // Check match of the header\n if(!bearer) {\n res.status(401).send({ error: \"invalid_authorization_header\" }).end();\n return;\n }\n // Get jwt from match\n let token = bearer[1];\n\n // Try to verify the jwt\n try {\n token = jwt.verify(token, Config.config.jwt.secret);\n } catch(err) {\n res.status(401).send({ error: \"unauthorized\" }).end();\n return;\n }\n\n // Check permissions\n if(options.admin && !token.admin) {\n res.status(403).send({ error: \"no_admin\" }).end();\n return;\n }\n\n // Set token payload to req.user\n req.user = token;\n\n next();\n\n}", "function authMiddleware(req, res, next) {\n // Check token validity\n const authHeader = req.headers.authorization;\n const token = authHeader && authHeader.split(\" \")[1];\n if (token == null) return res.sendStatus(403);\n\n // Verify token\n const verify = authToken(token);\n if (verify && verify.exp > Date.now()) {\n next();\n } else {\n return res.sendStatus(401);\n }\n}", "static authorize() {\n return (req, res, next) => {\n const { provider, accessToken } = this._getCredentials(req);\n\n if (!provider) {\n return next(new Error(\"No provider given\"));\n }\n if (!accessToken) {\n return next(new Error(\"No access token delivered\"));\n }\n\n let authUserId;\n let authClientId;\n\n return this._callProvider({ provider, accessToken })\n .then(({ clientId, userId }) => {\n authUserId = userId;\n authClientId = clientId;\n return this._checkClient(authClientId);\n })\n .then(() => {\n return this._checkUser(authUserId, provider);\n })\n .then(person => {\n req.user = person;\n return next();\n })\n .catch(ex => {\n return next(ex);\n });\n };\n }", "protect(callback) {\n // if the callback isn't defined default to one which just makes sure \n // someone is logged in.\n let middleware = callback ? callback : (request, response, next) => {\n if (!request.isAuthenticated())\n return response.redirect('/login');\n \n return next();\n }\n // get local this because of fucked up scope.\n let that = this;\n return {\n get(path, method) {\n that.router.get(path, method, middleware);\n },\n post(path, method) {\n that.router.post(path, method, middleware);\n },\n put(path, method) {\n that.router.put(path, method, middleware);\n },\n delete(path, method) {\n that.router.delete(path, method, middleware);\n }\n }\n }", "function ensureAuthorized(req, res, next) {\n var bearerHeader = req.headers[\"authorization\"];\n if (typeof bearerHeader !== 'undefined') {\n var bearer = bearerHeader;\n req.token = bearer;\n next();\n } else {\n res.status(403).send('Unable to authenticate');\n }\n}", "function authCheck(req, res, next) {\n const bearerHeader = req.headers[\"authorization\"];\n if (typeof bearerHeader === \"undefined\") {\n // 403 Forbidden if no authorization header\n res.sendStatus(403);\n } else {\n const bearerToken = bearerHeader.split(\" \")[1];\n jwt.verify(bearerToken, jwtSecret, (err, authData) => {\n if (err) {\n console.log(err);\n res.send(500);\n } else {\n User.findById(\n authData.activeUser.id,\n \"_id name emailId\",\n (err, result) => {\n if (err) {\n console.log(err);\n res.send(500);\n } else {\n req.activeUser = result;\n next();\n }\n }\n );\n }\n });\n }\n}", "function jwtAuth () {\n return function (req, res, next) {\n if (isOpen(req.path())) {\n return next()\n } else if (isSlackForImagePath(req.path(), req.header('user-agent'))) {\n return next()\n } else {\n if (!req.token) {\n return next(new err.UnauthorizedError({success: false, message: 'API token missing.'}))\n } else {\n jwt.verify(req.token)\n .then((result) => {\n checkUserAccess(result, req.path(), (err, user) => {\n if (err) {\n return next(new err.ForbiddenError({success: false, message: 'Unauthorized for that route'}))\n }\n return next()\n })\n })\n .catch(() => {\n return next(new err.ForbiddenError({success: false, message: 'Unverified JWT'}))\n })\n }\n }\n }\n}", "validate(req, res, next) {\n\n // check header or url parameters or post parameters for token\n let token = req.headers['x-access-token'];\n let url = req.url.split('/');\n // console.log('headers => ',req.headers);\n // console.log('url = ',req.url);\n\n /**\n * Exclude validation on all routes with auth, status and public\n */\n if ( url.includes('auth')\n || url.includes('status')\n || url.includes('public')\n || url.includes('register')\n || url.includes('dashboard')\n || url.includes('apidoc')\n || url.includes('login') || req.url==='/') {\n next();\n } else {\n /**\n * Decode user from token and add to request if request has a valid token\n */\n if (token) {\n // verifies secret and checks exp\n jwt.verify(token, config.jwtSecret, (err, decoded) => {\n if (err) {\n // console.log(err)\n return res.status(403).send({success: false, message: err.message});\n\n } else {\n // if everything is good, save to request for use in other routes\n req.user = decoded;\n // console.log(decoded);\n next();\n }\n });\n } else {\n /**\n * Return 403 - Forbidden status if there's no token or token is valid\n */\n return res.status(403).send({\n success: false,\n message: 'You are not allowed access',\n reason: 'No token provided.'\n });\n }\n }\n }", "function secureRoute(req, res, next) {\n if(!req.headers.authorization) return res.status(401).json({ message: \"You are not allowed in because you're not cool enough.\"});\n\n var token = req.headers.authorization.replace(\"Bearer \", \"\")\n\n jwt.verify(token, secret, function(err, payload){\n if(err || !payload) return res.status(401).json({ message: \"You are not allowed in because you're not cool enough.\"});\n\n req.user = payload;\n next();\n });\n}", "function authorize(req, res, next) {\n\tdebug('url: ' + req.originalUrl);\n\tdebug('method: ' + req.method);\n\tif (!req[configs.roleObjectKey].role) {\n\t\tif (!configs.defaultRole) {\n\t\t\tnext(new UnauthorizedError('No Role found'));\n\t\t\treturn;\n\t\t}\n\n\t\treq[configs.roleObjectKey].role = configs.defaultRole;\n\t}\n\n\tlet role = req[configs.roleObjectKey].role;\n\tlet url = req.originalUrl;\n\n\tlet rules = configs.rules[role];\n\tlet rule;\n\n\tif (rules) {\n\t\trule = findRule(rules, url, req.method);\n\t\tdebug(rule);\n\t}\n\n\tif (!rule) {\n\t\tlet message = 'No matching rule found for \\'' + role + '\\' on \\'' + url + '\\'';\n\t\tdebug(message);\n\t\tnext(new UnauthorizedError(message));\n\t\treturn;\n\t}\n\n\tnext();\n}", "function verification(req, res, next) {\n const bearerHeader = req.headers['authorization'];\n if (typeof bearerHeader !== 'undefined') {\n const bearer = bearerHeader.split(' ');\n const bearerToken = bearer[1];\n req.token = bearerToken;\n\n next();\n }\n else {\n res.sendStatus(403);\n }\n}", "function authenticationMiddleware(req, res, next) {\n if (req.isAuthenticated() && require('./permissions')(req))\n // se o usuario tiver autenticado e a funcao do permissions der TRUE ele consegue seguir adiante, se não ele é direcionado para /off\n return next()\n res.redirect('/off')\n }", "function authenticationRequired(req, res, next) {\nconst authHeader = req.headers.authorization || '';\nconst match = authHeader.match(/Bearer (.+)/);\n\nif (!match) {\n return res.status(401).end();\n}\n\nconst accessToken = match[1];\nconst expectedAudience = 'api://default';\n\nreturn oktaJwtVerifier.verifyAccessToken(accessToken, expectedAudience)\n .then((jwt) => {\n req.jwt = jwt;\n next();\n })\n .catch((err) => {\n res.status(401).send(err.message);\n });\n}", "authorize(options) {\n logger.debug('Creating authorization endpoint middleware')\n return async (ctx, next) => {\n logger.debug('Running authorize endpoint middleware')\n const { request, response } = build(ctx)\n\n await this.server\n .authorize(request, response, options)\n .then(async code => {\n ctx.state.oauth.code = code\n handleResponse(ctx, response)\n if (next) await next()\n })\n .catch(err => {\n handleError(err, ctx)\n })\n }\n }", "function gen_auth_middleware (sql) {\n return function (req, res, next) {\n if (!req.headers.authorization) {\n return res.status(401).end();\n }\n const token = req.headers.authorization.split(' ')[1];\n\n return jwt.verify(token, secret.jwtSecret, (err, decoded) => {\n if (err) {\n console.log(`[401] ${req.method} ${req.url}: Cannot verify JWT token`);\n return res.status(401).end();\n }\n\n const userId = decoded.sub;\n\n // check if a user exists\n return sql.getUserById(userId).then((user) => {\n if (!user) {\n console.log(`[401] ${req.method} ${req.url}: Cannot find user in DB`);\n return res.status(401).end('Cannot find user in DB');\n }\n\n console.log(`[200] ${req.method} ${req.url}: Found user in DB`);\n req.locals = { userId: userId };\n\n return next();\n }).catch((err) => {\n console.log(`[401] ${req.method} ${req.url}: ${err.message}`);\n return res.status(401).end(err.message);\n });\n });\n };\n}", "function createRuleValidator(path) {\n\t return function (req, res, next) {\n\n\t if (req.headers.authorization && req.headers.authorization.split(' ')[0] === 'Bearer') {\n\t var token = req.headers.authorization.split(' ')[1];\n\t return _jsonwebtoken2.default.verify(token, req.webtaskContext.data.EXTENSION_SECRET, {\n\t audience: (0, _urlJoin2.default)(req.webtaskContext.data.WT_URL, path),\n\t issuer: 'https://' + req.webtaskContext.data.AUTH0_DOMAIN\n\t }, function (err, decoded) {\n\t if (err) {\n\t return res.sendStatus(401);\n\t }\n\t return next();\n\t });\n\t }\n\n\t return res.sendStatus(401);\n\t };\n\t}", "function protected() {\n return async function (req, res, next) {\n if (req.session && req.session.user_id) {\n // We have a session, we can use the user id to get the access token\n try {\n let conn = await db()\n let [userTokens] = await conn('users').where('id', req.session.user_id)\n const token = JSON.parse(userTokens.manageToken).access_token\n return acceptToken(token, res, next)\n } catch (err) {\n return res.status(500).send('Could not authorize user')\n }\n } else {\n // We don't have a session, probably an API route, check for an access token\n if (req.headers.authorization && req.headers.authorization.split(' ')[0] === 'Bearer') {\n const token = req.headers.authorization.split(' ')[1]\n return acceptToken(token, res, next)\n } else {\n return res.status(401).send('Access denied')\n }\n } \n }\n}", "function authorize(req, res, next) {\n if (userService.authorize()) {\n next();\n } else {\n res.status(401).send({ message: \"Unauthorized!\" });\n }\n}", "function authenticationRequired(req, res, next) {\n const authHeader = req.headers.authorization || ''\n const match = authHeader.match(/Bearer (.+)/)\n\n if (!match) {\n res.status(401)\n return next('Unauthorized')\n }\n\n const accessToken = match[1];\n const audience = 'api://default'\n return oktaJwtVerifier.verifyAccessToken(accessToken, audience)\n .then((jwt) => {\n req.jwt = jwt\n next()\n })\n .catch((err) => {\n console.log('error verifying token ' + err)\n res.status(401).send(err.message)\n })\n}", "parseAuthorization(){\n\t\tthis.app.use(\n\t\t\t(req, res, next) => {\n\t\t\t\tconst b64Auth = req.get('Authorization');\n\t\t\t\tif(typeof b64Auth == 'string'){\n\t\t\t\t\tlet {user: userID, pass: plainword, authToken} = this.decipherCredentials(b64Auth);\n\t\t\t\t\tthis.log.debug(`Authorization: user=${userID}, pass=${plainword}, authToken=${authToken}, b64Auth=${b64Auth}`);\n\t\t\t\t\treq.parsedParams = {\n\t\t\t\t\t\t...req.parsedParams,\n\t\t\t\t\t\tplainword,\n\t\t\t\t\t\tauthToken,\n\t\t\t\t\t\tuserID\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tnext();\n\t\t\t}\n\t\t);\n\t}", "function authenticationRequired(req, res, next) {\n const authHeader = req.headers.authorization || '';\n const match = authHeader.match(/Bearer (.+)/);\n\n if (!match) {\n res.status(401);\n return next('Unauthorized');\n }\n\n const accessToken = match[1];\n const audience = sampleConfig.resourceServer.assertClaims.aud;\n return oktaJwtVerifier.verifyAccessToken(accessToken, audience)\n .then((jwt) => {\n req.jwt = jwt;\n next();\n })\n .catch((err) => {\n res.status(401).send(err.message);\n });\n}", "function isAuthenticated() {\n return compose()\n .use(function(req, res, next) { // used to validate jwt of user session\n if(req.query && req.query.hasOwnProperty('access_token')) { // allows 'access_token' to be passed through 'req.query' if necessary\n req.headers.authorization = 'Bearer ' + req.query.access_token;\n }\n validateJwt(req, res, next);\n })\n .use(function(req, res, next) { //used to attach 'user' to 'req'\n User.findById(req.user._id, function (err, user) {\n if (err) return next(err);\n if (!user) return res.status(401).send('Unauthorized');\n\n req.user = user;\n console.log('user auth success');\n next();\n });\n });\n}", "function auth() {\n var opts = {};\n opts.jwtFromRequest = ExtractJwt.fromAuthHeaderWithScheme(\"jwt\");\n opts.secretOrKey = secret;\n passport.use(\n new JwtStrategy(opts, function (jwt_payload, done) {\n const body = jwt_payload;\n\n kafka.make_request(\"passport\", body, function (err, results) {\n if (err) {\n return done(err.data, err.boolean);\n } else {\n return done(results.boolean, results.data);\n }\n });\n })\n );\n}", "function auth() {\n const opts = {\n jwtFromRequest: ExtractJwt.fromAuthHeaderWithScheme('jwt'),\n secretOrKey: secret,\n };\n passport.use(\n new JwtStrategy(opts, (jwt_payload, callback) => {\n const user_id = jwt_payload._id;\n const role = jwt_payload.role\n console.log(user_id)\n User.findById(user_id, (err, results) => {\n if (err) {\n return callback(err, false);\n }\n if (results) {\n callback(null, results);\n } else {\n callback(null, false);\n }\n });\n }),\n );\n}", "static ensureAuthorized(request, response, next) {\n let bearerToken;\n const bearerHeader = request.headers.authorization || request.query.authorization;\n if (typeof bearerHeader !== 'undefined') {\n const bearer = bearerHeader.split(' ');\n bearerToken = bearer[1];\n request.token = bearerToken;\n next();\n } else {\n const error = new UndefinedTokenError(ErrorCode.NOT_ALLOWED.msg.noBearer);\n Http.sendResponse(response, 403, ErrorCode.NOT_ALLOWED.code, error);\n }\n }", "function isValidUser(req, res, next) {\n\tconst bearerHeader = req.headers['authorization'];\n\tif (typeof bearerHeader !== 'undefined') {\n\t\treq.token = bearerHeader;\n\t\tjwt.verify(req.token, 'secretKey', (err, authData) => {\n\t\t\tif (err) {\n\t\t\t\tres.status(403).json({message: 'Unauthorized'})\n\t\t\t} else {\n\t\t\t\tres.status(200).json({\n\t\t\t\t\tmessage: 'Authorized request',\n\t\t\t\t\tauthData\n\t\t\t\t})\n\t\t\t\treq.params = authData\n\t\t\t\tnext();\n\t\t\t}\n\t\t})\n\t\tnext();\n\t} else {\n\t\tres.status(403).json({\n\t\t\tmessage: 'Unauthorized request'\n\t\t})\n\t}\n}", "function byPassJWT(req, res, next) {\n // example: allow all get requests\n // if(req.method === 'GET') {\n // return next();\n // }\n return expressJwt({ secret: config.secret })(req, res, next);\n }", "hasAccess(req, res, next) {\n let token = req.headers['x-access-token']\n if(!token) return res.status(403).end('forbidden')\n\n this.sessionStore.getSession(token).then(function(session) {\n return this.userStore.getUser(session.userId)\n }.bind(this)).then(function(user) {\n req.user = user\n const roles = ['admin', 'volunteer', 'respondent']\n if(roles.indexOf(user.role) > -1) {\n next()\n } else {\n return res.status(403).end('forbidden')\n }\n })\n }", "function ensureAuthorized(req, res, next) {\n\t// create role\n var role;\n // if the user doesn't exist, set role to public\n if(!req.user) {\n \trole = userRoles.public;\n }\n else {\n // if the user exists set the user.role to role\n \trole = req.user.role;\n }\n \n // create accessLevel and findWhere path has accessLevel or set the accessLevel to public.\n var accessLevel = _.findWhere(routes, { path: req.route.path }).accessLevel || accessLevels.public;\n\n // if not true then return a 403 response\n // if(!(accessLevel.bitMask & role.bitMask)) {\n // \treturn res.send(403);\n // }\n // otherwise return next and enter the \n return next();\n}", "function authenticationMiddleware () { \n return (req, res, next) => {\n if (req.isAuthenticated()) return next();\n res.redirect('/login')\n }\n }", "function auth() {\n var opts = {\n jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),\n secretOrKey: secret,\n };\n passport.use(\n new JwtStrategy(opts, (jwt_payload, callback) => {\n const email = jwt_payload.email;\n connection.query(\n \"SELECT * FROM user WHERE email = ?\",\n [email],\n function (err, results, fields) {\n console.log(\"Results\");\n console.log(results);\n if (results.length > 0) {\n console.log(results);\n console.log(jwt_payload);\n callback(null, results);\n }\n if (err) {\n console.log(err);\n callback(null, false);\n }\n }\n );\n })\n );\n}", "function authenticationMiddleware() { \n\treturn (req, res, next) => {\n\t\tconsole.log(`req.session.passport.user: ${JSON.stringify(req.session.passport)}`);\n\t\t//only if the user is authenticated \n\t if (req.isAuthenticated()) return next();\n\t //if use is NOT authenticated then redirect them to login page\n\n\t res.redirect('/login');\n\t \n\t}\n}", "function checkAuthorization(req, res, next) {\n\t// if user is authenticated (logged-in)\n\tif (req.isAuthenticated()) {\n\t\t// find the poll to check for authorization as well\n\t\tPoll.findById(req.params.id, (err, foundPoll) => {\n\t\t\tif (err) {\n\t\t\t\tres.redirect('back');\n\t\t\t} else {\n\t\t\t\t// if current user is the one who added the poll\n\t\t\t\tif (foundPoll.user.id && foundPoll.user.id.equals(req.user._id)) {\n\t\t\t\t\tnext();\n\t\t\t\t} else {\n\t\t\t\t\tres.redirect('back');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t} else {\n\t\tres.redirect('back');\n\t}\n}", "function stateAuthentication(req, res, next) {\r\n if (req.canPlayRoleOf('apiUser')) {\r\n return next();\r\n } else {\r\n return res.status(401).json({'error': 'user not authorized for this type of role', 'status': 401});\r\n }\r\n}", "function isValidUser(req,res,next){\n if(req.isAuthenticated()) next(); // passport method will check \n else return res.status(401).json({message:'Unauthorized Request'});\n}", "function authenticationMiddleware(req, res, next) {\n //1.check if user sent a token in the headers | body | query \n var token = req.body.token || req.query.token || req.get('Authorization');\n Logger_1.Logger.d(TAG, '=============== Authentication Middleware ===============', 'gray');\n Logger_1.Logger.d(TAG, 'the token > ' + token, 'gray');\n // decode token\n if (token) {\n //2.verify user token and its exp.\n jwt.verify(token, 'mySecretForJWTtoken', (err, decoded) => __awaiter(this, void 0, void 0, function* () {\n if (err) {\n Logger_1.Logger.d(TAG, 'Failed to authenticate token > ' + err, 'red');\n return res.status(401).json({ success: false, message: 'Failed to authenticate token.' });\n }\n else {\n let userId = decoded.userId;\n /*\n 3.check that userId exist in db and if so save the user in req.user\n using userId from decrypted token - to check if there is such user in db*/\n try {\n let userRep = new user_rep_1.UserRepository();\n let user = yield userRep.getUserById(userId);\n Logger_1.Logger.d(TAG, `user is authenticated, userId > ${userId} `, 'green');\n Logger_1.Logger.d(TAG, JSON.stringify(user), 'green');\n Logger_1.Logger.d(TAG, '=============== / Authentication Middleware ===============', 'gray');\n req.user = user;\n next();\n }\n catch (e) {\n Logger_1.Logger.d(TAG, 'ERR=========>' + e, 'red');\n res.status(401).json({\n success: false,\n message: e\n });\n }\n }\n }));\n }\n else {\n Logger_1.Logger.d(TAG, 'token not exist on Header | url | querystring', 'red');\n Logger_1.Logger.d(TAG, '=============== / Authentication Middleware ===============', 'gray');\n // if there is no token\n // return an error\n return res.status(401).json({\n success: false,\n message: 'No token provided.'\n });\n }\n}", "function restricted(req, res, next) {\n const token = req.headers.authorization;\n\n if (token) {\n jwt.verify(token, process.env.REACT_APP_SECRET, (err, decodedToken) => {\n if (err) {\n return res.status(401).json({ message: \"Haha! Unauthorized!\" });\n }\n console.log(\"Restricted\");\n next();\n });\n } else {\n res.status(401).json({ message: \"You need some token, my Friend!\" });\n }\n}", "hasBasicAccess(req, res, next) {\n let token = req.headers['x-access-token']\n if(!token) return res.status(403).end('forbidden')\n\n this.sessionStore.getSession(token).then(function(session) {\n return this.userStore.getUser(session.userId)\n }.bind(this)).then(function(user) {\n req.user = user\n const roles = ['respondent']\n if(roles.indexOf(user.role) > -1) {\n next()\n } else {\n return res.status(403).end('forbidden')\n }\n })\n }", "function checkRequest (req, res, next) {\n // TODO: Cleaner way of excluding some paths from the auth check\n if (req.url === '/status') {\n return next(null);\n }\n\n var appAuthorization = req.headers.authorization;\n var user = req.headers[userHeader];\n\n if (!appAuthorization) {\n return next(new restify.InvalidArgumentError('You must provide an valid Authorization header to access seguir the seguir API.'));\n }\n\n var appId = appAuthorization.split(':')[0].split(' ')[1];\n\n checkApplicationToken(appId, function (err, token) {\n if (err) { return next(err); }\n if (!token) {\n return next(new restify.InvalidArgumentError('You must provide an valid Authorization header to access seguir the seguir API.'));\n }\n\n if (authUtils.validateAuthorization(req.headers, token.tokenid, token.tokensecret)) {\n req.keyspace = keyspace + '_' + token.appkeyspace;\n checkUser(req.keyspace, user, function (err, user) {\n if (err) { return next(err); }\n req.liu = user;\n next(null);\n });\n } else {\n return next(new restify.InvalidArgumentError('You must provide an valid Authorization header to access seguir the seguir API.'));\n }\n });\n }", "function authorize(req, res, next) {\n if(!req.header('authorization')) {\n return res.status(401).json({\n status: 401,\n message: 'Unauthorized. Missing Auth Header'\n })\n } else {\n let token = jwt.verify(req.headers['authorization'], jwtkey);\n if(!token) {\n return res.status(401).json({\n status: 401,\n message: 'Unauthorized. Auth Header Invalid'\n })\n } else {\n req.userId = token.sub;\n next();\n }\n }\n}", "function authenticationMiddleware () {\r\n return function (req, res, next) {\r\n if (req.isAuthenticated()) {\r\n console.log(\"is authenticated\")\r\n return next()\r\n }\r\n console.log(\"not authenticated\")\r\n res.redirect('/?login=false')\r\n }\r\n}", "static getAuthorization(req, res, next) {\n let token = req.body.storage;\n jwt.verify(token, config.secret, function(err, authData) {\n if (err) {\n res.send(\"Error\").end();\n } else {\n connection.query(\n `SELECT * FROM users WHERE username = '${authData.userForToken.username}' AND password = '${authData.userForToken.password}'`,\n function(err, result) {\n if (err) {\n }\n connection.query(queries.getLoginDetails2, [result[0].id], function(\n err,\n row\n ) {\n if (\n authData.userForToken.username === result[0].username &&\n authData.userForToken.password === result[0].password\n ) {\n const userApproved = {\n id: result[0].id,\n firstname: result[0].firstname,\n lastname: result[0].lastname,\n role: row[0].role\n };\n res.send(userApproved).end();\n }\n });\n }\n );\n }\n });\n }", "function authTokenMiddleware(req, res, next) {\n req.hull = req.hull || {};\n if (req.headers.authorization) {\n const [authType, token64] = req.headers.authorization.split(\" \");\n if (authType === \"Basic\" && token64) {\n try {\n req.hull.token = new Buffer(token64, \"base64\").toString().split(\":\")[0].trim();\n req.hull.config = false;\n } catch (err) {\n const e = new Error(\"Invalid Basic Auth Header\");\n e.status = 401;\n return next(e);\n }\n }\n }\n return next();\n}", "function isAuthenticated() {\n return (0, _composableMiddleware2.default)()\n // Validate jwt\n .use(function (req, res, next) {\n // allow access_token to be passed through query parameter as well\n if (req.query && req.query.hasOwnProperty('access_token')) {\n req.headers.authorization = 'Bearer ' + req.query.access_token;\n }\n // IE11 forgets to set Authorization header sometimes. Pull from cookie instead.\n if (req.query && typeof req.headers.authorization === 'undefined') {\n req.headers.authorization = 'Bearer ' + req.cookies.token;\n }\n validateJwt(req, res, next);\n })\n // Attach user to request\n .use(function (req, res, next) {\n _sqldb.User.find({\n where: {\n id: req.user.id\n }\n }).then(function (user) {\n if (!user) {\n return res.status(401).end();\n }\n req.user = user;\n next();\n }).catch(function (err) {\n return next(err);\n });\n });\n}", "function authenticationMiddleware() {\n return (req, res, next) => {\n // if (req.isAuthenticated()) return next();\n // res.redirect('/login');\n return next();\n }\n}", "static async authorize(req, res, next) {\n if (!req.headers.authorization || req.headers.authorization.indexOf('Basic ') === -1) {\n return res.error('Missing Authorization Header', 401);\n }\n\n // verify basic auth credentials\n const base64Credentials = req.headers.authorization.split(' ')[1];\n const credentials = Buffer.from(base64Credentials, 'base64').toString('ascii');\n const [username, password] = credentials.split(':');\n\n if (\n username !== global.env.SHIPSTATION_AUTH_USERNAME\n || password !== global.env.SHIPSTATION_AUTH_PASSWORD\n ) {\n return res.error('Invalid Authentication Credentials', 401);\n }\n\n next();\n }", "authMentor(req, res, next){\n if(req.userToken.role === ROLES.mentor || req.userToken.role === ROLES.admin) next();\n else res.status(403).send();\n }", "checkAuthenticated(req, res, next) {\n // NOTE: I've added below to show how to Authenticate\n\n\n // if (!req.header('authorization')) {\n // res.status(constants.ResCodes.UNAUTHORIZED)\n // .json({\n // status: constants.ResCodes.UNAUTHORIZED,\n // message: 'Unauthorized. Missing Auth Header',\n // data: null\n // });\n\n // return;\n // }\n\n // const token = req.header('authorization'),\n // payload = jwt.decode(token, bcryptCreds.password);\n\n // let unauthorized = false;\n // if (!payload) {\n // unauthorized = true;\n // }\n\n // if (unauthorized) {\n // res.status(constants.ResCodes.UNAUTHORIZED)\n // .json({\n // status: constants.ResCodes.UNAUTHORIZED,\n // message: 'Unauthorized. Auth Header Invalid',\n // data: null\n // });\n\n // return;\n // }\n\n // req.userId = payload.orgUserId;\n\n next();\n }", "function middlewareAuthenticator(request, response, callback) {\n var token = request.header.authorization;\n\n if (!token) {\n callback(new Error('No Authentication Token'));\n } else {\n var user = jwt.decode(token, 'secret phrase');\n\n if (user) {\n callback();\n } else {\n response.status(401).send('Authentication failed');\n }\n }\n}", "function authenticate(req, res, next) {\n // check header or url parameters or post parameters for token\n let token = req.headers['x-access-token'] || req.headers.authorization;\n if (token.startsWith('Bearer ')) {\n // Remove Bearer from string\n token = token.slice(7, token.length);\n }\n\n if (!token) {\n return next(new errs.ForbiddenError());\n }\n\n // verifies secret and checks exp\n return new Promise((pResolve, pReject) => {\n jwt.verify(token, 'secret', (err, decoded) => {\n if (err) {\n return pReject(err);\n }\n return pResolve(decoded);\n });\n })\n .then((decoded) => {\n // if everything is good, save to request for use in routes\n req.decoded = decoded;\n return next();\n })\n .catch(err => next(new errs.ForbiddenError(err)));\n}", "function isAuthenticated() {\n return compose()\n // Validate jwt\n .use(function (req, res, next) {\n console.log('Validating JWT');\n // allow access_token to be passed through query parameter as well\n if (req.query && req.query.hasOwnProperty('access_token')) {\n req.headers.authorization = 'Bearer ' + req.query.access_token;\n }\n validateJwt(req, res, next);\n })\n // Attach user to request\n .use(function (req, res, next) {\n console.log('finding user');\n console.log('users in mem', users);\n console.log('user in req', req.user);\n let user = users.find(user => user.email === req.user.email);\n console.log('user from find', user);\n if (!user) {\n return res.status(401).end();\n }\n req.user = user;\n next();\n });\n\n}", "function authenticationMiddleware () {\n return function (req, res, next){\n console.log('user:', req.session.passport.user);\n\n if (req.isAuthenticated()) {\n return next();\n }else{\n res.redirect('signin');\n }\n }\n}", "function isAuthenticated() {\n return compose()\n // Validate jwt\n .use(function(req, res, next) {\n // allow jwt to be placed on query string too\n if (req.query && req.query.hasOwnProperty('access_token')) {\n req.headers.authorization = 'Bearer ' + req.query.access_token;\n }\n validateJwt(req, res, next);\n })\n // attach user to the request\n .use(function(req, res, next) {\n User.findById(req.user._id, function(err, user) {\n if (err) {\n return next(err);\n }\n\n if (!user || _.isEmpty(user)) {\n return res.send(401);\n }\n\n req.user = user;\n next();\n });\n });\n}", "function isAuthenticated() {\n return compose()\n // Validate jwt\n .use(function(req, res, next) {\n req.headers.authorization = req.get(\"authorization\");\n validateJwt(req, res, next);\n })\n // Attach user to request\n .use(function(req, res, next) {\n User.findByIdAsync(req.user._id)\n .then(function(user) {\n if (!user) {\n return res.status(401).end();\n } return req.user = user; })\n .catch(function(err) {\n return next(err);\n });\n next()\n });\n}", "function isAuthenticated() {\n return compose()\n // Validate jwt\n .use(function(req, res, next) {\n // allow access_token to be passed through query parameter as well\n if (req.query && req.query.hasOwnProperty('access_token')) {\n req.headers.authorization = 'Bearer ' + req.query.access_token;\n }\n validateJwt(req, res, next);\n })\n // Attach user to request\n .use(function(req, res, next) {\n User.find({\n where: {\n _id: req.user._id\n },\n\t\tinclude: [{\n\t\t\tmodel: Role}]\n })\n .then(function(user) {\n if (!user) {\n return res.send(401);\n }\n req.user = user;\n next();\n })\n .catch(function(err) {\n return next(err);\n });\n });\n}", "function authMiddleware(req, res, next){\n if(req.cookies.token === AUTH_TOKEN){\n next();\n } else{\n res.status(401).redirect(\"/admin/login\").end();\n }\n}", "function authorizedOnly(req , res , next){\n\t// is a delete request?\n\tif (req.method == \"DELETE\"){\n\t\treq.body.token = req.params.token;\n\t}\n\tif (!req.body.token || (tokens.indexOf(req.body.token) == -1))\n\t\t\treturn res.status(401).send({request:\"authenticate\" , status:-1, err:new Error(\"Unauthorized\")});\n\telse\n\t\tnext();\n\t/* If you need session auth\n\tif (req.session.isAutenticated)\n\t\tnext();\n\telse\n\t\tres.status(401).send({request:\"authenticate\" , status:-1, err:new Error(\"Unauthorized\")});\n\t*/\n}", "function restricted(req, res, next) {\n if (req.url.match('/api/restricted')) {\n verifySession(req, res, next)\n } else {\n next()\n }\n}", "function middleware(request, response, next) {}", "function validateAuthentication(req, res, next) {\n\tnext(); //continue processing the request\n}", "async function requireAdmin(req, res, next) {\n const authHeader = req.headers.authorization;\n if (authHeader) {\n const token = authHeader && authHeader.split(' ')[1];\n // verify the access token\n jwt.verify(token, process.env.ACCESS_TOKEN_SECRET, (err, tokenUser) => {\n if (err) {\n // verify return an error\n res.status(401).send({ error: '401 Token is unauthorized' })\n } else {\n const user = tokenUser.user\n if (user.permission === 'Admin') {\n next()\n } else {\n res.status(403).send({ error: '403 Forbidden' })\n\n }\n }\n })\n } else {\n // if no auth header exist\n res.status(401).send({ error: '401 token does not exist' })\n }\n}", "function isAuthorized(req, res, next) {\n if (typeof req.headers.authorization !== \"undefined\") {\n // retrieve the authorization header and parse out the\n // JWT using the split function\n let token = req.headers.authorization.split(\" \")[1];\n \n let privateKey = fs.readFileSync('./private.pem', 'utf8');\n // Here we validate that the JSON Web Token is valid and has been \n // created using the same private pass phrase\n jwt.verify(token, privateKey, { algorithm: \"HS256\" }, (err, user) => {\n \n // if there has been an error...\n if (err) { \n // shut them out!\n res.status(500).json({ error: \"Not Authorized\" });\n }\n // if the JWT is valid, allow them to hit\n // the intended endpoint\n return next();\n });\n } else {\n // No authorization header exists on the incoming\n // request, return not authorized\n res.status(500).json({ error: \"Not Authorized\" });\n }\n}", "function adminAuth (req, res, next){\r\n try {\r\n // if the token is not sent in the header, throws an error\r\n if (!(req.headers.authorization)) { throw new Error ('Missing token. Need permissions') }\r\n // extracts the token from the header\r\n const token = req.headers.authorization.split(' ')[1];\r\n // verifies the token with the sign chose \r\n const decodeToken = jwt.verify(token, jwtKey);\r\n // checks if the user is admin\r\n // when it is, allows the request to keep going\r\n if(decodeToken && decodeToken.admin === 1) { return next(); }\r\n else{ throw new Error ('Access denied') }\r\n } catch(err){\r\n res.status(403).json({ error: err.message });\r\n }\r\n}", "function verifyToken(req,res,next){\n //get auth header value\n var bearerHeader = req.headers['authorization'];\n //check if bearer is undefined\n /* if(typeof(bearerHeader) !== \"undefined\"){\n //Split at the space\n var bearer = bearerHeader.split(' ');\n var bearerToken = bearer[1];\n //Set the token\n req.token = bearerToken;\n //Next Middleware\n next();\n }*/\n if(bearerHeader!=\"\"){\n req.token = bearerHeader;\n next();\n }\n else{\n //Forbidden\n res.sendStatus(403);\n }\n}", "function restrictMiddleware(req, res, next) {\n // if path contains '/api/restricted', no matter what follows, runs check for valid session and cookie info\n if (req.path.includes(\"/api/restricted\")) {\n // verifies if user is logged in. if yes, points to next middleware (the endpoint, in this case)\n if (req.session && req.session.userId) {\n next();\n } else {\n // not logged in, kill request\n res.status(401).json({ message: \"You shall not pass!\" });\n }\n } else {\n // path doesn't contain '/api/restricted', so runs the next middleware(endpoint) as it's written\n next();\n }\n}", "verify(){ \n let header = this.header.toLowerCase();\n let secret = this.secret;\n let postVerify = this.postVerify;\n\n return function(req, res, next){\n let token = req.headers[header];\n if(token){\n jwt.verify(token, secret, function(err,decoded){\n if(err){\n res.status(401).json({message:\"not authorised\", error:err.message});\n }\n else\n {\n postVerify(req, decoded, next);\n }\n });\n }\n else\n {\n res.status(403).json({message:\"not authenticated\"});\n }\n }\n }", "function auth(req, res, next){\n const token = req.header('x-auth-token');\n if(!token) return res.status(401).send('Access denied. No token provided!');\n try{\n const decodedPayload = jwt.verify(token,config.get('jwtPrivateKey'));\n //getting user object with the help of token, secure approach\n //no one else can generate the token and paste it in header, because they don't have the private jwt key,\n //it's in environment variable\n \n req.user = decodedPayload;\n next(); //route handler, next middleware function\n }\n catch(ex){\n res.status(400).send('invalid token!!'); //terminating req res cycle\n }\n}", "function addRoutes(app) {\n\n app.all('*', (req, res, next) => {\n console.log(req.method + ' ' + req.url);\n next();\n });\n\n //register users\n /*\n param 1: api endpong\n param 2: middleware that uses a controller function \n */\n app.post('/api/register', authController.register);\n\n //login users\n /*\n param 1: api endpoint\n param 2: middleware that uses a controller function \n */\n app.post('/api/login', authController.login);\n\n app.post('/api/account-activate', authController.accountActivate);\n app.post('/api/resend-activation-link', authController.resendActivationLink);\n app.post('/api/reset-password-link', authController.resetPasswordLink);\n app.post('/api/reset-password', authController.resetPassword);\n\n //authorize your user - check that the user sending requests to server is authorized to view this route\n\n /*\n summary of this route:\n 1. call route\n 2. run first middleware, checkAuth \n - checkAuth uses the jwtAuth strategy defined in lib/passport.js\n - remember that this jwt auth strategy compares the JWT token saved to the client, \n either stored in a cookie or sent via an Authorization Header, \n with the JWT token that was created when the user logged in.\n - checkAuth, if successful, returns the user object from the DB\n 3. run second middleware, authController.testAuth\n - returns a {isLoggedIn: true/false} based on whether or not previous middleware\n successfully returned a user object\n */\n app.get('/api/test-auth', checkAuth, authController.testAuth);\n //if you ahve other protected routes, you can use the same middleware,\n //e.g: app.get('/api/protected-route', checkAuth, authController.testAuth);\n //e.g: app.get('/api/another-protected-route', checkAuth, authController.testAuth);\n\n}", "function authorized(request, response, next) {\n passport.authenticate('jwt', { session: false, }, async (error, token) => {\n if (error || !token) {\n response.status(401).json({ message: 'Unauthorized' });\n }\n next();\n })(request, response, next);\n}", "function authorizeReq(req, res, next) {\n // First we grab the token from the header\n const bearerTokenHead = req.headers['authorization']\n // We then check that the token exist, or return 403 \n if (typeof bearerTokenHead == `undefined`) res.sendStatus(403) // there is no token\n // Then we split the \"bearer\" and the JWT part\n const bearerToken = bearerTokenHead.split(` `)\n // We grab only the secon part, that is the JWT that we need\n const token = bearerToken[1]\n //we select the correct key from the JWKs\n const publicPem = pemfromkid(token)\n // Now we have the token and correct JWK\n jwt.verify(token, publicPem, signOptions, (err, payload) => {\n //we now check that there is nothing wrong with the token\n if (err) res.sendStatus(401) // token is not valid\n if ( typeof payload == `undefined`) res.sendStatus(401)\n // You can do additional checks here. See the EITF RFC 7517 and RFC 7519\n if (payload.iss != `https://api.veracity.com`) res.sendStatus(401) // token not issued by me\n // We now know that the request is valid. Lets return with the payload\n res.payload = payload\n next()\n })\n}", "function isAuthenticated(check) {\n return compose()\n // Validate jwt\n .use(function (req, res, next) {\n Scenario.current(function (current) {\n if (!current) {return res.send(404);}\n req.auth = current.auth;\n if (current.auth) {\n if (req.query && req.query.hasOwnProperty('access_token')) {\n req.headers.authorization = 'Bearer ' + req.query.access_token;\n }\n validateJwt(req, res, next);\n } else {\n next();\n }\n });\n })\n // Attach user to request\n .use(function (req, res, next) {\n if (req.auth) {\n Users.find(req.user._id, function (err, user) {\n if (err) {return next(err);}\n if (!user) {return res.send(404);}\n req.user = user;\n next();\n });\n } else {\n next();\n }\n })\n // Security check\n .use(function (req, res, next) {\n if (req.auth && _.isFunction(check)) {\n check(req, function (err, result) {\n if (err) {return next(err);}\n if (!result) {return res.send(403);}\n next();\n });\n } else {\n next();\n }\n });\n}", "function authUser(req, res, next) {\n try {\n const token = req.headers.authorization.split(' ')[1];\n //Si el token es valido, la variable user tiene el objeto guardado en el /auth\n const user = jsonwebtoken.verify(token, process.env.SECRET);\n if (user) {\n req.user = user;// El objeto de user se guarda en el request que comparte la funcion\n return next();\n }\n } catch(err){\n res.status(400).send({message:'Error validating user.', error: err}); \n }\n}", "function verifyToken(req, res, next) {\n // Get authorization header value OR We can say getting token from authorization header\n const bearerHeader = req.headers['authorization'];\n // Check if bearer is undefined\n if(typeof bearerHeader !== 'undefined'){\n // Split at the space\n const bearer = bearerHeader.split(' ');\n // Get token from array\n const bearerToken = bearer[1];\n // Set the token\n authorization = bearerToken;\n // next middleware\n next();\n } else {\n // Forbidden \n res.sendStatus(403);\n }\n}", "function authorization(req, res, next){\n var credentials = auth(req);\n if (!credentials) {\n var err = new Error('Email or password not provided.');\n err.status = 401;\n return next(err);\n } else {\n User.authenticate(credentials.name, credentials.pass, function (err, user){\n if (err || !user) {\n var err = new Error('Incorrect email or password.');\n err.status = 401;\n return next(err);\n } else {\n req.data = user;\n return next();\n }\n });\n }\n}", "function auth(req, res, next) {\n\tconst token = req.headers.authorization;\n\tif (token) {\n\t\tjwt.verify(token, jwtKey, (error, decoded) => {\n\t\t\tif (error) {\n\t\t\t\treturn res.status(401).json(error);\n\t\t\t} else {\n\t\t\t\treq.decoded = decoded;\n\t\t\t\tnext();\n\t\t\t}\n\t\t});\n\t} else {\n\t\treturn res.status(401).json({\n\t\t\terror: 'User not logged in'\n\t\t});\n\t}\n}", "verifyToken(req, res, next) {\n const token = req.get('Authorization');\n jsonwebtoken_1.default.verify(token, config_1.config.SEED, (err, decode) => {\n if (err) {\n return res.status(401).json({\n err: {\n message: 'Autorization (token) invalid'\n }\n });\n }\n req.user = decode.user;\n next();\n });\n }", "function verifyToken(req, res, next) {\n\t// Get auth header\n\tconst bearerHeader = req.headers['authorization'];\n\t// Check if bearer is undefined\n\tif (typeof bearerHeader !== 'undefined') {\n\t\tconsole.log('bearerHeader:', bearerHeader);\n\t\tconst bearer = bearerHeader.split(' ');\n\t\t// Get token from array\n\t\tconst bearerToken = bearer[1];\n\t\t// Set the token\n\t\treq.token = bearerToken;\n\t\t// Next Middleware\n\t\tnext();\n\t} else {\n\t\tconsole.log('Forbidden');\n\t\t// Forbidden\n\t\tres.sendStatus(403);\n\t}\n}", "authenticate() {\n logger.debug('Creating authentication endpoint middleware')\n return async (ctx, next) => {\n logger.debug('Running authenticate endpoint middleware')\n const { request, response } = build(ctx)\n\n await this.server\n .authenticate(request, response)\n .then(async token => {\n ctx.state.oauth.token = token\n ctx.state.oauth.authenticated = true\n if (next) await next()\n })\n .catch(err => {\n ctx.state.authenticated = false\n handleError(err, ctx)\n })\n }\n }", "function authenticationMiddleware() {\n return (req, res, next) => {\n if (req.isAuthenticated()) return next();\n res.redirect('/login');\n }\n}", "function ensureAuthenticated (req, res, next) {\r\n if (req.isAuthenticated()) {\r\n console.log('access granted')\r\n return next()\r\n }\r\n console.log('denied')\r\n res.redirect('/auth/facebook')\r\n}", "function requireAuth(request, response, next) {\n passport.authenticate('jwt', { session: false }, async (error, token) => {\n if (error || !token) {\n console.log(\"error+\" + error)\n console.log(\"token in if\" + token)\n\n //response.status(401).json({ message: 'Unauthorized' });\n response.writeHead(200, {\n 'Content-Type': 'text/plain'\n })\n response.end(\"Invalid Token\")\n // //response.sendStatus(401).end();\n }\n else {\n console.log(\"token\" + JSON.stringify(token))\n const user = await Users.findById({\n _id: token.user._id\n });\n request.user = user;\n }\n // catch (error) {\n // next(error);\n // }\n next();\n })(request, response, next);\n}", "function protectEndpoints(req, res, next) {\n\n let token = req.headers['authorization'];\n\n if (token) {\n try {\n logindata = jwt.verify(token, secret);\n next();\n } catch (err) {\n res.status(403).json({ msg: \"Not a valid token\" });\n }\n }\n else {\n res.status(403).json({ msg: \"no token\" });\n }\n}", "verifyToken(req, res, next) {\n const token = req.headers.authorization;\n if (!token) {\n return res.status(404).send('Unauthorization');\n }\n if (token === 'test_model') { //for testing\n return next();\n }\n jwt.verify(token, process.env.SECRET_KEY, function(err, decoded) {\n if (err) {\n return res.status(404).send(err);\n }\n req.user = decoded;\n return next();\n });\n }", "function verifyAuthentication(){\n return (req, res, next) => {\n if (req.isAuthenticated()){\n return next();\n }else{\n res.redirect('/login');\n }\n }\n}", "function verifyToken(req, res, next) {\n // Get auth header value\n const bearerHeader = req.headers['authorization'];\n // Check if bearer is undefined\n if(typeof bearerHeader !== 'undefined') {\n // Split at the space\n const bearer = bearerHeader.split(' ');\n // Get token from array\n const bearerToken = bearer[1];\n // Set the token\n req.token = bearerToken;\n // Next middleware\n next();\n } else {\n // Forbidden\n res.sendStatus(403);\n }\n \n }", "function checkAuth(req, res, next) {\n if (req.user) return next();\n return res.status(401).json({ msg: 'Not Authorized' });\n}", "function checkAuth(req, res, next) {\n if (req.user) return next();\n return res.status(401).json({ msg: 'Not Authorized' });\n}", "function authRequired(request, response, next) {\n var token = request.query.token || request.body.token;\n User.findOne({authenticationTokens: token}, function(err, user){\n request.user = user;\n if (err) {\n request.send(err.message);\n return;\n }\n\n if(user) {\n next();\n } else {\n response.json({message: 'please login'});\n }\n });\n}", "function authenticateTokenMiddleware(req, res, next){\n const token = req.cookies[\"accessToken\"];\n if(!token) return res.status(400).send({ error: \"no access token\" });\n jwt.verify(token, process.env.ACCESS_TOKEN_SECRET, (err, user) => {\n if(err) return res.status(400).send({ error: \"invalid access token\" });\n req.user = user.username;\n next();\n });\n}", "function restrict() {\n return (req, res, next) => {\n // OR const token = req.cookies.token // express session does so automatically\n // set res.cookie in the generateToken function with 'cookie-parser' NPm\n // import cookie parser into server.js file, server.use(cocokieParser)\n //when a cookie gets sent out from client (insomnia, browser, etc)\n // then we can use req.cookies, instead of authorization we can do\n //req.tookies.token, get token value from cookie instead sent by client\n //This is another option to save tokens and not use authorization request\n //Example Login -: const token = generateToken(user) --- res.cookie - token\n //remove token from res.json message after login, cookie will automatically\n //handle all requests without authorizat\n const token = req.headers.authorization; // || req.cookies.token\n // see if there is a token\n //check if it is valid\n //reash the header + payload + secrete and see if it matches signature\n if (token) {\n jwt.verify(token, process.env.JWT_SECRET, (err, decodedToken) => {\n if (err) {\n console.log(\"err in verify token middleware----->\", err);\n res.status(401).json({ message: \"correct token required\" });\n } else {\n //token is valid here\n req.decodedToken = decodedToken;\n next();\n }\n });\n } else {\n res.status(401).json({\n message:\n \"token invalid, not logged in, enter correct login credentials\",\n });\n }\n };\n}", "authenticate(req, res, next) {\n // Get the token from either the body, query or token\n const token = req.body.token || req.query.token || req.headers['x-access-token'];\n if (token) {\n jwt.verify(token, 'pebbles', (err, decoded) => {\n if (err) {\n res.status(401).send({ message: 'Failed to authenticate token. Please login in to verify account' });\n } else {\n // Store token information in a request object for use in other requests\n req.decoded = decoded;\n next();\n }\n });\n } else {\n res.status(403).send({ message: 'You must be logged in to view the page you requested' });\n }\n }", "getBrowserMiddleware() {\n const self = this;\n\n return function (req, res, next) {\n if(self._config.isDisabled()){\n next();\n return;\n }\n\n let sessionId;\n if (self._userAuth.hasSession(req.cookies[\"session\"])) {\n sessionId = req.cookies[\"session\"];\n } else {\n // first time we have seen this user.\n sessionId = self._userAuth.getNewSessionId();\n res.cookie(\"session\", sessionId);\n }\n\n if (req.path === \"/azuread\") {\n fetch(self._config.authorityUrl(), { method: 'POST', body: self._config.accessTokenParam(req.body.code) })\n .then(res => res.json())\n .then(json => {\n if(json.access_token) {\n let body = json.access_token.split(\".\")[1];\n let buff = new Buffer(body, 'base64');\n let userJson = buff.toString('ascii');\n let user = JSON.parse(userJson);\n\n self._userAuth.setUser(sessionId,user);\n res.redirect(\"/\");\n }else {\n res.status(401).send(json).end();\n }\n });\n return;\n }\n\n if (self._userAuth.getUser(sessionId) !== null) {\n // we have user.\n next();\n return;\n }\n\n res.redirect(self._config.createAuthorizationUrl(sessionId));\n }\n }", "async function auth(req, res, next) {\n let token = req.headers[\"authorization\"];\n if(token){\n token = token.split(\" \")[1]; //Access token\n jwt.verify(token, accessTokenKey, async (err, user) => {\n if (user) {\n req.user = user;\n next();\n } else if (err.message === \"jwt expired\") {\n return res.json(handleErr('Access token expired'));\n } else {\n return res\n .status(403)\n .json(handleErr('User not authenticated'));\n }\n });\n }\n else {\n return res\n .status(403)\n .json(handleErr('Unauthorized'));\n }\n}", "function verifyToken(req, res, next) {\n // get auth header value\n const bearerHeader = req.headers['authorization'];\n // check if bearer is undefined\n if(typeof bearerHeader !== 'undefined'){\n //Split at the space\n const bearer = bearerHeader.split(' ');\n //get token from array\n const bearerToken = bearer[1];\n // set token\n req.token = bearerToken;\n // next middleware\n next();\n }\n else{\n // forbidded\n return res.sendStatus(403);\n }\n }", "async acl({ request, response }) {\n const validation = await validate(request.all(), {\n access: 'required',\n username: 'required',\n clientid: 'required',\n ipaddr: 'required',\n topic: 'required',\n })\n\n if (validation.fails()) {\n return response.status(400).send()\n }\n\n const secret = Env.get('APP_KEY')\n if (request.input('clientid') === secret) {\n return true\n }\n\n const user = await User.query()\n .where('token', request.input('clientid'))\n .first()\n\n if (\n parseInt(request.input('access')) === 1 &&\n request.input('topic') === `callback/${user.token}`\n ) {\n return response.status(200).send()\n }\n\n if (\n parseInt(request.input('access')) === 2 &&\n request.input('topic') == `api/${user.token}`\n ) {\n return response.status(200).send()\n }\n\n return response.status(400).send()\n }", "function verifyToken(req, res, next) {\r\n // Get auth header value\r\n const bearerHeader = req.headers['authorization'];\r\n // Check if bearer is undefined\r\n if (typeof bearerHeader !== 'undefined') {\r\n // Split at the space\r\n const bearer = bearerHeader.split(' ');\r\n // Get token from array\r\n const bearerToken = bearer[1];\r\n // Set the token\r\n req.token = bearerToken;\r\n // Next middleware\r\n next();\r\n } else {\r\n // Forbidden\r\n res.sendStatus(403);\r\n }\r\n\r\n }", "function isAuthenticated() {\n return (\n compose()\n // Validate jwt\n .use((req, res, next) => {\n const { authorization } = req.headers;\n if (config.encriptedToken) {\n const bytes = CryptoJS.AES.decrypt(\n authorization.toString(),\n config.encriptedTokenKey,\n );\n req.headers.authorization = bytes.toString(CryptoJS.enc.Utf8);\n }\n req.authorization = authorization;\n req.headers.authorization = `Bearer ${req.headers.authorization}`;\n validateJwt(req, res, next);\n })\n // Attach user to request\n .use((req, res, next) => {// eslint-disable-line\n if (!req.user || !req.user._id) {// eslint-disable-line\n res.statusMessage = 'User Data is Null';\n return res.status(401).end();\n }\n \n const findUserQuery = {\n _id: req.user._id, // eslint-disable-line\n active: true,\n };\n\n User.findOneAndUpdate(findUserQuery, {\n $set: { 'activityLogs.lastVisit': new Date() },\n })\n .exec()\n .then(user => {\n if (!user) {\n return res.status(401).end();\n }\n const userData = JSON.parse(JSON.stringify(user));\n delete req.authorization;\n req.user = userData;\n return next();\n })\n .catch(err => next(err));\n })\n );\n}", "function auth(req, res, next) {\n let token = req.headers['authorization']\n if (token) {\n token = token.replace('Bearer ', '')\n\n // verifies secret and checks exp\n jwt.verify(token, config.JWT_SECRET, function(err, decoded) {\n if (err) {\n if (err.name === 'TokenExpiredError') {\n return respondWithError(res, 'TokenExpiredError')\n } else {\n return respondWithError(res, 'JsonWebTokenError')\n }\n }\n\n req.user = {\n _id: decoded._id,\n username: decoded.username,\n role: decoded.role\n }\n\n next()\n })\n } else {\n return respondWithError(res, 'missingAuthToken')\n }\n}", "function isAuthenticate(req, resp, next){\n console.log(\"autenticando\")\n next()\n}", "function checkAuthorizationToken(req, res, next) {\n\tconst authHeader = req.headers.authorization\n\tconst authToken = authHeader && authHeader.split(\" \")[1]\n\n\tif (authToken == null) {\n\t\treturn res.status(401).send({\n\t\t\tsuccess: false,\n\t\t\tmessage: \"Unauthorized To Access. Please Login Again\"\n\t\t})\n\t}\n\n\tjwt.verify(authToken, process.env.AUTHORIZATION_TOKEN_SECRET, (err, user) => {\n\n\t\tif (err) {\n\t\t\treturn res.status(403).send({\n\t\t\t\tsuccess: false,\n\t\t\t\tmessage: \"Forbidden Access, Please Login Again.\"\n\t\t\t})\n\t\t}\n\n\t\treq.user = user\n\t\tnext()\n\t})\n\n}" ]
[ "0.66901636", "0.64889306", "0.6415423", "0.6407284", "0.63963217", "0.6231911", "0.62131715", "0.61843795", "0.61745197", "0.6152839", "0.6151388", "0.61328274", "0.6114872", "0.61108834", "0.61013573", "0.6083041", "0.60803026", "0.60414076", "0.60403216", "0.60398936", "0.60301596", "0.60231686", "0.60213506", "0.601493", "0.5996388", "0.59963113", "0.5992671", "0.5989554", "0.59880316", "0.59508735", "0.59401375", "0.59332585", "0.59246695", "0.5923531", "0.5918431", "0.59114337", "0.5904057", "0.5900829", "0.58997726", "0.5893157", "0.5887156", "0.58838296", "0.58831954", "0.58816105", "0.58800954", "0.5872971", "0.58706534", "0.5863886", "0.58594656", "0.58588034", "0.5849688", "0.5843863", "0.58411527", "0.58401334", "0.58342546", "0.5833241", "0.58210856", "0.5809514", "0.5791215", "0.57902086", "0.5789869", "0.5788472", "0.578197", "0.5780836", "0.5775364", "0.5771126", "0.5767617", "0.5749908", "0.5745793", "0.57424664", "0.57423323", "0.57408315", "0.5735551", "0.5734756", "0.57085615", "0.5678751", "0.56754714", "0.566728", "0.5665075", "0.5661823", "0.5656373", "0.56538093", "0.56523556", "0.5650745", "0.5647804", "0.5645789", "0.5645124", "0.5645124", "0.56394917", "0.56387687", "0.5638611", "0.56342405", "0.5630188", "0.5626782", "0.56149185", "0.5610863", "0.561041", "0.5604092", "0.55981004", "0.5597844", "0.55961376" ]
0.0
-1
Render the 2D grid of pixels, given a div as input (appends an svg inside the div) Returns a function which allows you to update it
function renderGrid(s, transition) { var sampleSVG = s.style("display", "block") .style("margin-left","auto") .style("margin-right","auto") .style("width", "920px") .append("svg") .attr("width", 920) .attr("height", 150) /* Render discretization of 2D Laplacian*/ sampleSVG.selectAll("rect") .data(V) .enter().append("rect") .style("fill", function(d,i) { return "white" }) .attr("height", 7.7) .attr("width", 7.7) .attr("x", function(d, i){return d[0]*8+ 10}) .attr("y", function(d, i){return d[1]*8 + 10}) /* display a function on the laplacian using colormap map*/ var display = function (x, map) { if (transition === undefined){ sampleSVG.selectAll("rect").style("fill", function(d,i) { return map(x[i]) }) } else { sampleSVG.transition() .duration(transition) .selectAll("rect") .style("fill", function(d,i) { return map(x[i]) }) } } return display }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawGrid(number){\n\tfor (var i = 0; i < number*number; i++) {\n\t\t$(\"#container\").append('<div class=\"pixel\"></div>');\n\t}\n\n\t$(\".pixel\").height($(\"#container\").height()/number);\n\t$(\".pixel\").width($(\"#container\").width()/number);\n\t$(\".pixel\").css({\"float\": \"left\", \"background-color\": \"#FFFFFF\"});\n}", "function plot(rows = 36, cols = 64) {\n\n /* 'c' will contain the whole generated html rect tags string to change innerhtml of enclosing div */\n /* 'y' will denote the 'y' coordinate where the next grid must be placed */\n let c = \"\", y = 0;\n\n /* Looping for each row */\n for (let i = 0; i < rows; i++) {\n\n /* 'x' is a coordinate denoting where the next grid must be placed */\n var x = 0;\n\n /* For each row we will loop for each column present in the Grid */\n for (let j = 0; j < cols; j++) {\n\n /* 'colr' will store the rest grid color which is dark gray currently */\n let colr = grid_color;\n\n /* If the Rectange present in the grid is on the border side then change the color in order to highlight borders */\n if(i === 0 || j === 0 || i === rows - 1 || j === cols - 1){\n colr = border_color;\n }\n\n /* Creating a rect tag that is appending in 'c' for now and will be updated to innerhtml of enclosing div */\n /* I know you will be wondering about the id given to each rect :-\n * Each rect must be provided with id in order to do anything with the corresponding rect.\n * Operations like coloring the grid as well saving saving any number in corresponding matrix needs an id of the rect.\n * Hence id is important to allot to each rect to make further changes in matrix on which whole algo is based.\n * In order to assing every rect id i decided to allot their corresponding row_number + : + col_number to be as id\n * As with this scenario it is easy to remember and will be unique for every rect tag. \n */\n c += `<rect id=${i + \":\" + j} x=\"${x}\" y=\"${y}\" width=\"30\" height=\"30\" fill=\"${colr}\" r=\"0\" rx=\"0\" ry=\"0\" stroke=\"#000\" style=\"-webkit-tap-highlight-color: rgba(0, 0, 0, 0); stroke-opacity: 0.2;\" stroke-opacity=\"0.2\"></rect>`;\n\n /* Incrementing the 'x' coordinate as we have width of 30px and hence 'x' coordinate for next rect will be +30 from current pos. */\n x += 30;\n }\n\n /* Incrementing the 'y' coordinate as we have placed sufficient rect in 1 row now need to advance 'y' as height of each rect \n is 30px hence for every rect in next column the y coordinate will be +30*/\n y += 30;\n }\n\n /* At last after creating rect tags using loops, now update innerHtml of enclosing div with id='container'[grid.html] */\n document.getElementById(\"container\").innerHTML = c;\n\n /* I wanted to preplace the Source - coordinate so at rect with id='src_crd' will be coloured green */\n document.getElementById(src_crd).style.fill = \"rgb(0, 255, 0)\";\n matrix[split(src_crd, 0)][split(src_crd, 1)] = 1; /* Update the pos as '1' to denote source location */\n\n /* I wanted to preplace the Destination - coordinate so at rect with id='dst_crd' will be coloured Red */\n document.getElementById(dst_crd).style.fill = \"rgb(255, 0, 0)\";\n matrix[split(dst_crd, 0)][split(dst_crd, 1)] = 2; /* Update the pos as '2' to denote Destination location */\n\n }", "function CreateGraphicsGrid() {\n\tvar gridHTML = \"\";\n\tfor(i=0; i<100; i++) { // 10 x10\n\t\tgridHTML += '<div class=\"grid\" id=\"g' + i +'\"></div>';\n\t}\n\tdocument.getElementById(\"graphics-map\").innerHTML=gridHTML;\n\tvar gridHTMLz = \"\";\n\tfor(i=0; i<9; i++) { // 3x3\n\t\tgridHTMLz += '<div class=\"grid-z\" id=\"gz' + i +'\"></div>';\n\t}\n\tdocument.getElementById(\"graphics-map-z\").innerHTML=gridHTMLz;\n}", "function renderGrids(x){\n\t\tfor (var i = 0; i < x; i++){\n\t\t\tvar pixels = document.createElement('div');\n\t\t\tpixels.className = 'miniDiv';\n\t\t\tcontainer.appendChild(pixels);\n\t\t}\n\t}", "function makeGrid(x,y) {\n $('#pixel_canvas').empty();\n for(let i=0; i<y; i++){\n let row = $('<tr>');\n $('#pixel_canvas').append(row);\n for(let j=0; j<x; j++){\n $(row).append('<td class=\"cell\"></td>');\n }\n }\n}", "function draw_grid(grid_size, cell_size) {\r\n\t//instantiate variables\r\n\tvar i;\r\n\tvar j;\r\n\r\n\t$(\"#grid\").empty();\r\n\r\n\t//iterate to create rows\r\n\tfor (i = 0; i < grid_size; i++) {\r\n\t\tfor (j = 0; j < grid_size; j++) {\r\n\t\t\t//draw row of divs, assinging them a class of \"cell\" and a css width and height\r\n\t\t\t$(\"#grid\").append(\"<div class='cell'></div>\").find(\"div:last\").css({\r\n\t\t\t\t\"width\": cell_size,\r\n\t\t\t\t\"height\": cell_size\r\n\t\t\t});\r\n\t\t}\r\n\t\t//end the line\r\n\t\t$(\"#grid\").append(\"<br>\");\r\n\t}\r\n}", "drawPixels() {\n this.cells.forEach((row, y) => {\n row.forEach((cell, x) => {\n this.drawPixel([y, x], cell);\n });\n });\n }", "function createPixels() {\n let pixels = document.getElementById('pixels');\n pixels.className = \"newDiv row\";\n //creates multiple divs within the board, and sets the width, height and floats left\n for (let i = 0; i <= 3093; i++) {\n let innerDivs = document.createElement('div');\n innerDivs.classList.add(\"pixel-squares\");\n // appends divs to the parent board\n pixels.appendChild(innerDivs);\n }\n return pixels;\n}", "function generateGrid(squares) {\n\n container.style.setProperty(\"grid-template-columns\", \"repeat(\" + squares + \", 1fr)\");\n container.style.setProperty(\"grid-template-rows\", \"repeat(\" + squares + \", 1fr)\");\n \n //creates the ammount of divs necessary to fill the entire grid\n for (let i = 1; i <= squares * squares; i++) {\n const div = document.createElement(\"div\");\n div.classList.add(\"pixels\");\n div.style.border = \"1px solid rgba(0,0,0,0.5)\";\n \n container.appendChild(div);\n }\n \n //creates a nodelist as a global variable, of all the squares in the grid\n window.pixels = document.querySelectorAll(\".pixels\");\n\n //currentPen points to the function that determine the behavior of the pen\n pixels.forEach(currentPen);\n}", "function drawMyActualGrid(){\n for(i =0;i<col;i++){\n for(j=0;j<row;j++){\n x = i *resolution;\n y = j * resolution;\n if(grid[i][j]==1){\n fill(255);\n stroke(1);\n rect(x,y,resolution,resolution);\n }\n }\n }\n}", "function makeGrid(height, width) {\n\n for (let i = 0; i < height; i++){\n const rows = document.createElement(\"tr\");\n for (let j = 0; j < width; j++){\n const cells = document.createElement(\"td\");\n rows.appendChild(cells);\n cells.setAttribute(\"id\", \"cell\" + [i]+[j]);\n cells.setAttribute(\"onclick\", \"drawPixels(this.id)\");\n }\n table.appendChild(rows);\n }\n}", "function createDivs(gridDimension, canvasSize) {\n $(\".container\").children().remove();\n $(\".container\").append(\"<table>\");\n for(i=0; i< gridDimension; i++) {\n $(\".container\").append(\"<tr>\");\n for(j=0; j < gridDimension; j++) {\n $(\".container\").append(\"<td></td>\")\n $(\"td\").css(\"height\", canvasSize/gridDimension);\n $(\"td\").css(\"width\", canvasSize/gridDimension);\n }\n $(\".container\").append(\"</tr>\");\n }\n $(\".container\").append(\"</table>\");\n drawOnCanvas(getColor());\n}", "function drawGameBoard (id){\n var placeholder = document.getElementById(id);\n \n for(var i = 0; i < row; i++){\n for(var j = 0; j < col; j++){\n var gridCell = document.createElement(\"div\");\n \n placeholder.appendChild(gridCell);\n gridCell.classList.add(\"gridItem\");\n gridCell.setAttribute(\"id\", `${id}-${i}-${j}`);\n }\n }\n}", "function makeGrid(height, width) {\n for (let row = 0; row < height; row++) {\n $(\"#pixelCanvas\").append($(\"<tr></tr>\"));\n for (let col = 0; col < width; col++) {\n $(\"tr\")\n .last()\n .append($(\"<td></td>\"));\n\n $(\"td\").attr(\"class\", \"pixel\");\n }\n }\n}", "function makeGrid(event) {\n// Your code goes here!\n event.preventDefault();\n let height = heightInput.value;\n let width = widthInput.value;\n console.log(height + \",\" + width);\n while (pixelCanvas.firstChild) {\n pixelCanvas.removeChild(pixelCanvas.firstChild);\n }\n\n for (let i = 0; i < height; i++) {\n let newRow = document.createElement(\"tr\");\n for (let j = 0; j < width; j++) {\n let newTd = document.createElement(\"td\");\n newRow.appendChild(newTd);\n }\n pixelCanvas.append(newRow);\n }\n}", "draw() {\n const { width, height, radius, animate, generation, onCellClick } = this.props;\n const svg = select(this.base);\n \n //create blur filter the first time the board is drawn\n if (!document.getElementById(GOOEY_FILTER_ID)) {\n addSVGFilter(svg, animate);\n }\n\n //set filter stdDev according to radius; disable if not animating\n const stdDev = animate ? radius * 0.75 : 0;\n document.getElementById(\"blurFilter\").setAttribute(\"stdDeviation\", `${stdDev}`);\n \n //create grid markers\n drawGrid(svg, width, height, radius);\n\n //remove dead cells if animation is ongoing\n const data = animate ? generation.filter(cell => cell.life) : generation.slice();\n drawCells(svg, width, height, radius, data, onCellClick);\n }", "function renderGameField(){\n let render = ''; //Store all the content\n \n //Each pixel of the grid will be a div\n for(var y = 1; y <= fieldSizeY; y++){\n for(var x = 1; x <= fieldSizeX; x++){\n render += `<div id='${x}_${y}' class='pixel'></div>`;\n }\n }\n\n //Put the content into the game field\n gameField.innerHTML = render;\n}", "function makeGrid() {\n pixelCanvas.innerHTML = \"\";\n for (let i = 0; i < gridHeight;i++) {\n const tr = document.createElement(\"tr\");\n for(let j = 0; j < gridWidth; j++){\n const td = document.createElement(\"td\");\n tr.appendChild(td);\n }\n fragment.appendChild(tr);\n }", "render() {\n const { grid, mouseIsPressed } = this.state;\n return (\n <div>\n <div className=\"visual-div\" id=\"visual-div\">\n <Button id=\"visualize-btn\" onClick={() => {\n document.getElementById(\"visualize-btn\").classList.toggle(\"changecolor\")\n document.getElementById(\"visual-div\").classList.toggle(\"changecolor\")\n this.animateAlgo()\n }}>Visualize!</Button>\n </div>\n <div className=\"grid\">\n {grid.map((row, rowIDX) => \n // only returning one div object, hence return is omitted\n <div key={rowIDX} className=\"row\">\n {/* iterate through the matrix to display the node element */}\n {row.map((node, nodeIDX) => {\n let {row, col, isFinish, isStart, isWall} = node;\n \n // passing in properties for creating a node object\n return (<Node\n key={nodeIDX}\n col = {col}\n row = {row}\n isStart = {isStart}\n isFinish = {isFinish}\n isWall = {isWall}\n mouseIsPressed = {mouseIsPressed}\n onMouseDown={(row, col) => this.handleMouseDown(row, col)}\n onMouseEnter={(row, col) => this.handleMouseEnter(row, col)}\n onMouseLeave={(row, col) => this.handleMouseLeave(row, col)}\n onMouseUp={() => this.handleMouseUp()}\n />);\n })}\n </div>\n )}\n </div>\n </div>\n );\n }", "function grid(dimensions = 16) {\r\n for(let i = 0; i < dimensions; i++) {\r\n divRows[i] = document.createElement(\"div\");\r\n divRows[i].classList.add(\"rows\");\r\n divRows[i].style.height = `calc(100% / ${dimensions})`;\r\n container.appendChild(divRows[i]);\r\n }\r\n \r\n for(let i = 0; i < dimensions; i++) {\r\n for(let j = 0; j < dimensions; j++) {\r\n divCols[j] = document.createElement(\"div\");\r\n divCols[j].classList.add(\"cols\");\r\n divRows[i].appendChild(divCols[j]);\r\n \r\n divRows[i].children[j].onmouseover = function() {\r\n divRows[i].children[j].style.backgroundColor = setColor();\r\n }\r\n \r\n }\r\n }\r\n}", "function makeGrid (){\nvar in1= $('#input_height').val();\nvar in2= $('#input_width').val();\n$(\"#pixel_canvas\").html(table(in1,in2)); }", "function makeGrid() {\n\n const pixelGrid = document.querySelector('#pixelCanvas');\n\n pixelGrid.innerHTML = ''; //Clears previous grid\n\n inputHeight = document.querySelector('#inputHeight').value;\n inputWidth = document.querySelector('#inputWidth').value;\n\n if (inputHeight > 100) { //Limit grid height\n inputHeight = 100;\n };\n\n if (inputWidth > 100) { //Limit grid width\n inputWidth = 100;\n }\n\n //Get user selected color and set pixel color\n function colorClick() {\n color = document.querySelector('#colorPicker').value;\n event.target.style.backgroundColor = color;\n }\n\n // Build grid based on user form input\n for (var height = 0; height < inputHeight; ++height) { //Loop creates rows\n const newRow = document.createElement('tr');\n pixelGrid.appendChild(newRow);\n for (var width = 0; width < inputWidth; ++width) { //Loop create pixels\n const newPixel = document.createElement('td');\n newRow.appendChild(newPixel);\n newPixel.addEventListener('click', colorClick);//Add click event to pixels\n }\n }\n}", "function createGrid(width, height) {\n for (let i = 0; i < height; i++) {\n let row = document.createElement('div');\n row.classList.add('row');\n\n for (let x = 0; x < width; x++) {\n let pixel = document.createElement('div');\n pixel.classList.add('pixel');\n row.appendChild(pixel);\n }\n grid.appendChild(row);\n }\n}", "function drawGrid(x,y,s){\r\n for(j = 0; j<7 ; j++){\r\n for(var i = 0 ; i<7 ; i++){\r\n drawRectangle(x+i*s/7,y+j*s/7, s/7,s/7,colArray[3], colArray[4],1, false, true);\r\n }\r\n }\r\n}", "function drawBoard(divId)\n{\n //SVG which the board will be drawn on\n var boardSVG = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n\n //div to which to add svg\n var divForBoard = document.getElementById(divId);\n\n //Get height and width of divForBoard to use for drawing svg elements\n var height = divForBoard.getAttributeNS(null, \"height\");\n var width = divForBoard.getAttributeNS(null, \"width\");\n\n //Padding to go around sides of inner boards\n var padding = 15;\n\n //Set boardSVG height and width to divForBoard height and width\n boardSVG.setAttributeNS(null, \"height\", height);\n boardSVG.setAttributeNS(null, \"width\", width);\n\n //Set SVG id for later reference\n boardSVG.setAttributeNS(null, \"id\", \"boardSVG\");\n\n //Add boardSVG to divForBoard\n divForBoard.appendChild(boardSVG);\n\n //Add yellow, hidden rectangles to each cell for highlighting\n var rectAttrs = [];\n rectAttrs[\"height\"] = height/3-2*padding;\n rectAttrs[\"width\"] = width/3-2*padding;\n rectAttrs[\"fill\"] = \"yellow\";\n rectAttrs[\"fill-opacity\"] = 0;\n rectAttrs[\"stroke\"] = \"none\";\n for(var i = 0; i < 3; i++)\n {\n for(var j = 0; j < 3; j++)\n {\n rectAttrs[\"x\"] = i * width/3 + padding;\n rectAttrs[\"y\"] = j * height/3 + padding;\n //Assign id to each cell corresponding to which cell it is for later reference\n rectAttrs[\"id\"] = \"cell\" + i + \"x\" + j;\n addEltToSVG(boardSVG, \"rect\", rectAttrs);\n }\n }\n\n //Draw the lines for the main board\n var lineAttrs = [];\n lineAttrs[\"stroke\"] = \"black\";\n lineAttrs[\"stroke-width\"] = 5;\n //Vertical lines\n for(var i = width/3; i < width; i += width/3)\n {\n lineAttrs[\"x1\"] = i;\n lineAttrs[\"x2\"] = i;\n lineAttrs[\"y1\"] = 0;\n lineAttrs[\"y2\"] = height;\n\n addEltToSVG(boardSVG, \"line\", lineAttrs);\n }\n //Horizontal lines\n for(var i = height/3; i < height; i += height/3)\n {\n lineAttrs[\"x1\"] = 0;\n lineAttrs[\"x2\"] = width;\n lineAttrs[\"y1\"] = i;\n lineAttrs[\"y2\"] = i;\n\n addEltToSVG(boardSVG, \"line\", lineAttrs);\n }\n\n //Draw inner boards\n //Change height and width for rectAttrs for new smaller rectangles\n rectAttrs[\"height\"] = height/9 - 2*padding/3;\n rectAttrs[\"width\"] = width/9 - 2*padding/3;\n //Change stroke width for inner board lines to be smaller than main board\n lineAttrs[\"stroke-width\"] = 2;\n for(var i = 0; i < 3; i++)\n {\n for(var j = 0; j < 3; j++)\n {\n\n //Add the rectangles with padding on the sides\n for(var k = 0; k < 3; k ++)\n {\n for(var l = 0; l < 3; l ++)\n {\n rectAttrs[\"x\"] = i*width/3 + k*(width/9 - 2*padding/3) + padding;\n rectAttrs[\"y\"] = j*height/3 + l*(height/9 - 2*padding/3) + padding;\n //Assign id to each cell corresponding to which cell it is for later reference\n rectAttrs[\"id\"] = \"cell\" + i + \"x\" + j + \"x\" + k + \"x\" + l;\n addEltToSVG(boardSVG, \"rect\", rectAttrs);\n \n }\n }\n \n //Draw the lines for the inner boards\n //Vertical lines\n for(var k = width/9 + padding/3; k < (width/3 - padding*3); k += (width/9 - 2*padding/3))\n {\n lineAttrs[\"x1\"] = i*width/3 + k;\n lineAttrs[\"x2\"] = i*width/3 + k;\n lineAttrs[\"y1\"] = j*height/3 + padding;\n lineAttrs[\"y2\"] = (j + 1)*height/3 - padding;\n\n addEltToSVG(boardSVG, \"line\", lineAttrs);\n }\n //Horizontal lines\n for(var k = height/9 + padding/3; k < (height/3 - padding*3); k += (height/9 - 2*padding/3))\n {\n lineAttrs[\"x1\"] = i*width/3 + padding;\n lineAttrs[\"x2\"] = (i+1)*width/3 - padding;\n lineAttrs[\"y1\"] = j*height/3 + k;\n lineAttrs[\"y2\"] = j*height/3 + k;\n\n addEltToSVG(boardSVG, \"line\", lineAttrs);\n }\n }\n }\n}", "renderGrid(){\n // Remove all child elements of previous grid\n while (this.GRID_DIV.firstChild) {\n var child = this.GRID_DIV.firstChild;\n this.GRID_DIV.removeChild(child);\n child.remove();\n }\n\n // https://developer.mozilla.org/en-US/docs/Glossary/Grid_Cell\n this.GRID_DIV.style.gridTemplateColumns = \"repeat(\" + this.COLUMN_COUNT + \", 1fr)\";\n for(var i=0; i < this.ROW_COUNT * this.COLUMN_COUNT; i++){\n if(document.getElementById(i.toString()) == undefined){\n var cell = document.createElement(\"div\");\n cell.id = i.toString();\n cell.className = \"bitmap_grid_cell\";\n\n cell.style.backgroundColor = \"white\";\n\n cell.onclick = this.cellLeftClickCallback.bind(this, cell);\n cell.oncontextmenu = this.cellRightClickCallback.bind(this, cell);\n cell.onmousemove = this.cellHoverCallback.bind(this, cell);\n\n this.GRID_DIV.appendChild(cell);\n }\n }\n }", "function makeGrid(height,width) {\n for (let r = 0; r < height; r++) {\n $('#pixel_canvas').prepend('<tr></tr>');\n for (let d = 0; d < width; d++) {\n $('tr').first().append('<td></td>')\n }\n }\n}", "function makeGrid(e) {\n\n canvas.innerHTML = '';\n\n // console.log(canvas);\n\n for (var i = 0; i < gridHeight.value; i++) {\n let row = canvas.appendChild(document.createElement('tr'));\n row.classList.add('row');\n canvas.append(row);\n\n for (var j = 0; j < gridWidth.value; j++) {\n let pixels = row.appendChild(document.createElement('td'));\n pixels.classList.add('pixel');\n pixels.innerHTML;\n };\n };\n let brush = false;\n let $td = document.getElementsByTagName('td');\n\n for (var i = 0; i < $td.length; i++) {\n $td[i].addEventListener('mousedown', (e) => {\n brush = true;\n if (brush) {\n e.target.style.backgroundColor = colorValue.value;\n };\n for (var i = 0; i < $td.length; i++) {\n $td[i].addEventListener('mousemove', (e) => {\n if (brush) {\n e.target.style.backgroundColor = colorValue.value;\n };\n });\n };\n });\n };\n for (var i = 0; i < $td.length; i++) {\n $td[i].addEventListener('mouseup', () => {\n brush = false;\n });\n };\n }", "function makeGrid() {\n const body = document.getElementsByTagName(\"body\")[0];\n const table = document.querySelector(\"#pixelCanvas\");\n const tableBody = document.createElement(\"tbody\");\n\n // Removing the previous grid (if any)\n if (table.firstChild) {\n table.firstChild.remove();\n };\n\n // Making a grid using user input\n for (let i = 0; i < newHeight; i++) {\n const row = document.createElement(\"tr\");\n\n for (let j = 0; j < newWidth; j++) {\n const cell = document.createElement(\"td\");\n row.appendChild(cell);\n };\n\n tableBody.appendChild(row);\n };\n\n table.appendChild(tableBody);\n body.appendChild(table);\n\n // Adding an event which changes background color for individual cells\n const td = document.getElementsByTagName(\"td\");\n\n for (let i = 0; i < td.length; i++) {\n td[i].onclick = function() {\n this.style.backgroundColor = newColor;\n };\n };\n}", "generate_grid() {\n\t\tvar svg_grid = document.getElementById(\"grid\");\n\t\tvar viewbox = \"\" + (-this.cell_width) + \" \" + (-this.cell_width) + \" \" + (this.cell_width*(this.width+2)) + \" \" + (this.cell_width*(this.height+2));\n\t\tsvg_grid.setAttribute(\"viewBox\", viewbox);\n\t\tdocument.addEventListener(\"keydown\", onKeyDown);\n\t\tdocument.addEventListener(\"keyup\", onKeyUp);\n\n\t\t// thick lines\n\n\t\tvar g_element = document.createElementNS(this.uri, 'g');\n\t\tg_element.setAttribute(\"fill\", \"white\");\n\t\tg_element.setAttribute(\"stroke\", \"black\");\n\t\tg_element.setAttribute(\"stroke-width\", \"0.5\");\n\t\t// 3x3 cells\n\t\tfor (var x = 0 ; x < (this.width/3) ; x++) {\n\t\t\tfor (var y = 0 ; y < (this.height/3) ; y++) {\n\t\t\t\tvar rect_element = document.createElementNS(this.uri,'rect');\n\t\t\t\trect_element.setAttribute(\"x\", 3*this.cell_width*x);\n\t\t\t\trect_element.setAttribute(\"y\", 3*this.cell_width*y);\n\t\t\t\trect_element.setAttribute(\"width\", 3*this.cell_width);\n\t\t\t\trect_element.setAttribute(\"height\", 3*this.cell_width);\n\t\t\t\tg_element.appendChild(rect_element);\n\t\t\t}\n\t\t}\n\t\tsvg_grid.appendChild(g_element);\n\t\t\n\t\t// cursor\n\t\tvar g_element = document.createElementNS(this.uri, 'g');\n\t\tg_element.setAttribute(\"id\", \"cursor\");\n\t\tg_element.setAttribute(\"fill\", \"none\");\n\t\tg_element.setAttribute(\"stroke\", \"blue\");\n\n\t\t// top left corner\n\t\tvar polyline_element = document.createElementNS(this.uri, \"polyline\");\n\t\tvar points = \"0,\" + (this.cell_width/3) + \" \" + \"0,0 \" + (this.cell_width/3) + \",0\";\n\t\tpolyline_element.setAttribute(\"points\", points);\n\t\tg_element.appendChild(polyline_element);\n\n\t\t// top right corner\n\t\tvar polyline_element = document.createElementNS(this.uri, \"polyline\");\n\t\tvar points = \"\" + (2*this.cell_width/3) + \",0 \" + (this.cell_width) + \",0 \" + (this.cell_width) + \",\" + (this.cell_width/3);\n\t\tpolyline_element.setAttribute(\"points\", points);\n\t\tg_element.appendChild(polyline_element);\n\n\t\t// bottom right corner\n\t\tvar polyline_element = document.createElementNS(this.uri, \"polyline\");\n\t\tvar points = \"\" + (2*this.cell_width/3) + \",\" + (this.cell_width) + \" \" + (this.cell_width) + \",\" + (this.cell_width) + \" \" + (this.cell_width) + \",\" + (2*this.cell_width/3);\n\t\tpolyline_element.setAttribute(\"points\", points);\n\t\tg_element.appendChild(polyline_element);\n\n\t\t// bottom left corner\n\t\tvar polyline_element = document.createElementNS(this.uri, \"polyline\");\n\t\tvar points = \"\" + (this.cell_width/3) + \",\" + (this.cell_width) + \" 0,\" + (this.cell_width) + \" 0,\" + (2*this.cell_width/3);\n\t\tpolyline_element.setAttribute(\"points\", points);\n\t\tg_element.appendChild(polyline_element);\n\n\t\tsvg_grid.appendChild(g_element);\n\n\t\t// Numbers\n\n\t\tvar g_element = document.createElementNS(this.uri, 'g');\n\t\tg_element.setAttribute(\"id\", \"numbers\");\n\t\tg_element.setAttribute(\"fill\", \"black\");\n\n\t\tvar g_fill = document.createElementNS(this.uri, 'g');\n\t\tg_fill.setAttribute(\"id\", \"fill\");\n\t\tvar g_corner = document.createElementNS(this.uri, 'g');\n\t\tg_corner.setAttribute(\"id\", \"corner\");\n\t\tvar g_center = document.createElementNS(this.uri, 'g');\n\t\tg_center.setAttribute(\"id\", \"center\");\n\n\t\tfor (var x = 1 ; x <= this.max ; x++) {\n\t\t\tfor (var y = 1 ; y <= this.max ; y++) {\n\t\t\t\tvar text = document.createElementNS(this.uri, \"text\");\n\t\t\t\ttext.id = \"fill\" + x + \",\" + y;\n\t\t\t\ttext.setAttribute(\"x\", this.cell_width*(x-1)+2);\n\t\t\t\ttext.setAttribute(\"y\", this.cell_width*(y)-1);\n\t\t\t\ttext.setAttribute(\"style\",\"font-size : 10px;\");\n\t\t\t\tg_fill.appendChild(text);\n\t\t\t\tvar text = document.createElementNS(this.uri, \"text\");\n\t\t\t\ttext.id = \"corner\" + x + \",\" + y;\n\t\t\t\ttext.setAttribute(\"x\", this.cell_width*(x-1)+1);\n\t\t\t\ttext.setAttribute(\"y\", this.cell_width*(y)-7);\n\t\t\t\ttext.setAttribute(\"textLength\", 8);\n\t\t\t\ttext.setAttribute(\"style\",\"font-size : 3px;\");\n\t\t\t\tg_corner.appendChild(text);\n\t\t\t\tvar text = document.createElementNS(this.uri, \"text\");\n\t\t\t\ttext.id = \"center\" + x + \",\" + y;\n\t\t\t\ttext.setAttribute(\"x\", this.cell_width*(x-1)+4);\n\t\t\t\ttext.setAttribute(\"y\", this.cell_width*(y)-4);\n\t\t\t\ttext.setAttribute(\"style\",\"font-size : 3px;\");\n\t\t\t\tg_center.appendChild(text);\n\t\t\t}\n\t\t}\n\n\t\tg_element.appendChild(g_fill);\n\t\tg_element.appendChild(g_corner);\n\t\tg_element.appendChild(g_center);\n\n\t\tsvg_grid.appendChild(g_element);\n\n\t\t// selectable cells\n\n\t\tvar g_element = document.createElementNS(this.uri,'g');\n\t\tg_element.setAttribute(\"id\",\"cells\");\n\t\tg_element.setAttribute(\"fill\", \"#FFFFFF00\");\n\t\tg_element.setAttribute(\"stroke\", \"black\");\n\t\tg_element.setAttribute(\"stroke-width\", \"0.1\");\n\n\t\tfor (var y = 1 ; y <= this.height ; y++) {\n\t\t\tfor (var x = 1 ; x <= this.width ; x++) {\n\t\t\t\tvar rect_element = document.createElementNS(this.uri,'rect');\n\t\t\t\tvar id = \"\" + x + \",\" + y;\n\t\t\t\trect_element.setAttribute(\"id\", id);\n\t\t\t\trect_element.setAttribute(\"onclick\", \"Grid.instance.onCellClick(id)\");\n\t\t\t\trect_element.setAttribute(\"x\", this.cell_width*(x-1));\n\t\t\t\trect_element.setAttribute(\"y\", this.cell_width*(y-1));\n\t\t\t\trect_element.setAttribute(\"width\", this.cell_width);\n\t\t\t\trect_element.setAttribute(\"height\", this.cell_width);\n\t\t\t\tg_element.appendChild(rect_element);\n\t\t\t}\n\t\t}\n\t\tsvg_grid.appendChild(g_element);\n\n\t\tthis.generate_buttons();\n\t}", "function makeGrid() {\n var {width, height} = size_input();\n\n for (rowNum = 0; rowNum < height; rowNum++) {\n grid.append(\" <tr></tr>\");\n }\n for (colNum = 0; colNum < width; colNum++) {\n $(\"#pixel_canvas tr\").append(\" <td></td>\");\n }\n}", "function pixelGrid() {\n\t\"use strict\";\n\t// Remove old grid.\n\tremoveGrid();\n\t\n\t// Defining variables.\n\tvar pixelTable, gridHeight, gridWidth;\n\tpixelTable = $('#pixel_canvas');\n\t\n\t// Setting up values for size.\n\tgridHeight = $('#input_height').val();\n\tgridWidth = $('#input_width').val();\n\t/* if (myGrid.isSet === 0) {\n\t\tgridHeight = myGrid.defaultHeight;\n\t\tgridWidth = myGrid.defaultWidth;\n\t\t\n\t\t$('#input_height').val(gridHeight);\n\t\t$('#input_width').val(gridWidth);\n\t}\n\telse {\n\t\tgridHeight \t= \t$('#input_height').val();\n\t\tgridWidth \t= \t$('#input_width').val();\n\t} */\n\n\t// Create grid using for loop.\n\tfor (var i = 0; i < gridHeight; i++) {\n\t\t// Add rows / tr.\n\t\tvar simpleTR = $('<tr></tr>');\n\t\tpixelTable.append(simpleTR);\n\t\t\n\t\t// Add pixels / td.\n\t\tfor (var j = 0; j < gridWidth; j++) {\n\t\t\tsimpleTR.append(\"<td></td>\");\n\t\t}\n\t}\n\t\n\t// changing all tr / td to right size.\n\t//if (myGrid.isSet === 1) {\n\tpixelTable.find(\"tr\").css(\"height\", myGrid.pixelSize);\n\tpixelTable.find(\"tr\").css(\"min-height\", myGrid.pixelSize);\n\tpixelTable.find(\"td\").css(\"width\", myGrid.pixelSize);\n\tpixelTable.find(\"td\").css(\"min-width\", myGrid.pixelSize);\n\t//}\n\n\thoverClick();\n}", "function createGrid() {\n for (let i = 0; i < DIMENSION; ++i) {\n const container = document.querySelector('#gridContainer');\n const row = document.createElement('div');\n\n row.classList.add('row');\n container.appendChild(row);\n\n for (let j = 0; j < DIMENSION; ++j) {\n const cell = document.createElement('div');\n cell.classList.add('cell');\n\n row.appendChild(cell);\n paint(cell);\n }\n }\n}", "function createGrid(tiles){\n //create and append the rows\n for (let y=0; y < tiles;y++){\n let row = document.createElement('div');\n row.classList.add('row');\n container.appendChild(row);\n \n //Create and append columns\n for (let x=0; x < tiles; x++){\n let cell = document.createElement('div');\n cell.classList.add('cell');\n row.appendChild(cell);\n }\n\n }\n let cells = document.getElementsByClassName('cell');\nfor (let i = 0; i < cells.length; i++){\n cells[i].addEventListener(\"mouseover\", draw);\n}\n \n\n}", "function buildBoard(){\n container = document.createElement(\"div\");\n container.classList.add(\"grid-container\");\n\n for(i=0; i < dims; i++){\n for(j = 0; j < dims; j++){\n let temp = makeGridEle(boardSize);\n container.appendChild(temp);\n }\n let br = document.createElement(\"br\");\n container.appendChild(br);\n }\n\n document.body.appendChild(container);\n}", "function createGrid(hexSize, fill, strokeSize, strokeColor, xGrid, yGrid) {\n\n // VARIABLE(S)\n let xmlns = 'http://www.w3.org/2000/svg';\n\n // CREATE SVG\n let svgElement = document.createElementNS(xmlns, 'svg');\n svgElement.setAttribute('width', ( hexSize + strokeSize ) * ( xGrid - 1 ) + 'px' );\n svgElement.setAttribute('height', ( hexSize + strokeSize ) * yGrid + 'px' );\n\n // DEFINE FIRST COORDS\n const radian = 60 * Math.PI / 180;\n let points = [];\n\n let coordinatesX = (rad) => Math.cos(rad) * (hexSize / 2) + (hexSize / 2) + (strokeSize / 2);\n let coordinatesY = (rad) => Math.sin(rad) * (hexSize / 2) + (hexSize / 2) + (strokeSize / 2);\n\n points.push([ coordinatesX(0), coordinatesY(0) ]);\n\n //DRAW COL GRID\n for( let p = 0 ; p < yGrid ; p++){\n\n // DRAW ROW GRID\n for( let i = 0 ; i < xGrid ; i++ ){\n\n // VARIABLE(S)\n points = [];\n let gapY = i % 2 === 0 ? ( hexSize * .44 ) + ( ( hexSize * .86 ) * p ) : ( hexSize * .86 ) * p;\n let gapX = ( hexSize * .75 ) * i;\n\n // DEFINE POINTS ARRAY\n for( let t = 0 ; t < 6 ; t++ ){\n points.push([ coordinatesX(radian * t ) + gapX, coordinatesY(radian * t ) + gapY ]);\n }\n\n // CREATE POLY\n let poly = document.createElementNS(xmlns, \"polygon\");\n poly.setAttribute('id', p + '-' + i);\n poly.setAttribute('fill', fill);\n poly.setAttribute('stroke', strokeColor);\n poly.setAttribute('stroke-width', strokeSize + 'px');\n poly.setAttribute('points', points.join(' '));\n\n // ADD POLY TO SVG ELEMENT\n svgElement.appendChild(poly);\n\n }\n\n }\n\n // RETURN SVG ELEMENT\n return svgElement;\n\n}", "function makeGrid(newNum){\n userInptNum = newNum;\n container.style.gridTemplateRows = userInptNum;\n container.style.gridTemplateColumns = userInptNum;\n\n for (let i = 1; i <= userInptNum; i++){\n for(let j = 1; j <= userInptNum; j++){\n let square = document.createElement('div');\n square.classList.add('square');\n square.style.backgroundColor = \"rgb(250,250,250\";\n square.style.gridRow = i;\n square.style.gridColumn = j;\n container.appendChild(square);\n\n }\n \n }\n getColor();\n \n}", "function changePixels() {\n let pixels = slider.value;\n\n let gridPixels = container.querySelectorAll('div');\n gridPixels.forEach(cell => cell.remove());\n\n makeRows(pixels, pixels, currColor);\n}", "function draw_grid_html(grid,n,id){\n var html = ''\n var grid_center = grid[(grid.length-1)/2];\n html += '<div class=\"info\">Grid build of '+ n + ' blocks with center ' + grid_center + ' blocks high</div>';\n html += '<div class=\"info\">['+ grid.toString() + '] = ' + grid.reduce(function(a,b){return a+b;}) + ' blocks</div>';\n html += '<div class=\"grid\">'\n for(var x = 0; x < grid.length; x++){\n var column = '<div class=\"col\">';\n for (var b=1; b <= grid[x]; b++){\n column += '<div class=\"block\"></div>';\n }\n column +='</div>';\n html += column;\n }\n html += '</div>';\n document.getElementById(id).innerHTML = html;\n\n return html;\n}", "function createGrid(squareNumber) {\n container.setAttribute('id', 'container');\n container.style.cssText = `margin: 0 auto; \n background-color: rgb(228, 166, 125);\n width: ${width}px;\n height: ${height}px;\n display: grid;\n cursor: crosshair;\n box-shadow: -1px 2px 12px 5px rgb(112, 80, 80);\n grid-template-columns: repeat(${squareNumber}, ${parseInt(height) / squareNumber}px);\n grid-template-rows: repeat(${squareNumber}, ${parseInt(width) / squareNumber}px);`;\n gameWindow.appendChild(container);\n\n for (let i = 1; i <= squareNumber; i++) {\n for (let j = 1; j <= squareNumber; j++) {\n const newDiv = document.createElement('div');\n newDiv.setAttribute('class', 'item');\n newDiv.style['text-align'] = 'center';\n newDiv.style['grid-area'] = `${i} / ${j} / span 1 / span 1`;\n newDiv.style.opacity = '0.0';\n //newDiv.style.border = '.5px dotted grey';\n container.appendChild(newDiv);\n console.log(`Created a div with row: ${i} and column: ${j}`);\n squares.push(newDiv);\n // puts an event listener on all divs that constantly listens for the paintSquare function on mouseenter\n newDiv.addEventListener('mouseenter', paintSquare);\n }\n }\n}", "function generateGrid(x) {\n \tfor (var rows = 0; rows < x; rows++) {\n \tfor (var columns = 0; columns < x; columns++) {\n \t$('#container').append(\"<div class='cell'></div>\");\n };\n };\n $('.cell').width(720/x);\n $('.cell').height(720/x);\n\t\tpaint();\n}", "renderBoard() {\n let board = Array(6).fill(null).map(ele => ele = Array(7).fill(null));\n return( //***** fix key to reflect unique val\n <div>\n <div id=\"0\">{board[0].map((col, j) => this.renderSquare(0, j, j))}</div>\n <div id=\"1\">{board[1].map((col, j) => this.renderSquare(1, j, j))}</div>\n <div id=\"2\">{board[2].map((col, j) => this.renderSquare(2, j, j))}</div>\n <div id=\"3\">{board[3].map((col, j) => this.renderSquare(3, j, j))}</div>\n <div id=\"4\">{board[4].map((col, j) => this.renderSquare(4, j, j))}</div>\n <div id=\"5\">{board[5].map((col, j) => this.renderSquare(5, j, j))}</div>\n </div>\n // board.map((row, i) => row.map((col, j) => this.renderSquare(i, j, j))) \n )\n }", "function render() {\n const hexPositions = drawHexGrid(500, 500);\n}", "function redraw() {\n var i, j, str, myEl, x, val;\n for(i = 0; i < size; i++) {\n for(j = 0; j < size; j++) {\n x = 4*i + j;\n str = \"\" + x;\n myEl = document.getElementById(str);\n if(mat[i][j] !== 0) {\n val = \"\" + mat[i][j];\n myEl.innerHTML = val;\n changeTileColor(str, mat[i][j]);\n }\n else {\n val = \"\";\n myEl.innerHTML = val;\n myEl.style.backgroundColor = \"rgb(205, 193, 180)\";\n }\n }\n } \n }", "function makeGrid(){\r\n $('#pixel_canvas').children().remove();\r\n row=$('#input_height').val();\r\n column=$('#input_width').val();\r\n var i=0;\r\n while(i<row){\r\n $('#pixel_canvas').append('<tr></tr>');\r\n for(var j=0;j<column;j++){\r\n $('tr').last().append('<td></td>');\r\n }\r\n i++;\r\n }\r\n }", "function makeGrid(x, y) {\n for (var rows = 0; rows < x; rows++) {\n for (var columns = 0; columns < y; columns++) {\n $(\"#container\").append(\"<div class='grid'></div>\");\n };\n };\n $(\".grid\").height(960/x);\n $(\".grid\").width(960/y);\n}", "function createGrid(){\n\n etchContainer.style.gridTemplateColumns = `repeat(${gridSize}, 1fr)`;\n etchContainer.style.gridTemplateRows = `repeat(${gridSize}, 1fr)`;\n \n for (let i = 0; i < gridSize * gridSize; i++){\n let etchSquareDiv = document.createElement(\"div\");\n etchSquareDiv.className = 'etchSquare';\n\n //add listener to change the color, for the sketching purposes\n etchSquareDiv.addEventListener(\"mouseenter\", function(){\n etchSquareDiv.style.backgroundColor = 'black';\n })\n\n etchContainer.appendChild(etchSquareDiv);\n } \n}", "function makeGrid() {\n // reset pixel canvas\n $(\"#pixelCanvas\").html(\"\");\n // Select size input\n height = $(\"#inputHeight\").val();\n width = $(\"#inputWeight\").val();\n //loop to add table cells and rows according to user input\n for (let x = 0; x < height; x++) {\n $('#pixelCanvas').append('<tr></tr>');\n }\n for (let y = 0; y < width; y++) {\n $('#pixelCanvas tr').each(function () {\n $(this).append('<td></td>');\n });\n }\n}", "function renderIterates(div) {\n\n // Render the other stuff\n var intDiv = div.style(\"width\", w + \"px\")\n .style(\"height\", h + \"px\")\n .style(\"box-shadow\",\"0px 3px 10px rgba(0, 0, 0, 0.4)\")\n .style(\"border\", \"solid black 1px\")\n\n // Render Contours \n var plotCon = contour_plot.ContourPlot(w,h)\n .f(function(x,y) { return f([x,y])[0] })\n .drawAxis(false)\n .xDomain(axis[0])\n .yDomain(axis[1])\n .contourCount(num_contours)\n .minima([{x:xstar[0], y:xstar[1]}]);\n\n var elements = plotCon(intDiv);\n\n var svg = intDiv.append(\"div\")\n .append(\"svg\")\n .style(\"position\", 'absolute')\n .style(\"left\", 0)\n .style(\"top\", 0)\n .style(\"width\", w)\n .style(\"height\", h)\n .style(\"z-index\", 2) \n\n\n // var X = d3.scaleLinear().domain([0,1]).range(axis[0])\n // var Y = d3.scaleLinear().domain([0,1]).range(axis[1])\n\n var X = d3.scaleLinear().domain(axis[0]).range([0, w])\n var Y = d3.scaleLinear().domain(axis[1]).range([0, h])\n \n // Rendeer Draggable dot\n var circ = svg.append(\"circle\")\n .attr(\"cx\", X(w0[0])) \n .attr(\"cy\", Y(w0[1]) )\n .attr(\"r\", 4)\n .style(\"cursor\", \"pointer\")\n .attr(\"fill\", colorbrewer.OrRd[3][1])\n .attr(\"opacity\", 0.8)\n .attr(\"stroke-width\", 1)\n .attr(\"stroke\", colorbrewer.OrRd[3][2])\n .call(d3.drag().on(\"drag\", function() {\n var pt = d3.mouse(this)\n var x = X.invert(pt[0])\n var y = Y.invert(pt[1])\n this.setAttribute(\"cx\", pt[0])\n this.setAttribute(\"cy\", pt[1])\n w0 = [x,y]\n onDrag(w0)\n iter(state_alpha, state_beta, w0);\n }))\n\n var iterColor = d3.scaleLinear().domain([0, totalIters]).range([\"black\", \"black\"])\n\n var update2D = plot2dGen(X, Y, iterColor)(svg)\n\n // Append x^star\n svg.append(\"path\")\n .attr(\"transform\", \"translate(\" + X(xstar[0]) + \",\" + Y(xstar[1]) + \")\")\n .attr(\"d\", \"M 0.000 2.000 L 2.939 4.045 L 1.902 0.618 L 4.755 -1.545 L 1.176 -1.618 L 0.000 -5.000 L -1.176 -1.618 L -4.755 -1.545 L -1.902 0.618 L -2.939 4.045 L 0.000 2.000\")\n .style(\"fill\", \"white\")\n .style(\"stroke-width\",1)\n\n \n function iter(alpha, beta, w0) {\n\n // Update Internal state of alpha and beta\n state_alpha = alpha\n state_beta = beta\n\n // Generate iterates \n var OW = runMomentum(f, w0, alpha, beta, totalIters)\n var W = OW[1]\n\n update2D(W)\n\n circ.attr(\"cx\", X(w0[0]) ).attr(\"cy\", Y(w0[1]) )\n circ.moveToFront()\n\n }\n\n iter(state_alpha, state_beta, w0);\n \n return { control:iter, \n w0:function() { return w0 }, \n alpha:function() { return state_alpha }, \n beta:function() {return state_beta} }\n\n }", "function generateGrid(blocks){\n //subtracting by 10 due to the px values associated with the padding and margin properties\n var gridSquareHeightAndWidth = Math.floor(960/blocks)-10;\n var toAdd = document.createDocumentFragment();\n for(let x=1; x<=blocks; x++){\n for(let y=1; y<=blocks; y++){\n var gridSquare = document.createElement(\"div\");\n gridSquare.id = \"grid-square\";\n gridSquare.style.width = gridSquareHeightAndWidth + \"px\";\n gridSquare.style.height = gridSquareHeightAndWidth + \"px\";\n gridSquare.style.backgroundColor = \"white\";\n gridSquare.addEventListener(\"mouseover\", e => {\n e.target.style.backgroundColor = \"black\";\n })\n toAdd.appendChild(gridSquare);\n }\n }\n document.getElementById(\"container\").appendChild(toAdd); \n}", "function RenderPixels(){\n for(const p of prev_pixels){\n p.attr('type','wall');\n }\n}", "function sketch(input) {\n let area = input * input;\n if (input >= 4 && input <= 100) {\n grid.innerHTML = '';\n for (let i = 0; i < area; i++) {\n const etch = document.createElement(`div${i}`);\n etch.className = 'square';\n etch.addEventListener('mouseover', function() {blk = etch.style.backgroundColor = 'black';});\n grid.style.gridTemplateRows = `repeat(${input}, ${500 / input}px)`;\n grid.style.gridTemplateColumns = `repeat(${input}, ${500 / input}px)`;\n etch.style.height = `${500 / input}px`;\n etch.style.width = `${500 / input}px`;\n grid.appendChild(etch);\n }\n }\n else console.log('invalid input');\n}", "function createGrid(gridSize) {\n let tileDiv = document.querySelector('.tileDiv');\n tileDiv.style.setProperty(\"--colNum\", gridSize);\n tileDiv.style.setProperty(\"--rowNum\", gridSize);\n for (let row = 0; row < gridSize; row++) {\n for (let column = 0; column < gridSize; column++) {\n let newTileDiv = document.createElement('div');\n newTileDiv.setAttribute('class', 'tile');\n // newTileDiv.style.filter = 'brightness(100%)';\n tileDiv.appendChild(newTileDiv);\n newTileDiv.addEventListener('mouseenter', function () {\n let opacity = this.style.opacity;\n if (blackLine === true) {\n const opacity = Number(this.style.opacity);\n this.style.backgroundColor = 'black';\n this.style.opacity = opacity + 0.2;\n } else if (this.classList.contains('active')) {\n this.style.opacity = (Number(opacity) + 0.2);\n } else {\n this.classList.add('active');\n this.setAttribute('style', 'opacity:0.1');\n this.style.background = randomColor();\n };\n });\n }\n }\n}", "function makeGrid() {\n\tvar grid = $('#grid');\n\t// Capture grid height and width and limit it to 1 to 30\n\tvar height = Number($('#grid-height').val());\n\t$('#win').removeClass('win-is-visible');\n\tif (height > 30) {\n\t\theight = 30;\n\t}\n\tif (height < 1) {\n\t\theight = 1;\n\t}\n\tvar width = Number($('#grid-width').val());\n\tif (width > 30) {\n\t\twidth = 30;\n\t}\n\tif (width < 1) {\n\t\twidth = 1;\n\t}\n\t// Reset game variables\n\tgrid.html('');\n\tgridArr = [];\n\ttilesFound = 0;\n\tnonogram = false;\n\t// Construct grid in dom and gridArr variable\n\tgrid.prepend('<div id=\\'y-numbers\\'</div>');\n\tfor (var x = 0; x < width + 1; x++){\n\t\tx == 0 ? $('#y-numbers').append('<div id=\\'corner\\'></div>') : \n\t\t\t$('#y-numbers').append('<div id=\\'column-'+ (x - 1) +'\\'><ul></ul></div>');\n\t}\n\tfor (var y = 0; y < height; y++){\n\t\tgrid.append('<div id='+ y +'-row></div>');\n\t\tgridArr.push([]);\n\t\tfor (var x = 0; x < width + 1; x++){\n\t\t\tif (x === 0){\n\t\t\t\t$('#'+ y +'-row').append('<div id=\\'row-'+ y +'\\'><ul></ul></div>');\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$('#'+ y +'-row').append('<div class=\\'pixel '+ (x - 1) +'\\' data-isPixel = \\'false\\' data-y='+ y +' data-x='+ (x - 1) +' onclick=\\'handlePixel(this)\\'></div>');\n\t\t\t\tgridArr[y].push(0);\n\t\t\t}\n\t\t}\n\t}\n\t// Append color picker and nonogramify buttons\n\t$('#grid').append('<div id=\"color-picker\"><p>Color Picker</p><input id=\"grid-color\" type=\"color\"></div><button id=\"nonogramify\" onclick=\"nonogramify()\">Create Nonogram</button>');\n}", "function makeGrid(_row, _col, _rowID, _colID) {\n // let canvasTable = document.getElementById('canvasTable'); // table used for drawing artwork\n let table = '';\n\n console.log('makeGrid');\n //Create grid rows\n for (let r = 0; r < _row; r++) {\n table += '<tr class=\"pixel\">'; // add row opening with <tr> tag\n //Create grid columns\n for (let c = 0; c < _col; c++) {\n //add <td> tags equal to _col\n //each <td> has an id equal to the row/col. e.g. id=A4\n // OLD - Removed 'onclick' and placed inside sketch.js file\n // table += '<td class=\"pixel\" id=' + _rowID[r] + _colID[c] + ' onclick=\"changeColor(this)\"></td>'; // add cols\n table += '<td class=\"pixel\" id=' + _rowID[r] + _colID[c] + '></td>'; // add cols\n\n // table += '<td class=\"pixel\" id=' + rowID[r] + colID[c] + '></td>'; // add cols\n }\n //add closing </tr> tag to each completed row\n table += '</tr>';\n }\n // add table elements inside of <table id='pixelTable' class='pixel'></table>\n document.getElementById('pixelTable').innerHTML = table;\n}", "function drawGrid() {\n noFill();\n stroke(230, 50);\n strokeWeight(2);\n\n for (let j = 0; j < config.numRows; j++) {\n for (let i = 0; i < config.numCols; i++) {\n rect(i * colWidth, j * rowHeight, colWidth, rowHeight)\n }\n }\n }", "function loadGrid(x){\n for (let i = 0; i < x; i++){\n let row = document.createElement('div');\n row.style.height = (640/x) + 'px';\n row.style.width = '640px';\n row.className = 'gridRows';\n gridContainer.appendChild(row); \n \n for (let j = 0; j < x; j++){\n let square = document.createElement('div');\n square.style.width = 640/x + 'px';\n square.style.height = 640/x + 'px';\n square.className = 'gridSquares';\n row.appendChild(square);\n square.onmouseover = function(){\n square.style.backgroundColor = whichColor;\n square.style.border = 'none';\n };\n } \n }\n}", "function makeGrid() {\nconst gridHeight = document.getElementById(\"inputHeight\").value;\nconst gridWidth = document.getElementById(\"inputWidth\").value;\nconst pixelCanvas = document.getElementById(\"pixel_Canvas\"); \npixelCanvas.innerText=\"\"; // empty table \n\nfor (let h=0; h<gridHeight; ++h) {\n const row = pixelCanvas.insertRow(-1); // insert new row\n for (let w=0; w<gridWidth; ++w) {\n const cell = row.insertCell(-1); //insert new cell\n cell.onclick = changeColor;\n }\n}\nevent.preventDefault();\n\n\n}", "function makeGrid(height, width) {\n var table = document.getElementById('pixelCanvas');\n table.innerHTML=\"\";\n for (var i = 0; i<height; i++){\n var row = table.insertRow();\n for (var j = 0; j<width; j++){\n var cell = row.insertCell();\n cell.addEventListener('click', function(event){\n event.target.style.backgroundColor = color.value;})\n }\n }\n}", "function makeGrid() {\n // Variables for Function\n const gridHeight = document.getElementById('inputHeight').value;\n const gridWidth = document.getElementById('inputWidth').value;\n const canvas = document.getElementById('pixelCanvas');\n canvas.innerHTML = \"\"; // Resets grid when new submitted again.\n // Function below Creates Rows & Columns\n for (let y = 0; y < gridHeight; ++y) {\n var row = document.createElement('tr');\n canvas.appendChild(row);\n for (let x = 0; x < gridWidth; ++x) {\n var col = document.createElement('td');\n row.appendChild(col);\n // eventListener assigns color to background when cell clicked.\n col.addEventListener('click', function(c) {\n var color = setColor();\n c.target.style.backgroundColor = color;\n });\n }\n }\n}", "function makeGrid(r,c) {\n $('tr').remove();\n\n for (let i = 1; i<=r; i++){\n $('#pixelCanvas').append('<tr></tr>');\n for(let j = 1; j<=c; j++) {\n $('tr').filter(':last').append('<td></td>');\t\n }\n }\naddColor();\n \n}", "function renderGrid(grid) {\r\n let modules = grid.modules;\r\n let svg = document.getElementById('root');\r\n let i;\r\n\r\n for (i = 0; i < modules.length; i++) {\r\n svg.appendChild(createModule(modules[i], svg.namespaceURI));\r\n }\r\n}", "function makeGrid(height, width) {\r\n// Grid is cleared\r\n pixelCanvas.empty();\r\n// Create new grid\r\n// Create rows\r\n for (let row = 0; row < height; row++) {\r\n let tableRow = $('<tr></tr>');\r\n// Create columns\r\n for (let col = 0; col < width; col++) {\r\n let tableCell = $('<td></td>');\r\n// Append table data to create grid\r\n tableRow.append(tableCell);\r\n }// End col for loop\r\n pixelCanvas.append(tableRow);\r\n }// End row for loop\r\n }// End makeGrid function", "drawGrid() {\n\n for (let i = 0; i <= HEIGHT; i += SQUARE_SIDE) {\n line(0, i, WIDTH, i);\n }\n for (let i = 0; i <= WIDTH; i += SQUARE_SIDE) {\n line(i, 0, i, HEIGHT);\n }\n\n }", "function makeGridEle(ms) {\n let ediv = document.createElement(\"div\");\n ediv.classList.add('sketch');\n ediv.addEventListener('mouseover', function(e){ //mouseover changes color if hovered\n e.target.style.backgroundColor = 'black';\n console.log('hoover');\n });\n ediv.style.width = ms / dims + \"px\";\n console.log(Math.ceil(ms/dims));\n ediv.style.height = ms / dims + \"px\";\n\n return ediv;\n}", "function gridData(values) {\n // INPUTS:\n // @nbpix: nb of pixels\n // @values: list containing all the values\n let nbpix = parseInt(Math.sqrt(values.length))\n\tlet data = new Array();\n\tlet xpos = 1; //starting xpos and ypos at 1 so the stroke will show when we make the grid below\n\tlet ypos = 1;\n\tlet cell_width = 0.99*width/nbpix;\n\tlet cell_height =0.99*height/nbpix;\n\tlet click = 0;\n\t\n // iterate for rows\t\n let ii = 0;\n\tfor (var rr = 0; rr < nbpix; rr++) {\n data.push( new Array() );\n\t\t// iterate for cells/columns inside rows\n\t\tfor (var cc = 0; cc < nbpix; cc++) { \n\t\t\tdata[rr].push({\n\t\t\t\tx: xpos,\n\t\t\t\ty: ypos,\n\t\t\t\twidth: cell_width,\n\t\t\t\theight: cell_height,\n click: click,\n value: values[ii]\n })\n ii++\n\t\t\t// increment the x position. I.e. move it over by 50 (width variable)\n\t\t\txpos += cell_width;\n }\n \n\t\t// reset the x position after a row is complete\n\t\txpos = 1;\n\t\t// increment the y position for the next row. Move it down 50 (height variable)\n\t\typos += cell_height;\t\n }\n\treturn data;\n}", "function squareGen(num,cells){\n const node = document.createElement(\"div\");\n //aggiungo classe square e stili per dimensioni\n node.classList.add(\"square\");\n node.style.width = ` calc(100% /${cells}` ;\n node.style.height = ` calc(100% /${cells}` ;\n\n //span per numero generato\n const span = document.createElement(\"div\");\n span.append(num);\n \n\n //Inserisco lo span nello square\n node.append(span);\n\n return node;\n}", "function squareGen(num,cells){\n const node = document.createElement(\"div\");\n //aggiungo classe square e stili per dimensioni\n node.classList.add(\"square\");\n node.style.width = ` calc(100% /${cells}` ;\n node.style.height = ` calc(100% /${cells}` ;\n\n //span per numero generato\n const span = document.createElement(\"div\");\n span.append(num);\n \n\n //Inserisco lo span nello square\n node.append(span);\n\n return node;\n}", "function draw_grid(){\n //background(254);\n for (var x = 0; x < width; x +=GridSize*Zoom) {\n\t\tfor (var y = 0; y < height; y += GridSize*Zoom) {\n //background(234);\n\t\t\tstroke(204, 102, 0);\n\t\t\tstrokeWeight(0.04);\n line(-x, -height, -x, height);\n line(x, -height, x, height);\n line(-width, y, width, y);\n line(-width, -y, width, -y);\n\t\t}\n }\n}", "_draw() {\n this.grid = [];\n\n for (let i = 0; i < this.gridSize; i++) {\n const row = [];\n\n const y = this.hexagonHeight/2 + 5 + i * this.hexagonHeight * 3/4;\n const x_offset = i * this.hexagonWidth/2;\n\n for (let j = 0; j < this.gridSize; j++) {\n\n if (this._isCornerCell(i, j) && !this.drawCorners) {\n row.push(null);\n continue;\n }\n\n const x = this.hexagonWidth/2 + 5 + j * this.hexagonWidth;\n\n const points = this._getPoints(x + x_offset, y);\n\n const hexagon = this.elem.append('path')\n .attr('d', this._hexagonPathGenerator(points))\n .attr('stroke', 'grey')\n .attr('stroke-width', 2)\n .attr('fill', () => this._isCornerCell(i, j) ? '#ff9482' : 'none');\n\n row.push({x: x + x_offset, y: y, hexagon: hexagon});\n\n if (!this.drawText) {\n continue;\n }\n\n this.elem.append('text')\n .attr('x', x + x_offset)\n .attr('y', y)\n .attr('font-family', 'sans-serif')\n .attr('font-size', '12px')\n .attr('text-anchor', 'middle')\n .attr('dominant-baseline', 'middle')\n .text(`${i},${j}`);\n }\n\n this.grid.push(row);\n }\n }", "#buildPixelsArray() {\n this.father.style.width = `${this.width * this.pixelSize}px`;\n let pixels = [];\n for (let i = 0; i < this.height; i++) {\n let col = [];\n for (let j = 0; j < this.width; j++) {\n let d = document.createElement('div');\n d.classList.add('pixel', 'backgroundPixel');\n d.style.width = `${this.pixelSize}px`;\n d.style.height = `${this.pixelSize}px`;\n this.father.appendChild(d);\n col.push(d);\n }\n pixels.push(col);\n }\n return pixels;\n }", "function drawCells(){\n context.fillStyle = 'white';\n context.fillRect(0, 0, resolution, resolution);\n context.fillStyle = 'black'\n for (let y = 0; y < resolution; y++){\n for(let x = 0; x < resolution; x++){\n if (cells[x][y]) \n context.fillRect(x,y,1,1) //position of the cell are given with x and y, fill react first parameters are the coordenates\n }\n }\n}", "resizeGrid(lw, lh, sw, sh) {\n this.gridCellW = lw;\n this.gridCellH = lh;\n this.cellW = sw;\n this.cellH = sh;\n var elLargeGridRect = document.getElementById(\"largeGridRect\");\n var elLargeGridPath = document.getElementById(\"largeGridPath\");\n var elLargeGrid = document.getElementById(\"largeGrid\");\n\n var elSmallGridPath = document.getElementById(\"smallGridPath\");\n var elSmallGrid = document.getElementById(\"smallGrid\");\n\n var elSvg = document.getElementById(\"svg\");\n var elSurface = document.getElementById(\"surface\");\n var elGrid = document.getElementById(\"grid\");\n\n elLargeGridRect.setAttribute(\"width\", lw);\n elLargeGridRect.setAttribute(\"height\", lh);\n\n elLargeGridPath.setAttribute(\"d\", \"M \" + lw + \" 0 H 0 V \" + lh);\n elLargeGrid.setAttribute(\"width\", lw);\n elLargeGrid.setAttribute(\"height\", lh);\n\n elSmallGridPath.setAttribute(\"d\", \"M \" + sw + \" 0 H 0 V \" + sh);\n elSmallGrid.setAttribute(\"width\", sw);\n elSmallGrid.setAttribute(\"height\", sh);\n\n elGrid.setAttribute(\"x\", -lw);\n elGrid.setAttribute(\"y\", -lh);\n\n var svgW = +elSvg.getAttribute(\"width\");\n var svgH = +elSvg.getAttribute(\"height\");\n\n elSurface.setAttribute(\"width\", svgW + lw * 2);\n elSurface.setAttribute(\"height\", svgH + lh * 2);\n\n elSurface.setAttribute(\"x\", -lw);\n elSurface.setAttribute(\"y\", -lh);\n\n elSurface.setAttribute(\"width\", svgW + lw * 2);\n elSurface.setAttribute(\"height\", svgH + lh * 2);\n }", "function drawCells() {\n\n for(var i = 0; i < cols; i++) {\n\n const cell = document.createElement('div');\n\n if (state[i] == 1){\n cell.setAttribute(\"style\", \"background-color: black; width: 8px; height: 8px; float: left;\");\n }\n else {\n cell.setAttribute(\"style\", \"width: 8px; height: 8px; float: left;\");\n }\n\n document.body.appendChild(cell);\n }\n\n findNewState()\n}", "function makeGrid() {\n\tfor (y = 0; y < sizeY; y++ ){\n\t\t$('#pixelCanvas').append('<tr>');\n\t\t\tfor(x = 0; x< sizeX; x++ ){\n\t\t\t\t$('#pixelCanvas tr:last-child').append('<td></td>');\n\t\t\t}\n\t\t$('#pixelCanvas').append('</tr>');\n\t}\n}", "function makeGrid() {\n\n canvas.innerHTML = '';\n\t\n\t\n // This builds the rows and columns\n var fragment = document.createDocumentFragment();\n\t\n for (let a = 0; a < height.value; a++) {\n var tr = document.createElement('tr');\n\n for (let b = 0; b < width.value; b++) {\n var td = document.createElement('td');\n tr.appendChild(td);\n }\n\n tr.addEventListener('click', clickedBox);\n fragment.appendChild(tr);\n\t\n }\n \n \n \n // Push grid onto DOM\n canvas.appendChild(fragment);\n \n}", "function drawGrid(gridSize) {\n let gridArea = gridSize * gridSize;\n for (let i = 0; i < gridArea; i++) {\n const box = document.createElement('div');\n box.classList.add('box');\n box.attributes.width = 600/gridSize;\n box.attributes.length = 600/gridSize;\n gridContainer.appendChild(box);\n box.addEventListener('mouseover', function() {\n sketch(box);\n });\n }\n gridContainer.style.gridTemplateRows = `repeat(${gridSize}, 1fr)`;\n gridContainer.style.gridTemplateColumns = `repeat(${gridSize}, 1fr)`;\n}", "_renderGrid() {\n\n\t\tconst $wrapper= document.createElement('div');\n\t\t$wrapper.classList.add('wrapper');\n\n\t\t// Iterate trough the grid and create elements to render\n\t\tthis._grid.forEach( (row, i) => {\n\n\t\t\tconst $row= document.createElement('div');\n\t\t\t$row.classList.add('board-row');\n\n\t\t\trow.forEach( (col, j) => {\n\n\t\t\t\tconst $col= document.createElement('mem-card');\n\n\t\t\t\t// Set properties\n\t\t\t\t$col.setAttribute('cardid', col.id);\n\t\t\t\t$col.setAttribute('image', col.image);\n\t\t\t\t$col.setAttribute('row', i);\n\t\t\t\t$col.setAttribute('col', j);\n\n\t\t\t\t$col.parentClickHandlerHook= (rowID, colID)=> this._cardSelectHandler(rowID, colID);\n\n\t\t\t\t$row.appendChild($col);\n\n\t\t\t\tcol['$elem']= $col;\n\t\t\t});\n\n\t\t\t$wrapper.appendChild($row);\n\t\t});\n\n\t\treturn $wrapper;\n\t}", "function createGrid(width, height) {\n\n}", "drawHTMLBoard() {\r\n for (let column of this.spaces) {\r\n for (let space of column) {\r\n space.drawSVGSpace();\r\n }\r\n }\r\n\t}", "function makeGrid() {\n\n\n}", "function makeGrid(){\n var rowNumber = prompt(\"How many rows on the grid?\");\n var sideSize = 700 / rowNumber;\n var elementNumber = \" \";\n for (var i = 0; i < rowNumber * rowNumber; i++){\n elementNumber += \"<div class = 'square'></div>\";\n }\n $(document).ready(function() {\n $('.square').remove(); //clears grid \n $('body').find(\"#container\").append(elementNumber);\n $('.square').css({\"height\": sideSize + 'px', \"width\": sideSize + 'px'});\n $(document).on('mouseenter', '.square', function() {\n $(this).css(\"background-color\", \"#255E69\");\n });\n });\n}", "function matrix_to_divs(matrix){\n var no_rows=matrix.length;\n var no_cols=matrix[0].length;\n var drawing='<div class=\"output_drawing\">';\n for(var i=0;i<no_rows;i++){\n drawing+='<div class=\"output_row\">';\n for(var j=0;j<no_cols;j++){\n if(matrix[i][j]==0){\n drawing+='<div class=\"output_cell\"></div>'\n }else{\n drawing+='<div class=\"output_cell output_active\"></div>'\n }\n };\n drawing+='</div>';\n };\n drawing+='</div>';\n return drawing;\n}", "drawHTMLBoard () {\n for (let column of this.spaces) {\n for (let space of column) {\n space.drawSVGSpace();\n }\n }\n }", "function makeGrid() {\n\n // get the table element\n const canvas = document.getElementById('pixelCanvas');\n // reset grid\n while(canvas.firstChild) {\n canvas.removeChild(canvas.firstChild);\n }\n\n\n var width = sizeForm.width.value;\n var height = sizeForm.height.value;\n console.debug(width);\n console.debug(height);\n \n // create grid with height and width inputs\n for(y = 0; y < height; y++) {\n row = canvas.appendChild(document.createElement('TR'));\n for(x = 0; x < width; x++) {\n cell = row.appendChild(document.createElement('TD'));\n }\n }\n\n canvas.addEventListener('click', changeColor);\n\n}", "function buildGrid() {\n gameArea.innerHTML = \"\";\n\n console.log('---------------[ GENERATING GRID ]---------------');\n\n for (var i = 0; i < Math.sqrt(config.gridSize); i++) {\n var row = document.createElement('div');\n row.classList.add('row');\n // console.log('ROW ' + i + \":\");\n for (var j = 0; j < Math.sqrt(config.gridSize); j++) {\n var cell = document.createElement('div');\n cell.id = `cell-${j}-${i}`;\n cell.setAttribute('row', i);\n cell.setAttribute('cell', j);\n cell.classList.add('cell');\n row.appendChild(cell);\n\n // console.log(' - Cell ' + j);\n }\n gameArea.appendChild(row);\n }\n console.log('---------------[ GENERATED GRID ]---------------');\n\n}", "function userGrid (userChoice) {\n let totalDivs = userChoice * userChoice;\n for (let i=0; i<totalDivs; i++) {\n let gridDiv = document.createElement('div');\n gridDiv.classList.add('gridDiv');\n let text = document.createTextNode(\"\");\n gridDiv.appendChild(text);\n containerDiv.appendChild(gridDiv); \n gridDiv.addEventListener('mouseover', whiteColors); \n }\n containerDiv.style.gridTemplateColumns = `repeat(${userChoice}, 1fr)`;\n containerDiv.style.gridTemplateRows = `repeat(${userChoice}, 1fr)`;\n}", "function makeGrid(inputHeight, inputWidth) {\n var grid = '';\n\n for (let i = 0; i < inputHeight; i++) {\n grid += '<tr>';\n for (let w = 0; w < inputWidth; w++) {\n grid += '<td class=\"cell\"></td>';\n };\n grid += '</tr>';\n };\n\n //append grid to the table\n pixelCanvas.innerHTML = grid;\n}", "function makeGrid() {\n // Select size input\n const height = document.getElementById('inputHeight').value;\n const width = document.getElementById('inputWidth').value;\n // select table\n const table = document.getElementById('pixelCanvas');\n //remove old table then create new one .\n table.innerHTML = \"\";\n // create inner loops to draw row and column .\n for (var i = 0; i < height; i++) {\n // create a new row .\n var tableRow = document.createElement(\"tr\");\n for (var j = 0; j < width; j++) {\n // create new column in each rows.\n var tableCell = document.createElement(\"td\");\n tableRow.appendChild(tableCell);\n }// End inner for loop .\n // add row and cell in each round .\n var cell = table.appendChild(tableRow);\n // add listenr to each cell.\n cell.addEventListener('click', function (e) {\n // Select color input\n var color = document.getElementById('colorPicker').value;\n e.target.style.backgroundColor = color;\n });\n }; // end main loop.\n}", "function renderGrid() {\n let { C, cols, rows, px, grid_color, render_border } = state\n C.gx.clearRect(\n -render_border,\n -render_border,\n C.gx.canvas.width,\n C.gx.canvas.height\n )\n C.gx.strokeStyle = grid_color\n C.gx.lineWidth = 1\n C.gx.strokeRect(0.5, 0.5, sub(mul(cols, px), 1), sub(mul(rows, px), 1))\n C.gx.lineWidth = 2\n for (let c = 1; c < state.cols; c++) {\n C.gx.beginPath()\n C.gx.moveTo(mul(c, px), 0)\n C.gx.lineTo(mul(c, px), mul(rows, px))\n C.gx.stroke()\n }\n for (let r = 1; r < state.rows; r++) {\n C.gx.beginPath()\n C.gx.moveTo(0, mul(r, px))\n C.gx.lineTo(mul(cols, px), mul(r, px))\n C.gx.stroke()\n }\n}", "function grid() {\n var size = 10; // size of grid\n var tile = document.getElementById(\"container\"); // type less.\n var row = new Array(); // grid row array\n var i = 0; // array sub index\n var j = 0; // array sub index\n\n // excel-style grid indices to populate grid elements\n var cols = [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\"];\n var rows = [\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\"];\n\n // grid array 10x10 data structure\n for (i = 0; i < size; i++) { // 10x10 array\n row[i] = new Array(); // new array per element\n for (j = 0; j < size; j++) { // each column\n row[i][j] = cols[i]+rows[j]; // fill with (x,y)\n }\n }\n\n // make 100 <div> grid, including attributes and onclick event\n for(i = 0; i < size; i++) { // 10 rows\n for (j = 0; j < size; j++) { // 10 cols\n tile.innerHTML += // append to container\n '<div onclick=\"clicked('+row[i][j]+')\" ' +\n 'id=\"'+row[i][j]+'\" ' +\n 'class=\"blue\" >' +\n '?</div>';\n } // one table div done\n tile.innerHTML += '<br />' // \\n and print next row\n }\n}", "function makeGrid(){\n\tconst inputHt=$('#inputHeight').val(); //Getting input value for row\n\tconst inputWt=$('#inputWidth').val(); //Getting input value for column\n\n\tfor(var i=0;i<inputHt;i++){\n\t\t$('#pixelCanvas').append(\"<tr id=row\" +i+ \"></tr>\"); //creating rows\n\t\tfor(var j=0;j<inputWt;j++){\n\t\t\t$('#row'+i).append(\"<td></td>\"); //creating columns\n\t\t}\n\t}\n}", "function renderSVGRows(settings) {\n let svg = createSVGContext(window.innerWidth, window.innerHeight); // || ctx - they both work here.\n let row = 0;\n let width = window.innerWidth;\n svg.fillStyle = getColor(appState.backgroundColor, /* useHex = */ true);\n svg.fillRect(0, 0, window.innerWidth, window.innerHeight);\n\n for (let y = lastRow; y > 0; y -= iteratorSettings.step) {\n drawSVGLine(lastLine, svg);\n lastLine = [];\n let isEven = (row % 2) === 0\n row += 1;\n\n for (let i = 0; i < width; i += 1) {\n let x = isEven ? i : width - 1 - i;\n let height = regionInfo.getHeightAtPoint(x, y);\n let fY = y - Math.floor(scale * (height - minHeight) / heightRange);\n if (height <= oceanLevel) {\n drawSVGLine(lastLine, svg);\n lastLine = [];\n } else {\n lastLine.push(x, fY);\n }\n }\n\n lastRow = y - iteratorSettings.step;\n }\n\n drawSVGLine(lastLine, svg);\n\n appState.renderProgress = null;\n if (settings && settings.labels) {\n }\n if (svg.serialize) {\n svg.appendLabels(settings && settings.labels);\n // ctx (used for debugging) doesn't have this method\n return svg.serialize();\n }\n }", "function drawGrid() {\n for (r = 0; r < ROW; r++) {\n for (c = 0; c < COLUMN; c++) {\n drawSquare(c, r, grid[r][c]);\n }\n }\n }", "squareToRender() {\n const element = [];\n for (let i = 0; i < 3; i++) {\n element.push(this.handleSquare(i))\n }\n return element.map((item, index) => <Fragment key={index}>{item}</Fragment>);\n }", "function makeGrid(height, width) {\n\tfor(i = 0; i < height; i++){\n\t\t$(\"#pixelCanvas\").append($(\"<tr></tr>\"));\n\t\tfor(j = 0; j < width; j++){\n\t\t\t$(\"tr\").last().append($(\"<td></td>\"));\n\t\t}\t\n\t}\n\n\t$(\"td\").on('click', function(event){\n\t\tconst painting = $('#colorPicker').val(); // Select color input\n\t\t$(event.target).css('background-color', painting); //painting the background of td with color picked by user\n\t});\n\n}", "function GenerateField(boardContainer, cells){\n for (i = 0; i < cols; i++) {\n for (j = 0; j < rows; j++) {\n\n var cell = document.createElement(\"div\");\n boardContainer.appendChild(cell);\n\n cell.id = 'cell' + i + j;\n\n var topPosition = j * squareSize;\n var leftPosition = i * squareSize;\n\n cell.style.top = topPosition + 'px';\n cell.style.left = leftPosition + 'px';\n cell.style.width = squareSize + 'px';\n cell.style.height = squareSize + 'px';\n cells.push(cell);\n }\n }\n \n}", "function displayGrid() {\r\n for (i = 0; i < cols; i++) {\r\n for (j = 0; j < rows; j++) {\r\n grid[i][j].display(w, h, 255);\r\n }\r\n }\r\n}", "function pixeles() {\n for (let i = 0; i < 1751; i++) {\n let pix = document.createElement(\"div\");\n pix.className = \"grilla-pixeles\";\n grilla.appendChild(pix); \n }\n}", "function draw() {\n var str = \"\";\n \n for (i = 0; i < 3; i++) {\n // Add ClusterLine\n str += '<div class=\"ClusterLine\">';\n for (j = 0; j < 3; j++) {\n // Add Cluster\n str += '<div class=\"Cluster\">';\n for (k = 0; k < 3; k++) {\n // Add line\n str += '<div class=\"Line\">';\n for (l = 0; l < 3; l++) {\n // Compute x and y\n var x = i * 3 + k;\n var y = j * 3 + l;\n\n // Get Value\n var v = currentGrid[x][y];\n var empty = (v == 0) ? \" empty\" : \"\";\n var value = (v == 0) ? \"\" : v;\n\n // Add box\n str += '<div class=\"Box' + empty + '\"><p>' + value + '</p></div>';\n }\n // Close line\n str += '</div>';\n }\n // Close Cluster\n str += '</div>';\n }\n // Close ClusterLine\n str += '</div>';\n }\n document.getElementById(\"Board\").innerHTML = str;\n\n document.getElementById(\"moves\").value = numberOfMoves;\n}" ]
[ "0.6823166", "0.6325612", "0.62825996", "0.6255605", "0.6157618", "0.60907245", "0.6087567", "0.607411", "0.6071256", "0.60576814", "0.60312384", "0.60074204", "0.6003403", "0.5990763", "0.59757036", "0.59583867", "0.59556204", "0.5950396", "0.5915684", "0.59137803", "0.59047633", "0.59001094", "0.58947855", "0.5888133", "0.58842355", "0.5872104", "0.58702385", "0.5867193", "0.58627456", "0.58494586", "0.5843914", "0.5829982", "0.5814783", "0.5809433", "0.5806547", "0.580486", "0.57977086", "0.5787176", "0.57634777", "0.5757425", "0.57530797", "0.5738739", "0.5723606", "0.5714319", "0.57082236", "0.5695924", "0.5692617", "0.5676882", "0.56763875", "0.5665955", "0.56580675", "0.56471914", "0.56342626", "0.5622276", "0.5619912", "0.5611149", "0.56067187", "0.5599111", "0.55987084", "0.5593769", "0.5593381", "0.55909604", "0.5586973", "0.5582796", "0.55792075", "0.556587", "0.5556492", "0.5556492", "0.5545644", "0.5545599", "0.5540838", "0.5538495", "0.55352324", "0.5528488", "0.552799", "0.5527509", "0.5526759", "0.55249125", "0.5523268", "0.5522466", "0.5518385", "0.5516502", "0.5516338", "0.5514319", "0.5512881", "0.55073535", "0.5500199", "0.5499932", "0.5499237", "0.5495393", "0.54933363", "0.5483293", "0.5483192", "0.54822916", "0.5475531", "0.5474631", "0.54660684", "0.5459486", "0.5458527", "0.54584473" ]
0.5939573
18
Game Over pop up
function gameOver() { popup.classList.remove('hide'); document.querySelector('.final-move').innerHTML = document.querySelector('.moves').innerHTML; document.querySelector('.final-time').innerHTML = document.querySelector('.timer').innerHTML; document.querySelector('.final-star').innerHTML = document.querySelector('.stars').innerHTML; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gameOver() {\n\tstopClock();\n\twriteModalStats();\n\ttoggleModal();\n}", "function showGameOverDialog() {\n alert(\"Game Over!!\");\n }", "function gameOver() {\n\tstopClock();\n\twriteModalStats();\n\ttoggleModal();\n\tmatched=0;\n}", "function gameOver() {\n stopClock();\n writeModalStats();\n toggleModal();\n}", "function gameOver() {\n if (gameState == \"win\") {\n console.log(\"You win!!\");\n $(\"#gameOverDialog\").dialog(\"open\");\n $(\"#gameOverDialog\").text(\"You win. You successfully avoided too much harmful content.\");\n } else if (gameState == \"lose\") {\n console.log(\"You lose!!\");\n $(\"#gameOverDialog\").dialog(\"open\");\n $(\"#gameOverDialog\").text(\"You lose. You were unable to avoid harmful content.\");\n }\n}", "function gameOver() {\t\n\t\t$('#score').html(score);\n\t\t$('#game-over').show(200);\n\t}", "function gameOver() {\n\tstopTimer();\n\tupdateModal();\n\ttoggleModal();\n}", "function gameOver(){\n\t\t\tconsole.log(\"gameOver() called\");\n\t\t\tupdate($question, \"Game Over, you score \" + score + \" points!\");\n\t\t\twindow.clearInterval(interval);\n\t\t\thide($form);\n\t\t\tshow($start);\n\t\t}", "function gameOver() {\n stopTimer();\n toggleModal();\n writeModalStats();\n}", "function gameOver (){\n $(\"#correct-answers\").html(\"Correct answers: \" + correctAns);\n $(\"#wrong-answers\").html(\"Wrong answers: \" + wrongAns);\n $(\"#skipped-questions\").html(\"Skipped questions: \" + skippedQuestions);\n \n }", "gameOver() {\r\n const overlay = document.querySelector('#overlay');\r\n const h1 = document.querySelector('#game-over-message');\r\n\r\n if (this.checkForWin() === true) {\r\n overlay.style.display = '';\r\n h1.textContent = 'WIN';\r\n overlay.className = 'win';\r\n this.resetGame();\r\n } else {\r\n overlay.style.display = '';\r\n h1.textContent = 'LOST';\r\n overlay.className = 'lose';\r\n this.resetGame();\r\n }\r\n }", "function gameOver(){\n getPlayerName();\n clearInterval(hoopIntervalId);\n clearInterval(divMoverIntervalId);\n clearInterval(gravityIntervalId);\n clearInterval(characterMoverIntervalId);\n clearInterval(hoopSpeedUpIntervalId);\n $endScore = $points.text();\n vSpeed = 0;\n $instruction.show();\n gameOngoing = false;\n resetGame();\n }", "function gameOver(){\n\t\t$(\"#previousStat\").text(\"Game Over! Refresh the page to play again!\");\n\t\t$(\"#showCorrect\").text(\"You got \" + totalCorrect + \" correct!\");\n\t\t$(\"#showIncorrect\").text(\"You got \" + totalWrong +\" incorrect.\");\n\t\t$(\"#showTimeOut\").text(\"You ran out of time \" + outOfTime + \" times.\");\n\t\t$(\".answerbtn\").hide();\n\t\t$(\"#question\").hide();\n\t\t$(\"#timer\").hide();\n\t}", "function gameOver(){\n\t\tgameArena.hide()\n\t\tscoring()\n\t}", "function gameOver() {\n // Clear the interval\n clearInterval(info.timeout);\n // Display the modal\n divs.modal_div.style.display = \"block\";\n // Update the final score element\n divs.final_score.innerText = \"Your final score is: \" + info.score;\n}", "function gameOver(){\n \tconsole.log(\"game over\");\n \t_onGameOver();\n }", "function gameOver() {\n document.getElementById('game-over').style.display = 'block';\n document.getElementById('game-over-overlay').style.display = 'block'; // Screen over the game?\n isGameOver = true;\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 }", "gameOver() {\n clearInterval(this.timeCount);\n this.soundControl.gameOver();\n document.getElementById('game-over-msg').classList.add('visible');\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 gameOver() {\n\t$(\"#gameOver\").show();\n\t$(\"#savebutton\").hide();\n\t$(\"#scoretext\").text(parseInt(pairsFound*pairsFound*pairsFound*100/(hours*60*60+minutes*60+seconds)));\n\ttimerOn = false;\n}", "function gameover() {\n if (lossCounter === 3) {\n $(\".main\").hide();\n $(\"#game-over\").show();\n }\n else if (winCounter === 3) {\n $(\".main\").hide();\n $(\"#surprise\").show();\n }\n else {}\n }", "function gameOverMC() {\r\n console.log('Game Over');\r\n setTimeout(function () {\r\n $('#gameoverMC h1').html(\"Game Over!\");\r\n $('#gameoverMC div.ui-content p').html(\"The Game Is Over. <br/> You Scored \" + score + \" Out Of \" + totalPts + \" Points!\");\r\n $(\"#gameoverMC\").popup(\"open\");\r\n }, 600);\r\n }", "gameOver() {\r\n // Supress key input at the end screen\r\n this.suppressKeyInput = true;\r\n const h1 = document.getElementById('game-over-message');\r\n const overlay = document.getElementById('overlay');\r\n overlay.style.display = 'block';\r\n if(this.missed === 5) {\r\n // Lost\r\n h1.textContent = 'Sry, you\\'ve lost the game!';\r\n overlay.className = 'lose';\r\n }\r\n else {\r\n h1.textContent = 'Well done! Game won.';\r\n overlay.className = 'win';\r\n }\r\n }", "function gameOver() {\n if (guessesRemaining < 1) {\n alert('Game Over')\n }\n }", "function displayGameover(context) {\n context.save();\n context.font = 'bold 30pt Helvetica';\n context.fillText(\"GAME OVER!!\", 125, 250);\n context.font = '20pt Helvetica';\n context.fillText(\"Click to Restart\", 165, 150);\n context.restore();\n }", "function gameOver() {\n isGameRunning = false;\n showGameOverMenu();\n setupInstructions();\n cleanBullets();\n teardownScore();\n}", "gameOver() {\n //showing the original start screen overlay\n startScreen.style.display = 'block';\n //this method displays a final 'win' or 'loss' message and updates overlay screen with CSS class\n const h1 = document.getElementById('game-over-message');\n if (this.missed < 4) {\n h1.innerHTML = 'Game over';\n startGame.classList.add('lose');\n } else {\n h1.classList.remove('lose');\n h1.innerHTML = 'Congratulations, you won!';\n startScreen.classList.add('win');\n }\n }", "gameOver() {\n const h1 = document.querySelector('h1');\n const overlay = document.querySelector('#overlay');\n if(this.missed < 5) {\n h1.innerHTML = \"You Win!\";\n } else {\n h1.innerHTML = \"You Lose!\";\n }\n overlay.style.display = '';\n reset();\n this.missed = 0;\n }", "gameOverAction() {\n\n }", "function gameOver() {\n\n\tvar score = {\n\t\t\"score\": getScore(),\n\t\t\"player\": localStorage.getItem(\"player\"),\n\t\t\"level\": 1\n\t};\n\tnetwork.postNewScore(score);\n\tglitchScreen(500);\n\tdocument.getElementById('gameOverText3').innerHTML = getScore();\n\t$('#gameOverBox').animate({top: '20%'}, 500);\n \tPause = true;\n \tPauseScreen = true;\n movement.unlockPointer();\n}", "function gameovercheck() {\n\t\tif (lives === 0) {\n\t\t\tball.y_speed = 0;\n\t\t\tball.x_speed = 0;\n\t\t\tcontext.font = \"40px Copperplate\";\n\t\t\tcontext.fillText(\"GAME OVER\", width/2 - 120, height/2 + 35);\n\t\t\tgameover = 1;\n\t\t\tdocument.getElementById(\"newgame\").style.visibility = \"visible\";\n\t\t}\n\t\telse if (brickcount === 0) {\n\t\t\tball.y_speed = 0;\n\t\t\tball.x_speed = 0;\n\t\t\tcontext.font = \"40px Copperplate\";\n\t\t\tcontext.fillText(\"YOU WIN!\", width/2 - 95, height/2 + 35);\n\t\t\tgameover = 1;\n\t\t\tdocument.getElementById(\"newgame\").style.visibility = \"visible\";\n\t\t}\n\t}", "gameOver() {\n let gameOverModal = document.querySelector('#game-over');// Get Game over modal element\n let stats = document.querySelector('#stats');// get Stats elemnt\n if (this.remainAlive < 1) {// If player loses all his lives\n this.x = -100;// move player offscreen\n allEnemies = [];// delete enemies\n gameOverModal.classList.remove('hide');// Show gmae over modal element\n //Inner stats text\n stats.innerHTML = `${gem.gemCollected} gems collected.\n Score: ${this.score}.\n Level: ${this.level}`;\n Player.score = 0;\n }\n }", "function goGameOver() {\n gameResultSpan.innerHTML = gameResult[1]\n gameOverDiv.style.display = 'flex'\n playerFinalScoreSpan.innerHTML = player['currentScore']\n scoreBoardDiv.style.display = 'none'\n playerHighScoreSpans.forEach(item => item.innerHTML = localStorage.highScore)\n finalGameTimeSpan.innerHTML = gameClock\n }", "function displayGameover() {\n\t$btnStart.innerHTML = \"RESTART\";\n\tif (modeGOT) {\n\t\t$txt.style.color = \"skyblue\";\n\t\t$txt.innerHTML = \"V. Morghulis\".toUpperCase();\n\t\t$gotOstMain.pause();\n\t\t$gotOstGameover.play();\n\t} else {\n\t\t$txt.style.color = \"red\";\n\t\t$txt.innerHTML = \"Oh non...\".toUpperCase();\n\t\t$ostMain.pause();\n\t\t$ostGameover.play();\n\t}\n}", "function checkGameOver(){\n if (announcedGameOver) {\n return;\n }\n if (game.game_over()) {\n var info, winner;\n if(game.in_stalemate()){\n info = \"Stalemate\";\n }else info = \" \";\n announcedGameOver = true;\n if(game.in_draw()){\n winner = \"Draw\";\n $('#end-info').html(info);\n $('#end-winner').html(winner);\n $( \"#end-dialog\" ).dialog('open').dialog('widget').position({\n my: 'middle',\n at: 'middle',\n of: $('#board'),\n });\n }\n if(game.in_checkmate()){\n info = \"Checkmate\";\n winner = game.turn() == 'w' ? 'Black is victorious!' : 'White is victorious!';\n $('#end-info').html(info);\n $('#end-winner').html(winner);\n $( \"#end-dialog\" ).dialog('open').dialog('widget').position({\n my: 'middle',\n at: 'middle',\n of: $('#board'),\n });\n }\n }\n }", "gameOver() {\n const overlay = document.getElementById('overlay');\n const message = document.querySelector('h1');\n document.querySelector('button').textContent = 'Play Again?';\n overlay.style.display = 'block';\n //If the player wins, show win phrase and overlay\n if (this.checkForWin()) {\n overlay.className = 'win';\n message.innerHTML = `You guessed the affirmation! </br>\n \"${this.activePhrase.phrase.toUpperCase()}.\" </br>\n Cultivate positive self talk by repeating this phrase to yourself often.`\n //If not, that means they lost and lose phrase and overlay is shown \n } else {\n overlay.className = 'lose';\n message.innerHTML = `Everything is impermanent, the affirmation floated away. </br> \n Better luck next time!`\n }\n this.resetGame();\n }", "function isGameOver() {\n if (questionsIndex >= questionsList.length) {\n $(\"#timer\").hide()\n $(\"#question\").hide()\n $(\"#msg-box\").append(\"<h1>Game Over</h1>\");\n $(\"#msg-box\").append(\"<h2>questions correct: \" + questionsCorrect + \"</h2>\");\n $(\"#msg-box\").append(\"<h2>Incorrect answer choices made: \" + questionsIncorrect + \"</h2>\");\n $(\"#msg-box\").append(\"<h2>Total POINTS: \" + totalPoints + \"</h2>\");\n stopTimer()\n clearAnswerDetail()\n }\n }", "function gameOver()\r\n{\r\n alert(\"GAME OVER!\" + \"\\n\" + \"Nombre de mouvements effectues: \" + moveCount + \"\\n\\n\" + \"Le jeu sera recommence apres la fermeture de cette fenêtre.\");\r\n restart();\r\n}", "function displayGameOver() {\r\n // get the html element corresponding to game over sign\r\n var gameoverSign = document.getElementById('gameover');\r\n gameoverSign.style.display = \"block\";\r\n}", "handleGameOverEvent() {\n \n }", "function gameOver() {\n if(matchedCard.length === fontIcons.length){\n openModal();\n //alert(`game is over you made ${moves} moves`);\n shuffle(fontIcons); //shuffle card.\n clearInterval(i);\n }\n}", "function drawGameOver() {\n\tdrawBackground();\n\tdrawBanner();\n\tif (livesRemaining === 0) {\n\t\tcolorTxt('OUT OF LIVES', canvas.width / 2, canvas.height / 2, '100px Arial', 'center', 'middle', '#fff');\n\t} else {\n\t\tcolorTxt('GAME COMPLETE', canvas.width / 2, canvas.height / 2, '100px Arial', 'center', 'middle', '#fff');\n\t}\n}", "checkForGameOver() {\n if (!this.win) {\n if (this.board.emptySpaces.length === 0) {\n this.win = false\n this.active = false\n document.getElementById(\"gameStatus\").innerHTML = `\n <h5 class=\"text-dark\">Game over! &#128528;\n <button class=\"btn btn-sm pl-3 pr-3 btn-success rounded-pill\" onclick=\"newGame();\">New Game</button></h5>\n `\n }\n }\n }", "gameOver() {\n clearInterval(this.countDown);\n $('#game-over').addClass('visible')\n }", "gameOver(){\n const overlay = document.querySelector(\"#overlay\");\n overlay.style.display = 'flex';\n const h1 = overlay.querySelector('h1');\n if(this.checkForWin()){\n overlay.className = 'win';\n //h1.style.color = 'green';\n h1.textContent = \"Congratulations! You won!\";\n }else{\n overlay.className = 'lose';\n //h1.style.color = 'red';\n h1.textContent = \"Game Over. Better luck next time.\";\n }\n this.resetGame();\n }", "function gameend(){\nvar gameover= true;\n$('.message').html('GAME OVER');\t\n}", "function showGameOver() {\n audioError.currentTime = 0;\n audioError.play();\n $(document.body).addClass('game-over');\n h3.html(`Game over at level ${pattern.length}!<br/>Select any direction to start over.`);\n pattern = [];\n}", "gameOver(gameWon) {\r\n const overlay = document.querySelector('#overlay');\r\n const overlayDiv = document.querySelector('#game-over-message');\r\n const startButton = document.querySelector('#btn__reset');\r\n const startMessage = document.querySelector('.title');\r\n if (gameWon) {\r\n overlayDiv.textContent = 'You won!!!';\r\n overlay.className = 'win';\r\n startButton.value = 'play_again';\r\n startButton.textContent = 'Play Again';\r\n startMessage.className = 'title winning';\r\n } else {\r\n overlayDiv.textContent = 'You lost :(';\r\n overlay.className = 'lose';\r\n startButton.textContent = 'Play Again';\r\n startButton.value = 'play_again';\r\n startMessage.className = 'title not_winning';\r\n }\r\n overlay.style.display = 'block';\r\n }", "function gameOver() {\n\n\t\tcanvas.clearRect(0,0,BOARD_SIZE * SQUARE_SIZE, BOARD_SIZE * SQUARE_SIZE);\n\t\tcanvas.font = \"26px Arial\";\n\t\tcanvas.textAlign = 'center';\n\t\tcanvas.fillText(\"Game Over\", 192,192);\n\t\tcanvas.font = \"17px Arial\";\n\t\t//newHighScore();\n\t\t$scope.started = false;\n\t\t$scope.paused = false;\n\t\t$scope.scoreToSave = true;\n\t\t$scope.$apply();\n\t}", "function gameOver() {\n if (matchedCards.length === icons.length) {\n stopTimer();\n showModal();\n }\n}", "function gameOver() {\n $(\"#question, #choices\").show();\n $(\"#start\").show();\n\n restarting = false;\n $(\"#question\").html(\"<h1> All done, here's how you did!</h1>\");\n $(\"#final\").show().html(\"<h2> Correct Answers: \" + correct + \"</h2>\").append(\"<h2> Incorrect Answers: \" + incorrect + \"</h2>\");\n $(\"#choices\").hide();\n $(\"#start\").html(\"<h1> Start Over? </h1>\");\n }", "function showGameOver() {\n textSize(32);\n textAlign(CENTER, CENTER);\n var gameOverText = \"GAME OVER\\n\";\n gameOverText += \"you ded.\"\n text(gameOverText, width / 2, 50);\n}", "function gameOver() {\n var EightBitter = EightBittr.ensureCorrectCaller(this),\n text = EightBitter.ObjectMaker.make(\"CustomText\", {\n \"texts\": [{\n \"text\": \"GAME OVER\"\n }]\n }),\n texts, textWidth, dx, i;\n\n EightBitter.killNPCs();\n\n EightBitter.AudioPlayer.clearAll();\n EightBitter.AudioPlayer.play(\"Game Over\");\n\n EightBitter.GroupHolder.clearArrays();\n EightBitter.StatsHolder.hideContainer();\n EightBitter.TimeHandler.cancelAllEvents();\n EightBitter.PixelDrawer.setBackground(\"black\");\n\n EightBitter.addThing(\n text,\n EightBitter.MapScreener.width / 2,\n EightBitter.MapScreener.height / 2\n );\n\n texts = text.children;\n textWidth = -(texts[texts.length - 1].right - texts[0].left) / 2;\n for (i = 0; i < texts.length; i += 1) {\n EightBitter.shiftHoriz(texts[i], textWidth);\n }\n\n EightBitter.TimeHandler.addEvent(function () {\n EightBitter.gameStart();\n EightBitter.StatsHolder.displayContainer();\n }, 420);\n\n EightBitter.ModAttacher.fireEvent(\"onGameOver\");\n }", "function gameOver(){\n $(\"#gameOverBoot\").removeClass('d-none');\n if(score == quesBank.length){\n $(\"#gameOver\").html(\"Congrats !\");\n }\n else{\n $(\"#gameOver\").html(\"Game Over !\");\n }\n scoreCard();\n calcWrongAnswers();\n calcUnanswered();\n allHide();\n restartGame();\n }", "function GameOver() {\n\t\talert(\"GAME OVER\");\n\t\tdiplomaPositions = [{x: 300, y: 0}, {x: 450, y:250}, {x:600, y:150}];\n\t\tpreGame = true;\n\t\tscore = 0;\n\t}", "function gameOver(){\n\t\tclearInterval(timeID);\n\t\tclearInterval(secondID);\n\n\t\tplayerMoney += ((grapeCount * grape.price) + (appleCount * apple.price) + (bananaCount * banana.price) + (orangeCount * orange.price));\n\t\t$(\"#playerMoney\").text(playerMoney.toFixed(2))\n\t\t$(\"#grapesOwned\").text(0);\n\t\t$(\"#applesOwned\").text(0);\n\t\t$(\"#bananasOwned\").text(0);\n\t\t$(\"#orangesOwned\").text(0);\n\t\t$(\"h4\").text(\"Game Over! You made $\" + (playerMoney - 100).toFixed(2));\n\t\t$(\".startBut\").remove();\n\t\t$(\"header\").append(\"<button class=\\\"restart\\\">Restart</button>\");\n\t\t$(\".fruitBox\").removeClass(\"grapeColor\").addClass(\"colorHighlight\");\n\t\t$(\".fruitBox\").removeClass(\"appleColor\").addClass(\"colorHighlight\");\n\t\t$(\".fruitBox\").removeClass(\"bananaColor\").addClass(\"colorHighlight\");\n\t\t$(\".fruitBox\").removeClass(\"orangeColor\").addClass(\"colorHighlight\");\n\t\t$(\"#grapeBut\").remove();\n\t\t$(\"#appleBut\").remove();\n\t\t$(\"#bananaBut\").remove();\n\t\t$(\"#orangeBut\").remove();\n\n\t\t$(\".restart\").on(\"click\", function(){\n\t\t\tlocation.reload();\n\t\t});\n\t\tgameEnd = true;\n\t}", "function gameOver() {\n stopMusic();\n loose.play();\n modal.style.display = \"block\";\n modalContent.innerHTML = `<h1 class=\"centered\">Game Over!</h1><h3 class=\"centered\">You have lost all lives and collected ${player.score} points!</h3><button class=\"restart button centered\">RESTART!</button>`;\n}", "showGameOver(e){\n $(this.$parentElem).find(\".infoField\").removeClass(\"alert-danger\");\n $(this.$parentElem).find(\".infoField\").removeClass(\"alert-warning\");\n $(this.$parentElem).find(\".infoField\").addClass(\"alert-success\");\n $(this.$parentElem).find(\".infoField\").html(\"<b>Game over!</b>Spieler Nr. \" + e.currentPlayer + \" hat gewonnen!\");\n }", "function gameOver () {\n isGameOver = true\n playArea.innerHTML = ''\n endGameScore.innerText = score.innerText\n endGameScore.style.fontSize = '300px'\n endGameScore.style.marginTop = '100px'\n endGameOverlay.style.visibility = 'visible'\n }", "function gameOver() {\n\tsaveValues();\n\tmessage = $('<div>GAME OVER</div>');\n\tmessage.css(\"position\", \"absolute\");\n\t$snake.append(message);\n\tplaceDiv(message, (WIDTH/2) - 4, HEIGHT/2);\n\n\t$snake.off(\"keydown\");\n\t$snake.keydown(function(key) {\n\t\t\tkey.preventDefault();\n\t\t\tif (key.which == 32) { //spacebar\n\t\t\t\tmessage.remove();\n\t\t\t\tpaused = false;\n\t\t\t\treset();\n\t\t\t}\n\t\t});\t\n}", "function gameOver(){\n\t\tclearInterval(interval);\n\t\tclearTimeout(timer);\n\t\t$(\"#timer\").hide();\n\t\t$(\"#answers\").hide();\n\t\t$(\"#question\").hide();\n\t\t$(\".headerSection\").hide();\n\t\t$(\"#imagesDiv\").hide();\n\t\t$(\".mainsection\").append(\"<div class = \\\"results\\\"> Questions Correct \" + answersCorrect + \"</div\");\n\t\t$(\".mainsection\").append(\"<div class = \\\"results\\\"> Questions Incorrect \" + answersWrong + \"</div\");\n\t\t$(\".mainsection\").append(\"<div class = \\\"results\\\"> Questions Blank \" + answersBlank + \"</div\");\n\t\t$(\".mainsection\").append(\"<div class = \\\"results\\\"> <button class =\\\"startOver btn btn-primary\\\"> Start Over </button> </div>\");\n\t}", "function gameOver() {\n gameActive = false\n playSound(\"wrong\")\n gameOverAnimation()\n updateLevelText(\"Game Over\")\n resetGame()\n}", "function lost(){\n pause();\n playing = false;\n lose = true;\n setHighscore();\n html('rows','Game Over')\n }", "gameOver() {\n $('#overlay').slideDown(1250);\n if (this.missed === 5) {\n $('#overlay h1').text('You lose, maybe next time!')\n $('#overlay').removeClass('win').addClass('lose');\n } else {\n $('#overlay h1').text('Congrats you win! Play another game.');\n $('#overlay').removeClass('lose').addClass('win');\n }\n $('.letter').remove();\n $('.space').remove();\n $key.removeClass('wrong').removeClass('chosen').prop('disabled', false)\n $('.tries img').remove();\n $('.tries').append('<img src=\"images/liveHeart.png\" alt=\"Heart Icon\" height=\"35\" width=\"30\"></img>');\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}", "function showGameOver() {\n\n\tdocument.getElementById(\"gameOver\").style.display = \"inline\";\n\tdocument.getElementById(\"gameOverBtn\").addEventListener(\"click\", restartGame, true);\n\n\tvar timeLeft = $(\"#clock\").html();\n\n\t$(\"#timer\").css(\"visibility\",\"hidden\");\n\t\t$(\"#gameOver .scoreAlert\").html(\"Time: \" + timeLeft + \"<br>Score: 0\");\n\n\tendGame();\n}", "function gameOver() {\n $(\"#question\").hide();\n $(\"#timer\").hide();\n $(\"#results\").hide();\n $(\"#choices\").hide();\n $(\"#gameOver\").show();\n $(\"#gif\").html(\"<img src=assets/images/giphy-8.gif>\");\n //Show score\n $(\"#right\").text(\"Correct: \" + right);\n $(\"#wrong\").text(\"Inorrect: \" + wrong);\n}", "function gameOverPopup(){\n var modalGameOver = document.getElementById('modalGameOver');\n var rePlay = document.getElementById(\"replayBtn\");\n var img = document.querySelectorAll(\"img\")[0];\n\n modalGameOver.style.display = \"block\";\n $(\"#score\").html(\"Final score: \" + finalScore);\n // When the user clicks button replay, close it\n rePlay.onclick = function() {\n window.location.assign(\"../start.html\");\n }\n }", "function gameOver() {\n\tdocument.getElementById(\"wrapper\").style.display = \"none\"; //hide the game screen\n\tdocument.getElementById(\"endScreen\").style.display = \"block\";//show the end screen\n\t// then determine whether the player won or not and display the result\n\tif (humanScore > computerScore){\n\t\tdocument.getElementById(\"endResult\").textContent = \"You won!\";\n\t}\n\telse if (humanScore < computerScore) {\n\t\tdocument.getElementById(\"endResult\").textContent = \"You lost!\";\n\t}\n\telse {\n\t\tdocument.getElementById(\"endResult\").textContent = \"You tied! Lame.\";\n\t}\n}", "gameOver() {\n clearInterval(this.countdown);\n this.audioController.gameOver();\n document.getElementById('game-over-text').classList.add('visible');\n }", "gameOver(){\r\n overlay.style.display = \"initial\";\r\n if(this.checkForWin() === true){\r\n overlay.classList.remove(\"lose\");\r\n overlay.classList.add(\"win\");\r\n gameMsg.innerHTML = `Good job <em>PHRASE HUNTER</em>, you guessed the phrase with ${this.missed} characters missed!`;\r\n } else if(this.missed === 5) {\r\n overlay.classList.remove(\"win\");\r\n overlay.classList.add(\"lose\");\r\n gameMsg.innerHTML = `Mission failed, the phrase has injected itself into the system, press start game to try again.`\r\n }\r\n this.missed = 0;\r\n }", "gameover() {\n AM.play(\"gameover\");\n alert(\"game over!\" + this.score);\n this.reset();\n }", "gameOver(){\n $('.keyrow button').removeClass('phraseLetters')\n $('.keyrow button').removeClass('correct')\n $('#overlay').removeClass('win')\n $('#overlay').addClass('lose').show();\n $('#game-over-message').text('You Lose').show();\n $('#btn__reset').text('try again?');\n $('.key').attr('disabled',false);\n $('.key').css(\"background-color\", \"#e5e5e5\");\n $('.hide').remove();\n $('ol').append(`<li class=\"tries\"><img src=\"images/liveHeart.png\" height=\"35px\" widght=\"30px\"></li>`);\n $('ol').append(`<li class=\"tries\"><img src=\"images/liveHeart.png\" height=\"35px\" widght=\"30px\"></li>`)\n $('ol').append(`<li class=\"tries\"><img src=\"images/liveHeart.png\" height=\"35px\" widght=\"30px\"></li>`)\n $('ol').append(`<li class=\"tries\"><img src=\"images/liveHeart.png\" height=\"35px\" widght=\"30px\"></li>`)\n $('ol').append(`<li class=\"tries\"><img src=\"images/liveHeart.png\" height=\"35px\" widght=\"30px\"></li>`)\n }", "function winMC() {\r\n console.log('You Win');\r\n \r\n setTimeout(function () {\r\n $('#gameoverMC h1').html(\"You Win!\");\r\n $('#gameoverMC div.ui-content p').html(\"Congratulations You Win! <br/> You Scored \" + score + \" Out Of \" + totalPts + \" Points!\");\r\n $(\"#gameoverMC\").popup(\"open\");\r\n }, 600);\r\n }", "gameOver(gameWon) {\n const overlay = document.getElementById('overlay');\n const gameOverMessage = document.getElementById(\"game-over-message\");\n if (gameWon === false) {\n gameOverMessage.textContent = 'Sorry, better luck next time!';\n overlay.className = \"lose\";\n overlay.style.display = '';\n } else if (gameWon === true) {\n gameOverMessage.textContent = 'Great job!';\n overlay.className = \"win\";\n overlay.style.display = '';\n }\n }", "function gameOver() {\n\t\tif (typeof flagsPlacedTimer != 'undefined') {\n\t\t\tclearInterval(flagsPlacedTimer);\n\t\t};\n\t\tif (typeof gameTimer != 'undefined') {\n\t\t\tclearInterval(gameTimer);\n\t\t};\n\t\tvar homePage = require('ui/common/homePage')\n\t\tvar homePageScreen = new homePage();\n\t\thomePageScreen.open();\n\t\tinstance.close();\n\t}", "function gameOverMessage(win) {\n if (win) {\n $(\"#instructions-1\").html(\"You are Win!!!! May the force be with you\");\n } else {\n $(\"#instructions-1\").html(\"You are dead - Game Over\");\n }\n $(\"#instructions-2\").html(\"\");\n $(\"#instructions-3\").html(\"\");\n $(\"#section-2\").html(\"\");\n $(\"#section-3\").html(\"\");\n $(\"#game-info\").html(\"\");\n\n isGameActive = false;\n\n}", "gameOverCheck() {\n \tif (this.model.checkIfGameOver() === true) {\n\t\t\tthis.view.gameEndedAlert();\n\t\t\tthis.model.findTotals();\n\t\t\tthis.view.writeTotals(this.model);\n \t}\n }", "function gameOver() {\n if (guessesRemaining < 1) {\n alert('Game Over')\n }\n}", "function showGameOverDialog() {\n console.log(\"game Over\");\n $(\"#gameOver\").show();\n var z = document.getElementById('reset1');\n z.addEventListener('click',reset);\n }", "function isGameOver() {\n //game is over if the player has 6 wrong guesses\n if (wrongGuesses === 6) {\n //display game over\n $(\"#gameOver\").text(\"You Lost! Maggie will be lost in space!\").css(\"color\", \"red\").show();\n $(\"#hangman\").hide();\n }\n //game is over if the player has guessed the word\n if (dashes.join(\"\") === randomWordArray.join(\"\")) {\n //display you won, yay\n $(\"#gameOver\").text(\"You guessed it! Maggie can get back to her ship now!\").css(\"color\", \"blue\").show();\n $(\"#hangman\").hide();\n }\n }", "function gameOver() {\n\tctx.fillStlye = \"white\";\n\tctx.font = \"20px Arial, sans-serif\";\n\tctx.textAlign = \"center\";\n\tctx.textBaseline = \"middle\";\n\n\tvar playerWinner = (score_jugadores[0] > score_jugadores[1])?\"P1\":\"P2\";\n\tplayerWinner += \" wins!!!\";\n\tvar messageGame = \"\";\n\tif(usuario_id === -1)\n\t\tmessageGame = playerWinner;\n\telse\n\t\tmessageGame = playerWinner +\" - Game Over - You scored \"+score_jugadores[usuario_id -1]+\" points!\"\n\tctx.fillText( messageGame , W/2, H/2 + 25 );\n\t\n\t// Stop the Animation\n\t\t\n\tvar playPromise = perder.play();\n\n\t if (playPromise !== undefined) {\n\t playPromise.then(_ => {\n\t perder.pause();\n\t })\n\t .catch(error => {\n\t // Auto-play was prevented\n\t // Show paused UI.\n\t console.log(\"Error...\");\n\t });\n\t }\n\tcancelRequestAnimFrame(init);\n\t\n\n\t// Set the over flag\n\tover = 1;\n\t\n\t// Show the restart button\n\tif(usuario_id !== -1)\n\t\trestartBtn.draw();\n}", "function showGameOver() {\n isGameOver = true;\n clearInterval( updateInterval );\n gameOverText.position.x = ( window.innerWidth - gameOverText.width ) / 2;\n gameOverText.position.y = ( window.innerHeight - gameOverText.height ) / 2;\n gameOverText.visible = true;\n renderer.render( stage );\n direction = \"right\";\n}", "function gameOver() {\r\n disableActions();\r\n }", "function gameOver() {\n clearInterval(timer);\n getTimeClock();\n setTimeout(function () {\n $(\"#winModal\").toggleClass(\"hidden animated bounceIn\");\n }, 500);\n }", "function showGameOver() {\n gameSound.pause();\n textSize(60);\n textAlign(CENTER,CENTER);\n fill(243,231,45);\n var gameOverText = \"GAME OVER\\n\";\n gameOverText += \"You caught \" + snitchEaten + \" snitch\\n\";\n gameOverText += \"before you died.\"\n text(gameOverText,width/2,height/2);\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 gameOver() {\n ctx.fillStyle = \"brown\";\n ctx.font = \"28px Helvetica\";\n ctx.fillText(\"Game Over\", 170, 300);\n ctx.fillText('Click \"Restart\" to restart the game', 40, 350);\n }", "function gameOver() {\n\tctx.fillStlye = \"white\";\n\tctx.font = \"20px Arial, sans-serif\";\n\tctx.textAlign = \"center\";\n\tctx.textBaseline = \"middle\";\n\tctx.fillText(\"Game Over - You scored \"+points+\" points!\", W/2, H/2 + 25 );\n\t\n\t// Stop the Animation\n\twindow.cancelAnimationFrame(init);\n\t\n\t// Set the over flag\n\tover = 1;\n\t\n\t// Show the restart button\n\trestartBtn.draw();\n}", "function GameOver()\n{\n StreakManager();\n SwitchWinnerPhoto();\n player_performance--;\n gamesLost++;\n gameResultContainer.style.display = \"block\";\n _playAgain.style.display = \"flex\";\n _gameResult.textContent = \"YOU LOSE!\";\n _gameResult.classList.add(\"opponent\");\n _gameEndMessage.textContent = \"Mission failed! We'll get him next time.\" \n}", "function gameover() {\n home();\n }", "function gameOver(){\n round = 1;\n numberOfCards = 4;\n numberOfcolours = 2;\n $(\"#commandText\").text(\"Game Over!\");\n var msg = {\n \"messageType\": \"SCORE\",\n \"score\": parseFloat($(\"#points\").text())\n };\n points = 0;\n window.parent.postMessage(msg, \"*\");\n }", "function gameOver() {\n alert(\"You, good sir, have lost.\");\n $(\"body\").innerHTML = updateGameOverMessage(tracker);\n}", "function displayLost() {\n\tif (!modeGOT) {\n\t\t$txt.style.color = \"orange\";\n\t\t$txt.innerHTML = \"Essaie encore\".toUpperCase();\n\t\t$ostMain.pause();\n\t\t$ostGameover.play();\n\t}\n}", "function isGameOver(){\n sounds.explosion.cloneNode().play();\n if(lives <= 0){\n triggerModal(overWindow);\n }\n else{\n lives--;\n livesElem.innerText = lives;\n document.querySelector('.footer-left').querySelector('.spaceship').remove()\n }\n}", "function winGame() {\n // show screens\n $(\"#gameScreen1\").hide();\n $(\"#store\").hide();\n $(\"#upgrade\").hide();\n $(\"#gameScreen2\").show();\n\n $(\"#numSquareGeneratorsOwned1\").text(squares.amountOwned - 1 + \" x\");\n $(\"#numCircleGeneratorsOwned1\").text(circles.amountOwned - 1 + \" x\");\n $(\"#numTriangleGeneratorsOwned1\").text(triangles.amountOwned - 1 + \" x\");\n $(\"#numDiamondGeneratorsOwned1\").text(diamonds.amountOwned - 1 + \" x\");\n $(\"#finalTimeValue\").text(timeElapsed);\n }", "function gameOver() {\n document.querySelector('.game-over-score').textContent = score;\n document.querySelector('.game-over').classList.remove('hide');\n document.querySelector('.overlay').classList.remove('hide');\n }", "function showGameOver() {\n push();\n textSize(32);\n textAlign(CENTER, CENTER);\n fill(255);\n\n let gameOverText = \"GAME OVER\\n\";\n gameOverText = gameOverText + \"Your lust gave way \" + otherGenderEaten + \" times for Eve\\n\";\n gameOverText = gameOverText + \"before you died.\"\n\n text(gameOverText, width / 2, height / 2);\n pop();\n}", "function gameOver() {\n\n // Pause the player's movements as they are no longer in the game\n freezePlayer();\n\n // Inform other code modules in this application that the game is over\n Frogger.observer.publish(\"game-over\");\n }", "function gameOver() {\n\t\tcontext.fillStyle = \"#F9C328\";\n\t\tcontext.textAlign=\"center\";\n\t\tcontext.shadowOffsetX = quantum/5\n\t\tcontext.shadowOffsetY = quantum/5\n\t\tcontext.shadowColor = \"black\"\n\t\tcontext.shadowBlur = quantum/5\n\t\tcontext.font = 2*quantum + \"px Bangers, cursive\";\n\t\tcontext.fillText(\"You scored \" + pacmans[0].score + \" points.\",context.canvas.width/2,context.canvas.height/2 + 2.5*quantum);\n\t\tcontext.font = \"bold \" + 3.5*quantum + \"px Bangers, cursive\";\n\t\tcontext.fillText(\"GAME OVER \",context.canvas.width/2, context.canvas.height/2 - 3*quantum);\n\t}" ]
[ "0.82198364", "0.816292", "0.80010164", "0.7988407", "0.78447586", "0.78089464", "0.7792189", "0.77468866", "0.7729106", "0.76778334", "0.7653985", "0.7651026", "0.76345164", "0.7621238", "0.7610905", "0.7604168", "0.7603355", "0.75707686", "0.75689733", "0.7557001", "0.7549755", "0.7546959", "0.7536575", "0.7523978", "0.75200486", "0.7495908", "0.74947095", "0.74908", "0.74893165", "0.74686205", "0.7453476", "0.74393034", "0.74342525", "0.741387", "0.74100137", "0.74096954", "0.7376087", "0.73672426", "0.73598886", "0.73458767", "0.73261535", "0.7323609", "0.73196995", "0.73147875", "0.73138297", "0.7309533", "0.7307658", "0.73000556", "0.72992474", "0.72965574", "0.7295574", "0.7294209", "0.72859997", "0.72777426", "0.7277224", "0.7273539", "0.7270918", "0.7261886", "0.72584134", "0.7248911", "0.72488594", "0.7243592", "0.72374296", "0.72373223", "0.72352624", "0.72337806", "0.72269166", "0.72242707", "0.7220906", "0.7218214", "0.7207374", "0.72054005", "0.71935916", "0.7190955", "0.7190814", "0.7188171", "0.7188149", "0.7185449", "0.71784997", "0.7172707", "0.7170515", "0.71694237", "0.71630263", "0.7153606", "0.71529716", "0.7152117", "0.7146729", "0.7141989", "0.7135379", "0.7134901", "0.71320987", "0.7131218", "0.7129493", "0.7126492", "0.7126151", "0.71122473", "0.7104863", "0.7103992", "0.7103535", "0.70908564", "0.7086328" ]
0.0
-1
stateless component: received data as props and presents that data, sometimes as a list every class must have a render function it's recommended that you start with a functional based component and only refactor to a class when you need some added functionality
function SearchResults (props) { return axios.get('api/events', { params: { title: props.value//TODO: grab event's whose titles have the word passed in as any of the words in the title } }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n const { name, code } = this.props\n return (\n <div>\n <h1>This is a Class Components</h1>\n <p>I am {name}, and I love {code}</p>\n </div>\n )\n }", "render() {\n // in class components as in function component we can access props\n //const { name } = this.props;\n return <p> This is a class component</p>\n }", "render() {\n console.log('--Rendering First List--');\n const name = 'First list';\n const listItems = render(ListItem, this.props.listClass, name);\n return (\n <div className=\"list\">\n <h2>{name}</h2>\n { listItems }\n </div>\n );\n }", "function ProjectDescriptionDisplayComponent({data}){\n return(\n <React.Fragment>\n <p>\n {data}\n </p>\n </React.Fragment>\n )\n}", "function MyComponentClass (props) {\n return <h1>{props.title}</h1>;\n}", "function passData(WrappedComponent, fetchData) {\n return class extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n data: {}\n };\n }\n\n componentDidMount() {\n fetchData({url: 'http://localhost:3000/list'}).then((resp) => {\n this.setState((prevState) => ({\n data: resp\n }))\n })\n }\n\n render() {\n return(\n <WrappedComponent data={this.state.data} {...this.props}/>\n )\n }\n }\n}", "render() {\n\n // should mandatorily return JSX\n return (\n <div>\n <h2>Program List | Props Demo</h2>\n\n <Program \n name='Man Vs Wild'\n category='Infotainment'\n time='9 PM'>Wild Adventure Program on Discovery Channel</Program>\n\n <Program \n name='Planet Earth'\n category='Infotainment'\n time='8 PM'>A Programme by David Attenborough on BBC Earth</Program>\n\n <Program\n name='IPL 2021'\n category='Sports'\n time='7 PM'>Enjoy IPL 2021 - in Star Sports</Program>\n\n </div>\n );\n }", "function MyComponent() {\n return (\n <div>\n <p>This is my functional component.</p>\n </div>\n );\n}", "render() {\n\n //in the class we can declare javascript constants, variables and lets. This iterates over the array and returns each element to the page\n const dataList = this.props.datas.map( data => {\n return(\n <div key={data.id}>\n <div onClick={() => this.onDataSelect(data)}>{data.name}</div>\n </div>\n );\n });\n\n return (\n\n <div>\n {/* returning the const we declared above */}\n <div className=\"firstComponentList\">{dataList}</div>\n\n {/* External component that we imported */}\n <SecondComponent data={this.state.selectedData} />\n </div>\n )\n\n }", "function Data() {\n\n return (\n <div>\n \n </div>\n )\n}", "function ListItem(props) {\n //must return JSX\n return (\n <li className=\"list-item\">\n <p>{props.itemName}</p>\n <div>\n <button>Done</button>\n <button>Not Done</button>\n </div>\n </li>\n );\n}", "function MyList(){\r\n \r\n const list = productData.map(item => {\r\n return <Product name={item.name} price={item.price} description={item.description} />\r\n })\r\n\r\n return (\r\n <div>\r\n <p> This is a test </p>\r\n <hr/>\r\n <p>{list}</p>\r\n <hr/>\r\n </div>\r\n )\r\n\r\n}", "render(){\n \n return (\n <ul>\n {this.props.list} \n </ul>\n );\n }", "function TodoHome() {\n return (\n <div>\n <List />\n </div>\n );\n}", "function MyComponentClass (props) {\n\tvar title = props.title;\n return <h1>{title}</h1>;\n}", "function ProjectList(props) {\n // inside the function code to do all sorts of logical steps\n\n // return output for the component \n return <div className=\"holder\">\n <h1>{props.message1}</h1>\n <h2>{props.message2}</h2>\n <ol>\n {\n // use map() method to loop array of data\n props.list.map(\n (item,index) => (\n <li key={index}>\n <strong>{item.title}</strong><br /> <em>{item.description}</em>\n <br />\n <img src={item.imagepath} alt={item.title} width=\"480\" height=\"300\" /><br /><br />\n </li>\n )\n )\n }\n </ol>\n </div>;\n}", "render() { \n return (\n <div className=\"shopping-list\">\n <h1>Shopping List for {this.props.name}</h1>\n <ul>\n <li>Instagram</li>\n <li>WhatsApp</li>\n <li>Oculus</li>\n </ul>\n </div>\n );\n }", "function Stateles() {\n return <p>Functional Components</p>;\n}", "render() { \n return ( \n <div>\n<h1>Componente de tipo Clase</h1>\n\n{/* Accedemos al estado \"texto\" del objeto state */}\n<h2 style={{color:this.props.colorText}}>{this.state.texto}</h2>\n<h3>Hola, {this.props.name}</h3>\n<ExampleProps nombre={this.props.name}/>\n</div>\n );\n }", "function FatherComponent({ render }) {\n const [list, setList] = React.useState(['hola mundo', 'hola mir']);\n return render({ list });\n}", "render() {\n // this.props is the object with the info being sent to the component\n console.log(this.props);\n\n // <User firstName=\"Pablo\" />\n // ↓↓↓↓↓↓↓↓↓↓↓↓\n // this.props = { firstName: \"Pablo\" }\n\n const { firstName, lastName, email, photo } = this.props;\n\n // render() returns the HTML of this component's content\n // (use parenthesis when returning multiple lines of HTML)\n return (\n // use \"className\" instead of \"class\" for styling your HTML\n <div className=\"User\">\n <p>\n Welcome, {firstName} {lastName}! This is your email: {email}.\n </p>\n {/* call a function in {} to display its result */}\n {displayAvatar(photo)}\n </div>\n );\n }", "render() {\n return <ComposedComponent {...this.props} />\n }", "render() {\n return <ComposedComponent {...this.props}/>\n }", "function FunctionalComponentSyntax(props) {\n return <div>Hello World!</div>;\n}", "render() {\n return (\n <div>\n <h1>{this.props.title}</h1>\n <p>{this.props.description}</p>\n </div>\n )\n }", "function App() {\n return (\n <div>\n <FruitList />\n </div>\n )\n}", "render() {\n //Returns JSX { }\n return (\n <div>\n {/* //State comes from the class State */}\n <h3>{ this.state.title }</h3>\n <p>{ this.state.body }</p>\n </div>\n )\n }", "function App() {\n return (\n <div>\n <List />\n </div>\n );\n}", "render(){\n\n // How do we know courses will always be props? Anyway, it keeps things shorter\n const {courses} = this.props;\n\n // This becomes quite clean\n return(\n <div>\n <h1>Courses</h1>\n <CourseList courses={courses}/>\n </div>\n );\n }", "render() {\n return <ComponentToBeRendered {...this.props} />;\n }", "function Item(props) {\r\n let test = {\r\n example: \"object contents\"\r\n };\r\n console.log(test.example);\r\n\r\n // below are console logs showing your CUSTOM props!\r\n // to get things \"out\" of props, use \"dot notation\"\r\n // price lives INSIDE of props\r\n console.log(props.price);\r\n // product lives INSIDE of props\r\n console.log(props.product);\r\n\r\n // React will give you a param named \"props\" which is an object\r\n // THIS IS A REACT *FUNCTION* COMPONENT\r\n /*\r\n everything is trapped in the func,\r\n until you return it to whoever called it\r\n */\r\n return (\r\n // whatever we \"return\" will be what \"renders\" on the screen\r\n <div className=\"tile\">\r\n {/* prod ADD the product name here :-) */}\r\n <div className=\"pricebox\">{props.price}</div>\r\n </div>\r\n );\r\n}", "render() {\n return (\n <div>\n <ProductListComponent/>\n </div>\n )\n }", "constructor(props) {\n super(props);\n\n this.inputTitle = () => <input \n type = \"text\"\n name = \"title\"\n placeholder = \"Work title...\"\n value = {this.props.fields.title} \n onChange = {this.props.inputChange}\n disabled = {!this.props.editable}\n />\n\n this.searchResults = () => <ul className=\"search-results\">\n {this.props.searchResults.map((x, i) => \n <li onClick = {() => this.props.okReadClick(x.id)}>\n {x.title}\n </li>\n )}\n </ul>\n\n this.questionsList = () => <RunQuestionsList\n mode = {this.props.mode}\n questions = {this.props.fields.questions}\n changeAnswer = {this.props.changeAnswer}\n editable = {this.props.editable}\n />\n }", "function GreeterFunc(props) {\n // render function is replaced with just return\n return (\n <div>\n {/* Props are used in the return statement without the 'this' keyword */}\n <h2>Hello, {props.name}!</h2>\n </div>\n );\n}", "render() {\n \n // of course, there is no props\n // need to have this.props\n return <PassedComponent {...this.props}/>\n }", "function Card(props) {\n// The Card component receives the props argument. \n// React will pass one argument to your component function => An object, which contains all properties you set up on <Card ... /> .\n return (\n <div>\n <h2>{props.name}</h2>\n <img src={props.image} alt=\"\" />\n <p>{props.tel}</p>\n <p>{props.mail}</p>\n </div>\n );\n}", "render() {\n //Map creates contacts into a new object using the function(contact)\n const contactList = this.state.contacts.map(function(contact){\n //Creates a new instance of Contact the function\n return <Contact\n fname={contact.fname}\n lname={contact.lname}\n pnumber={contact.pnumber}\n status={contact.status}\n />\n });\n //this is what you want to return from the render function\n return(\n <div>\n <Greet fname=\"Victoria\" lname=\"Echevarria\" pnumber=\"704-555-1234\"/>\n {contactList}\n </div>\n );\n }", "render() {\n return(\n <>\n {/* ^^ Esta sintaxis es equivalente a <React.Fragment></React.Fragment> */}\n {/* Cada componente devuelve 1 bloque */}\n <Header>GO FOR IT!</Header>\n {/* Se podría exportar este button a un compoente externo? Por qué? Es reutilizable? */}\n <button onClick={this.createList.bind(this)} className=\"tdl-add_list_button\">Create new list</button>\n {/* Recuerdas por qué se linka este this.createList? porque le pasamos el this */}\n <section className=\"tdl-main-section\">\n {/* Renderizando listas gracias al método map */}\n {this.state.lists.map((list, idx, lists) => (\n <List\n key={idx}\n newListName={() => this.newListName(idx)}\n submitName={this.submitName}\n changeListName={() => this.changeListName(idx)}\n >\n {/* Todos los elementos que devuelve el map TIENEN que tener un key prop que usa React por motivos de performance */}\n {/* Esta instancia de List tiene como props distintos métodos, los cuales linkan this de distintas formas */}\n {list}\n </List>\n ))}\n </section>\n </>\n )}", "render() {\n return(\n <>\n {/* ^^ Esta sintaxis es equivalente a <React.Fragment></React.Fragment> */}\n {/* Cada componente devuelve 1 bloque */}\n <Header>GO FOR IT!</Header>\n {/* Se podría exportar este button a un compoente externo? Por qué? Es reutilizable? */}\n <button onClick={this.createList.bind(this)} className=\"tdl-add_list_button\">Create new list</button>\n {/* Recuerdas por qué se linka este this.createList? porque le pasamos el this */}\n <section className=\"tdl-main-section\">\n {/* Renderizando listas gracias al método map */}\n {this.state.lists.map((list, idx, lists) => (\n <List\n key={idx}\n newListName={() => this.newListName(idx)}\n submitName={this.submitName}\n changeListName={() => this.changeListName(idx)}\n >\n {/* Todos los elementos que devuelve el map TIENEN que tener un key prop que usa React por motivos de performance */}\n {/* Esta instancia de List tiene como props distintos métodos, los cuales linkan this de distintas formas */}\n {list}\n </List>\n ))}\n </section>\n </>\n )}", "constructor(props) {\n super(props)\n this.state = {\n // declare list\n data: []\n\n }\n }", "render() {\r\n // console.log('-=-=-=-=-=-=-=-=', this.state); a test\r\n return(\r\n <div>\r\n {/* Now here, is where we have to show all the Albumlists on the page, this happens in the render function. Logic is above in functions, 1st half or so of component, and then in render is when what the visual will end up becoming depending on the rules of state and the above logic. */}\r\n <h1>Albumlist Index</h1>\r\n\r\n <div className=\"list-of-albumlists-container\">\r\n {this.showAllAlbumlists()}\r\n </div>\r\n \r\n <div className=\"add-new-component-container\">\r\n <NewAlbumlist letTheIndexComponentKnowThatWeAddedAlbumlist = {this.fetchAlbumlists} />\r\n {/* we pass in this function in the AlbumlistIndex Component, so after we add a new Albumlist in the NewAlbumlist Component, the NewP Component, will be able to tell the AlbumlistIndex Component to check for any new Albumlists that we're added since the last render of AlbumlistIndex.*/}\r\n </div>\r\n \r\n \r\n \r\n \r\n </div>\r\n )\r\n }", "function Test() {\n return <div>\n <h1> React Tutorial</h1>\n Hello <strong>World!</strong>\n <div>Unordered List of Web Technologies</div>\n <ul className='web_list'>\n <li><a href=\"/\">Tutorial</a></li>\n <li><a href=\"/state\">State</a></li>\n <li><a href=\"/api\">Querying APIs</a></li>\n </ul>\n Adding 5 + 10: {5+10}\n</div>;\n}", "render (){ // dummy component: solo renderiza cosas en el DOM basado en props\n return (\n <div>\n The price of BTC in {this.props.description} right now is: { this.props.rate } {this.props.code}\n </div>\n );\n }", "function ListOfItems (props) {\n\n let listItems=[];\n\n for (let i=0; i<props.data.length; i++){\n listItems.push(<li key={i}>{props.data[i]}</li>)\n //listItems.push(<li>{props.data[i]}</li>)\n }\n return (\n <ul> {listItems} </ul>\t\n );\n}", "render() {\n // -- Mark 1 -- continued\n // lecture 20: Class Components \n // the render method returns any html we want and let's return the html we had before\n // inside our function and we see that the webpage looks exactly the same as before when\n // we were using a function to return html\n\n // by using a class component we get access to this thing called state and state is a js\n // object with properties that we can access at anytime inside our class and the way we\n // would do this is by calling the constructor keyword and inside constructor we want to\n // call super() and super calls the constructor method on the Component class and this\n // gives us access to this.state and we can set it to something ( see above ) and now we\n // can render that string down below by typing \" { this.state.string } \" and jsx tells html\n // that anything between the curly braces will be JavaScript and we use \n // \" { this.state.string } \" in multiple places which is great\n\n // if we wanted to change the state, Component gives us a method called setState and\n // setState let's us modify our state object and we also have access to a property called\n // onClick that takes a function that gets called whenever the corresponding element gets\n // clicked or in our case whenever the button is clicked and will use the setState method\n // below to change the state and that is great because it gives us a lot of control over\n // what our components will display\n // End of -- Mark 1 --\n\n // -- Mark 2 -- continued\n // lecture 22: Dynamic Content\n // remove all the jsx between the div with the className of App and replace it as follows:\n\n // -- Mark 4 --\n // lecture 28: Card List Component\n // place the CardList component below and the props parameter in CardList will be equal to\n // an object that contains the key value pairs that we pass into CardList so if we say\n // \" name = James \" inside our CardList component below, we will see the following in \n // console ( remember in CardList we consoled out props or did console.log( props ); ):\n /*\n {name: \"James\"}\n {name: \"James\"}\n */\n\n // and one of the main properties that exist on the props object is called children and\n // children are what you pass in between a component or in between\n // <CardList></CardList> so if we say <CardList>Mike</CardList> then the children prop\n // will be \" Mike \" so try this below and the go to -- card-list.component.jsx -- and change\n // \" return <div>Hello</div> \" to \" return <div>{ props.children }</div> \" and the result\n // will be shown on the webpage as:\n /*\n Mike\n */\n\n // and we also have access to props in our App component and now let's focus on our css\n // file and go to -- card-list.styles.css -- and now were back from\n // -- card-list.styles.css -- and let's move </CardList> down so that it now includes the\n // monsters array and take out \" Mike \" so now props.children in the CardList component\n // will include all the monsters and they will be laid out in an equal grid per our style\n // sheet or card-list.styles.css\n\n // so this is a fundalmental principal of react, we are building components that only care\n // about one thing and our CardList component only cares about displaying cards and in the\n // next lesson we will take this ideas a step further and apply it to an individual card\n // component\n // End of -- Mark 4 --\n\n // -- Mark 5 --\n // lecture 29: Card Component\n // first, delete \" name = 'James' \" in <CardList> and then pass in a prop we can use in the\n // CardList component and that prop along with the corresponding value will be\n // \" monsters={ this.state.monsters } \" and we move\n // \" this.state.monsters.map( ( monster ) => <h1 key={ monster.id }>{ monster.name }</h1> ) \"\n // into the CardList component and go to the CardList component -- Mark 1 --\n // End of -- Mark 5 --\n\n // -- Mark 6 --\n // lecture 32: SearchField State\n // add an input element below and make the type equal to \" search \" and then give the\n // element a placeholder attribute equal to \" search monsters \" so now what we need to do\n // is be able to take the typed input string and store the string into our state object and\n // by storing the string in state we are able to use it to filter out our monsters so first\n // we need to figure out how to store the string in our state object and let's add a key\n // value pair to our state object and call the key \" searchField \" and leave the value\n // equal to an empty string for now and let's add an onChange event handler to our input\n // element and then use setState to change our searchField value within our state object \n // to equal whatever value the user types into the input element\n\n // asynchrosnous versus synchronous is a big thing in JavaScript development right now and\n // a big thing in reach as well and sychronous action is something we can expect to happen\n // almost immediately and with sychronous events JavaScript will wait until that action has\n // completed before moving to the rest of the code but with an asynchronous action or event\n // is something that takes an indefinite amount of time and JavaScript does not know how\n // long it will take to complete the asynchronous action or event so what happens is\n // that JavaScript will continue running the rest of the code and then when the ayschronous\n // event finishes then JavaScript will run that asynchronous event so the main takeaway\n // here is that setState is not happening immediately or when we would expect it to and\n // therefore setState is always one character behind where it should be in this particular\n // instance so the solution to this predicament is to use a second argument to setState\n // which will be an arrow function and this function will run after setState has updated\n // the searchField state\n\n // remember, if we want to see or do something with our state right after we set it then\n // we have to do it inside the second argument to the setState() call and this second\n // argument function will get called right after the first argument function has completed\n // in setState and now onChange looks like the following:\n /*\n onChange =\n { \n ( e ) => {\n this.setState( \n { searchField : e.target.value },\n () => console.log( this.state ) \n )\n } \n }\n */\n\n // now that we have our searchField being stored let's filter out our monsters but first\n // let's remove our second argument to setState or \" () => console.log( this.state ) \"\n // and onto the next video\n // End of -- Mark 6 --\n\n // -- Mark 7 --\n // lecture 34: Filtering State\n // remember, we don't want to modify our state's monster array in case we need it later\n // or somewhere else in this component so what we'll do is make a new array using the\n // filter method but first let's destructure the state object and what destructuring allows\n // us to do is pull properties off an object and set these properties equal to constants\n // and we put these properties inside the curly braces and set it equal to the object we\n // want to destructure from and when use the following syntax:\n // \" const { monsters, searchField } = this.state; \" we are saying that we want to pull\n // the monsters and searchField values off of the state object and setting them as\n // constants called monsters and searchField and this is equal to:\n // const monsters = this.state.monsters; and\n // const searchField = this.state.searchField;\n\n // now let's set a new const called filteredMonster and set it equal to\n // \" monsters.filter( ( monster ) => monster.name.toLowerCase().includes(\n // searchField.toLowerCase() ) ); \" and the\n // includes method checks to see whether the string value we pass to includes is found\n // in monster.name.toLowerCase() and if that is true then that monster will be added to the\n // new filters array and if false then that monster will not be added to the new filters\n // array and instead of using \" { this.state.monsters } \" in our CardList component we will\n // use filteredMonsters instead or \"<CardList monsters={ filteredMonsters } />\" and\n // filteredMonsters is just a new monsters array that has been filtered and remember that\n // whenever setState is called because our searchField property has changed then react will\n // rerender our component and when the component rerenders then filteredMonsters is called\n // again creating a new array and this new array is feed into the CardList component which\n // will then rerender our CardList component which will then rerender our Card component\n // and this is what is great about react because react is able to take control over what\n // to render and rerender in our application without us having to do a bunch of extensive\n // calls to show elements, hide elements, etc.\n\n const { monsters, searchField } = this.state;\n const filteredMonsters = monsters.filter( ( monster ) => {\n\n return monster.name.toLowerCase().includes( searchField.toLowerCase() )\n\n } );\n // End of -- Mark 7 --\n\n // -- Mark 8 --\n // lecture 36: Search Box Component\n // change the input element below into <SearchBox ... />\n // now go the website and test it and we see that our funtionality is working fine but\n // now we have a reuseable component ( i.e. SearchBox ) that we can use in multiple places\n // and this is what is great about react is this component style of writing code so our\n // SearchBox component is a presentational component that styles an input field within our\n // app and it takes in any funtionality it might need by using the handleChange property\n // that is being passed down to the SeachBox component from App.js or the App component\n // so again one of the huge advantages to using react is this idea of writing these smaller\n // and smaller reusable components\n // End of -- Mark 8 --\n\n // -- Mark 10 --\n // lecture 43: Deploying Our App\n // let's add am h1 tag above the SearchBox component and we need to import the Google font\n // for \" Monsters Rolodex \" and go to Google fonts and search for Bigelow Rules and copy\n // the link for the font into the <head></head> of our index.html file and then go to\n // App.css and add a new rule for our h1 tag and then go to index.css and add a new\n // background color to the body element and remember that index.css is a file that gets\n // generated by create react app and now our project is finished\n\n // so we've built a project that has filtering and we understand how components are created\n // End of -- Mark 10 --\n\n return (\n <div className=\"App\">\n <h1>Monsters Rolodex</h1>\n <SearchBox \n placeholder='seach monsters'\n handleChange={ this.handleChange }\n />\n <CardList monsters={ filteredMonsters } />\n </div>\n );\n }", "function App() {\n return (\n <div className= 'App'>\n <DataFetching /> \n\n </div>\n );\n}", "render() {\n return (\n <React.Fragment>\n <h1>Your Profile</h1>\n <h2>{this.props.user.firstName} {this.props.user.lastName}</h2>\n {/*<List\n itemLayout=\"horizontal\"\n dataSource={officesUnderExperienceManagerData}\n renderItem={item => (\n <List.Item>\n <List.Item.Meta\n avatar={<Avatar src=\"https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png\" />}\n title={<a href=\"https://ant.design\">{item.title}</a>}\n description=\"Ant Design, a design language for background applications, is refined by Ant UED Team\"\n />\n </List.Item>*/}\n )}\n />\n\n </React.Fragment>\n \n );\n\n }", "render() {\n return <div>Hello {this.props.firstName} {this.props.lastName}!</div>;\n }", "function App() {\n\n return (\n <div className=\"App\">\n {/* <BaiTapDanLayout /> */}\n {/* <DataBinding /> */}\n {/* <EventBinding /> */}\n {/* <State /> */}\n {/* <ExState /> */}\n {/* <ExState2 /> */}\n {/* <RenderWithMap /> */}\n {/* <DemoProps /> */}\n {/* <BT2ProductList productData={dataJson}/> */}\n {/* <BT3PhoneList /> */}\n {/* <BTCart /> */}\n {/* <TodoApp /> */}\n {/* <CartsRedux /> */}\n <StudentManagementForm />\n {/* <LifeCycle /> */}\n </div>\n );\n}", "render () {\n // since its a class, props accessed using this keyword\n return (<h1>\n {this.props.name}\n </h1>)\n }", "function App() {\n return (\n <div className=\"App\">\n {/* <h1>Hello I am Raju Molla</h1>\n <p>Worst programmer</p>\n <Hello />\n <Hi /> */}\n {/* <MyclassComp name='raju' age={21} />\n <MyclassComp name='Molla' age={25}/>\n <MyclassComp /> */}\n {/* <WithOutJsx /> */}\n {/* <StudnetInfo name=\"Raju\" age={2} /> */}\n {/* <StudnetInfo name=\"Sajid\" age={5} />\n <StudnetInfo name=\"kajol\" age={10} /> */}\n\n {/* <ParentComp name=\"raju\"> */}\n {/* <ChildComp /> */}\n {/* <h4>MERN stack developer</h4> */}\n {/* </ParentComp> */}\n {/* <ParentComp name=\"raju\"> */}\n {/* <ChildComp /> */}\n {/* <h4>Javascript developer</h4> */}\n {/* </ParentComp> */}\n {/* <MyclassComp /> */}\n {/* <ParentComp /> */}\n {/* <Task /> */}\n {/* <TaskControll /> */}\n {/* <ParentComp /> */}\n \n {/* <PrevStateComp /> */}\n {/* <ListRenderComp /> */}\n {/* <TableComp /> */}\n {/* < InfoCamp /> */}\n {/* <CssStyleSheet /> */}\n {/* <InlineCass /> */}\n {/* <Button /> */}\n {/* <ControlFrom /> */}\n <RegistrationFormComp />\n </div>\n );\n}", "function FunComponent()\n{\n return <h1>This is my Functional Component</h1>;\n \n}", "function Item(props) {\n return <div className=\"item\">\n <b>Name:</b> {props.name} <br />\n <b>Price:</b> ${props.price}\n </div>;\n}", "render() {\n\t\treturn (\n\t\t\t<div className=\"wc-products-list-card wc-products-list-card--specific\">\n\t\t\t\t<ProductsSpecificSearchField\n\t\t\t\t\taddProductCallback={ this.addProduct.bind( this ) }\n\t\t\t\t\tselectedProducts={ this.state.selectedProducts }\n\t\t\t\t/>\n\t\t\t\t<ProductSpecificSelectedProducts\n\t\t\t\t\tproducts={ this.state.selectedProducts }\n\t\t\t\t\tremoveProductCallback={ this.removeProduct.bind( this ) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}", "render() { // all components need this.\n return (\n <div>\n <h3>Stories App</h3>\n <p className=\"lead\">Sample paragraph</p>\n </div>\n );\n }", "render() {\n return (\n <div className=\"dashboard\">\n <div className=\"dashboard-username\">\n Username: {this.props.username}\n </div>\n <div className=\"dashboard-name\">Name: {this.props.name}</div>\n <div className=\"dashboard-protected-data\">\n Protected data: {this.props.protectedData}\n </div>\n </div>\n );\n }", "function App() {\n return (\n // <Wrapper>\n // <Hello name=\"react\" color=\"red\" isSpecial={true}></Hello>\n // <Hello color=\"pink\"></Hello>\n // </Wrapper>\n // <Counter></Counter>\n\n // 돔객체 접근 및 useState\n // <InputSample></InputSample>\n\n // 배열 렌더링방법\n <UserList></UserList>\n );\n}", "function App() {\n // Naming the constant variables that will be \n const fName = \"Devin\";\n const lName = \"Brueberg\";\n const subjectName = \"CSC 435 Adv Web App Development\";\n const projectDate = \"March 3, 2021\";\n\n // The return is what this component will return to the \n // caller. This return consists of some HTML elements \n // that will create a h1 title header followed by the \n // name, subject name, and project date of this App\n return (\n \n // Only one main div is allowed per component so the main div \n // is defined here. It will hold the components contents\n <div id=\"main\"> \n \n {/* Page Heading */}\n <h1>\n Welcome to the React App\n </h1>\n \n {/* This div will flex in the css */}\n <div id=\"flex\">\n {/* Using a ul to include the name, class, and date. \n The const are referenced here and added to the \n HTML via JavaScript\n */}\n <ul>\n <li>\n {fName} {lName}\n </li>\n <li>\n {subjectName}\n </li>\n <li>\n {projectDate}\n </li>\n </ul>\n </div>\n </div>\n );\n}", "render() {\n return <h1>Hello, {this.props.name}</h1>;\n }", "function FunctionComponent(props) {\n return <h1>hello, {props.name}</h1>\n}", "function renderComponent(ComponentClass, props) {\n return mount(<ComponentClass {...props} />);\n}", "function App(){\n const cardProps = vacationData.map(item => <Card spot={item} />)\n return (\n <div className=\"cards\">\n <h1>Best Vacation Spots</h1>\n {cardProps}\n </div>\n )\n}", "render() {\n return (\n <div className=\"App\">\n <Header setSearch={this.setSearch} />\n <Dropdown setCourse={this.setCourse} />\n {/* <CreateClass /> */}\n {this.state.data && <HomeDisplay data={this.state.data} course={this.state.courseName}/>}\n <hr />\n \n <div style={{textAlign: 'center'}}>\n <p>Made with <span role=\"img\" aria-label=\"heart emoji\" >❤️</span> by KRAAG</p>\n </div>\n </div>\n );\n }", "function App() {\n return (\n <div className=\"App\">\n {/* <h1>sreedhar</h1>\n <Student />\n <Add_1 /> */}\n {/* <Props_Components/> */}\n {/* <Props_Classcomponents sayhello=\"good morning\"/> */}\n {/* <State_Components/> */}\n {/* <Events_Component /> */}\n {/* <Binding_Component/> */}\n <Navbar_Component />\n {/* <Conditions_Components/> */}\n {/* <Loops_FunctionalComponets /> */}\n </div>\n );\n}", "function Hi(props) {\n return <div>\n <h3>Hi {props.name}</h3>\n </div>;\n}", "function Card(props) {\n return (\n <div className={s.card} >\n <p>Title: {props.title}</p> \n <p>Description: {props.description}</p>\n <p className={s.p} >Price: ${props.price}</p>\n <p className={s.p}>Category: {props.category}</p>\n </div>\n )\n}", "render(){\n\t\t/* Creates variables to hold properties */\n\t\tconst todoEntries = this.props.entries\n\t\tconst listItems = todoEntries.map(this.createItems)\n\n\t\treturn(\n\t\t\t/* Creates an unordered list that holds the information entered by user */\n\t\t\t<ul id = \"theList\">{listItems}</ul>\n\n\t\t)\n\t}", "function Hello(props) {\n return <h1>Hello {props.name}</h1>;\n}", "function UseData(props) {\n if (!props.catData) return null\n\n return (\n <div>\n <h1>Name: {props.catData.name}</h1>\n <h2>Color: {props.catData.color}</h2>\n <h2>Likes: </h2>\n {props.catData.likes.map((like, i) => {\n return <p key={i}>{like}</p>\n })}\n </div>\n )\n}", "render () {\n return (\n <div>\n <p>Mon application super trop bien 👌🏻❤️</p>\n <Filter />\n <List />\n <Form />\n <p>Made with ❤️ by 🦆 tout doux</p>\n <p><b> Nos vrais noms sont Gilles de la tourette et Gabriel</b> </p>\n </div>\n )\n }", "render () {\n return (\n <React.Fragment>\n <div>\n <MemberDisplay first_name={this.props.first_name} last_name={this.props.last_name} onClick={this.toggleDisplay}/>\n <div className={this.state.display}>\n <p>Responsibilities include:</p>\n <Assignments description ={this.props.description} deadline ={this.props.deadline} className=\"team_members\" />\n <p>Responsible for the following materials:</p>\n <Materials material={this.props.material} />\n </div>\n </div>\n\n </React.Fragment>\n );\n }", "render() {\n const {\n classes: { root, list },\n participants,\n open,\n toggle\n } = this.props;\n\n const participantList = (\n <div className={root}>\n <List\n subheader={\n <ListSubheader color=\"primary\">Active Users</ListSubheader>\n }\n >\n {participants.map((participant, index) => {\n return (\n <ListItem className={list} key={participant + index.toString()}>\n {participant}\n </ListItem>\n );\n })}\n </List>\n </div>\n );\n\n return (\n <div>\n <Drawer open={open} onClick={toggle}>\n <div>{participantList}</div>\n </Drawer>\n </div>\n );\n }", "function OrderList(props) {\n return (\n <div className=\"Order-list\">\n <Title name={props.name} />\n <OrderNumbers />\n </div>\n );\n}", "function ListContent(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n description = props.description,\n floated = props.floated,\n header = props.header,\n verticalAlign = props.verticalAlign;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"j\" /* useValueAndKey */])(floated, 'floated'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"l\" /* useVerticalAlignProp */])(verticalAlign), 'content', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"b\" /* getUnhandledProps */])(ListContent, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* getElementType */])(ListContent, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_4__lib__[\"d\" /* childrenUtils */].isNil(children)) return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_6__ListHeader__[\"a\" /* default */].create(header),\n __WEBPACK_IMPORTED_MODULE_5__ListDescription__[\"a\" /* default */].create(description),\n content\n );\n}", "render(props) {\n return (\n <div>{props.hello}</div>\n )\n }", "function ListContent(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n description = props.description,\n floated = props.floated,\n header = props.header,\n verticalAlign = props.verticalAlign;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_2_classnames___default()(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"h\" /* useValueAndKey */])(floated, 'floated'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"k\" /* useVerticalAlignProp */])(verticalAlign), 'content', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"b\" /* getUnhandledProps */])(ListContent, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* getElementType */])(ListContent, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_1_lodash_isNil___default()(children)) {\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_6__ListHeader__[\"a\" /* default */].create(header),\n __WEBPACK_IMPORTED_MODULE_5__ListDescription__[\"a\" /* default */].create(description),\n content\n );\n}", "render() {\n return (\n <div>\n {this.props.list.map((d, i) => {\n return <Todo key = {i} status={d.status} priority={d.priority} description={d.description} />\n })\n }\n </div>\n )\n }", "render() {\n return (\n <div>\n <ul className=\"todoList\">{\n this.props.todos.map((todo) => {\n return <TodoItem key={todo.id} todo={todo} actions={this.props.actions}/>\n })\n }</ul>\n </div>\n );\n }", "function App() {\n return (\n <div className=\"App\">\n <Stylesheet primary = {true} />\n {/* <MyComponent/>\n <MyHeader />\n <ClassComponent name = \"murat aykurt\"/>\n <FunctionalComponent name=\"Murat Aykurt\" dateBirth = \"1992\" /> */}\n \n </div>\n );\n}", "render() {\n const { searchTerm, results, searchKey, error, isLoading } = this.state; //ES6 Destructuring\n const page = (results && results[searchKey] && results[searchKey].page) || 0;\n const list = (results && results[searchKey] && results[searchKey].hits) || [];\n\n return (\n /**\n * Attention:\n * input, like textarea and select\n * are called \"uncontrolled component\"\n * In React we need to control them!\n * so we use value={searchTerm}\n */\n <div className=\"page\">\n <h1 className=\"page-title\">HKRNews</h1>\n <div className=\"interactions\">\n <Search \n value={searchTerm} \n onChange={this.onSearchChange}\n onSubmit={this.onSearchSubmit}\n >\n Search\n </Search>\n </div>\n \n\n { \n error\n ? <div className=\"interactions\">\n <p>Something went wrong fetching data. Sorry!</p>\n </div>\n : <Table \n list={ list }\n onDismiss={ this.onDismiss } \n />\n }\n\n\n <div className=\"interactions\">\n <ButtonWithLoading\n isLoading={isLoading}\n onClick={ () => this.fetchSearchTopStories(searchKey, page + 1) }\n >\n More\n </ButtonWithLoading> \n </div> \n \n\n </div>\n );\n }", "function ProviderHome(props) {\n return (\n <div>\n <UserDisplay {...props}/>\n </div>\n )\n}", "function Props(props) {\n return <h1>{props.value}</h1>;\n}", "function ComponentA(props) {\n return <div>\n Hello Component A!!!\n </div>;\n}", "function PieChart(props) {\n //Create the element\n const pieChartDiv = new ReactFauxDOM.Element('div')\n \n\n // const dataset = props.countsList\n // console.log(dataset)\n\n\n\n\n\n //DOM manipulations done, convert to React\n return pieChartDiv.toReact()\n\n\n\n\n\n\n\n\n\n\n \n\n \n}", "function createListComponent(_ref) {\n var _class, _temp;\n\n var getItemOffset = _ref.getItemOffset,\n getEstimatedTotalSize = _ref.getEstimatedTotalSize,\n getItemSize = _ref.getItemSize,\n getOffsetForIndexAndAlignment = _ref.getOffsetForIndexAndAlignment,\n getStartIndexForOffset = _ref.getStartIndexForOffset,\n getStopIndexForStartIndex = _ref.getStopIndexForStartIndex,\n initInstanceProps = _ref.initInstanceProps,\n shouldResetStyleCacheOnItemSizeChange = _ref.shouldResetStyleCacheOnItemSizeChange,\n validateProps = _ref.validateProps;\n return _temp = _class =\n /*#__PURE__*/\n function (_PureComponent) {\n _inheritsLoose$2(List, _PureComponent);\n\n // Always use explicit constructor for React components.\n // It produces less code after transpilation. (#26)\n // eslint-disable-next-line no-useless-constructor\n function List(props) {\n var _this;\n\n _this = _PureComponent.call(this, props) || this;\n _this._instanceProps = initInstanceProps(_this.props, _assertThisInitialized$2(_assertThisInitialized$2(_this)));\n _this._outerRef = void 0;\n _this._resetIsScrollingTimeoutId = null;\n _this.state = {\n instance: _assertThisInitialized$2(_assertThisInitialized$2(_this)),\n isScrolling: false,\n scrollDirection: 'forward',\n scrollOffset: typeof _this.props.initialScrollOffset === 'number' ? _this.props.initialScrollOffset : 0,\n scrollUpdateWasRequested: false\n };\n _this._callOnItemsRendered = void 0;\n _this._callOnItemsRendered = index$1(function (overscanStartIndex, overscanStopIndex, visibleStartIndex, visibleStopIndex) {\n return _this.props.onItemsRendered({\n overscanStartIndex: overscanStartIndex,\n overscanStopIndex: overscanStopIndex,\n visibleStartIndex: visibleStartIndex,\n visibleStopIndex: visibleStopIndex\n });\n });\n _this._callOnScroll = void 0;\n _this._callOnScroll = index$1(function (scrollDirection, scrollOffset, scrollUpdateWasRequested) {\n return _this.props.onScroll({\n scrollDirection: scrollDirection,\n scrollOffset: scrollOffset,\n scrollUpdateWasRequested: scrollUpdateWasRequested\n });\n });\n _this._getItemStyle = void 0;\n\n _this._getItemStyle = function (index) {\n var _this$props = _this.props,\n direction = _this$props.direction,\n itemSize = _this$props.itemSize,\n layout = _this$props.layout;\n\n var itemStyleCache = _this._getItemStyleCache(shouldResetStyleCacheOnItemSizeChange && itemSize, shouldResetStyleCacheOnItemSizeChange && layout, shouldResetStyleCacheOnItemSizeChange && direction);\n\n var style;\n\n if (itemStyleCache.hasOwnProperty(index)) {\n style = itemStyleCache[index];\n } else {\n var _style;\n\n var _offset = getItemOffset(_this.props, index, _this._instanceProps);\n\n var size = getItemSize(_this.props, index, _this._instanceProps); // TODO Deprecate direction \"horizontal\"\n\n var isHorizontal = direction === 'horizontal' || layout === 'horizontal';\n itemStyleCache[index] = style = (_style = {\n position: 'absolute'\n }, _style[direction === 'rtl' ? 'right' : 'left'] = isHorizontal ? _offset : 0, _style.top = !isHorizontal ? _offset : 0, _style.height = !isHorizontal ? size : '100%', _style.width = isHorizontal ? size : '100%', _style);\n }\n\n return style;\n };\n\n _this._getItemStyleCache = void 0;\n _this._getItemStyleCache = index$1(function (_, __, ___) {\n return {};\n });\n\n _this._onScrollHorizontal = function (event) {\n var _event$currentTarget = event.currentTarget,\n clientWidth = _event$currentTarget.clientWidth,\n scrollLeft = _event$currentTarget.scrollLeft,\n scrollWidth = _event$currentTarget.scrollWidth;\n\n _this.setState(function (prevState) {\n if (prevState.scrollOffset === scrollLeft) {\n // Scroll position may have been updated by cDM/cDU,\n // In which case we don't need to trigger another render,\n // And we don't want to update state.isScrolling.\n return null;\n }\n\n var direction = _this.props.direction;\n var scrollOffset = scrollLeft;\n\n if (direction === 'rtl') {\n // TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.\n // This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).\n // It's also easier for this component if we convert offsets to the same format as they would be in for ltr.\n // So the simplest solution is to determine which browser behavior we're dealing with, and convert based on it.\n switch (getRTLOffsetType()) {\n case 'negative':\n scrollOffset = -scrollLeft;\n break;\n\n case 'positive-descending':\n scrollOffset = scrollWidth - clientWidth - scrollLeft;\n break;\n }\n } // Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.\n\n\n scrollOffset = Math.max(0, Math.min(scrollOffset, scrollWidth - clientWidth));\n return {\n isScrolling: true,\n scrollDirection: prevState.scrollOffset < scrollLeft ? 'forward' : 'backward',\n scrollOffset: scrollOffset,\n scrollUpdateWasRequested: false\n };\n }, _this._resetIsScrollingDebounced);\n };\n\n _this._onScrollVertical = function (event) {\n var _event$currentTarget2 = event.currentTarget,\n clientHeight = _event$currentTarget2.clientHeight,\n scrollHeight = _event$currentTarget2.scrollHeight,\n scrollTop = _event$currentTarget2.scrollTop;\n\n _this.setState(function (prevState) {\n if (prevState.scrollOffset === scrollTop) {\n // Scroll position may have been updated by cDM/cDU,\n // In which case we don't need to trigger another render,\n // And we don't want to update state.isScrolling.\n return null;\n } // Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.\n\n\n var scrollOffset = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight));\n return {\n isScrolling: true,\n scrollDirection: prevState.scrollOffset < scrollOffset ? 'forward' : 'backward',\n scrollOffset: scrollOffset,\n scrollUpdateWasRequested: false\n };\n }, _this._resetIsScrollingDebounced);\n };\n\n _this._outerRefSetter = function (ref) {\n var outerRef = _this.props.outerRef;\n _this._outerRef = ref;\n\n if (typeof outerRef === 'function') {\n outerRef(ref);\n } else if (outerRef != null && typeof outerRef === 'object' && outerRef.hasOwnProperty('current')) {\n outerRef.current = ref;\n }\n };\n\n _this._resetIsScrollingDebounced = function () {\n if (_this._resetIsScrollingTimeoutId !== null) {\n cancelTimeout(_this._resetIsScrollingTimeoutId);\n }\n\n _this._resetIsScrollingTimeoutId = requestTimeout(_this._resetIsScrolling, IS_SCROLLING_DEBOUNCE_INTERVAL$1);\n };\n\n _this._resetIsScrolling = function () {\n _this._resetIsScrollingTimeoutId = null;\n\n _this.setState({\n isScrolling: false\n }, function () {\n // Clear style cache after state update has been committed.\n // This way we don't break pure sCU for items that don't use isScrolling param.\n _this._getItemStyleCache(-1, null);\n });\n };\n\n return _this;\n }\n\n List.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {\n validateSharedProps$1(nextProps, prevState);\n validateProps(nextProps);\n return null;\n };\n\n var _proto = List.prototype;\n\n _proto.scrollTo = function scrollTo(scrollOffset) {\n scrollOffset = Math.max(0, scrollOffset);\n this.setState(function (prevState) {\n if (prevState.scrollOffset === scrollOffset) {\n return null;\n }\n\n return {\n scrollDirection: prevState.scrollOffset < scrollOffset ? 'forward' : 'backward',\n scrollOffset: scrollOffset,\n scrollUpdateWasRequested: true\n };\n }, this._resetIsScrollingDebounced);\n };\n\n _proto.scrollToItem = function scrollToItem(index, align) {\n if (align === void 0) {\n align = 'auto';\n }\n\n var itemCount = this.props.itemCount;\n var scrollOffset = this.state.scrollOffset;\n index = Math.max(0, Math.min(index, itemCount - 1));\n this.scrollTo(getOffsetForIndexAndAlignment(this.props, index, align, scrollOffset, this._instanceProps));\n };\n\n _proto.componentDidMount = function componentDidMount() {\n var _this$props2 = this.props,\n direction = _this$props2.direction,\n initialScrollOffset = _this$props2.initialScrollOffset,\n layout = _this$props2.layout;\n\n if (typeof initialScrollOffset === 'number' && this._outerRef != null) {\n var outerRef = this._outerRef; // TODO Deprecate direction \"horizontal\"\n\n if (direction === 'horizontal' || layout === 'horizontal') {\n outerRef.scrollLeft = initialScrollOffset;\n } else {\n outerRef.scrollTop = initialScrollOffset;\n }\n }\n\n this._callPropsCallbacks();\n };\n\n _proto.componentDidUpdate = function componentDidUpdate() {\n var _this$props3 = this.props,\n direction = _this$props3.direction,\n layout = _this$props3.layout;\n var _this$state = this.state,\n scrollOffset = _this$state.scrollOffset,\n scrollUpdateWasRequested = _this$state.scrollUpdateWasRequested;\n\n if (scrollUpdateWasRequested && this._outerRef != null) {\n var outerRef = this._outerRef; // TODO Deprecate direction \"horizontal\"\n\n if (direction === 'horizontal' || layout === 'horizontal') {\n if (direction === 'rtl') {\n // TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.\n // This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).\n // So we need to determine which browser behavior we're dealing with, and mimic it.\n switch (getRTLOffsetType()) {\n case 'negative':\n outerRef.scrollLeft = -scrollOffset;\n break;\n\n case 'positive-ascending':\n outerRef.scrollLeft = scrollOffset;\n break;\n\n default:\n var clientWidth = outerRef.clientWidth,\n scrollWidth = outerRef.scrollWidth;\n outerRef.scrollLeft = scrollWidth - clientWidth - scrollOffset;\n break;\n }\n } else {\n outerRef.scrollLeft = scrollOffset;\n }\n } else {\n outerRef.scrollTop = scrollOffset;\n }\n }\n\n this._callPropsCallbacks();\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n if (this._resetIsScrollingTimeoutId !== null) {\n cancelTimeout(this._resetIsScrollingTimeoutId);\n }\n };\n\n _proto.render = function render() {\n var _this$props4 = this.props,\n children = _this$props4.children,\n className = _this$props4.className,\n direction = _this$props4.direction,\n height = _this$props4.height,\n innerRef = _this$props4.innerRef,\n innerElementType = _this$props4.innerElementType,\n innerTagName = _this$props4.innerTagName,\n itemCount = _this$props4.itemCount,\n itemData = _this$props4.itemData,\n _this$props4$itemKey = _this$props4.itemKey,\n itemKey = _this$props4$itemKey === void 0 ? defaultItemKey$1 : _this$props4$itemKey,\n layout = _this$props4.layout,\n outerElementType = _this$props4.outerElementType,\n outerTagName = _this$props4.outerTagName,\n style = _this$props4.style,\n useIsScrolling = _this$props4.useIsScrolling,\n width = _this$props4.width;\n var isScrolling = this.state.isScrolling; // TODO Deprecate direction \"horizontal\"\n\n var isHorizontal = direction === 'horizontal' || layout === 'horizontal';\n var onScroll = isHorizontal ? this._onScrollHorizontal : this._onScrollVertical;\n\n var _this$_getRangeToRend = this._getRangeToRender(),\n startIndex = _this$_getRangeToRend[0],\n stopIndex = _this$_getRangeToRend[1];\n\n var items = [];\n\n if (itemCount > 0) {\n for (var _index = startIndex; _index <= stopIndex; _index++) {\n items.push(react.createElement(children, {\n data: itemData,\n key: itemKey(_index, itemData),\n index: _index,\n isScrolling: useIsScrolling ? isScrolling : undefined,\n style: this._getItemStyle(_index)\n }));\n }\n } // Read this value AFTER items have been created,\n // So their actual sizes (if variable) are taken into consideration.\n\n\n var estimatedTotalSize = getEstimatedTotalSize(this.props, this._instanceProps);\n return react.createElement(outerElementType || outerTagName || 'div', {\n className: className,\n onScroll: onScroll,\n ref: this._outerRefSetter,\n style: _extends$9({\n position: 'relative',\n height: height,\n width: width,\n overflow: 'auto',\n WebkitOverflowScrolling: 'touch',\n willChange: 'transform',\n direction: direction\n }, style)\n }, react.createElement(innerElementType || innerTagName || 'div', {\n children: items,\n ref: innerRef,\n style: {\n height: isHorizontal ? '100%' : estimatedTotalSize,\n pointerEvents: isScrolling ? 'none' : undefined,\n width: isHorizontal ? estimatedTotalSize : '100%'\n }\n }));\n };\n\n _proto._callPropsCallbacks = function _callPropsCallbacks() {\n if (typeof this.props.onItemsRendered === 'function') {\n var itemCount = this.props.itemCount;\n\n if (itemCount > 0) {\n var _this$_getRangeToRend2 = this._getRangeToRender(),\n _overscanStartIndex = _this$_getRangeToRend2[0],\n _overscanStopIndex = _this$_getRangeToRend2[1],\n _visibleStartIndex = _this$_getRangeToRend2[2],\n _visibleStopIndex = _this$_getRangeToRend2[3];\n\n this._callOnItemsRendered(_overscanStartIndex, _overscanStopIndex, _visibleStartIndex, _visibleStopIndex);\n }\n }\n\n if (typeof this.props.onScroll === 'function') {\n var _this$state2 = this.state,\n _scrollDirection = _this$state2.scrollDirection,\n _scrollOffset = _this$state2.scrollOffset,\n _scrollUpdateWasRequested = _this$state2.scrollUpdateWasRequested;\n\n this._callOnScroll(_scrollDirection, _scrollOffset, _scrollUpdateWasRequested);\n }\n }; // Lazily create and cache item styles while scrolling,\n // So that pure component sCU will prevent re-renders.\n // We maintain this cache, and pass a style prop rather than index,\n // So that List can clear cached styles and force item re-render if necessary.\n\n\n _proto._getRangeToRender = function _getRangeToRender() {\n var _this$props5 = this.props,\n itemCount = _this$props5.itemCount,\n overscanCount = _this$props5.overscanCount;\n var _this$state3 = this.state,\n isScrolling = _this$state3.isScrolling,\n scrollDirection = _this$state3.scrollDirection,\n scrollOffset = _this$state3.scrollOffset;\n\n if (itemCount === 0) {\n return [0, 0, 0, 0];\n }\n\n var startIndex = getStartIndexForOffset(this.props, scrollOffset, this._instanceProps);\n var stopIndex = getStopIndexForStartIndex(this.props, startIndex, scrollOffset, this._instanceProps); // Overscan by one item in each direction so that tab/focus works.\n // If there isn't at least one extra item, tab loops back around.\n\n var overscanBackward = !isScrolling || scrollDirection === 'backward' ? Math.max(1, overscanCount) : 1;\n var overscanForward = !isScrolling || scrollDirection === 'forward' ? Math.max(1, overscanCount) : 1;\n return [Math.max(0, startIndex - overscanBackward), Math.max(0, Math.min(itemCount - 1, stopIndex + overscanForward)), startIndex, stopIndex];\n };\n\n return List;\n }(react.PureComponent), _class.defaultProps = {\n direction: 'ltr',\n itemData: undefined,\n layout: 'vertical',\n overscanCount: 2,\n useIsScrolling: false\n }, _temp;\n } // NOTE: I considered further wrapping individual items with a pure ListItem component.", "function TypescriptComponent(props: {\n data: {\n title: string;\n intro: string;\n }[];\n}) {\n return <p onClick={props.someFunc(props[0].title)}>{props[0].title}</p>\n}", "function App() {\n // this whole thing gets plugged into the dom\n\n const [todos, setTodos] = useState([\n // pretend like u did a mongo db find and this is what you got back ;)\n {\n id: 1,\n item: \"Drink Water\",\n },\n {\n id: 2,\n item: \"Make Healthy Dinner\",\n },\n {\n id: 3,\n item: \"Exercise\",\n },\n ]);\n\n const addTodo = (todo) => {\n const id = Math.ceil(Math.random() * 100000); // sets the id cuz you need an ID\n const newTodo = { id, ...todo }; // the todo is an object that has a id key using an implied key and the parameter of this function\n setTodos([...todos, newTodo]); // makes the todos array of obects have this new object and all the other objects with the spread\n };\n\n return (\n // this is the view\n <div className=\"container\">\n {/*whole return needs to be in an element or empty tags?*/}{\" \"}\n {/*class name is weird because this is jsx*/}\n <Header title=\"Todo List\" />{\" \"}\n {/*set the title of this header, and we told the component whtever is in the title should go into the h1*/}\n <AddTodo onAdd={addTodo} />{\" \"}\n {/*Im really confused here if you read this i dont get it*/}\n <List todos={todos} />{\" \"}\n {/*the list here is a component the prop we are passing in is the object above, that component iterates thru the array and makes h2s*/}\n </div>\n );\n}", "render() {\n return (\n <>\n {/* A file container where I attach props. And I export */}\n <HeroList\n questions={this.props.questions}\n history={this.props.history}\n currentQuestion={this.props.currentQuestion}\n listItem={this.props.listItem}\n buttonList={this.props.buttonList}\n closeModal={this.props.closeModal}\n />\n <Question\n showResult={this.props.showResult}\n currentQuestion={this.props.currentQuestion}\n questions={this.props.questions}\n showButtons={this.props.showButtons}\n nextQuestion={this.props.nextQuestion}\n backHandle={this.props.backHandle}\n returnQuestions={this.props.returnQuestions}\n />\n </>\n );\n }", "render() {\n let { name } = this.props\n let { isSelected } = this.state\n\n // inside this, we embed an example of a stateless component, that simply takes props from upstream (here)\n return (\n <p className=\"person\">\n Hi, { name }, welcome to React! Currently you\n <Toggler value={isSelected} clickHandler={this.toggleSelected} />\n selected.\n </p>\n )\n }", "render() {\n // Called every time the component gets new props\n this.update();\n // Render the empty table text if there is no data\n if (!this.state.data[0]) return <TableEmpty message={this.props.emptyMessage} />;\n return <Component {...this.props} {...this.state} headerClick={this.headerClick} />;\n }", "render() {\n\t//map is a build-in for-each loop for an array\n\t//but lets you selectively add/edit/remove\n\t//on the fly while building a new array\n const listItems = this.props.names.map((friend) => {\n return <li> {friend} </li>;\n });\n\t//pass in our new <li> listItems array to our JSX\n return (\n <div>\n <h3> Friends </h3>\n <ul>\n {listItems}\n </ul>\n </div>\n );\n }", "function Hello(props) {\r\n return (\r\n <div class=\"hello\">Hello Component - Hello {props.name}</div>\r\n );\r\n}", "function ListContent(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n description = props.description,\n floated = props.floated,\n header = props.header,\n verticalAlign = props.verticalAlign;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"D\" /* useValueAndKey */])(floated, 'floated'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"E\" /* useVerticalAlignProp */])(verticalAlign), 'content', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getUnhandledProps */])(ListContent, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"p\" /* getElementType */])(ListContent, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_4__lib__[\"d\" /* childrenUtils */].isNil(children)) return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_6__ListHeader__[\"a\" /* default */].create(header),\n __WEBPACK_IMPORTED_MODULE_5__ListDescription__[\"a\" /* default */].create(description),\n content\n );\n}", "function App() {\n const data = products.map((product, i) => <Product key={product.id} name={product.name} description={product.description} price={product.price}/>)\nreturn (\n <div>\n {data}\n </div>\n)\n}", "function App(){\n return(\n <div>\n <ShoppingList name=\"demo\"/>\n </div>\n )\n}", "render() {\n console.log('Examples.render()');\n return (\n <div>\n <div style={{color:'red'}}>\n Describe: {this.props.desc}</div>\n </div>\n )\n }", "function Navbar(props) {\n \n\n // NO Function\n // No states\n\n\n return(\n <div>\n <p>My name is {props.name}</p>\n\n <p>I am {props.age} years old</p>\n\n <p>I am a {props.status} at AT&T</p>\n\n <button onClick = { props.clickMe }> Click me!!! </button>\n </div>\n );\n}", "render() {\n return (\n <div className=\"board\">\n { /* render the lists */ }\n { /* render the list creation form */ }\n </div>\n );\n }", "function App() {\n return (\n <>\n <ClassComp start={10}/>\n <FunctionalComp start={100}/>\n </>\n )\n}", "function CartData({ cost, quantity }) {\n\n return ( \n <div className=\"CartData\">\n <h5>Your Cart:</h5>\n <p>Total Cost: ${cost}</p>\n <p># of Items: {quantity}</p>\n </div>\n )\n}", "constructor(props){\n super(props);\n this.state ={\n datas:props.data\n }\n }" ]
[ "0.7040937", "0.6760913", "0.67469466", "0.6670974", "0.66335297", "0.65529585", "0.64397043", "0.64300007", "0.64294136", "0.6419273", "0.63870054", "0.6351749", "0.6336235", "0.6325579", "0.63154984", "0.6313294", "0.62951326", "0.6285804", "0.62676775", "0.62588984", "0.6256779", "0.6238179", "0.6196631", "0.6196246", "0.6184754", "0.61774045", "0.61686677", "0.6148029", "0.613161", "0.61280847", "0.61064845", "0.61027294", "0.6101122", "0.60944885", "0.6093898", "0.60914433", "0.60829914", "0.6082065", "0.6082065", "0.60556424", "0.6036698", "0.60356224", "0.6031286", "0.60186386", "0.60178745", "0.601459", "0.6001475", "0.59996516", "0.59976834", "0.5992862", "0.5988306", "0.5980435", "0.5976368", "0.5971029", "0.5970991", "0.5959068", "0.5947366", "0.5943902", "0.59425473", "0.59372234", "0.5934711", "0.5932638", "0.59275556", "0.5923809", "0.5921756", "0.5918672", "0.5910685", "0.5907663", "0.5906414", "0.58983725", "0.58934", "0.5889037", "0.58887696", "0.58885217", "0.5885437", "0.58768433", "0.58740574", "0.5871232", "0.58661556", "0.58629626", "0.5858355", "0.58539486", "0.58514094", "0.5849648", "0.58469844", "0.5845945", "0.5845581", "0.5843536", "0.58418083", "0.5837534", "0.582907", "0.5829059", "0.5828587", "0.58277506", "0.5823201", "0.582309", "0.5823043", "0.58209693", "0.5820497", "0.5818701", "0.58172053" ]
0.0
-1
a render method needs to be a pure function, no ajax calls, etc it should just receive state and props and render a UI
render() { return ( <form onSubmit={this.handleSubmit}> <input type="text" value={this.state.value} onChange={this.handleChange} /> <input type="submit" value="Submit" /> </form> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n if (this.props) return this.renderWithProps();\n if (this.store) return this.renderWithStore();\n }", "render (props) {\n if (this.state.error) return this.renderDefaultError(props)\n return this.renderContent(props)\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 let api = {\n counter: this.state.counter,\n increase: this.increase,\n decrease: this.decrease\n }\n return this.props.render(api);\n }", "render(){}", "render(){}", "function doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}", "function doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}", "function doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}", "function doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}", "function doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}", "function doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}", "function doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}", "function render(state, update, undo, redo) {\n // ImModel calls this function after making changes to state.\n // Pass the immutable state object and callbacks to our top-level react component:\n React.render(React.createElement(AppComponent, {appState: state,\n update: update, undo: undo, redo: redo }),\n\t\t container);\n}", "render() {\n const error = this.state.studyLoadError || this.state.gameLoadError;\n if (error)\n return <ErrorLabel className=\"text-2xl m-2\" value={error} />;\n\n if (this.state.studyLoading)\n return <ProgressLabel className=\"text-2xl m-2\" value=\"The study is loading...\" />;\n if (this.state.gameLoading)\n return <ProgressLabel className=\"text-2xl m-2\" value=\"The game is loading...\" />;\n\n const study = this.state.study;\n const game = this.state.game;\n if (!study)\n return <ErrorLabel className=\"text-2xl m-2\" value=\"The study did not load correctly.\" />;\n if (!game)\n return <ErrorLabel className=\"text-2xl m-2\" value=\"The game did not load correctly.\" />;\n\n // Just in case\n this.updateQueryParams(game);\n return this.renderWithStudyAndGame(study, game);\n }", "render() {\n return <div>{this.toRender()}</div>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader>Getting data</Loader>;\n }", "render() {\n\n return (\n <div>\n {this.renderContent()}\n </div>\n );\n \n }", "render() {\n const notesStore = this.props.notesStore;\n\n //add loading state\n if (notesStore.isLoading) {\n return <BubbleLoader/>;\n }\n\n //add failure state\n if (notesStore.isFailure) {\n return <span>Error loading note!</span>;\n }\n\n return <div>\n <Note submitHandler={this.createNote.bind(this)}/>\n </div>;\n\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader>Getting data</Loader>;\n }", "render(){return renderNotImplemented;}", "render() {\n\t\treturn <div>{this.renderContent()}</div>;\n\t}", "render() { }", "render(){\n return(\n <div>\n {this.props.render(this.state.count, this.clickHandler)} \n </div> \n )\n }", "render() {}", "render() {}", "render() {}", "render() {\r\n return <div />\r\n }", "render() {\n console.log(this.state.on);\n let args = {\n on: this.state.on,\n toggle: this.toggle\n };\n return (\n <div>\n {this.props.render(args)}\n </div>\n )\n }", "render() {\n var toBeRendered = () => {\n if (this.state.currentState === 'Dashboard') {\n return (<Dashboard goToCountdown={this.goToCountdown} workoutHistory={this.state.workoutHistory} loggedIn={this.state.loggedIn} getUserWeight={this.getUserWeight} userWeight={this.state.userWeight}/>);\n }\n if (this.state.currentState === 'Login') {\n return (<Login login={this.login} goToDashboard={this.goToDashboard}/>);\n }\n if (this.state.currentState === 'SignUp') {\n return (<SignUp signup={this.signup} goToDashboard={this.goToDashboard} />);\n }\n if (this.state.currentState === 'Countdown') {\n return (<Countdown countdown={this.state.countdown} />);\n }\n if (this.state.currentState === 'Workout') {\n return (<Workout exercise={this.state.currentWorkout[this.state.currentExercise]} timer={this.formatTime(this.state.time)} countdown={this.state.countdown} goToSummary={this.goToSummary} goToDashboard={this.goToDashboard} ref=\"workoutPage\" />);\n }\n if (this.state.currentState === 'createWorkout') {\n return (<CreateWorkout submitExercise={this.submitExercise} visible={this.state.visible} />);\n }\n if (this.state.currentState === 'Profile') {\n return ( <Profile\n ownerExerciseList={this.state.ownerExerciseList}\n removeExerciseFromUser={this.removeExerciseFromUser}\n profileView={this.state.profileView}\n addExerciseToUser={this.addExerciseToUser}\n changeProfileView={this.changeProfileView}\n warmupList={this.state.warmupList}\n workoutList={this.state.workoutList}\n cooldownList={this.state.cooldownList}\n exerciseCard={this.state.exerciseCard}\n />)\n }\n\n if (this.state.currentState === 'Summary') {\n return (<Summary\n goToDashboard={this.goToDashboard}\n currentWorkout={this.state.currentWorkout}\n workoutDate={this.state.workoutDate}\n loggedIn={this.state.loggedIn}\n elapsedTime={this.state.elapsedTime}\n formatTime={this.formatSummaryTime}\n completedWorkouts={this.state.completedWorkouts}\n expendedCalories={this.state.expendedCalories}/>);\n\n }\n }\n\n return (\n <div className = \"App\">\n <Header username={this.state.username} goToLogin={this.goToLogin} goToSignUp={this.goToSignUp} loggedIn={this.state.loggedIn} logOut={this.logOut} showButtons={this.state.showButtons} createWorkout={this.createWorkout} goToProfile={this.goToProfile}/>\n {toBeRendered()}\n </div>\n )\n }", "render() {\n return(<div />);\n }", "render() {\n return (\n myutils.renderLoadingstate()\n );\n }", "render() {\n // Called every time the component gets new props\n this.update();\n // Render the empty table text if there is no data\n if (!this.state.data[0]) return <TableEmpty message={this.props.emptyMessage} />;\n return <Component {...this.props} {...this.state} headerClick={this.headerClick} />;\n }", "render() {\n return <ComponentToBeRendered {...this.props} />;\n }", "render(){\n //esto es lo que te devuelve esta funcion\n return <div></div>;\n }", "render() {\r\n var toBeRendered = () => {\r\n if (this.state.currentState === 'Dashboard') {\r\n return (<Dashboard goToCountdown={this.goToCountdown} workoutHistory={this.state.workoutHistory} loggedIn={this.state.loggedIn} />);\r\n }\r\n if (this.state.currentState === 'Login') {\r\n return (<Login login={this.login}\r\n alert={this.state.alertDisplay }\r\n alertText = {this.state.alert}\r\n hideAlert={ this.hideAlert} />);\r\n }\r\n if (this.state.currentState === 'SignUp') {\r\n return (<SignUp signup={this.signup}\r\n alert={this.state.alertDisplay }\r\n alertText = {this.state.alert}\r\n hideAlert={ this.hideAlert}\r\n\r\n />);\r\n }\r\n if (this.state.currentState === 'Countdown') {\r\n return (<Countdown countdown={this.state.countdown} />);\r\n }\r\n if (this.state.currentState === 'Workout') {\r\n return (<Workout exercise={this.state.currentWorkout[this.state.currentExercise]} timer={this.formatTime(this.state.time)} countdown={this.state.countdown} pauseButtonStyle={this.state.pauseButtonStyle} pauseButtonText={this.state.pauseButtonText} pauseWorkout={this.togglePauseForWorkoutTimer} goToSummary={this.goToSummary} goToDashboard={this.goToDashboard} ref=\"workoutPage\" />);\r\n }\r\n if (this.state.currentState === 'Summary') {\r\n return (<Summary goToDashboard={this.goToDashboard} currentWorkout={this.state.currentWorkout} workoutDate={this.state.workoutDate} workoutLengthInMins={this.state.workoutLengthInMins} loggedIn={this.state.loggedIn} />);\r\n }\r\n }\r\n\r\n return (\r\n <div>\r\n\r\n <Header username={this.state.username} goToLogin={this.goToLogin} goToSignUp={this.goToSignUp} loggedIn={this.state.loggedIn} logOut={this.logOut} showButtons={this.state.showButtons}/>\r\n {toBeRendered()}\r\n <div className=\"text-center sample main-content\"></div>\r\n </div>\r\n )\r\n }", "render() {\n return this.props.ready ? (\n this.renderPage()\n ) : (\n <Loader active>Getting data</Loader>\n );\n }", "_didRender(_props, _changedProps, _prevProps) { }", "render() {\n return (this.props.tickets) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render(){\n console.log('Ey! RENDERIZANDOME!. Mis props:', this.props, this.state);\n return(\n <span>{this.props.value}</span>\n )\n }", "render() {\n return this.state.user && this.state.project ? (this.renderComponent()) : (null)\n }", "render() {\n return this.renderContent()\n }", "render() {\n\n // Canviem els this.states per this.props en el cas de fer servir l'store\n return <main className=\"container\">\n <SearchForm onSubmit={this.onSubmit} search={this.props.search}/>\n <RepositoryList\n data={this.props.results} search={this.props.search}\n loading={this.props.loading} queried={this.props.queried}/>\n </main>;\n }", "render() {\n\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (\n <React.Fragment>\n <GameStatusTable\n gameAddress={this.props.gameAddress}\n players={this.props.players}\n cost={this.props.cost}\n />\n {this.getDisplyState()}\n </React.Fragment >\n );\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready && this.props.ready2) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready) ? this.renderPage() : <Loader active>Fetching Data</Loader>;\n }", "render() {\n return <section className=\"RepositoryList\">\n { this.renderMessage() }\n { this.renderTable() }\n </section>;\n }", "render() {\n return this.renderContent();\n }", "render() {\n }", "render() {\n // console.log('Up here', this);\n return (\n <div>\n <SelectLanguage\n selectedLanguage = {this.state.selectedLanguage}\n onSelect = {this.updateLanguage}\n />\n {!this.state.repos\n ? <p>LOADING</p>\n : <RepoGrid repos = {this.state.repos} />}\n </div>\n )\n }", "render() {\n // Subclasses should override\n }", "render() {\n }", "render() {\n }", "_render() {}", "render() {\n\n }", "render() {\n\n }", "render() {\n\n }", "render() {\n return <div />\n }", "render() {\n\t\tconst { isFetching } = this.state; //a failed attempt to avoid double rendering\n\t\treturn(\n\t\t\t<div>\n\t\t\t{ isFetching ? (\n\t\t\t\t<div>Loading...</div>\n\t\t\t) : (\n\t\t\t\t<div>\n\t\t\t\t\t<ul className=\"contact-ul\">\n\t\t\t\t\t\t{this.state.contactList.map(\n\t\t\t\t\t\t\t(contact) =>\n\t\t\t\t\t\t\t\t<li key={contact.phone} className=\"contact-li\">\n\t\t\t\t\t\t\t\t\t<div className=\"contact\">\n\t\t\t\t\t\t\t\t\t\t<span className=\"fname\"> {contact.fname} </span>\n\t\t\t\t\t\t\t\t\t\t<span className=\"lname\"> {contact.lname} </span>\n\t\t\t\t\t\t\t\t\t\t<span className=\"phone\"> {contact.phone} </span>\n\t\t\t\t\t\t\t\t\t\t<span className=\"gender\"> {contact.gender}</span>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ul>\n\t\t\t\t\t<br />\n\t\t\t\t\t<AddContact onSubmit= {this.handleNewContact} />\n\t\t\t\t\t<GenderChart genders={this.state.genderCount} />\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t}", "render() {\n\t\t// Check comment status from component state and display either notification or form\n\t\tswitch (this.state.commentStatus) {\n\t\t\tcase 'success':\n\t\t\t\treturn <Tag isColor=\"success\" isSize='medium'>{\"Your comment has been successfully submitted.\"}</Tag>\n\t\t\tcase 'loading':\n\t\t\t\treturn <Progress isColor='primary' isSize='small' max={100} />\n\t\t\tcase 'error':\n\t\t\t\treturn <>{this.renderCommentForm()}<Tag isColor='danger' isSize='medium'>{\"One or more of the required fields is missing or invalid.\"}</Tag></>\n\t\t\tdefault:\n\t\t\t\treturn this.renderCommentForm();\n }\n\t}", "render() {\n return this._flux.render(this._flux.state);\n }", "render() {\n return renderNotImplemented;\n }", "render() {\n return renderNotImplemented;\n }", "render() { return super.render(); }" ]
[ "0.7374528", "0.7365574", "0.72897464", "0.70920694", "0.702981", "0.702981", "0.7027581", "0.7027581", "0.7027581", "0.7027581", "0.7027581", "0.7027581", "0.7027581", "0.7004238", "0.69955593", "0.6952057", "0.6931295", "0.6907774", "0.68666524", "0.6843598", "0.6843598", "0.6843598", "0.6843598", "0.68364316", "0.6799572", "0.67874277", "0.67818815", "0.6780327", "0.6780327", "0.6780327", "0.67772037", "0.6763842", "0.67629135", "0.6758046", "0.67396843", "0.67302954", "0.6723635", "0.6717425", "0.67143756", "0.6711367", "0.6700293", "0.6678917", "0.66701406", "0.6667507", "0.6658801", "0.6653651", "0.6637329", "0.66305053", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.6603806", "0.66037995", "0.6595546", "0.65932155", "0.65738654", "0.65677404", "0.6565842", "0.6550268", "0.6540878", "0.6540878", "0.6539167", "0.65386623", "0.65386623", "0.65386623", "0.65378076", "0.6537761", "0.65368986", "0.65361226", "0.65349865", "0.65349865", "0.6532636" ]
0.0
-1
limit the number of events per second
function throttle(callback, delay) { var previousCall = new Date().getTime(); return function () { var time = new Date().getTime(); if (time - previousCall >= delay) { previousCall = time; callback.apply(null, arguments); } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateTimerLimit(limit) {\n\ttimerLimit = limit;\n}", "minTimeBetweenSimilarHistoryEvents() { return 400; }", "function limitedRepeat() {\n let counter = 0;\n let repeat = setInterval( function(){\n console.log('hi for now');\n counter++;\n\n if(counter === 5){\n clearInterval(repeat);\n }\n }, 1000,)}", "onCompleteByLimitTime(setData) {\n console.log('time到达上限');\n setData({ a: 'time limit' });\n times = 0;\n }", "function timeLimit() {\n if (!timerRunning) {\n timerRunning = true;\n intervalId = setInterval(function () {\n timer--\n points--\n $(\"#timer\").html(timer)\n if (timer <= 0) {\n timerRunning = false;\n points = 1\n questionsIncorrect++\n questionsIndex++\n stopTimer()\n timeoutQuestion()\n }\n }, 1000)\n }\n }", "_throttle (callback, limit) {\n let inThrottle = false;\n return function() {\n const args = arguments;\n const context = this;\n if (!inThrottle) {\n callback.apply(context, args);\n inThrottle = true;\n setTimeout(() => inThrottle = false, limit);\n }\n }\n }", "setTimeLimit() {\nvar lastframe;\n//-----------\nif (this.fCount === 0) {\nreturn this.tLimit = 0;\n} else {\nlastframe = this.frameAt(this.fCount - 1);\nreturn this.tLimit = (lastframe.getTime()) + (lastframe.getDuration());\n}\n}", "function throttledScrollEvents() {\n\n }", "loadMoreSearchResult(event){\n Session.set(\"limit\",Session.get(\"limit\")+6)\n }", "function setTimeoutForEvents() {\n\t\tfor(var channel in events) {\n\t\t\tif(carsts[channel]) {\n\t\t\t\tevents[channel].forEach(function (event) {\n\t\t\t\t\tsetTimeoutForEvent(event);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tsetTimeout(setTimeoutForEvents, 86400000);\n\t}", "function setmaxtimelimit() { \n maxtimelimit = 3600;\n}", "function timeLimit() {\n timer = setInterval(function () {\n $(\"#clock\").css(\"animation\", \"none\");\n $(\"#timer\").text(\"Time left: \" + seconds);\n seconds--;\n\n if (seconds < 5) {\n $(\"#clock\").css(\"animation\", \"pulse 5s infinite\");\n }\n\n if (seconds === -1 && click < questions.length) {\n seconds = 15;\n click++;\n incorrect++;\n clearTimeout(timer);\n showAnswer();\n }\n else if (click === questions.length) {\n displayScore();\n }\n }, 1000);\n }", "function limitNotifySubscribers (value, event) {\n if (!event || event === defaultEvent) {\n this._limitChange(value);\n } else if (event === 'beforeChange') {\n this._limitBeforeChange(value);\n } else {\n this._origNotifySubscribers(value, event);\n }\n }", "function limitNotifySubscribers(value, event) {\n if (!event || event === defaultEvent) {\n this._limitChange(value);\n } else if (event === 'beforeChange') {\n this._limitBeforeChange(value);\n } else {\n this._origNotifySubscribers(value, event);\n }\n }", "function limitNotifySubscribers(value, event) {\n\t if (!event || event === defaultEvent) {\n\t this._limitChange(value);\n\t } else if (event === 'beforeChange') {\n\t this._limitBeforeChange(value);\n\t } else {\n\t this._origNotifySubscribers(value, event);\n\t }\n\t}", "function setTimeoutForEvent(event) {\n\t\t\tvar currentTime = new Date();\n\t\tcontext.io.sockets.emit('log', currentTime.getHours());\n\t\t\tvar rest = ((event.eventHour - currentTime.getHours())*3600000) + ((event.eventMin - currentTime.getMinutes()) * 60000);\n\t\t\tif(rest > 0) {\n\t\t\t\traiseEvent(event, rest);\n\t\t\t} else {\n\t\t\t\traiseEvent(event, 86400000 + rest);\n\t\t\t}\n\t}", "maxOutTimeTicker() {\r\n this.timeTicker = this.maxTime - 1;\r\n }", "function safariEventRateLimitBlock() {\n\tif (isWebKit && isSafariVersion13OrOlder()) {\n\t\tif (safariRateLimited != 0)\n\t\t\treturn true;\n\t\telse {\n\t\t\tsafariRateLimited = setTimeout('safariRateLimited = 0;', 10);\n\t\t\treturn false;\n\t\t}\n\t}\n}", "function limitedRepeat() {\n let intervalId = setInterval(console.log(\"hi for now\"), 100);\n setTimeout(() => clearInterval(intervalId), 500);\n}", "function limitNotifySubscribers(value, event) {\n if (!event || event === defaultEvent) {\n this._limitChange(value);\n } else if (event === 'beforeChange') {\n this._limitBeforeChange(value);\n } else {\n this._origNotifySubscribers(value, event);\n }\n}", "function limitNotifySubscribers(value, event) {\n if (!event || event === defaultEvent) {\n this._limitChange(value);\n } else if (event === 'beforeChange') {\n this._limitBeforeChange(value);\n } else {\n this._origNotifySubscribers(value, event);\n }\n}", "function limitNotifySubscribers(value, event) {\n if (!event || event === defaultEvent) {\n this._limitChange(value);\n } else if (event === 'beforeChange') {\n this._limitBeforeChange(value);\n } else {\n this._origNotifySubscribers(value, event);\n }\n}", "function limitNotifySubscribers(value, event) {\n if (!event || event === defaultEvent) {\n this._limitChange(value);\n } else if (event === 'beforeChange') {\n this._limitBeforeChange(value);\n } else {\n this._origNotifySubscribers(value, event);\n }\n}", "function limitNotifySubscribers(value, event) {\n if (!event || event === defaultEvent) {\n this._limitChange(value);\n } else if (event === 'beforeChange') {\n this._limitBeforeChange(value);\n } else {\n this._origNotifySubscribers(value, event);\n }\n}", "function limitNotifySubscribers(value, event) {\n if (!event || event === defaultEvent) {\n this._limitChange(value);\n } else if (event === 'beforeChange') {\n this._limitBeforeChange(value);\n } else {\n this._origNotifySubscribers(value, event);\n }\n}", "function setupTimer() {\n timelimit = maxtimelimit; \n clearInterval(myVar); \n startTimer(); \n}", "function start30SecTimer(){\r\n\t\tconsole.log( new Date());\r\n\t\t//setTimeout(function(){ console.log( new Date()) }, 30000);\r\n\t\tconsole.log(\"START TIMER!!!!!!\");\r\n\t\tfor(var x = 6; x>1; x--){\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\t//sendOutCount(x);\r\n\t\t\t\tDom.emit('count',data={count:count});\r\n\t\t\t\tcount++;\r\n\t\t\t\t}, 2000);\r\n\t\t\t\r\n\t\t}\r\n\t\t//it just does console log and then comes back and do what it has left to do\r\n\t\t//console.log( new Date());\r\n\t}", "function getTimerLimit() {\n\treturn timerLimit;\n}", "function setTickLimit(i) {\n tickLimit = i;\n}", "static async rateLimiting() {\n await new Promise(resolve => setTimeout(resolve, 250))\n }", "_trimTimeArray() {\n const threshold = (new Date()).getTime() / 1000 - 5;\n\n // Removing old times until there are none for 5 sec.\n while (this._times[0] < threshold) {\n this._times.shift();\n }\n }", "catchUpTimestamp(ts, callback) {\n async.whilst(() => {\n return Math.floor(ts / this.granularity) != this.last_ts;\n }, (xcallback) => {\n this.sendAggregates(xcallback);\n }, callback);\n }", "function startDataTime() {\n TimeHandler.addEventInterval(updateDataTime, 25, Infinity, data.time);\n}", "function mediumDelay(callback) {\n setTimeout(callback, 10);\n }", "checkIfPooped() {\n setInterval(() => {\n if (this.feedCount % 5 === 0) {\n this.hasPooped = true;\n }\n }, 1000);\n }", "function throttle(callback, delay) {\n let previousCall = new Date().getTime();\n return (...args) => {\n const time = new Date().getTime();\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback(...args);\n }\n };\n}", "function offbeatLimit(w) {\n return stdLimit(w > 1 ? (1 - 2 * (w - 1)) : w);\n }", "function throttledResizeEvents() {\n\n }", "function throttle(callback, delay) {\n let previousCall = new Date().getTime();\n return function () {\n let time = new Date().getTime();\n\n if (time - previousCall >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function stopRunning(){\n\n return Date.now().valueOf() - start.valueOf() > millimit\n\n}", "function throttle (callback, limit) {\n\t\tvar wait = false; // Initially, we're not waiting\n\t\treturn function () { // We return a throttled function\n\t\t\tif (!wait) { // If we're not waiting\n\t\t\t\tcallback.call(); // Execute users function\n\t\t\t\twait = true; // Prevent future invocations\n\t\t\t\tsetTimeout(function () { // After a period of time\n\t\t\t\t\twait = false; // And allow future invocations\n\t\t\t\t}, limit);\n\t\t\t}\n\t\t}\n\t}", "function skipForward10Sec()\r\n\t{\r\n\t\tmyVideo.currentTime = myVideo.currentTime + 10; //the playback time increases by ten second\r\n\t}", "function timeLimit() {\n var array = document.querySelectorAll(\"span\");\n var time = 0;\n if (array.length <= 90) {\n time = 30;\n } else if (array.length > 90 && array.length <= 135) {\n time = 45;\n } else {\n time = 60;\n }\n\n let x = setInterval(() => {\n if (time < 0 || complete) {\n clearInterval(x);\n getNextQuote();\n complete = false;\n } else {\n timerElement.innerHTML = time;\n time--;\n }\n }, 1000);\n}", "function timer() {\n\tif (isPlay) {\n\t\tcount++;\n\t\tif (count > numElements - 1) {\n\t\t\tcount = 0\n\t\t}\n\t\tselectelement();\n\n\t\tconsole.log(count);\n\t\twindow.setTimeout(function () { timer(); }, 5000);\n\t}\n}", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "run(cb) {\n const now = new Date().getTime();\n // drop any old data\n this.firedTs = this.firedTs.filter(ts => ts > now - this.seconds * 1000);\n if (this.firedTs.length < this.times) {\n this.firedTs.push(now);\n cb();\n return true;\n }\n return false;\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if (time - previousCall >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "explote() {\n if (this.timer > 1520) {\n this.isExploding = true\n this.timer = 0\n }\n }", "async _handleSessionLimit() {\n const canSpawn = await this._checkSessionLimit();\n if (typeof canSpawn === 'number') {\n this.debug(`Exceeded identify threshold, setting a timeout for ${canSpawn}ms`);\n await Util.delayFor(canSpawn);\n }\n this.create();\n }", "function fewLastEvents(){\n getEvents(QTY_TO_GRAB_LAST_DEPOSITS).then(() => {\n console.log(`Last ${QTY_TO_GRAB_LAST_DEPOSITS} done!`)\n\n setTimeout(fewLastEvents,MS_TO_GRAB_LAST_DEPOSITS)\n })\n }", "set interval(interval) {\n this.interval_ = interval < 17 ? 17 : interval; // 17 ~ 60fps\n }", "function throttle(fn, limit) {\n let timer = null;\n let lastCall = null;\n return function() {\n let context = this;\n if (!lastCall) {\n fn.apply(context, [...arguments]);\n lastCall = Date.now();\n } else {\n clearTimeout(timer);\n timer = setTimeout(() => {\n fn.apply(context, [...arguments]);\n lastCall = Date.now();\n }, limit - (Date.now() - lastCall));\n }\n }\n}", "function throttle (callback, delay) {\n var previousCall = new Date().getTime();\n return function () {\n var time = new Date().getTime();\n\n if (time - previousCall >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle(callback, delay) {\n\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle(callback, delay) {\n var last;\n var timer;\n return function () {\n var context = this;\n var now = +new Date();\n var args = arguments;\n if (last && now < last + delay) {\n // le délai n'est pas écoulé on reset le timer\n clearTimeout(timer);\n timer = setTimeout(function () {\n last = now;\n callback.apply(context, args);\n }, delay);\n } else {\n last = now;\n callback.apply(context, args);\n }\n };\n }", "function sleepn(n) {\n var start = new Date().getTime();\n while (true) if (new Date().getTime() - start > n) break;\n}", "function onSkip(count) {\n if (count == 2) {\n _this.primusServer.removeListener('heartbeat-skipped', onSkip);\n setTimeout(function () {\n _this.relay.stopLargePayload();\n }, 100);\n }\n }", "function appendTime() {\n count -= 10;\n}", "function pageright(e) {\n setMedia();\n media.currentTime = media.currentTime + (trjs.dmz.winsize() * trjs.dmz.pagePercentage);\n if (trjs.param.synchro.block() === true) {\n trjs.events.goToTime('partition', media.currentTime); // the wave is not already set\n }\n }", "function sleep(intMilisegundos)\n{\n if (empty(intMilisegundos))\n intMilisegundos = 0;\n var intStart = new Date().getTime();\n for (var intCount = 0; intCount < 1e7; ++intCount) {\n if ((new Date().getTime() - intStart) > intMilisegundos)\n break;\n }\n}", "function throttle (callback, limit) {\n var wait = false; // Initially, we're not waiting\n return function () { // We return a throttled function\n if (!wait) { // If we're not waiting\n callback.call(); // Execute users function\n wait = true; // Prevent future invocations\n setTimeout(function () { // After a period of time\n wait = false; // And allow future invocations\n }, limit);\n }\n }\n }", "limitInputTo(inp, limit) {\r\n inp.addEventListener(\"input\", () => {\r\n let inputVal = inp.value;\r\n inp.value = inputVal > limit ? limit : inputVal;\r\n }) \r\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "_configureThrottling() {\n if (this.options.maxTPS && this.options.maxTPS > 0) {\n const minTime = parseInt(1000 / this.options.maxTPS);\n if (minTime > 0) {\n this.rate_limiter = new Bottleneck({ minTime });\n this._processMatchedSqsMessage = this.rate_limiter.wrap(this._processMatchedSqsMessage);\n }\n }\n }", "runAgents(limit) {\n if (!limit){\n limit = Infinity;\n }\n if (world.getTicks() < limit) {\n Utils.startRecording(world.getTicks());\n for (var a = 0; a < this.observers.length; a++) {\n Utils.recordData(this.observers[a]);\n this.observers[a].interact();\n }\n Utils.endRecording();\n Utils.clearRecorder();\n this.ticks++;\n DOM.labels.ticksInWorld.innerHTML = this.ticks;\n }else {\n // At run completion \n return true;\n }\n }", "function increaseIntervalTime(){\n intervalTime = intervalTime + 1000;\n}", "function oneHundred() {\n\n el.off('scroll');\n\n remainder = photos.splice(100);\n\n // Add the 100.\n _.each(photos, addImgToDom);\n\n photos = remainder;\n\n // If there's more to do, add back the listener after a delay.\n if (photos.length !== 0) {\n setTimeout(el.on.bind(el, 'scroll', oneHundred), 250);\n }\n\n }", "function thirtySeconds() {\n\t\tif ( counter === 0 ) {\n\t\t\tclearInterval( Clock );\n\t\t\ttimeOutLoss();\n\t\t}\n\t\t//If the number is greater than zero, keep counting down.\n\t\tif ( counter > 0 ) {\n\t\t\tcounter--;\n\t\t}\n\t\t$( \".timer\" )\n\t\t\t.html( counter );\n\t}", "function concurrent_time() {\n if (app_opt.simulate)\n return simulate(event_opt.simulate.min, event_opt.simulate.max);\n else\n return event_opt.simulate.tick;\n }", "function throttleEvent(target, eventName, newEventName) {\n\t var running = false;\n\t /* istanbul ignore next: borrowed directly from MDN */\n\t var func = function (event) {\n\t if (running) {\n\t return;\n\t }\n\t running = true;\n\t requestAnimationFrame(function () {\n\t target.dispatchEvent(new CustomEvent(newEventName, event));\n\t running = false;\n\t });\n\t };\n\t target.addEventListener(eventName, func);\n\t return func;\n\t}", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function () {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n}", "function findTenFree(eventTimes, currentEventObj) {\n var tenFreeTimes = []\n var eventCounter = 0\n var dayCounter = 0\n var aDay = 86400000;\n var now = new Date().getTime();\n var time = now - now%aDay + aDay;\n var halfHour = aDay/48;\n var startTime = currentEventObj.end + 1800000\n while (dayCounter < 3) {\n eventTimes.map((eventObj) => {\n var eventTimeObject = convertMilli(eventObj)\n if(!checkConflict(eventTimeObject, {'start': startTime, 'end': startTime + halfHour})) {\n console.log('THIS IS THE event counter: ', eventCounter);\n tenFreeTimes.push(startTime)\n console.log('This is the array of shit', tenFreeTimes);\n if (eventCounter === 10) {\n console.log('THIS SHOULD BE 10: ', eventCounter);\n dayCounter = 4\n }\n eventCounter ++\n if (dayCounter === 2) {\n dayCounter = 0\n startTime = startTime - startTime%aDay + aDay + aDay/3\n }\n else {\n dayCounter++\n }\n }\n })\n }\n return tenFreeTimes\n}", "sendMoreMessages (callback) {\n\t\tthis.messages = [this.message];\n\t\tBoundAsync.timesSeries(\n\t\t\tthis,\n\t\t\t10,\n\t\t\tthis.sendMessage,\n\t\t\tcallback\n\t\t);\n\t}", "function pause(ms) {\n\t\t\tvar date = new Date(); \n\t\t\tcurDate = null;\n\t\t\tdo { var curDate = new Date(); }\n\t\t\twhile ( curDate - date < ms);\n\t\t }", "incrementRepeating(event) {\n event.count++;\n // the web audio spec doesn't allow buffer source nodes to be reused\n const dummySource = this.audioCtx.createBufferSource();\n dummySource.buffer = event.source.buffer;\n dummySource.connect(this.audioCtx.destination);\n dummySource.onended = () => {\n event.callback();\n // add the next occurence\n this.incrementRepeating(event);\n };\n dummySource.start(\n event.time + event.count * event.frequency - dummySource.buffer.duration\n );\n event.source = dummySource;\n }", "sleep(milliseconds) {\n var start = new Date().getTime();\n for (var i = 0; i < 1e7; i++) {\n if ((new Date().getTime() - start) > milliseconds){\n break;\n }\n }\n }", "function tweakWaitTime(t) {\n t += (t*Math.random()/5*(Math.random()>.5 ? 1 : -1));\n // now we need to tweak the start time to avoid a timing problem in htmlservice \n // .. never start one within 750ms of the last one.\n var now = new Date().getTime();\n startTime_ = Math.max(now + t, startTime_+750);\n return startTime_ - now;\n }", "function ten_second_interval( last_song_id ) {\n // Reload the number of days since the last discrepancy log\n // was filed\n daysSinceLastIncident();\n\n // Reload the number of web stream listeners\n $.getJSON( \"https://stream.wmtu.mtu.edu:8000/status-json.xsl\", undefined, czech_listeners );\n\n // Load new items into the trackback feed\n last_song_id = load_trackback( false, last_song_id );\n\n // Load new items into the Twitter request feed\n $.getJSON( \"./twitter.php?first=false\", function( data ) {\n var i = 0;\n cycleTwitterFeed( i, data, false );\n } );\n\n // Reload the image\n cycleImageFeed();\n\n // Check whether or not songs are being logged\n check_logging();\n\n // Run again in ten seconds\n setTimeout( ten_second_interval, 10000, last_song_id );\n}", "function throttle() {\n var fn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : noop;\n var interval = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;\n\n var last = 0;\n\n return function () {\n var context = this;\n var now = Date.now();\n\n if (now - last > interval) {\n last = now;\n fn.apply(context, arguments);\n }\n };\n }", "async function frequencyChanged() {\n config.changeFrequency = {change: false, newTime: 0};\n}", "onTimeOut() {\n if(this.exhausted) {\n this.stop();\n return;\n }\n \n this.roll();\n }", "function throttle(func, limit) {\n if (typeof func !== 'function') {\n throw new Error('function argument is expected');\n } else if (typeof limit !== 'number') {\n throw new Error('number argument is expected');\n }\n\n var listener = new ThrottleListener(limit);\n\n return function () {\n return listener.execute(func, this, arguments);\n };\n }", "function throttleAdvance(fn, limit) {\n var trottleFn;\n var lastRunTime;\n return function() {\n var context = this,\n args = arguments;\n if (!lastRunTime) {\n fn.apply(context, args);\n lastRunTime = Date.now();\n } else {\n clearTimeout(trottleFn);\n trottleFn = setTimeout(() => {\n if (Date.now() - lastRunTime >= limit) {\n fn.apply(context, args);\n lastRunTime = Date.now();\n }\n }, limit - (Date.now() - lastRunTime));\n }\n };\n}", "function musiciansControl(){\r\n var now = Date.now();\r\n for(var i = 0; i < musicians.length; ++i){\r\n if(now - musicians[i].activeSince > 5000){\r\n musicians.splice(i,1);\r\n }\r\n }\r\n}", "function listNext10Events() {\n var calendarId = 'primary';\n var now = new Date();\n var events = Calendar.Events.list(calendarId, {\n timeMin: now.toISOString(),\n singleEvents: true,\n orderBy: 'startTime',\n maxResults: 10\n });\n if (events.items && events.items.length > 0) {\n for (var i = 0; i < events.items.length; i++) {\n var event = events.items[i];\n if (event.start.date) {\n // All-day event.\n var start = new Date(event.start.date);\n Logger.log('%s (%s)', event.summary, start.toLocaleDateString());\n } else {\n var start = new Date(event.start.dateTime);\n Logger.log('%s (%s)', event.summary, start.toLocaleString());\n }\n }\n } else {\n Logger.log('No events found.');\n }\n}", "runWithTs(now, cb) {\n // drop any old data\n this.firedTs = this.firedTs.filter(ts => ts > now - this.seconds * 1000);\n if (this.firedTs.length < this.times) {\n this.firedTs.push(now);\n cb();\n return true;\n }\n return false;\n }", "updateNextMinuteData(minCount, minPosition) {\n // console.log(`minCount: ${minCount}, minPosition: ${minPosition}`);\n if (minPosition === 0) {\n // console.log(\"adding some visitors\");\n this.visitorsInMin = this.waitingVisitors.filter((visitor) => {\n let arrival = Number.parseInt(visitor.arrival);\n return arrival == minCount + 2;\n });\n // console.log(JSON.stringify(this.visitorsInMin));\n if (this.visitorsInMin.length > 0) {\n this.framesPerVisitor = Math.floor(this.framesPerMin / this.visitorsInMin.length);\n } else {\n this.framesPerVisitor = this.framesPerMin;\n }\n }\n }", "_addPingExecutionTimestamp() {\n this.pingExecIntervals.push(new Date().getTime()); // keep array length to PING_TIMESTAMPS_TO_KEEP\n\n if (this.pingExecIntervals.length > PING_TIMESTAMPS_TO_KEEP) {\n this.pingExecIntervals.shift();\n }\n }", "function throttleUpdates(t,e){function u(){function e(){n=+new Date,t.apply(u,d)}var u=this,a=+new Date-n,d=arguments;i&&clearTimeout(i),a>r?e():i=setTimeout(e,r-a)}var i,n=0,r=50;return jQuery.guid&&(u.guid=t.guid=t.guid||jQuery.guid++),u}", "function addNeededNotificationsForSecond(){ \n var currentTime = (Math.trunc(document.querySelector('.video-container video').currentTime))\n console.log('[drinker] currentTime: ' + currentTime);\n\n\n if (currentTime == 173) {\n addNotification('Interlude music - Take a drink!', 5000);\n }\n\n if (currentTime == 174) {\n addNotification('Hahaha, Mark ugh', 5000);\n }\n\n if (currentTime == 176) {\n addNotification('Dobby changes personality', 5000);\n }\n\n if (currentTime == 179) {\n addNotification('Mark is in a club', 5000);\n }\n}", "isPastCutoff() {\n return this.isTracking && Date.now() - this.pauses.last() > 5 * 60 * 1000\n }", "function starttime(){\n \twatch = setInterval(count, 1000)\n time = 10; \n }", "getMoreExpired(){\n this._numCurrent = 1;\n let output = _formatEventsIntoHTML(this._schedule[1].slice(this._numExpired - 1, this._numExpired + 9));\n this._numExpired += 10;\n\n return output;\n }", "function _throttle(fn) {\n\t\tvar prev = Date.now();\n\t\treturn function (e) {\n\t\t\tif((Date.now() - prev) < THROTTLE_THRESHOLD) return;\n\t\t\tfn.call(this, e);\n\t\t\tprev = Date.now();\n\t\t};\n\t}" ]
[ "0.62983847", "0.61174566", "0.5928281", "0.589216", "0.5866947", "0.584249", "0.58241105", "0.5796132", "0.57956105", "0.5787924", "0.5739298", "0.5708903", "0.56735647", "0.56702447", "0.5667123", "0.56582093", "0.56417125", "0.554792", "0.5539374", "0.55283046", "0.55283046", "0.55283046", "0.55283046", "0.55283046", "0.55283046", "0.55259657", "0.54875535", "0.544621", "0.5385802", "0.53854746", "0.53805375", "0.53676456", "0.5354616", "0.5346239", "0.5345557", "0.53369963", "0.5330647", "0.5292854", "0.52905935", "0.52901894", "0.5289263", "0.52881855", "0.5287374", "0.52808845", "0.5268356", "0.5268356", "0.5268356", "0.5268356", "0.5268356", "0.5268356", "0.5268356", "0.5263848", "0.52523214", "0.52507025", "0.5249827", "0.523989", "0.52382845", "0.5234412", "0.5233229", "0.5231228", "0.52279603", "0.5222568", "0.5220703", "0.5213815", "0.52136296", "0.52125496", "0.5211935", "0.52104634", "0.5201977", "0.519851", "0.51740324", "0.51600397", "0.51554126", "0.5153737", "0.51531357", "0.5152042", "0.51435906", "0.51427907", "0.51423186", "0.5141115", "0.5140973", "0.51390004", "0.513523", "0.5125747", "0.5120086", "0.5119786", "0.51197076", "0.51167893", "0.51163137", "0.5106621", "0.50971663", "0.5090354", "0.5073308", "0.50704694", "0.50697803", "0.506532", "0.50622654", "0.5061313", "0.505455", "0.5054528" ]
0.5164907
71
make the canvas fill its parent
function onResize() { // We execute the same script as before let vh = window.innerHeight * 0.01; document.documentElement.style.setProperty("--vh", `${vh}px`); canvas.width = window.innerWidth; canvas.height = window.innerHeight; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fillCanvas() {\n // Clear the previous elements\n ctx.clearRect(0, 0, canvas.width, canvas.height)\n\n addBackground();\n addUFO(); \n}", "setFill() {\n const fill = new PIXI.Graphics();\n fill.beginFill(0xffffff);\n fill.drawRect(0, 0, canvas.dimensions.width, canvas.dimensions.height);\n fill.endFill();\n this.composite(fill);\n fill.destroy();\n }", "function updateCanvas() {\n ctx.clearRect(0, 0, 430, 430);\n fillCanvas();\n }", "fill() {\n this.movePen(this.bpenx, this.bpeny);\n this.context.fill.apply(this.context, arguments);\n }", "fill() {\r\n canvas.ctx.beginPath();\r\n canvas.ctx.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\r\n canvas.ctx.fillStyle = this.color;\r\n canvas.ctx.fill();\r\n canvas.ctx.stroke();\r\n }", "draw(ctx){\n ctx.save()\n ctx.beginPath()\n ctx.strokeStyle = this.strokeColor\n ctx.lineWidth = this.strokeWidth\n\n const MAX_HEAD = 80\n let new_y = (this.pesanteur) ? window.innerHeight - this.height - MAX_HEAD : this.y\n ctx.rect(this.x, new_y, this.width, this.height)\n\n ctx.fillStyle = this.fillColor\n\n ctx.closePath()\n ctx.fill()\n ctx.stroke()\n ctx.restore() \n \n\n }", "draw(ctx){\r\n ctx.save()\r\n ctx.beginPath()\r\n ctx.strokeStyle = this.strokeColor\r\n ctx.lineWidth = this.strokeWidth\r\n\r\n const MAX_HEAD = 80\r\n let new_y = (this.pesanteur) ? window.innerHeight - this.height - MAX_HEAD : this.y\r\n ctx.rect(this.x, new_y, this.width, this.height)\r\n\r\n ctx.fillStyle = this.fillColor\r\n\r\n ctx.closePath()\r\n ctx.fill()\r\n ctx.stroke()\r\n ctx.restore()\r\n }", "function fillCanvas(event) {\r\n\t\t//remplissage de toute la toile avec la couleur en cours\r\n\t\tcontext.fillStyle = color;\r\n\t\tcontext.fillRect(0,0,canvasWidth,canvasHeight);\r\n\t}", "paint () {\n // Clearing canvas first\n this.clear()\n this.root.__paint(this.canvasContext)\n }", "function _adjustCanvasBounds() {\n\t\t\tvar parentSize = canvas.parentNode.getBoundingClientRect();\n\t\t\tcanvas.width = parentSize.width;\n\t\t\tcanvas.height = parentSize.height;\n\t\t}", "draw(ctx){\n ctx.save();\n ctx.fillStyle = \"green\";\n ctx.fillRect(this.x-this.width/2,this.y-this.height/2,this.width,this.height);\n ctx.restore();\n }", "function fillBackgroundColor(canvas, context) {\n\tcontext.fillStyle = bgColor.value;\n\tcontext.fillRect(0, 0, canvas.width, canvas.height);\n\n}", "drawbackground(){\n CTX.fillStyle = \"#41f459\";\n CTX.fillRect(this.x,this.y, this.width, this.height);\n\n\n }", "function fill() {\n //colours the canvas content to match rest of the screen\n cont.fillStyle = '#232323';\n //sets canvas content to same size as canvas\n cont.fillRect(0,0,canvas.width,canvas.height);\n //draws the current tile\n draw(current.shape, current.position.x, current.position.y);\n //draws the back table, all previously placed tiles\n drawGrid(backTable)\n\n}", "function draw(canvas)\n{\t\n\thelper.clear(canvas) // Clear canvas and set size\n \tvar ctx=canvas[0].getContext(\"2d\");\t\n\tctx.fillStyle=\"green\";\n\tctx.fillRect(0, 0, canvas.width(), canvas.height());\n}", "drawBackground() {\n this.cxt.fillStyle = '#FFE5CE'\n this.cxt.fillRect(0, 0, this.width, this.height)\n }", "function paintCanvas() {\r\n ctx.clearRect(0, 0, width, height);\r\n }", "draw(){\n canCon.beginPath();\n canCon.rect(this.x, this.y, this.width, this.height);\n canCon.fillStyle = 'blue';\n canCon.fill();\n}", "function setCanvasSizeToParentSize(canvas) {\n canvas.width = getParentProp(\"width\", { float: true });\n canvas.height = getParentProp(\"height\", { float: true });\n}", "dibujar(canvas, ctx) {\n // const x = map(this.posX() - 10, 0, this.tablero.ancho, 0, canvas.width);\n // const y = map(this.posY() - 10, 0, this.tablero.alto, 0, canvas.height);\n const x = (this.tablero.vista.ancho * this.posX() / this.tablero.ancho) | 0;\n const y = (this.tablero.vista.alto * this.posY() / this.tablero.alto) | 0;\n ctx.strokeStyle = '#0f';\n ctx.fillStyle = this.color;\n ctx.beginPath();\n ctx.arc(x , y, this.tablero.anchoCelda / 2, 0, (Math.PI / 180) * 360);\n ctx.fill();\n // ctx.beginPath();\n // ctx.strokeRect(x - this.tablero.vista.anchoCelda / 2, y - this.tablero.vista.anchoCelda / 2, this.tablero.anchoCelda, this.tablero.anchoCelda);\n // ctx.stroke();\n }", "function paintCanvas() {\n\tctx.fillStyle = \"black\";\n\tctx.fillRect(0, 0, W, H);\n}", "function paintCanvas() {\n\tctx.fillStyle = \"black\";\n\tctx.fillRect(0, 0, W, H);\n}", "draw(){\r\n ctx.beginPath();\r\n ctx.fillStyle = 'white';\r\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);\r\n ctx.fill();\r\n }", "_render(){\n this._ctx.save();\n this._ctx.clearRect(0, 0, this._width, this._height);\n this._ctx.fillStyle = this._background;\n this._ctx.fillRect(0, 0, this._width, this._height);\n\n // Update this object's canvas here.\n this._ctx.restore();\n }", "scaleCanvas() {\n this.canvas.setWidth(this.width);\n this.canvas.setHeight(this.height);\n this.canvas.renderAll();\n }", "clear() {\n this.context.fillStyle = \"white\";\n this.context.fillRect(\n -this.width / 2,\n -this.height / 2,\n this.width,\n this.height\n );\n }", "function fixCanvas(){\n CANVAS.width=400\n CANVAS.height=225\n CANVAS.style.width = \"400px\"\n CANVAS.style.height = \"225px\"\n}", "draw() {\n // Don't draw if shape has have moved off the canvas\n if (this.x > this.canvas.width || this.y > this.canvas.height ||\n this.x + this.width < 0 || this.y + this.height < 0) {\n return;\n }\n this.canvas.context.fillStyle = this.fill;\n this.canvas.context.fillRect(this.x, this.y, this.width, this.height);\n // Highlight after fill so it is on top\n if (this.selected) {\n this.highlightSelected();\n this.drawResizeHandles();\n }\n }", "function paintCanvas() \n{\n\t// Set the fill color to black\n\tctx.fillStyle = \"rgba(0,0,0,1)\";\n\t\n\t// This will create a rectangle of white color from the \n\t// top left (0,0) to the bottom right corner (W,H)\n\tctx.fillRect(0,0,W,H);\n}", "draw() {\n if (this.isFilled) {\n this.fill();\n } else {\n this.outline();\n }\n }", "clean() {\n const height = this.ctx.canvas.height;\n const width = this.ctx.canvas.width;\n // Origin is at the center, so start painting from bottom left.\n this.ctx.clearRect(width * -1 / 2, height * -1 / 2, width, height);\n }", "function Background() {\n\tctx.beginPath();\n\tctx.rect(0, 0, 1140, 600);\n\tctx.fillStyle = \"black\";\n\tctx.fill();\n}", "function initCanvas()\n{\n canvas.style.backgroundColor = \"white\";\n paper.clear();\n}", "function setUpCanvas() {\r\n canvas = document.createElement(\"CANVAS\");\r\n canvas.id = \"canvas\";\r\n canvas.style.width = \"100%\";\r\n canvas.style.height = \"100%\";\r\n canvas.style.background = 'black';\r\n canvas.style.marginLeft = 'auto';\r\n canvas.style.marginRight = 'auto';\r\n canvas.style.display = 'block';\r\n }", "clearCanvas() {\n const context= this.state.context;\n context.fillStyle = 'black';\n context.fillRect( 0, 0, this.state.engine.maxWidth, this.state.engine.maxHeight );\n }", "fitCanvasToScreen() {\n this.canvas.width = window.innerWidth;\n this.canvas.height = window.innerHeight;\n this._rect = this.canvas.getBoundingClientRect(); // Update\n }", "function makeGround() {\n c.beginPath();\n c.rect(0, canvas.height - 100, canvas.width, 50);\n c.fillStyle = \"green\";\n c.fill();\n}", "set rootCanvas(value) {}", "_drawOutline(){\n this.ctx.strokeStyle = 'black';\n this.ctx.strokeRect(0,0, this.canvas.width, this.canvas.height);\n }", "function paintCanvas(){\n\t// set color to black \n\tctx.fillStyle = \"rgba(46, 46,73, 1)\";\n\n\t// Rectangle of white from Top Left (0,0) to Bottom Right (W, H)\n\tctx.fillRect(0,0,W,H);\n}", "fill(v){\tthis.ctx.fillStyle = v; return this; }", "function paintCanvas() {\n ctx.fillStyle = \"black\";\n ctx.fillRect(0, 0, W, H);\n}", "paint() {\r\n graphics.fillStyle = \"#1aff1a\";\r\n graphics.fillRect(this.x - this.w / 2, this.y - this.h, this.w, this.h);\r\n }", "draw(){\n ctx.beginPath();\n ctx.arc(this.x, this.y, this.size, 0, Math.PI*2, false);\n ctx.fillStyle = this.color;\n ctx.fill();\n }", "drawCanvas() {\n\n\t}", "function coverWin() {\n noStroke();\n fill(130, 206, 245);\n rect(0,0,190,85);\n}", "setCanvas() {\n this.canvas.width = this.height = 800;\n this.canvas.height = this.width = 800;\n }", "drawBackground() {\n const width = this.canvas.width;\n const height = this.canvas.height;\n const radius = this.getBorderRadius();\n this.context.fillStyle = this.getBackgroundColor();\n this.context.beginPath();\n this.context.moveTo(radius, 0);\n this.context.arcTo(width, 0, width, radius, radius);\n this.context.arcTo(width, height, width - radius, height, radius);\n this.context.arcTo(0, height, 0, height - radius, radius);\n this.context.arcTo(0, 0, radius, 0, radius);\n this.context.fill();\n }", "draw(){ \n ctx.beginPath();\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2, false)\n ctx.fillStyle = this.color\n ctx.fill();\n }", "animate(ctx){\n this.drawBackground(ctx);\n }", "function Klein() {\n Zauberbild.canvas.height = 400;\n Zauberbild.canvas.width = 400;\n }", "function drawFrame() {\n context.fillRect(0, 0, canvas.width, canvas.height);\n context.fillStyle = \"#e8eaec\";\n }", "render(ctx, width, height) {\n ctx.beginPath();\n ctx.rect(0, 0, width, height);\n ctx.closePath();\n ctx.lineWidth = 2; //since this line is on the border, only 1px actually gets drawn\n ctx.strokeStyle = \"#ffffff\";\n ctx.stroke();\n\n this.guiManager.render(ctx, width, height);\n }", "backgroundDisplay() {\n push();\n rectMode(CORNER);\n noStroke();\n fill(this.color);\n rect(this.x, this.y, this.width, this.height);\n pop()\n }", "clearCanvas() {\n this.canvas.width = this.canvas.width;\n this.ctx.lineWidth = 3;\n }", "function fitToContainer(canvasName){\n var canvas = document.getElementById(canvasName)\n canvas.style.width=\"100%\";\n canvas.style.height=\"100%\";\n canvas.width = canvas.offsetWidth;\n canvas.height = canvas.offsetHeight;\n}", "draw(ctx) {\n const { x, y, height, width, color } = this;\n\n ctx.fillStyle = color;\n ctx.fillRect(x, y, width, height);\n }", "function respondCanvas() { \n var container = $($canvas).parent();\n\n $canvas.attr('width', $(container).width() ); //max width\n $canvas.attr('height', $(container).height() ); //max height\n\n $tmpCanvas.attr('width', $(container).width() ); //max width\n $tmpCanvas.attr('height', $(container).height() ); //max height\n }", "draw() {\n\t\t/**\n\t\t * @const {object}\n\t\t */\n\t\tconst rect = new fabric.Rect({\n\t\t\ttop: this.position.y,\n\t\t\tleft: this.position.x,\n\t\t\twidth: this.width,\n\t\t\theight: this.height,\n\t\t\tfill: this.color,\n\t\t\tstroke: '#000',\n\t\t\tstrokeWidth: 0.2,\n\t\t\tselectable: false,\n\t\t});\n\t\t\n\t\tcanvas.add(rect);\n\t}", "function drawBackground() {\n context.fillStyle = \"gray\";\n context.fillRect(0, 0, canvas.width, canvas.height);\n}", "draw() {\n ctx.beginPath();\n ctx.fillStyle = \"white\";\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);\n ctx.fill();\n }", "function drawCanvas() {\n\t\tdraw(context, drawer, colours, solver);\n\t\tsolver.callStateForItem(spanState);\n\t}", "function init(){\n \n c.fillStyle = canvasBkg\n c.fillRect(0, 0, canvas.width, canvas.height)\n}", "function resizeCanvas() {\n let parent = canv.parentNode;\n if (parent == document.body) {\n parent = window;\n canv.style.width = parent.innerWidth + \"px\";\n\n canv.width = parent.innerWidth;\n canv.height = parent.innerHeight;\n }\n else {\n //Take the canvas out of the parent div sive calculation momentarily\n can.style.height = \"0px\";\n can.style.width = \"0px\";\n can.width = 0\n can.height = 0;\n //Then on the next tick put it back in.\n setTimeout(function () {\n let width = parent.clientWidth;\n let height = parent.clientHeight;\n can.style.width = width + \"px\";\n can.style.height = height + \"px\";\n can.width = width;\n can.height = height;\n //console.log(`${parent.clientWidth}-${parent.innerWidth}-${parent.offsetWidth}`)\n console.log(`${can.style.height} ${can.height}`)\n }, 0);\n\n }\n }", "function drawBackground() {\n\tcontext.save();\n\tcontext.fillStyle = \"#f0f0ff\";\n\tcontext.fillRect(0, 0, canvas.width, canvas.height);\n\tcontext.translate(0, canvas.height - 50);\n\tcontext.fillStyle = \"#007f00\";\n\tcontext.fillRect(0, 0, canvas.width, 50);\n\tcontext.restore();\n}", "function canvasResizer(){\n variables.semlet().height=240;\n variables.semlet().width=400;\n variables.ctx().strokeStyle=\"white\";\n}", "function drawEverythingFromScratch() {\n\tcanvas.width = canvas.width;\n\tdrawThings();\n}", "draw(ctx){\n saveMatrix();\n ctx.save();\n translate(0,0);\n\n if (this.extended) {\n this.dockPointsReq.forEach((value) => {\n value.draw(ctx);\n });\n this.dockPointsDev.forEach((value) => {\n value.draw(ctx);\n });\n }\n\n ctx.strokeRect(this.x,this.y+this.margin_top,this.width,this.height);\n restoreMatrix();\n ctx.restore();\n }", "clearCanvas(){\n this.canvas.width = this.canvas.width;\n }", "display(){\r\n \r\n rectMode(CENTER);\r\n fill(\"cyan\");\r\n rect (this.body.position.x, this.body.position.y, this.width, this.height);\r\n \r\n }", "function fillBackground(color) {\n\t\tcontext.fillStyle = color;\n\t\tcontext.fillRect(0, 0, canvas.width, canvas.height);\n\t}", "function respondCanvas()\n{\n\tvar canvas = $('#canvas');\n\tvar container = $(canvas).parent();\n\tcanvas.attr('width', $(container).width() ); // Max width\n\t//canvas.attr('height', $(container).height() ); // Max height\n}", "function setCanvasSize() {\n var width = $('#coloring').width();\n var height = $('#coloring').height();\n\n $('#coloring_canvas').attr('width', width);\n $('#coloring_canvas').attr('height', height);\n context.lineWidth = radius * 2;\n }", "draw() {\n ctx.beginPath();\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2, false );\n ctx.fillStyle = '#ffffff';\n ctx.fill();\n }", "draw() {\n\t\t\tc.beginPath();\n\t\t\tc.fillStyle = this.color;\n\t\t\tc.fillRect(\n\t\t\t this.x - width / 2,\n\t\t\t this.y - height / 2,\n\t\t\t\twidth,\n\t\t\t\theight\n\t\t\t);\n\t\t\tc.closePath();\n\t\t }", "function effacerDessin() {\n objC2D.clearRect(0, 0, objCanvas.width, objCanvas.height);\n}", "drawBg() {\n let ctx = this.bgCanvas.getContext(\"2d\");\n // important: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/clearRect\n // using beginPath() after clear() prevents odd behavior\n ctx.beginPath();\n ctx.fillStyle = \"white\";\n ctx.lineStyle = \"black\";\n ctx.lineWidth = 1;\n\n // white rectangle for background\n ctx.fillRect(0, 0, this.canvasWidth, this.canvasHeight);\n }", "function clearCanvas() {\n c.clear();\n setBg(' ');\n document.getElementById(\"canvas-bg\").style.backgroundSize = '100%'\n document.getElementById('canvas-bg').style.backgroundPosition = '0px 0px'\n}", "function drawBackground() {\n\t// Draw the background\n\tcolorRect(0, 0, canvas.width, canvas.height, '#333');\n}", "function clearCanvas() {\n ctx.fillStyle = backgroundColor;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n}", "draw(ctx) {\n ctx.fillStyle = this.color;\n ctx.moveTo(this.position.X, this.position.Y);\n if (this.icon) {\n ctx.drawImage(this.icon, this.position.X, this.position.Y);\n } else {\n ctx.fillRect(this.position.X, this.position.Y, this.size.WIDTH, this.size.HEIGHT);\n }\n }", "clear(ctx) {\n var p1 = this.toWorld(0, 0);\n var p2 = this.toWorld(this.width, this.height);\n var fillStyle = this.get(\"fillStyle\");\n if (fillStyle) {\n ctx.fillStyle = fillStyle;\n ctx.fillRect(p1.x, p1.y, p2.x - p1.x, p2.y - p1.y);\n } else {\n ctx.clearRect(p1.x, p1.y, p2.x - p1.x, p2.y - p1.y);\n }\n }", "function borraCanvas(){\n \n canvas.width=500\n canvas.height=500\n\n\n}", "function preparaCanvas()\n{\n div = document.getElementById(\"lifegameBoard\");\n c.width = (cellsize + 1) * numeroColonne + 2;\n c.height = (cellsize + 1) * numeroRighe + 2;\n\n ctx.beginPath();\n disegnaCampo(\"#657b83\")\n ctx.stroke();\n div.appendChild(c);\n\n}", "clear() {\n this.context.fillStyle = '#d0fcb3';\n this.context.fillRect(0, 0, this.width, this.height);\n }", "fillRect(x, y, w, h) {\n CanvasManager.fillRect(findNodeHandle(this), x, y, w, h)\n }", "draw(ctx){\n ctx.save(); \n ctx.beginPath();\n ctx.rect(this.x-this.width/2,this.y-this.height/2,this.width,this.height);\n ctx.closePath();\n ctx.fillStyle = \"blue\";\n ctx.fill();\n ctx.restore();\n\n ctx.save();\n ctx.beginPath();\n ctx.rect(0,570,800 * (this.health/this.originalHealth),30);\n ctx.closePath();\n ctx.fillStyle = \"red\";\n ctx.fill();\n ctx.restore();\n }", "function fillContext() {\r\n\t\tcontext.lineWidth = lineWidth;\r\n\t\tcontext.fillStyle = color;\r\n\t\tcontext.fill();\r\n\t}", "function bg(ctx) {\n\tctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n\tctx.fillStyle = '#1c1c1c';\n\tfor (var x = -1; x < ctx.canvas.width + 1; x += cellSize) {\n\t\tctx.fillRect(x, 0, 2, ctx.canvas.height);\n\t}\n\tfor (var y = -1; y < ctx.canvas.height + 1; y += cellSize) {\n\t\tctx.fillRect(0, y, ctx.canvas.width, 2);\n\t}\n}", "function drawRect(){\n context.fillStyle = this.style;\n context.fillRect(Math.round(this.x), Math.round(this.y), this.xLen, this.yLen);\n}", "function cleanCanvas(){\r\n\tcanvas.width=ancho;\r\n\tcanvas.height=alto;\r\n}", "clear() {\n this.ctx.fillStyle = colours.flat_davys_grey;\n this.ctx.fillRect(0, 0, this.size.x, this.size.y);\n\n }", "draw(){\r\n ctx.beginPath()\r\n ctx.arc(this.x,this.y,this.size,0,Math.PI * 2,false)\r\n ctx.fillStyle = '#8C5523';\r\n ctx.fill();\r\n //ctx.globalAlpha=0.3;\r\n\r\n }", "function paintCanvas(color, context) {\r\n const W = context.canvas.clientWidth;\r\n const H = context.canvas.clientHeight;\r\n context.save();\r\n context.fillStyle = color;\r\n context.fillRect(0, 0, W, H);\r\n context.restore();\r\n}", "function clearCanvas() {\r\n\r\n ctx.fillStyle = CANVAS_BACKGROUND_COLOR;\r\n\r\n ctx.strokestyle = CANVAS_BORDER_COLOR;\r\n\r\n ctx.fillRect(0, 0, gameCanvas.width, gameCanvas.height);\r\n ctx.strokeRect(0, 0, gameCanvas.width, gameCanvas.height);\r\n }", "function fillBackgroundColor(canvas, context) {\n\t\n\t//var bgColor = document.getElementById(\"backgroundColor\").value;\n\tCOLORBG = document.getElementById(\"backgroundColor\").value;\n\tcontext.fillStyle = COLORBG;\n\tcontext.fillRect(0, 0, canvas.width, canvas.height);\n\n}", "function setup(){\n var canvas = createCanvas(594,841);\n rectMode(CENTER);\n canvas.parent(\"myContainer\");\n var value = 0;\n background(\"#ff6384\");\n}", "function drawCanvas() {\n\t\tdrawing(context, drawer, colours, solver, selectedSpacesGrid);\n\t\tsolver.callStateForItem(spanState);\n\t}", "draw() {\n noStroke();\n if (this.color) {\n fill(this.color.x, this.color.y, this.color.z);\n } else {\n fill(0);\n }\n rect(this.pos.x, this.pos.y, this.w, this.h);\n }", "drawBackground(ctx) {\n if (this.background) {\n if (!ctx) {\n this.background.draw(this.ctx)\n } else {\n this.background.draw(ctx)\n }\n }\n }", "function draw() {\n background(255,0,0)\n rectMode(CENTER)\n rect(250.250,100,100)\n}" ]
[ "0.70171833", "0.68119013", "0.67252463", "0.66741735", "0.6660765", "0.66560096", "0.66532516", "0.6634007", "0.66007406", "0.656795", "0.65208054", "0.63870007", "0.6386884", "0.6366845", "0.62956166", "0.6262411", "0.62279254", "0.62278765", "0.62194324", "0.6218293", "0.62015724", "0.62015724", "0.6199568", "0.61730015", "0.61691165", "0.61636555", "0.6150771", "0.61418635", "0.6109787", "0.6099054", "0.6074213", "0.6066588", "0.6064562", "0.6064334", "0.604542", "0.6042843", "0.6041799", "0.60226375", "0.6017849", "0.601402", "0.6013742", "0.6013306", "0.6012084", "0.60058737", "0.6001635", "0.5987962", "0.59802556", "0.59699035", "0.59668046", "0.59667003", "0.59621936", "0.5952896", "0.5943098", "0.5938145", "0.5937876", "0.593229", "0.592962", "0.5925249", "0.5924801", "0.5921905", "0.59172165", "0.591528", "0.59102136", "0.5910212", "0.59101707", "0.5899018", "0.58754665", "0.58599883", "0.58550423", "0.5853921", "0.58478165", "0.5846126", "0.5844616", "0.58413005", "0.58412766", "0.58378", "0.5833811", "0.58336824", "0.5831432", "0.5831429", "0.5830118", "0.5829504", "0.58262455", "0.5825473", "0.58223295", "0.58208716", "0.5811251", "0.5804623", "0.5798207", "0.579631", "0.5795054", "0.579041", "0.57839173", "0.5782685", "0.57676274", "0.5760869", "0.5755439", "0.5739429", "0.5734149", "0.5724221", "0.5723619" ]
0.0
-1
============================================== Smmoth Scroll Navigation ===============================================
function scrollNav() { $('.nav a').click(function(){ //Toggle Class $(".active").removeClass("active"); $(this).closest('li').addClass("active"); var theClass = $(this).attr("class"); $('.'+theClass).parent('li').addClass('active'); //Animate $('html, body').stop().animate({ scrollTop: $( $(this).attr('href') ).offset().top - 30 }, 1000); return false; }); $('.scrollTop a').scrollTop(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function navScroll() {\n // init controller\n height = window.innerHeight;\n var controller = new ScrollMagic.Controller();\n\n // build scenes\n new ScrollMagic.Scene({triggerElement: \"#intro\"})\n .setClassToggle(\"#nav\", \"bg-sienna\") // add class toggle\n .addTo(controller);\n}", "function opNavScroll() {\r\n\r\n if ($('.op-section')[0]) {\r\n\r\n var section = $(\".op-section\");\r\n var sections = {};\r\n var i = 0;\r\n\r\n Array.prototype.forEach.call(section, function(e) {\r\n sections[e.id] = e.offsetTop;\r\n });\r\n\r\n window.onscroll = function() {\r\n var scrollPosition = document.documentElement.scrollTop || document.body.scrollTop;\r\n\r\n for (i in sections) {\r\n if (sections[i] <= scrollPosition) {\r\n $('li.menu-item').removeClass('current_page_item');\r\n $('a[href*=' + i + ']').parent().addClass('current_page_item ');\r\n }\r\n }\r\n }\r\n\r\n }\r\n }", "function initNavigation() {\n const mainNavLinks = gsap.utils.toArray(\".main-nav a\");\n const mainNavLinksRev = gsap.utils.toArray(\".main-nav a\").reverse();\n\n mainNavLinks.forEach((link) => {\n link.addEventListener(\"mouseleave\", (e) => {\n // add class\n link.classList.add(\"animate-out\");\n setTimeout(() => {\n // remove class\n link.classList.remove(\"animate-out\");\n }, 300);\n });\n });\n\n function navAnimation(direction) {\n // console.log(direction);\n\n // if (direction == 1) {\n // return gsap.to(mainNavLinks, {\n // duration: 1,\n // stagger: 0.5,\n // autoAlpha: 0,\n // y: 20,\n // });\n // } else {\n // return gsap.to(mainNavLinks, {\n // duration: 1,\n // stagger: 0.5,\n // autoAlpha: 1,\n // y: -20,\n // });\n // }\n\n // Shorter syntax ( logic same )\n const scrollingDown = direction === 1;\n const links = scrollingDown ? mainNavLinks : mainNavLinksRev;\n return gsap.to(links, {\n duration: 0.3,\n stagger: 0.05,\n autoAlpha: () => (scrollingDown ? 0 : 1),\n y: () => (scrollingDown ? 20 : 0),\n ease: \"Power4.out\",\n // scrub: true,\n });\n }\n\n ScrollTrigger.create({\n start: 100,\n end: \"bottom bottom-=20\",\n toggleClass: {\n targets: \"body\",\n className: \"has-scrolled\",\n },\n onEnter: ({ direction }) => navAnimation(direction),\n onLeaveBack: ({ direction }) => navAnimation(direction),\n // markers: true,\n });\n}", "function scrNav() {\n var sTop = $(window).scrollTop();\n $('section').each(function () {\n var id = $(this).attr('id'),\n offset = $(this).offset().top - 1,\n height = $(this).height();\n if (sTop >= offset && sTop < offset + height) {\n link.removeClass('active');\n $('#navbar').find('[data-scroll=\"' + id + '\"]').addClass('active');\n }\n });\n }", "function navigationClicks()\n{\n navigationBar.addEventListener('click',function(eventInfo)\n {\n var findSection=document.getElementById(eventInfo.target.dataset.nav);\n findSection.scrollIntoView();\n\n\n\n });\n}", "function thememascot_navLocalScorll() {\n\t\tvar\tdata_offset = -60;\n $(\".menuzord-menu\").localScroll({\n target: \"body\",\n duration: 800,\n\t\t\toffset: data_offset,\n easing: \"easeInOutExpo\"\n });\n }", "function contentMenuScrollTo(){\n\t\"use strict\";\n\n\tif($j('nav.content_menu').length){\n\t\t\n\t\t$j(\"nav.content_menu ul.menu li a\").on('click', function(e){\n\t\t\te.preventDefault();\n\t\t\tvar $this = $j(this);\n\t\t\t\n\t\t\tif($j(this).parent().hasClass('active')){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tvar $target = $this.attr(\"href\");\n\t\t\tvar targetOffset = $j(\"div.wpb_row[data-q_id='\" + $target + \"'],section.parallax_section_holder[data-q_id='\" + $target + \"']\").offset().top - content_line_height - content_menu_top - content_menu_top_add;\n\t\t\t$j('html,body').stop().animate({scrollTop: targetOffset }, 500, 'swing', function(){\n\t\t\t\t$j('nav.content_menu ul li').removeClass('active');\n\t\t\t\t$this.parent().addClass('active');\n\t\t\t});\n\n\t\t\treturn false;\n\t\t});\n\t\t\n\t}\n}", "function navScroll(pos) {\n\t\tTweenMax.to(window, 1.25, {scrollTo: {y: pos, autoKill: false}});\n\t}", "function onScroll(event) {\n if ($('.mobileWrapp').width() < 639) {\n // console.log('asd')\n var scrollPos = $(document).scrollTop() + 65\n } else {\n // console.log('qwe')\n var scrollPos = $(document).scrollTop() + 68\n }\n $('ul.nav-script li a.ancor').each(function() {\n var currLink = $(this)\n var refElement = $(currLink.attr('href'))\n if (refElement.position().top <= scrollPos && refElement.position().top + refElement.height() > scrollPos) {\n $('ul.nav-script li a.ancor').removeClass('active')\n currLink.addClass('active')\n } else {\n currLink.removeClass('active')\n }\n })\n}", "function clicknav(){\n $(\"a,.clicknav\").click(function(event){\n var el = $($(this).data('clicknav'));\n var offset = $(this).data('clicknav-offset');\n\n if (typeof offset === 'undefined') {\n offset = 100;\n }\n\n if (!el[0]) {\n var href = $(this).attr('href');\n if (href[0] === '#') {\n el = $($(this).attr('href'));\n }\n }\n\n if (el[0]) {\n $('body,html').animate({'scrollTop':el.offset().top - offset},500,'swing');\n event.preventDefault();\n }\n });\n }", "function navScrollHome () {\n $window.scrollTop(0)\n }", "function menuScrolling() {\n\n // each,檢查每個 menu 連結的位置\n $('.navMain-items a').each(function() {\n var $linkMenu = $(this),\n $section = $(this.hash),\n\n // 取得這個 section 與可視畫面頂端的距離\n // 負數 : 表示在可視畫面上方\n // 正數 : 表示在可視畫下方或可視畫面內\n sectionDistance = $section.offset().top,\n\n // 因為有 border 和 margin 寬度,所以使用 outerHeight(),才能拿到這個 section 真正佔用的畫面高度\n sectionHeight = $section.outerHeight();\n\n if (\n (sectionDistance <= 1) // 目前 section 位置必須在可視畫面上方\n && (sectionHeight - Math.abs(sectionDistance)) > 0 // section 高度減去 section 頂端位置大於 0 表示可視畫面在該 section 內\n ) {\n $linkMenu.addClass('navMain-items-isActive');\n } else {\n $linkMenu.removeClass('navMain-items-isActive');\n }\n });\n}", "function scroll() {\n const navMenu = document.querySelectorAll(\".navbar__menu\");\n for (let nav of navMenu) {\n {\n nav.addEventListener(\"click\", function() {\n for (i = 0; i < section; i++) {\n section[i].scrollIntoView({\n behavior: \"smooth\"\n });\n }\n });\n }\n }\n}", "function setupPageNavs () {\n\t\t// For any nested list items, wrap the link text in a span so that we can put a border under the text on hover.\n\t\t$mobilemenu.find(\".ibm-mobilemenu-section li li a\").wrapInner(\"<span>\");\n\n\t\tIBM.common.util.a11y.makeTreeAccessible({\n\t\t\tel: $mobilemenu.find(\".ibm-mobilemenu-pagenav > ul\")\n\t\t});\n\t}", "initScrollSmooth() {\n const internalLinks = document.querySelectorAll('.menu a[href^=\"#\"]')\n\n function scrollToSection(e) {\n e.preventDefault()\n const href = this.getAttribute('href')\n const section = document.querySelector(href)\n const sectionTop = section.offsetTop\n\n window.scrollTo({\n top: sectionTop,\n behavior: 'smooth'\n })\n }\n\n internalLinks.forEach(link => {\n link.addEventListener('click', scrollToSection)\n })\n }", "function scrollspy () {\n\n var topPos;\n var myScroll;\n var scrollY = window.pageYOffset; // desplazamiento scroll\n var total = window.innerHeight; // alto ventana offset\n var elHrefId;\n\n\n for ( var i = 0; i < elHeading.length; i++) {\n\n //console.log(elHeading[i].id);\n\n topPos = elHeading[i].offsetTop; // distancia del top del offset (viewport)\n myScroll = topPos - (total + scrollY); // posicion del objeto en la ventana offset\n //for ( var j = 0; j < elMenuSections.length; j++) {\n //console.log(myScroll);\n // if( elMenu.querySelector('.sg-active') ){\n elMenu.querySelector('.sg-active').classList.remove('sg-active');\n // }\n\n if (myScroll < 0) {\n //elMenu.querySelector('a[href*=\"'+ elHeading[i].id + '\"]').style = 'color: red';\n if(elMenu.querySelector('a[href*=\"'+ elHeading[i].id + '\"]')) {\n //alert(\"hola\");\n elMenu.querySelector('a[href*=\"'+ elHeading[i].id + '\"]').classList.add('sg-active');\n }\n //elMenu.querySelector('a[href*=\"rubik-1.1\"]').style = 'color: red';\n\n }\n\n //elHref = elMenuSections[j].getAttribute('href').split('#');\n //elHrefId = elHref[elHref.length - 1];\n // //elHrefId = elMenuSections[1].getAttribute('href').substring(elHref);\n //console.log(elHeading[j].id +' == '+ elHrefId);\n //\n // if ( elHeading.id === elHrefId) {\n //\n // elMenuSections[i].style = 'color: red;';\n // document.querySelector('h1').innerHTML = elMenuSections[i].innerHTML;\n //\n // }\n //}\n\n }\n\n}", "function onScroll(event) {\r\n var scrollPosition = $(document).scrollTop();\r\n\r\n /* Cada vez que se referencia en el documento el selector (nav a) se active\r\n la funcion en el documento DOM y almacenamos en una variable la posicion */\r\n $('nav a').each(function () {\r\n var currentLink = $(this);\r\n\r\n\r\n /* almacenamos en una variable la referencia del elemento (href) */\r\n var refElement = $(currentLink.attr(\"href\"));\r\n\r\n /* Luego se realiza la validacion de la posicion del elemento */\r\n if (refElement.position().top <= scrollPosition && refElement.position().top + refElement.height() > scrollPosition) {\r\n $('nav a').removeClass(\"active\");\r\n currentLink.addClass(\"active\");\r\n }\r\n else {\r\n currentLink.removeClass(\"active\");\r\n }\r\n });\r\n }", "function onScroll(event) {\n if ($('.home').length) {\n var scrollPos = $(document).scrollTop();\n $('nav ul li a').each(function () {\n var currLink = $(this);\n var refElement = $(currLink.attr(\"href\"));\n });\n }\n }", "function setURLandNav(){\n let\n s = document.querySelectorAll('nav ul li a'),\n a = document.querySelectorAll('section');\n \n if(s.length>0){\n Array.prototype.forEach.call(s, function(elm, idx){ \n removeClass(elm,'active');\n });\n \n Array.prototype.forEach.call(a, function(el, i){\n if(el.querySelector('h2')){\n if (elementInViewport(el.querySelector('h2'))) {\t\n console.log(el.querySelector('h2').textContent);\n Array.prototype.forEach.call(s, function(elm, idx){ \n if(elm.href.indexOf('#'+el.id)>-1 && Math.max(document.body.scrollTop,document.documentElement.scrollTop)>50){\t\n history.pushState(null, null, \"#\"+el.id);\t\n addClass(elm,'active');\n } else {\n removeClass(elm,'active');\n }\n });\n } \n } else {\n if (elementInViewport(el)) {\t\n Array.prototype.forEach.call(s, function(elm, idx){ \n if(elm.href.indexOf('#'+el.id)>-1 && Math.max(document.body.scrollTop,document.documentElement.scrollTop)>50){\t\n history.pushState(null, null, \"#\"+el.id);\t\n addClass(elm,'active');\n } else {\n removeClass(elm,'active');\n }\n });\n } \n }\n });\n if(Math.max(document.body.scrollTop,document.documentElement.scrollTop)<50){\n addClass(s[0],'active');\n }\n }\t \t\n }", "function bigNav() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar $offset = nectarDOMInfo.scrollTop,\r\n\t\t\t\t\t$windowWidth = nectarDOMInfo.winW,\r\n\t\t\t\t\t$scrollTriggerOffset = ($body.is('.material')) ? 150 : 30;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($body.is('.material-ocm-open')) {\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\tif ($offset <= $scrollTriggerOffset && $windowWidth > 1000 || $('.small-nav').length > 0 && $('#ajax-content-wrap.no-scroll').length > 0) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('#header-outer, #search-outer').removeClass('small-nav');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($('#header-outer[data-megamenu-rt=\"1\"]').length > 0 && \r\n\t\t\t\t\t\t$('#header-outer[data-transparent-header=\"true\"]').length > 0 && \r\n\t\t\t\t\t\t$('#header-outer .megamenu').length > 0) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($headerOuterEl.attr('data-transparent-header') == 'true' && \r\n\t\t\t\t\t\t\t$('.nectar-box-roll').length == 0 && \r\n\t\t\t\t\t\t\t$('.megamenu.sfHover').length == 0) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$headerOuterEl.addClass('transparent');\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} else {\r\n\t\t\t\t\t\t\t\r\n\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$headerOuterEl.addClass('transparent');\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\t// Body border full width side padding\r\n\t\t\t\t\t\tif ($('#header-outer[data-full-width=\"true\"][data-transparent-header=\"true\"]').length > 0 && \r\n\t\t\t\t\t\t$bodyBorderTop.length > 0 && \r\n\t\t\t\t\t\t$bodyBorderHeaderColorMatch == true) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$('#header-outer[data-full-width=\"true\"] header > .container').stop(true, true).animate({\r\n\t\t\t\t\t\t\t\t'padding': '0 28px'\r\n\t\t\t\t\t\t\t}, {\r\n\t\t\t\t\t\t\t\tqueue: false,\r\n\t\t\t\t\t\t\t\tduration: 250,\r\n\t\t\t\t\t\t\t\teasing: 'easeOutCubic'\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\t\r\n\t\t\t\t\t\tif ($('body.material').length > 0) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$('header#top nav > ul > li.menu-item-with-margin').stop(true, true).animate({\r\n\t\t\t\t\t\t\t\t'margin-right': (parseInt($('header#top nav > ul > li.menu-item-with-margin').css('margin-right')) + parseInt(logoShrinkNum) * 3) + 'px'\r\n\t\t\t\t\t\t\t}, {\r\n\t\t\t\t\t\t\t\tqueue: false,\r\n\t\t\t\t\t\t\t\tduration: 140,\r\n\t\t\t\t\t\t\t\teasing: 'easeOutQuad'\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\t\r\n\t\t\t\t\t\t// Secondary header\r\n\t\t\t\t\t\tif ($headerSecondaryEl.length > 0) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$headerSecondaryEl.removeClass('hide-up');\r\n\t\t\t\t\t\t\t$headerOuterEl\r\n\t\t\t\t\t\t\t\t.removeClass('hide-up')\r\n\t\t\t\t\t\t\t\t.css('transform', 'translateY(0%)');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Box roll\r\n\t\t\t\t\t\tif ($('.nectar-box-roll').length > 0 && $('#header-outer[data-permanent-transparent=\"1\"]').length == 0) {\r\n\t\t\t\t\t\t\t$('#ajax-content-wrap').animate({\r\n\t\t\t\t\t\t\t\t'margin-top': (Math.floor(($logoHeight) + (headerPadding * 2) + nectarDOMInfo.adminBarHeight + nectarDOMInfo.secondaryHeaderHeight))\r\n\t\t\t\t\t\t\t}, {\r\n\t\t\t\t\t\t\t\tqueue: false,\r\n\t\t\t\t\t\t\t\tduration: 250,\r\n\t\t\t\t\t\t\t\teasing: 'easeOutCubic'\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.off('scroll.headerResizeEffect', bigNav);\r\n\t\t\t\t\t\t$window.on('scroll.headerResizeEffect', smallNav);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Dark slider coloring border\r\n\t\t\t\t\t\t$('#header-outer[data-transparent-header=\"true\"]').css('transition', 'transform 0.3s ease, background-color 0.30s ease, opacity 0.3s ease, box-shadow 0.30s ease, margin 0.25s ease-out');\r\n\t\t\t\t\t\t$('#header-outer[data-transparent-header=\"true\"] .cart-menu').css('transition', 'none');\r\n\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t$('#header-outer[data-transparent-header=\"true\"]').css('transition', 'transform 0.3s ease, background-color 0.30s ease, opacity 0.3s ease, box-shadow 0.30s ease, border-color 0.30s ease, margin 0.25s ease-out');\r\n\t\t\t\t\t\t\t$('#header-outer[data-transparent-header=\"true\"] .cart-menu').css('transition', 'border-color 0.30s ease');\r\n\t\t\t\t\t\t}, 300);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function sms_pageNav(to) {\r\n g_temp_pageIndex_status = g_sms_pageIndex;\r\n switch(to) {\r\n case \"first\":\r\n g_sms_pageIndex = 1;\r\n break;\r\n case \"last\":\r\n g_sms_pageIndex = g_sms_totalSmsPage;\r\n break;\r\n case \"prePage\":\r\n g_sms_pageIndex --;\r\n break;\r\n case \"nextPage\":\r\n g_sms_pageIndex ++;\r\n break;\r\n default:\r\n g_sms_pageIndex = to;\r\n break;\r\n }\r\n if(g_temp_pageIndex_status != g_sms_pageIndex){\r\n g_scroll_smsList_status = 0; \t\r\n }\r\n $(document).scrollTop(0);\r\n if(-1 != window.location.href.lastIndexOf(\"smschat\")){\r\n sms_getBoxCount();\r\n sms_initBoxCount();\r\n getChatHistory();\r\n }else{\r\n sms_initPage();\r\n }\r\n $(\"#jump_page_index\").val(\"\");\r\n $(\"#jump_page_index_chat\").val(\"\");\t\r\n}", "function activateMenuOnScroll(){\n waq.$menu.$anchoredSections = $();\n for(i=0;i<waq.$menu.$links.length; i++){\n var $trigger = waq.$menu.$links.eq(i);\n var $section = $( '#' + $trigger.parent().attr('class').split(\" \")[0] );\n if($section.length) waq.$menu.$anchoredSections.push($section[0]);\n }\n if(waq.$menu.$anchoredSections.length){\n waq.$menu.$anchoredSections.scrollEvents({\n flag: 'anchor',\n offset: 150,\n topUp: function(e){\n var slug = e.selection.attr('id');\n var $target = waq.$menu.$links.parent().filter('.'+slug);\n waq.$menu.$links.parent().removeClass('active');\n if($target.length){\n $target.addClass('active');\n // window.location.replace('#!/'+slug);\n };\n },\n topDown: function(e){\n var slug = $(scrollEvents.selection[minMax(e.i-1,0,100)]).attr('id')\n var $target = waq.$menu.$links.parent().filter('.'+slug);\n waq.$menu.$links.parent().removeClass('active');\n if($target.length){\n $target.addClass('active');\n // window.location.replace('#!/'+slug);\n }\n }\n\n });\n }\n // dirty fix\n $win.on('load',function(){\n waq.$menu.$links.parent().removeClass('active');\n });\n }", "function smoothScroll() {\n $('.docs-sidebar-menu').on('click','a', function(e) {\n if( this.hash !== '' ) {\n var target = this.hash;\n e.preventDefault();\n $.scrollTo( target, 3 * animationSpeed, {\n axis: 'y',\n onAfter: function() {\n window.location.hash = target;\n }\n } );\n }\n });\n}", "function clickonheads() {\r\n navbar.addEventListener(\"click\", function(event) {\r\n let chosensection = document.querySelector(\"#\" + event.target.dataset.nav)\r\n chosensection.scrollIntoView();\r\n });\r\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 }", "function scrollTo(event){\n if(event.target.parentNode.nodeName == 'LI' && event.target.tagName == 'SPAN' && event.target.classList.contains(\"menu__link\")){\n for ( let i = 0; i < sectionList.length; i++ ) {\n let section = sectionList[i];\n if(event.target.getAttribute('classList') == section.getAttribute('data-nav')){\n section.scrollIntoView({ behavior: \"smooth\"});\n break;\n }\n }\n }\n}", "function sticky_nav_scroll() {\n if (window.pageYOffset > 100 && w >= 500) {\n $('.nav').removeClass('display-none');\n $('body').addClass('body-margin-modifier');\n }\n else {\n $('.nav').addClass('display-none');\n $('body').removeClass('body-margin-modifier');\n }\n }", "function initScrollspy() {\n\n // Cache selectors\n var lastId,\n topMenu = $(\"#top-menu\"),\n topMenuHeight = topMenu.outerHeight(),\n // All list items\n menuItems = topMenu.find(\"a\"),\n // Anchors corresponding to menu items\n scrollItems = menuItems.map(function() {\n var item = $($(this).attr(\"href\"));\n if (item.length) {\n return item;\n }\n });\n\n // Bind click handler to menu items\n // so we can get a fancy scroll animation\n menuItems.click(function(e) {\n var href = $(this).attr(\"href\"),\n offsetTop = href === \"#\" ? 0 : $(href).offset().top - topMenuHeight + 1;\n $('html, body').stop().animate({\n scrollTop: offsetTop\n }, 400);\n e.preventDefault();\n });\n\n // Bind to scroll\n $(window).scroll(function() {\n // Get container scroll position\n var fromTop = $(this).scrollTop() + topMenuHeight;\n\n // Get id of current scroll item\n var cur = scrollItems.map(function() {\n if ($(this).offset().top < fromTop)\n return this;\n });\n // Get the id of the current element\n cur = cur[cur.length - 1];\n var id = cur && cur.length ? cur[0].id : \"\";\n if (lastId !== id) {\n $('#' + lastId + \"Link\").removeClass(\"menu-selected\");\n $('#' + id + \"Link\").addClass(\"menu-selected\");\n lastId = id;\n }\n });\n}", "function WR_Scroll_Animated() {\n\t \tvar list_id = [];\n\t \tvar menu_li = $( '.header .site-navigator > li' );\n\t \tvar adminBar = $( '#wpadminbar' ).outerHeight();\n\n\t \t$( '.wr-scroll-animated, .wr-scroll-animated *, .menu-item-link' ).click( function() {\n\t \t\tif ( location.pathname.replace( /^\\//, '' ) == this.pathname.replace( /^\\//, '' ) && location.hostname == this.hostname ) {\n\t \t\t\tvar target = $( this.hash );\n\n\t \t\t\tif ( !this.hash.slice( 1 ) ) {\n\t \t\t\t\treturn;\n\t \t\t\t}\n\n\t \t\t\tvar width_content_broswer = $( window ).width();\n\t \t\t\tvar offset = ( width_content_broswer > 1024 ) ? parseInt( WR_Data_Js[ 'offset' ] ) : 0;\n\n\t \t\t\ttarget = target.length ? target : $( '[name=' + this.hash.slice( 1 ) + ']' );\n\t \t\t\tif ( target.length ) {\n\t \t\t\t\tvar sticky_row = $( '.header .sticky-row' );\n\t \t\t\t\tvar height_sticky = parseInt( sticky_row.attr( 'data-height' ) );\n\n\t \t\t\t\tif( ! height_sticky ) {\n\t \t\t\t\t\theight_sticky = sticky_row.height();\n\t \t\t\t\t}\n\n\t \t\t\t\t$( 'html,body' ).stop().animate( {\n\t \t\t\t\t\tscrollTop: target.offset().top - adminBar - offset + 1 - height_sticky + \"px\"\n\t \t\t\t\t}, 1200 );\n\t \t\t\t\treturn false;\n\t \t\t\t}\n\t \t\t}\n\t \t} );\n\n\t \t$.each( $( '.header .site-navigator > li > a' ), function(){\n\t \t\tvar _this = $(this);\n\t \t\tvar href = _this.attr( 'href' );\n\n\t \t\tif( href.match(/^#/gi) != null ) {\n\t \t\t\tvar el_current = $( href );\n\n\t \t\t\tif( el_current.length ) {\n\t \t\t\t\tlist_id.push( el_current );\n\t \t\t\t}\n\t \t\t}\n\t \t} );\n\n\t \tvar frame_handler = _.debounce( function() {\n\t \t\tvar _this = $(this);\n\t \t\tvar scrollTop = _this.scrollTop();\n\n\t \t\t$.each( list_id, function(){\n\t \t\t\tvar _this_id = $(this);\n\t \t\t\tvar offset = _this_id.offset();\n\t \t\t\tvar this_height = _this_id.outerHeight();\n\t \t\t\tvar href_id = _this_id.attr( 'id' );\n\t \t\t\tvar height_row_sticky = $( '.header .sticky-normal.sticky-row-scroll' ).height();\n\n\t \t\t\tif( scrollTop >= ( offset.top - adminBar - height_row_sticky ) && scrollTop <= ( offset.top + this_height - adminBar - height_row_sticky ) ) {\n\t \t\t\t\tvar menu_current = $( '.header .site-navigator > li > a[href=\"#' + href_id + '\"]' );\n\t \t\t\t\tvar li_menu_current = menu_current.closest( 'li' );\n\n\t \t\t\t\tmenu_li.removeClass( 'current-menu-ancestor' ).removeClass( 'current-menu-item' );\n\t \t\t\t\tli_menu_current.addClass( 'current-menu-item' );\n\n\t \t\t\t\treturn;\n\t \t\t\t}\n\t \t\t} );\n\t \t}, 10 );\n\n\t \tvar scroll_handler = function() {\n\t \t\trequestAnimationFrame( frame_handler );\n\t \t};\n\n\t \tif( list_id.length ) {\n\t \t\t$( window ).scroll( scroll_handler );\n\t \t}\n\t }", "function navbarNavigation(link, btm) {\r\n let section,sectionPos,winPos,status;\r\n winPos = window.scrollY;\r\n if (!btm) {\r\n section = document.querySelector('.' + link.getAttribute('href').slice(1)),\r\n sectionPos = document.querySelector('.' + link.getAttribute('href').slice(1)).offsetTop - 100;\r\n } else {\r\n sectionPos = document.body.scrollHeight;\r\n }\r\n if (btm || window.scrollY !== sectionPos) {\r\n let animation = setInterval(frame, globalObj.navigationSpeed);\r\n if (!btm) {\r\n if (section.tagName.toLowerCase() !== 'section') {\r\n sectionPos = sectionPos + globalObj.closest(section, 'section').offsetTop;\r\n }\r\n if (section.style.paddingTop !== '') {\r\n sectionPos += Number(section.style.paddingTop.replace('px', ''));\r\n }\r\n }\r\n if (winPos > sectionPos && !btm) {\r\n // Go Up\r\n status = false;\r\n } else {\r\n // Go Down\r\n status = true;\r\n }\r\n function frame() {\r\n if (status) {\r\n if (winPos >= sectionPos) {\r\n clearInterval(animation);\r\n } else {\r\n winPos += globalObj.navigationCounter;\r\n window.scrollTo(0, winPos);\r\n }\r\n } else {\r\n if (winPos <= sectionPos) {\r\n clearInterval(animation);\r\n } else {\r\n winPos -= globalObj.navigationCounter;\r\n window.scrollTo(0, winPos);\r\n }\r\n }\r\n }\r\n }\r\n}", "function setScroll(){\n window.addEventListener(\"scroll\", ()=> {\n \n for (let i=0; i<navElements.length; ++i){\n let elementScroll = document.getElementById('section'+(i+1));\n let buttonNav = document.getElementById(\"section_nav\"+(i+1));\n if (isScrolledIntoView(elementScroll) ){\n elementScroll.classList.add(\"active\");\n buttonNav.style.background = \"orange\";\n \n }\n else{\n elementScroll.classList.remove(\"active\");\n buttonNav.style.background = \"white\";\n }\n \n }\n });\n}", "function scrollToMap() {\n\t$('.map-link a').on('click', function (e) {\n\t\tvar $target = $('.branches-section');\n\n\t\tif ($target.length) {\n\t\t\te.preventDefault();\n\n\t\t\tvar scrollTop = $target.offset().top - $('.nav').outerHeight() - 40;\n\n\t\t\tTweenMax.to(window, 1, {scrollTo: {y: scrollTop}, ease: Power2.easeInOut});\n\t\t}\n\t})\n}", "function Scroll(){\n\n const content = document.querySelector(\".content\");\n const sidebar = document.querySelector(\".sidebar\");\n const controller = new ScrollMagic.Controller();\n const scene = new ScrollMagic.Scene({\n triggerElement: sidebar,\n triggerHook: 0,\n offset: -140,\n duration: getDuration\n }).addTo(controller);\n if (window.matchMedia(\"(min-width: 1200px)\").matches) {\n scene.setPin(sidebar, {\n pushFollowers: false\n });\n }\n window.addEventListener(\"resize\", () => {\n if (window.matchMedia(\"(min-width: 1200px)\").matches) {\n scene.setPin(sidebar, {\n pushFollowers: false\n });\n } else {\n scene.removePin(sidebar, true);\n }\n });\n\n function getDuration() {\n return content.offsetHeight - sidebar.offsetHeight;\n }\n\n}", "function navmove() {\n var st = $(this).scrollTop();\n if (st > lastScrollTop) {\n // downscroll code\n $nav.stop(true, true).addClass($scrollout);\n } else if (st == 0) {\n // top\n scrollOut();\n } else if (st < lastScrollTop) {\n // upscroll code\n $window.scroll(_.debounce(scrollOut, 10000));\n }\n lastScrollTop = st;\n\n function scrollOut() {\n $nav.stop(true, true).removeClass($scrollout);\n }\n }", "function smallNav() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar $offset = nectarDOMInfo.scrollTop,\r\n\t\t\t\t\t$windowWidth = nectarDOMInfo.winW,\r\n\t\t\t\t\t$scrollTriggerOffset = ($body.is('.material')) ? 150 : 30;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($offset > $scrollTriggerOffset && $windowWidth > 1000 && $('body.material-ocm-open').length == 0) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Going to small when material search is closing, it must be closed immediately\r\n\t\t\t\t\t\tif ($body.is('.material')) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($('#search-outer.material-open').length == 0) {\r\n\t\t\t\t\t\t\t\t$('#header-outer[data-transparent-header=\"true\"] .bg-color-stripe').css('transition', 'none');\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// Secondary header\r\n\t\t\t\t\t\t\tif ($headerSecondaryEl.length > 0) {\r\n\t\t\t\t\t\t\t\t$headerSecondaryEl.addClass('hide-up');\r\n\t\t\t\t\t\t\t\t$headerOuterEl.css('transform', 'translateY(-' + nectarDOMInfo.secondaryHeaderHeight + 'px)');\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\tif ($('#header-outer[data-megamenu-rt=\"1\"]').length > 0 && \r\n\t\t\t\t\t\t$('#header-outer[data-transparent-header=\"true\"]').length > 0 && \r\n\t\t\t\t\t\t$('#header-outer .megamenu').length > 0) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($headerOuterEl.attr('data-transparent-header') == 'true' && \r\n\t\t\t\t\t\t\t$('#header-outer.side-widget-open').length == 0 && \r\n\t\t\t\t\t\t\t$('#header-outer[data-permanent-transparent=\"1\"]').length == 0 && \r\n\t\t\t\t\t\t\t$('.megamenu.sfHover').length == 0) {\r\n\t\t\t\t\t\t\t\t$headerOuterEl.removeClass('transparent');\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} else {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($headerOuterEl.attr('data-transparent-header') == 'true' && \r\n\t\t\t\t\t\t\t$('#header-outer.side-widget-open').length == 0 && \r\n\t\t\t\t\t\t\t$('#header-outer[data-permanent-transparent=\"1\"]').length == 0) {\r\n\t\t\t\t\t\t\t\t$headerOuterEl.removeClass('transparent');\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\t$('#header-outer, #search-outer').addClass('small-nav');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Body border full width side padding\r\n\t\t\t\t\t\tif ($('#header-outer[data-full-width=\"true\"][data-transparent-header=\"true\"]').length > 0 && \r\n\t\t\t\t\t\t$bodyBorderTop.length > 0 && \r\n\t\t\t\t\t\t$bodyBorderHeaderColorMatch == true) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$('#header-outer[data-full-width=\"true\"] header > .container').stop(true, true).animate({\r\n\t\t\t\t\t\t\t\t'padding': '0'\r\n\t\t\t\t\t\t\t}, {\r\n\t\t\t\t\t\t\t\tqueue: false,\r\n\t\t\t\t\t\t\t\tduration: 250,\r\n\t\t\t\t\t\t\t\teasing: 'easeOutCubic'\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\tif ($('body.material').length > 0) {\r\n\t\t\t\t\t\t\t$('header#top nav > ul > li.menu-item-with-margin').stop(true, true).animate({\r\n\t\t\t\t\t\t\t\t'margin-right': (parseInt($('header#top nav > ul > li.menu-item-with-margin').css('margin-right')) - parseInt(logoShrinkNum) * 3) + 'px'\r\n\t\t\t\t\t\t\t}, {\r\n\t\t\t\t\t\t\t\tqueue: false,\r\n\t\t\t\t\t\t\t\tduration: 310,\r\n\t\t\t\t\t\t\t\teasing: 'easeOutQuad'\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// Box roll effect\r\n\t\t\t\t\t\tif ($('.nectar-box-roll').length > 0 && $('#header-outer[data-permanent-transparent=\"1\"]').length == 0) {\r\n\t\t\t\t\t\t\t$('#ajax-content-wrap').animate({\r\n\t\t\t\t\t\t\t\t'margin-top': (Math.floor(($logoHeight - logoShrinkNum) + (headerPadding * 2) / 1.8 + nectarDOMInfo.adminBarHeight + nectarDOMInfo.secondaryHeaderHeight))\r\n\t\t\t\t\t\t\t}, {\r\n\t\t\t\t\t\t\t\tqueue: false,\r\n\t\t\t\t\t\t\t\tduration: 250,\r\n\t\t\t\t\t\t\t\teasing: 'easeOutCubic'\r\n\t\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\t$window.off('scroll.headerResizeEffect', smallNav);\r\n\t\t\t\t\t\t$window.on('scroll.headerResizeEffect', bigNav);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Dark slider coloring border \r\n\t\t\t\t\t\t$('#header-outer[data-transparent-header=\"true\"]').css('transition', 'transform 0.3s ease, background-color 0.30s ease, opacity 0.3s ease, box-shadow 0.30s ease, margin 0.25s ease-out');\r\n\t\t\t\t\t\t$('#header-outer[data-transparent-header=\"true\"] .cart-menu').css('transition', 'none');\r\n\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t$('#header-outer[data-transparent-header=\"true\"]').css('transition', 'transform 0.3s ease, background-color 0.30s ease, opacity 0.3s ease, box-shadow 0.30s ease, border-color 0.30s ease, margin 0.25s ease-out');\r\n\t\t\t\t\t\t\t$('#header-outer[data-transparent-header=\"true\"] .cart-menu').css('transition', 'border-color 0.30s ease');\r\n\t\t\t\t\t\t}, 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}", "function redrawNav(){\r\n var article1Top = 0;\r\n // The top of each article is offset by half the distance to the previous article.\r\n var article2Top = $('#frontend-school').offset().top / 2;\r\n var article3Top = ($(document).height() - $('#experience').offset().top) / 2;\r\n $('nav.nav li').removeClass('active');\r\n if($(document).scrollTop() >= article1Top && $(document).scrollTop() < article2Top){\r\n $('li.general-info').addClass('active');\r\n } else if ($(document).scrollTop() >= article2Top && $(document).scrollTop() < article3Top){\r\n $('li.frontend-school').addClass('active');\r\n } else if ($(document).scrollTop() >= article3Top){\r\n $('li.experience').addClass('active');\r\n }\r\n \r\n }", "function onScroll(){\n const scrollPos = $(document).scrollTop();\n $('.navbar-start a').each(function () {\n const currLink = $(this);\n const refElement = $(currLink.attr('href'));\n if (refElement.position().top <= scrollPos + 52 && refElement.position().top + refElement.height() > scrollPos) {\n $('.navbar-start ul li a').removeClass('active');\n currLink.addClass('active');\n } else{\n currLink.removeClass('active');\n }\n });\n }", "function singlePageMenu(){\n\t\tif ( $('.single-page').length) {\n\n\t\t\t$('.main-nav').each(function(){\n\t\n\t\t\t\t\tvar $active, $content, $links = $(this).find('a.on'),\n\t\t\t\t\t$li = $(this).find('a').closest('li');\n\t\t\t\t\n\t\t\t\t\t$active = $($links.filter('[href=\"'+location.hash+'\"]')[0] || $links[0]);\n\t\t\t\t\t$content = $($active.attr('href'));\n\t\t\t\t\n\t\t\t\t\t$(this).on('click', 'a', function(e){\n\t\t\t\n\t\t\t\t\t\t$li.removeClass('active');\n\t\t\t\t\n\t\t\t\t\t\t$active = $(this);\n\t\t\t\t\t\t$content = $($(this).attr('href'));\n\t\t\n\t\t\t\t\t\t$(this).closest('li').addClass('active');\n\t\t\t\t\t\t$(\"body,html\").animate({scrollTop:$content.position().top + 1}, 1000);\n\t\t\t\t\t\t\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t});\n\t\t\t});\n\n\t\t}\n\t}", "function setMenuActiveOnScroll() {\n for (let section of sectionsList) {\n if (isElementInViewport(section.children[0].children[0])) {\n setSectionActive(section.id);\n setMenuActive(section.id);\n }\n }\n}", "function onepage_activ_menu() {\r\n\t\r\n\tif(j$('body').hasClass('page-template-onepage') ) {\r\n\t\tj$('#header_container nav ul li a').click(function () {\r\n\t\tj$('#header_container nav ul li').removeClass('current-menu-item');\r\n\t\tj$(this).parent('li').addClass('current-menu-item');\r\n\t\t})\r\n\t\tvar aChildren = j$(\"#header_container nav ul li\").children(); // find the a children of the list items\r\n \tvar aArray = []; // create the empty aArray\r\n\t for (var i=0; i < aChildren.length; i++) { \r\n var aChild = aChildren[i];\r\n var ahref = j$(aChild).attr('href');\r\n aArray.push(ahref);\r\n \t} // this for loop fills the aArray with attribute href values\r\n\r\n j$(window).scroll(function(){\r\n var windowPos = j$(window).scrollTop(); // get the offset of the window from the top of page\r\n\r\n\t\tif(j$('.header_bottom_nav').length > 0){\r\n\t\t\tvar h_height = j$(\"#header_container\").height();\r\n\t\t\t}\r\n\t\t\telse if(j$(\".header_to_shrink\").length > 0) {\r\n\t\t\tvar h_height = \"55\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\tvar h_height = j$(\"#header_container\").height();\r\n\t\t}\r\n var windowHeight = j$(window).height(); // get the height of the window\r\n var docHeight = j$(document).height();\r\n\r\n for (var i=0; i < aArray.length; i++) {\r\n var theID = aArray[i];\r\n var divPos = (j$(theID).offset().top)-h_height;\r\n\t\t\tvar divh = j$(theID).height();\r\n var divHeight = +divh + +h_height; // get the height of the div in question\r\n if (windowPos >= divPos && windowPos < (divPos + divHeight)) {\r\n j$(\"a[href='\" + theID + \"']\").parent('li').addClass(\"current-menu-item\");\r\n } else {\r\n j$(\"a[href='\" + theID + \"']\").parent('li').removeClass(\"current-menu-item\");\r\n }\r\n }\r\n\r\n if(windowPos + windowHeight == docHeight) {\r\n if (!j$(\"#header_container nav ul li\").hasClass(\"current-menu-item\")) {\r\n var navActiveCurrent = j$(\".current-menu-item a\").attr(\"href\");\r\n j$(\"a[href='\" + navActiveCurrent + \"']\").parent('li').removeClass(\"current-menu-item\");\r\n j$(\"#header_container nav ul li:last-child a\").parent('li').addClass(\"current-menu-item\");\r\n }\r\n }\r\n });\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}\r\n}", "function largeMenu() {\n $('#navigation-large').singlePageNav({\n offset: $('#navbar').outerHeight(),\n filter: ':not(.external)',\n speed: 750,\n currentClass: 'active',\n\n beforeStart: function() {},\n onComplete: function() {}\n });\n }", "function onScroll(event) {\n var headerHeight = $('.header').outerHeight(true);\n var navHeight = $('.navigation').outerHeight(true);\n var scrollPos = $(document).scrollTop();\n $('.inside-look-component .navigation ul li a').each(function () {\n var currLink = $(this);\n var refElement = $(currLink.attr(\"href\"));\n //console.log($(currLink.attr(\"href\")));\n if (refElement.position().top <= scrollPos + headerHeight + navHeight - 3 && refElement.position().top + refElement.height() > scrollPos + headerHeight + navHeight - 95) {\n $('.inside-look-component .navigation ul li a').removeClass(\"active\");\n currLink.addClass(\"active\");\n }\n else {\n currLink.removeClass(\"active\");\n }\n });\n}", "function _navTo( n ) {\n\t\t// go to it\n\t\t$( \"#taxa > section\", _sandbox.context ).scrollTo( \"#\" + n.link.attr( \"id\" ), 100, { offset: -45 } );\n\t}", "function navigations() {\n\t//Navigation Button\n\t$(\"#nav_schedule\").click(function () {\n\t\t$('html, body').animate({\n\t\t\tscrollTop: $(\"#nav_schedule_sec\").offset().top\n\t\t}, 500);\n\t});\n\t$(\"#nav_features\").click(function () {\n\t\t$('html, body').animate({\n\t\t\tscrollTop: $(\"#nav_features_sec\").offset().top\n\t\t}, 500);\n\t});\n\t$(\"#nav_benefits\").click(function () {\n\t\t$('html, body').animate({\n\t\t\tscrollTop: $(\"#nav_benefits_sec\").offset().top\n\t\t}, 500);\n\t});\n\t$(\"#nav_statements\").click(function () {\n\t\t$('html, body').animate({\n\t\t\tscrollTop: $(\"#nav_statements_sec\").offset().top\n\t\t}, 500);\n\t});\n\t$(\"#nav_login\").click(function () {\n\t\t$('html, body').animate({\n\t\t\tscrollTop: $(\"#nav_login_sec\").offset().top\n\t\t}, 500);\n\t});\n\n\t$(\"#nav_top\").click(function () {\n\t\t$('html, body').animate({\n\t\t\tscrollTop: $(\"#top\").offset().top\n\t\t}, 500);\n\t});\n\n}", "checkScrollPos() {\n let fromTop = window.scrollY;\n this.links.forEach(link => {\n let section = document.querySelector(`#${link.el.dataset.section}`);\n if (section.offsetTop <= fromTop && section.offsetTop + section.offsetHeight > fromTop) {\n link.setCurrent();\n } else {\n link.setCurrent(false);\n }\n })\n }", "function goToAbout(){\r\n document.getElementById('overflow').scrollIntoView({behavior:\"smooth\"}) /*fazer scroll into view??*/\r\n theToggle.classList.remove(\"on\");\r\n document.body.style.overflow = '';\r\n [ 'toggle', 'menu'].forEach(function( id ) {\r\n\r\n document.getElementById( id ).style.transition= 'all .5s';\r\n \r\n });\r\n}", "function scrollView() {\n const menuClickNav = document.querySelectorAll('.menu__link');\n menuClickNav.forEach((item) => {\n item.addEventListener('click', (e) => {\n // console.log('hello')\n e.preventDefault();\n // Scroll to anchor ID using scrollIntoView event\n document\n .querySelector(item.getAttribute('href'))\n .scrollIntoView({ top: 150, left: 0, behavior: 'smooth' });\n });\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 mainNavigation() {\r\n $(\".hamb-menu\").off(\"click\");\r\n // $(\"#nav-main-mobile button\").off(\"click\");\r\n // $(\"#nav-main li\").off(\"mouseover\");\r\n // $(\"#nav-main li\").off(\"mouseleave\");\r\n // $_window.off('scroll.mainScroll');\r\n var tl = new TimelineMax({\r\n paused: !0\r\n }),\r\n speed = .2,\r\n $hambMenu = $(\".hamb-menu\"),\r\n $hambMenuTop = $(\".hamb-menu\").find(\".top\"),\r\n $hambMenuMiddle = $(\".hamb-menu\").find(\".middle\"),\r\n $hambMenuBottom = $(\".hamb-menu\").find(\".bottom\");\r\n tl.to($hambMenuTop, speed, {\r\n y: 6\r\n }).to($hambMenuBottom, speed, {\r\n y: -8\r\n }, \"-=.2\").to($hambMenu, speed, {\r\n rotation: 180,\r\n transformOrigin: \"center center\"\r\n }, .3).to($hambMenuMiddle, speed, {\r\n opacity: 0\r\n }, .3).to($hambMenuTop, speed, {\r\n rotation: 45,\r\n transformOrigin: \"center center\"\r\n }, .4).to($hambMenuBottom, speed, {\r\n rotation: -45,\r\n transformOrigin: \"center center\"\r\n }, .4), $(\".hamb-menu\").on(\"click\", function() {\r\n var $navMobile = $(\"#nav-main-mobile\");\r\n window.pageYOffset;\r\n $(\"#header-main\").toggleClass(\"opened\"), window.viewportUnitsBuggyfill.refresh(), TweenMax.set($navMobile.find(\".pressAnime\"), {\r\n opacity: 0,\r\n y: 40\r\n }), $_body.toggleClass(\"js-nav-mobile\"), $_body.hasClass(\"js-nav-mobile\") ? (tl.play(), TweenMax.to($navMobile, .1, {\r\n autoAlpha: 1\r\n }), TweenMax.staggerTo($navMobile.find(\".pressAnime\"), .8, {\r\n opacity: 1,\r\n y: 0,\r\n ease: Power2.easeOut\r\n }, .1), disableScroll()) : (enableScroll(), tl.reverse(), TweenMax.to($navMobile, .1, {\r\n autoAlpha: 0\r\n }), TweenMax.to($navMobile.find(\".pressAnime\"), 1, {\r\n opacity: 0,\r\n y: 40\r\n }))\r\n })\r\n}", "function updateNavigation() {\n\tif ($(document.body).hasClass('single-page')){\n\t\treturn;\n\t}\n\n\t$(\".toc .topic-link + ul\").hide();\n\n\tvar li = $(\".toc li\");\n\tvar next, prev;\n\t$.each(li, function(i, e){\n\t\tif ($(\".topic-link.active\").closest(\"li\").get(0) === this) {\n\t\t\tnext = $(li.get(i+1)).find(\".topic-link:first\");\n\t\t\tif (i>0){\n\t\t\t\tprev = $(li.get(i-1)).find(\".topic-link:first\");\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t});\n}", "_setupScrollspy() {\n if (!this.scrollContent) {\n return;\n }\n\n new ScrollSpy(document.querySelector(this.scrollContent), {\n target: this.menu,\n // Top offset position of the sticky menu\n offset: 220\n });\n }", "function handleNavLinks(e) { \r\n e.preventDefault();\r\n\r\n let destElementId = $(this).attr(\"href\");\r\n let destElement = $(destElementId);\r\n\r\n // TakeAway: We need to include jQuery UI library for \"easeInExpo\" effect.\r\n $(\"html, body\").stop().animate({\r\n // 60 px is substracted to offset for the height of the nav-bar.\r\n scrollTop: destElement.offset().top - 60\r\n }, 1500, \"easeInExpo\");\r\n}", "function vfNavigationOnThisPage() {\n var scope = document;\n // based on the attribute we select all navigation links\n var navLinks = scope.querySelectorAll(\"[data-vf-js-navigation-on-this-page-container='true'] .vf-navigation__item a\");\n // we store all ids from anchor tags to know the sections we should care about\n var ids = [];\n navLinks.forEach(function (link) {\n if (link.hash) {\n ids.push(link.hash.substring(1));\n }\n });\n // get all elements with an id and convert it from NodeList to Array\n var sections = Array.prototype.slice.call(scope.querySelectorAll(\"[id]\"));\n var sectionPositions = [];\n if (!navLinks || !sections) {\n // exit: either sections or section content not found\n return;\n }\n if (navLinks.length === 0 || sections.length === 0) {\n // exit: either sections or section content not found\n return;\n }\n // remove all the elements that doesn't appear in the navigation based on it's id\n sections = sections.filter(function (section) {\n return ids.indexOf(section.id) !== -1;\n });\n function activateNavigationItem() {\n // althought costly, we recalculate the position of elements each time as things move or load dynamically\n sectionPositions = [];\n sections.forEach(function (e) {\n var rect = e.getBoundingClientRect();\n var scrollTop = window.pageYOffset || document.documentElement.scrollTop;\n sectionPositions.push({\n id: e.id,\n position: rect.top + scrollTop\n });\n });\n // put sections in the bottom at the beginning of the array\n sectionPositions.reverse();\n var scrollPosition = document.documentElement.scrollTop || document.body.scrollTop;\n // We reverse the array because Array.find starts to search from position 0 and to simplify\n // the logic to find which element is closest to the current scroll position, otherwise it will always\n // select the first element.\n var currentSection = sectionPositions.find(function (s) {\n return !(scrollPosition <= s.position - 95);\n });\n navLinks.forEach(function (link) {\n link.setAttribute(\"aria-selected\", \"false\");\n });\n // if we don't match any section yet, highlight the first link\n if (!currentSection) {\n navLinks[0].setAttribute(\"aria-selected\", \"true\");\n } else {\n navLinks.forEach(function (link) {\n if (link.hash === '#' + currentSection.id) {\n link.setAttribute(\"aria-selected\", \"true\");\n }\n });\n }\n isCalculating = false;\n }\n var isCalculating = false;\n window.onscroll = function () {\n if (!isCalculating) {\n isCalculating = true;\n window.requestAnimationFrame(activateNavigationItem);\n }\n };\n navLinks.forEach(function (link) {\n link.addEventListener(\"click\", function (event) {\n var section = document.querySelector(link.hash);\n var scrollPosition = document.documentElement.scrollTop || document.body.scrollTop;\n if (!section) return;\n event.preventDefault();\n // get current styles of element we are moving to\n var elemStyles = window.getComputedStyle(section);\n // take into account the padding and/or margin top\n var value = elemStyles.paddingTop !== '0px' ? elemStyles.paddingTop : elemStyles.marginTop;\n // we remove the px characters from the value\n var offset = parseInt(value.slice(0, -2), 10);\n // total offset: margin/padding top of the element plus the size of the navigation bar\n window.scroll({\n top: section.getBoundingClientRect().top + scrollPosition - (offset + 40),\n behavior: 'smooth'\n });\n });\n });\n}", "function onScroll1(){\r\n var scrollPos = $(document).scrollTop();\r\n $('.nav li a').each(function () {\r\n var currLink = $(this);\r\n var refElement = $(currLink.attr(\"href\"));\r\n if (refElement.position().top <= scrollPos + 50 && refElement.position().top + refElement.height() > scrollPos) {\r\n $('.nav li a').removeClass(\"active\");\r\n currLink.addClass(\"active\");\r\n }\r\n else{\r\n currLink.removeClass(\"active\");\r\n }\r\n });\r\n}", "function onScroll(event){\n var scrollPos = $(document).scrollTop();\n $('#nav a:not(#back-to-top)').each(function () {\n var currLink = $(this);\n var refElement = $(currLink.attr(\"href\"));\n if (refElement.position().top - 110 <= scrollPos && refElement.position().top + refElement.height() > scrollPos) {\n $('#nav ul li a').removeClass(\"active\");\n currLink.addClass(\"active\");\n }\n else{\n currLink.removeClass(\"active\");\n }\n });\n}", "function movetolink(){\r\n !window.location.hash||$('html, body').scrollTop(0);\r\n var $offset = $(\".one-page-nav-scrolling\").outerHeight(false);\r\n if(window.location.hash){\r\n var hash = window.location.hash;\r\n $('html, body').animate({ scrollTop: $(hash).offset().top-$offset },1250,'easeInOutExpo');\r\n }\r\n}", "function onScroll() {\n let scroll_top = $(window).scrollTop();\n $('.scroll-box i:eq(0)').html('').append(scroll_top);\n $('.header-nav a').each(function()\n {\n let hash = $(this).attr(\"href\");\n let target = $(hash);\n let targetStart = target.position().top;\n let targetHeight = target.outerHeight();\n let targetStartC = Math.floor(targetStart);\n let targetHeightC = Math.floor(targetHeight);\n let targetStartAndHeight = parseInt(targetStartC) + parseInt(targetHeightC);\n //console.log(targetStartAndHeight);\n if (targetStartC <= scroll_top && targetStartAndHeight > scroll_top && scroll_top !== 0)\n {\n $(this).addClass(\"active\");\n $('.scroll-box i:eq(1)').html('').append(targetStart);\n $('.scroll-box i:eq(2)').html('').append(targetStartAndHeight);\n } else\n {\n $(this).removeClass(\"active\");\n }\n });\n }", "function scrollTO() {\n menuItems.forEach(item => {\n item.addEventListener('click', function () {\n let itemNumber = item.textContent.slice(item.textContent.length - 1);\n for (const sec of sections) {\n console.log(sec.getBoundingClientRect().top);\n let secNumber = sec.getAttribute('data-nav');\n if (itemNumber === secNumber.slice(secNumber.length - 1)) {\n sec.scrollIntoView({ behavior: \"smooth\", block: \"start\" });\n }\n }\n });\n });\n}", "function onScroll(event){\n var scrollPos = $(document).scrollTop();\n $('nav ul li a, nav ul ul li a').each(function () {\n var currLink = $(this);\n var refElement = $(currLink.attr(\"href\"));\n if (refElement.position().top <= scrollPos && refElement.position().top + refElement.height() > scrollPos) {\n $('nav ul li a, nav ul ul li a').removeClass(\"active\");\n currLink.addClass(\"active\");\n }\n else{\n currLink.removeClass(\"active\");\n }\n });\n }", "function setupNav() {\n\tvar section1Top = 0;\n\tvar section2Top \t= $('footer').offset().top - (($(document).height() - $('footer').offset().top) / 2);;\n\t\n\t$('nav li').removeClass('active');\n\t\n\tif($(document).scrollTop() >= section1Top && $(document).scrollTop() < section2Top){\n\t\t$('nav li.selected_work').addClass('active');\n\t} else if ($(document).scrollTop() >= section2Top){\n\t\t$('nav li.about').addClass('active');\n\t}\n\t\n\t// CHANGE THESE NUMBERS TO ADJUST THE POSITION OF THE NAV WHEN YOU HIT THE FOOTER\n\tif($(window).scrollTop() >= 14532) {\n\t\t$('header').css('position', 'absolute');\n\t\t$('header').css('top', 14552);\n\t} else {\n\t\t$('header').css('position', 'fixed');\n\t\t$('header').css('top', 20);\n\t}\n\t\n}", "function dotnavigation() {\n\n var numSections = $('section').length;\n \n $('#dot-nav li a').removeClass('active').parent('li').removeClass('active');\n $('section').each(function (i, item) {\n var ele = $(item),nextTop;\n \n //console.log(ele.next().html());\n \n if (typeof ele.next().offset() != \"undefined\") {\n nextTop = ele.next().offset().top;\n } else\n {\n nextTop = $(document).height();\n }\n \n if (ele.offset() !== null) {\n thisTop = ele.offset().top - (nextTop - ele.offset().top) / numSections;\n } else\n {\n thisTop = 0;\n }\n \n var docTop = $(document).scrollTop();\n \n if (docTop >= thisTop && docTop < nextTop) {\n $('#dot-nav li').eq(i).addClass('active');\n }\n });\n }", "function scrollHandler() {\n const element = document.getElementById(\"navbar__list\");\n element.addEventListener(\"click\", (e) => {\n const href = element.getAttribute(\"href\");\n // Remove old active class and add the new active class\n const active = document.getElementsByClassName(\".your-active-class\");\n if (active !== null) {\n active.classList.remove(\".your-active-class\");\n }\n e.target.className = \"link__active\";\n element.scrollIntoView({ block: 'end', behavior: 'smooth' });\n });\n }", "function onScroll(event) {\n let scrollPos = $(document).scrollTop();\n $(\".header__nav a\").each(function() {\n let currLink = $(this);\n let refElement = $(currLink.attr(\"href\"));\n if (\n refElement.position().top - 80 <= scrollPos &&\n refElement.position().top + refElement.height() + 180 > scrollPos\n ) {\n $(\".header__nav a\").removeClass(\"active\");\n currLink.addClass(\"active\");\n } else {\n currLink.removeClass(\"active\");\n }\n });\n }", "function onScroll(event) {\n var scroll = $(window).scrollTop();\n var breakpoint = scroll + $(\"nav\").height();\n\n $(\"nav a\").each(function() {\n var current = $(this);\n var href = $(current.attr(\"href\"));\n\n if (href.position().top <= breakpoint\n && href.position().top + href.outerHeight(true) > breakpoint) {\n current.addClass(\"active\");\n } else {\n current.removeClass(\"active\");\n }\n })\n}", "function function2(item1){ // start function \n \n item1.addEventListener('click',function(){ // add event type 'click' and listener function\n \n var elements = document.getElementById(item1.getAttribute('data-nav')); /* get the element by id and this id same like value of data-nav attribut for each link */\n elements.scrollIntoView({behavior:\"smooth\",block:\"start\"}); /* here i used scrollIntoView to scroll the appropriate section when clicking on nav-menu conected by value of id = data-nav */ \n });\n }", "function toggleScroll() {\r\n var maxOffset = Math.abs(parseInt($('.menu-holder').height() - $('.content').height())),\r\n currOffset = Math.abs(parseInt($(\".content\").css(\"margin-top\")));\r\n \r\n if (currOffset === 0) {\r\n $(\"#up .fas\").hide();\r\n $(\"#down .fas\").show();\r\n } \r\n else if (currOffset === maxOffset) {\r\n $(\"#up .fas\").show();\r\n $(\"#down .fas\").hide();\r\n    }\r\n else if (currOffset > 0 && currOffset < maxOffset) {\r\n $(\"#up .fas\").show();\r\n $(\"#down .fas\").show();\r\n }\r\n else {\r\n $(\"#up .fas\").hide();\r\n $(\"#down .fas\").hide();\r\n    }\r\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 _addNavigation() {}", "function animatedAnchorLinks() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($('body[data-animated-anchors=\"true\"]').length > 0 || \r\n\t\t\t\t\t$('.single-product [data-gallery-style=\"left_thumb_sticky\"]').length > 0) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar headerPadding2 = headerPadding - headerPadding / 1.8;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tsetTimeout(scrollSpyInit, 200);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $animatedScrollingTimeout;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$body.on('click', '#header-outer nav .sf-menu a, #footer-outer .nectar-button, #mobile-menu li a, .container-wrap a:not(.wpb_tabs_nav a):not(.um-woo-view-order):not(.magnific):not([data-fancybox]):not(.woocommerce-tabs .tabs a):not(.slider-prev):not(.slider-next):not(.testimonial-next-prev a), .swiper-slide .button a, #slide-out-widget-area a, #slide-out-widget-area .inner div a', function (e) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar $hash = $(this).prop(\"hash\");\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$body.addClass('animated-scrolling');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tclearTimeout($animatedScrollingTimeout);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$animatedScrollingTimeout = setTimeout(function () {\r\n\t\t\t\t\t\t\t\t$body.removeClass('animated-scrolling');\r\n\t\t\t\t\t\t\t}, 850);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar $headerNavSpace = ($('body[data-header-format=\"left-header\"]').length > 0 && $window.width() > 1000) ? 0 : $('#header-space').outerHeight();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($('.page-template-template-no-header-footer').length > 0 || $('.page-template-template-no-header').length > 0) {\r\n\t\t\t\t\t\t\t\t$headerNavSpace = 0;\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\tif ($hash && $body.find($hash).length > 0 && $hash != '#top' && $hash != '' && $(this).attr('href').indexOf(window.location.href.split(\"#\")[0]) !== -1 || \r\n\t\t\t\t\t\t\t$(this).is('[href^=\"#\"]') && $hash != '' && $body.find($hash).length > 0 && $hash != '#top') {\r\n\t\r\n\t\t\t\t\t\t\t\t//update hash\r\n\t\t\t\t\t\t\t\tif (!$(this).hasClass('skip-hash')) {\r\n\t\t\t\t\t\t\t\t\tif (history.pushState) {\r\n\t\t\t\t\t\t\t\t\t\thistory.pushState(null, null, $hash);\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\tlocation.hash = $hash;\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\tif ($(this).parents('ul').length > 0) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$(this)\r\n\t\t\t\t\t\t\t\t\t\t.parents('ul')\r\n\t\t\t\t\t\t\t\t\t\t.find('li')\r\n\t\t\t\t\t\t\t\t\t\t.removeClass('current-menu-item');\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\t// Side widget area click\r\n\t\t\t\t\t\t\t\tif ($(this).parents('#slide-out-widget-area').length > 0) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif ($('body.material[data-slide-out-widget-area-style=\"slide-out-from-right\"].material-ocm-open').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$('body > .slide_out_area_close')\r\n\t\t\t\t\t\t\t\t\t\t\t.addClass('non-human-allowed')\r\n\t\t\t\t\t\t\t\t\t\t\t.trigger('click');\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t// Sroll\r\n\t\t\t\t\t\t\t\t\t\tvar $clickedLinkStore = $(this);\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\t\t\t\t$clickedLinkStore.trigger('click');\r\n\t\t\t\t\t\t\t\t\t\t}, 1000);\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t$('#slide-out-widget-area .slide_out_area_close')\r\n\t\t\t\t\t\t\t\t\t\t\t.addClass('non-human-allowed')\r\n\t\t\t\t\t\t\t\t\t\t\t.trigger('click');\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\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\t\t\tif ($('body.material[data-slide-out-widget-area-style=\"slide-out-from-right\"]').length > 0) {\r\n\t\t\t\t\t\t\t\t\t\t\t$('body > .slide_out_area_close').removeClass('non-human-allowed');\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t$('#slide-out-widget-area .slide_out_area_close').removeClass('non-human-allowed');\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}, 100);\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\t// Mobile menu click\r\n\t\t\t\t\t\t\t\tif ( $(this).parents('#mobile-menu').length > 0 ) {\r\n\t\t\t\t\t\t\t\t\t$('.slide-out-widget-area-toggle.mobile-icon a')\r\n\t\t\t\t\t\t\t\t\t\t.addClass('non-human-allowed')\r\n\t\t\t\t\t\t\t\t\t\t.trigger('click');\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\t\t\t\t\t$('.slide-out-widget-area-toggle.mobile-icon a').removeClass('non-human-allowed');\r\n\t\t\t\t\t\t\t\t\t\t}, 100);\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\tvar $mobileMenuHeight = ($(this).parents('#mobile-menu').length > 0) ? $(this).parents('#mobile-menu').height() : null;\r\n\t\t\t\t\t\t\t\tvar $timeoutVar = 1;\r\n\t\t\t\t\t\t\t\tvar $that = $(this);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($('.nectar-box-roll').length > 0 && $('.container-wrap.bottomBoxOut').length > 0) {\r\n\t\t\t\t\t\t\t\t\tnectarBoxRoll.boxRoll(null, -1);\r\n\t\t\t\t\t\t\t\t\t$timeoutVar = 2050;\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\t\r\n\t\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tvar $scrollTopDistance;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t// Scrolling\r\n\t\t\t\t\t\t\t\t\tif ($('body[data-permanent-transparent=\"1\"]').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\tif (!$body.hasClass('mobile')) {\r\n\t\t\t\t\t\t\t\t\t\t\tvar $resize = ($('#header-outer[data-header-resize=\"0\"]').length > 0) ? 0 : parseInt(logoShrinkNum) + headerPadding2 * 2;\r\n\t\t\t\t\t\t\t\t\t\t\tif ($('#header-outer[data-remove-fixed=\"1\"]').length > 0) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t$headerNavSpace = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t$scrollTopDistance = $($hash).offset().top - $mobileMenuHeight - parseInt($headerNavSpace) + $resize + 3 - nectarDOMInfo.adminBarHeight;\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t// Condense\r\n\t\t\t\t\t\t\t\t\t\t\tif ($('body.mobile').length == 0 && $('#header-outer[data-condense=\"true\"]').length > 0) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar $headerSpan9 = $('#header-outer[data-format=\"centered-menu-bottom-bar\"] header#top .span_9'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t$headerHeightStored = $headerOuterEl.height(),\r\n\t\t\t\t\t\t\t\t\t\t\t\t$headerHeightCondensed = $headerHeightStored - (parseInt($headerSpan9.height()) + parseInt($('#header-outer #logo').css('margin-top')));\r\n\t\t\t\t\t\t\t\t\t\t\t\t$scrollTopDistance = $($hash).offset().top - parseInt($headerNavSpace) + $headerHeightCondensed - nectarDOMInfo.adminBarHeight;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t$scrollTopDistance = ($('#header-outer[data-mobile-fixed=\"1\"]').length > 0) ? $($hash).offset().top + 2 - $headerNavSpace + nectarDOMInfo.adminBarHeight : $($hash).offset().top - $mobileMenuHeight - nectarDOMInfo.adminBarHeight + 1;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t$scrollTopDistance = $($hash).offset().top - nectarDOMInfo.adminBarHeight + 1;\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\tif ($('body[data-hhun=\"1\"]').length > 0 && $('#header-outer[data-remove-fixed=\"1\"]').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// Alter offset \r\n\t\t\t\t\t\t\t\t\t\tif ($('#header-outer.detached').length == 0 || $that.parents('.page-submenu[data-sticky=\"true\"]').length > 0) {\r\n\t\t\t\t\t\t\t\t\t\t\t$scrollTopDistance = $scrollTopDistance + $headerNavSpace;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t// Hide top header\r\n\t\t\t\t\t\t\t\t\t\tif ($that.parents('.page-submenu[data-sticky=\"true\"]').length > 0) {\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t$('#header-outer.detached').addClass('invisible');\r\n\t\t\t\t\t\t\t\t\t\t\t$('.page-submenu')\r\n\t\t\t\t\t\t\t\t\t\t\t\t.addClass('header-not-visible')\r\n\t\t\t\t\t\t\t\t\t\t\t\t.css('transform', 'translateY(0px)');\r\n\t\t\t\t\t\t\t\t\t\t\t\t\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\t\r\n\t\t\t\t\t\t\t\t\tvar $pageSubMenu = ($that.parents('.page-submenu[data-sticky=\"true\"]').length > 0) ? $that.parents('.page-submenu').height() : 0;\r\n\t\t\t\t\t\t\t\t\tvar $headerSecondary;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif ($('body.material').length > 0 &&\r\n\t\t\t\t\t\t\t\t\t\t$headerSecondaryEl.length > 0 &&\r\n\t\t\t\t\t\t\t\t\t\t$('body[data-hhun=\"1\"]').length == 0 &&\r\n\t\t\t\t\t\t\t\t\t\t$('#header-outer[data-remove-fixed=\"1\"]').length == 0 &&\r\n\t\t\t\t\t\t\t\t\t\t!$body.hasClass('mobile')) {\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$headerSecondary = $headerSecondaryEl.height();\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tif($('body[data-hhun=\"1\"]').length > 0 && \r\n\t\t\t\t\t\t\t\t\t\t\t$headerSecondaryEl.length > 0 &&\r\n\t\t\t\t\t\t\t\t\t\t\t!$body.hasClass('mobile') &&\r\n\t\t\t\t\t\t\t\t\t\t\t$('#header-outer[data-remove-fixed=\"1\"]').length == 0) {\r\n\t\t\t\t\t\t\t\t\t\t\t$headerSecondary = $headerSecondaryEl.height();\r\n\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t$headerSecondary = 0;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\r\n\t\t\t\t\t\t\t\t\tnectar_scrollToY($scrollTopDistance - $pageSubMenu + $headerSecondary, 700, 'easeInOutQuint');\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}, $timeoutVar);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\te.preventDefault();\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\tif ($hash == '#top') {\r\n\t\t\t\t\t\t\t\t// Side widget area click\r\n\t\t\t\t\t\t\t\tif ($(this).parents('#slide-out-widget-area').length > 0) {\r\n\t\t\t\t\t\t\t\t\t$('#slide-out-widget-area .slide_out_area_close').trigger('click');\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\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function initSidenavScroll() {\n let sidenav = $(\".sidenav-list\");\n let sidenav_active_elements = $(\".sidenav .active\");\n if (sidenav_active_elements.length > 0) setTimeout(() => { //setTimeout gives bootstrap time to execute first\n sidenav[0].scrollTop = sidenav_active_elements[0].offsetTop - 60;\n });\n}", "function createScrollMagic() {\nvar navTween = TweenMax.fromTo('#siteNav', 6,\n {\n backgroundColor: \"transparent\"\n },\n {\n backgroundColor: \"#75e5f1\"\n }\n );\n var nav9Scene = new ScrollScene({\n triggerElement: '#ScrollDown',\n duration: 200, \n offset: 0\n })\n .addTo(scrollMagicController)\n .setTween(navTween);\n\n\n/* ##################################################### */\n var navTween9 = TweenMax.fromTo('.nav9', 6,\n {\n backgroundColor: \"transparent\"\n },\n {\n backgroundColor: \"#6e88e8\"\n }\n );\n var nav9Scene = new ScrollScene({\n triggerElement: '#ScrollDown',\n duration: 200, \n offset: 0\n })\n .addTo(scrollMagicController)\n .setTween(navTween9)\n/* ##################################################### */\n var navTween3 = TweenMax.fromTo('.nav3', 6,\n {\n backgroundColor: \"transparent\"\n },\n {\n backgroundColor: \"#75e5f1\"\n }\n );\n var nav3Scene = new ScrollScene({\n triggerElement: '#ScrollDown',\n duration: 200,\n offset: 0\n })\n .addTo(scrollMagicController)\n .setTween(navTween3)\n/* ##################################################### */\n \n //.addIndicators({name:\"1 (duration:200)\"})\n/* ##################################################### */\n var thirdContentTween = TweenMax.fromTo('#triggarThirdContent', 8,\n {\n backgroundPosition: '0px 0px'\n },\n {\n backgroundPosition: '0px -200px'\n }\n );\n var thirdContentScene = new ScrollScene({\n triggerElement: '#triggarThirdContent',\n duration:1100,\n offset: 0\n })\n .addTo(scrollMagicController)\n .setTween(thirdContentTween)\n\n\n\n\n/* ##################################################### */\n var thirdContentTween1 = TweenMax.staggerFromTo('.fc3', 0.1,\n {\n y:30,\n opacity:0\n },\n {\n y:0,\n opacity:1\n },\n 0.3);\n var thirdContentScene1 = new ScrollScene({\n triggerElement: '#triggarThirdContent',\n duration: 0,\n offset: 0\n })\n .addTo(scrollMagicController)\n .setTween(thirdContentTween1)\n\n/* ##################################################### */\n var firstContentTween = TweenMax.fromTo('#triggarFirstContent', 1.2,\n {\n opacity: 0,\n y: 500\n },\n {\n opacity:1,\n y:-62\n }\n );\n var firstContentScene = new ScrollScene({\n triggerElement: '#ScrollDown',\n duration:0,\n offset: 0\n })\n .addTo(scrollMagicController)\n .setTween(firstContentTween)\n/* ##################################################### */\n var contactTween = TweenMax.staggerFromTo('.fcContact', 0.2,\n {\n y:5,\n scale:0.8,\n opacity:0\n },\n {\n y:0,\n scale:1,\n opacity:1\n },\n 0.15);\n var contactScene = new ScrollScene({\n triggerElement: '#contact'\n })\n .addTo(scrollMagicController)\n .setTween(contactTween)\n/* ##################################################### */\n var aboutTween = TweenMax.staggerFromTo('.about1', 0.2,\n {\n y:30,\n opacity: 0\n },\n {\n y:0,\n opacity: 1\n },\n 0.2);\n var aboutScene = new ScrollScene({\n triggerElement: '#triggarAbout'\n })\n .addTo(scrollMagicController)\n .setTween(aboutTween)\n/* ##################################################### */\nvar bottomTween = TweenMax.fromTo('.bottomP', 1.25,\n {\n opacity: 0,\n scale: 0.5\n },\n {\n opacity:1,\n scale: 1\n }\n );\n var bottomScene = new ScrollScene({\n triggerElement: '#bottom',\n triggerHook: 'onEnter'\n })\n .addTo(scrollMagicController)\n .setTween(bottomTween)\n /* ##################################################### */\nvar forthTween = TweenMax.fromTo('#triggarFourthContent', 1.0,\n {\n opacity: 0,\n y: 30,\n scale: 0.85\n },\n {\n opacity:1,\n y: 0,\n scale: 1\n }\n );\n var forthScene = new ScrollScene({\n triggerElement: '#triggarFourthContent',\n triggerHook: 'onEnter'\n })\n .addTo(scrollMagicController)\n .setTween(forthTween)\n /* ##################################################### */\nvar fifthTween = TweenMax.fromTo('#triggarFifthContent', 1.0,\n {\n opacity: 0,\n y: 30,\n scale: 0.85\n },\n {\n opacity:1,\n y: 0,\n scale: 1\n }\n );\n var fifthScene = new ScrollScene({\n triggerElement: '#triggarFifthContent',\n triggerHook: 'onEnter'\n })\n .addTo(scrollMagicController)\n .setTween(fifthTween)\n\n/* ##################################################### */\n/*var bmiTween = TweenMax.fromTo('.bmi', 0.5,\n {\n opacity: 0,\n scale: 0.1\n },\n {\n opacity:1,\n scale: 1,\n ease:Back.easeOut\n }\n );\n var bmiScene = new ScrollScene({\n triggerElement: '.bmi',\n triggerHook: 'onEnter'\n })\n .addTo(scrollMagicController)\n .setTween(bmiTween)*/\n}", "function clickHandler(e) {\n const header = document.getElementById(\"header\");\n header.style.display = \"none\";\n e.preventDefault();\n for( link of links){\n link.classList.remove('active-navlink');\n }\n mainNav.classList.contains('transparent')? mainNav.classList.remove('transparent'): null ;\n const href = this.getAttribute(\"href\");\n this.classList.add('active-navlink');\n console.log(\"I got cliked !\"+href);\n for (section of sections) { \n let sectionId = \"#\"+section.id ;\n if (href === sectionId ) {\n \n section.classList.add('visible');\n document.querySelector(href).scrollIntoView({\n behavior: \"instant\"\n });\n } else {\n section.classList.remove('visible');\n }\n }\n \n ( burger.style.display === \"none\") ? null : toggleNavbar();\n \n \n}", "function OsEasingClick() {\r\n $('.easing-link-group a[href^=\"#\"] , a.easing-link[href^=\"#\"]').not('[href=\"#\"]').on('click', function (event) {\r\n event.preventDefault();\r\n\r\n var $this = $(this);\r\n var elementPostion = $($this.attr('href')).offset().top;\r\n\r\n $('html,body').animate({\r\n scrollTop: elementPostion\r\n },\r\n 400, function () {\r\n $('body').removeClass('mobile-nav-open');\r\n }\r\n );\r\n });\r\n }", "function navigatePositions() {\n const positionName = this.getAttribute('data-position');\n const positionTarget = document.querySelector(`[data-position=\"${positionName}\"]`);\n smoothScroll(positionTarget.offsetTop, 618);\n}", "function scrollMenuActive() {\n\n\t\t\t\t\t$('nav ul li a[href^=\"#\"]').each(function() {\n\n\t\t\t\t\t\tvar btn = $(this);\n\n\t\t\t\t\t\tif (isScrolledIntoView(btn.attr('active'))) {\n\t\t\t\t\t\t\tbtn.closest('li').addClass('active');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbtn.closest('li').removeClass('active');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\t\t\t\t}", "function toggleNavbarHighlightFromScrolling(onScreenLinks,nameOfSection) {\n // Iterate across elements onScreenLinksing newly encoutered section and unhighligthing the rest.\n for (const link of onScreenLinks) {\n\n if (link.innerText == nameOfSection) {\n\n // Turn On coloring for listitem\n link.parentElement.classList.add('onScreenLinks');\n\n } else { // Turn Off Coloring for list item\n\n if (link.parentElement.classList.contains('onScreenLinks')) {\n link.parentElement.classList.toggle('onScreenLinks');\n }\n }\n }\n}", "function addScrollMagic(){\n\n var $slides = $pages.find('.sc-slides');\n\n _scrollValues = [];\n \n _controller = null;\n\n _controller = new ScrollMagic.Controller({\n globalSceneOptions: {\n triggerHook: 0,\n reverse: true,\n }\n });\n\n $slides.find('.infos').each(function(e){\n \n var _this = this;\n var _index = e;\n var _color = $(this).data('color');\n\n var scene = new ScrollMagic.Scene({triggerElement: this, duration: \"100%\"})\n .setPin(this)\n .on(\"enter\", function (e) {\n\n $slides.find('.services-bckg').css({background:_color});\n $header.addClass('h-white').addClass('check-header');\n \n _scrollPos = _index;\n\n if(_index == 0){\n \n Title.motionIn($(_this));\n \n $(_this).find('.caption').addClass('motion-in');\n $(_this).find('.submenu').addClass('motion-in');\n\n setTimeout(function(){\n $(_this).find('.paragraph').addClass('motion-in');\n $(_this).find('.button').addClass('motion-in');\n $(_this).find('.image-services').addClass('motion-in');\n },1000);\n }\n\n if(_index == 1){\n $(_this).find('.caption').addClass('motion-in');\n $(_this).find('.subtitle').addClass('motion-in');\n $(_this).find('.paragraph').addClass('motion-in');\n $(_this).find('.button').addClass('motion-in');\n }\n\n if(_index == 2){\n $scrollDown.removeClass('hide');\n $(_this).find('.services-items').addClass('motion-in');\n }\n \n })\n .on(\"leave\", function (e) {\n\n if(_index == 0){\n \n Title.motionOut($(_this));\n\n $(_this).find('.submenu').removeClass('motion-in');\n $(_this).find('.paragraph').removeClass('motion-in');\n $(_this).find('.button').removeClass('motion-in');\n $(_this).find('.caption').removeClass('motion-in');\n $(_this).find('.image-services').removeClass('motion-in');\n }\n\n if(_index == 1){\n $(_this).find('.caption').removeClass('motion-in');\n $(_this).find('.subtitle').removeClass('motion-in');\n $(_this).find('.paragraph').removeClass('motion-in');\n $(_this).find('.button').removeClass('motion-in');\n }\n\n if(_index == 2){\n \n if(e.scrollDirection == \"FORWARD\"){\n $scrollDown.addClass('hide');\n }\n\n $(_this).find('.services-items').removeClass('motion-in');\n }\n\n })\n // .addIndicators()\n .addTo(_controller);\n\n\n _scrollValues.push(scene.scrollOffset()+(scene.duration()-10));\n \n });\n\n\n}", "function topFunction() {\r\n const topsy = document.querySelector(\"#section1\");\r\n topsy.scrollIntoView({ behavior: \"smooth\" });\r\n}", "function onScroll() {\n let navBar = document.querySelector(\"nav.row.nav-bar\");\n let navBarList = document.querySelectorAll(\".nav-items > a\");\n let navBarLogo = document.querySelector(\".nav-bar > .logo > a\");\n\n //!!\n //el.getBoundingClientRect() >>//grazina objekta turinti info apie tai kur tas elementas yra;\n //.getBoundingClientRect().right\n //screenHeight==window.innerHeight;\n //el.offsetTop ==>>palygina kiek zemai yra elementas lyginant su visu body ellementu;\n //window.scrollBy windowscrollTo\n // window.scrollY >>> parodo kiek px pasiskrolines ekranas:\n\n if (window.scrollY >= 250) {\n navBar.classList.add(\"nav-bar-scroll\");\n navBarList.forEach((item) => item.classList.add(\"a-scroll\"));\n navBarLogo.classList.add(\"logo-scroll\");\n } else {\n navBar.classList.remove(\"nav-bar-scroll\");\n navBarList.forEach((item) => item.classList.remove(\"a-scroll\"));\n navBarLogo.classList.remove(\"logo-scroll\");\n }\n}", "function scroll_actions(){\n // Checks if the logo has to be \"resized\". Big for intro, small if elsewhere.\n if($(this).scrollTop() > $(window).height()){\n $('#header-logo-big').toggleClass('active-logo', false);\n $('#header-logo-small').toggleClass('active-logo', true);\n $('#back-to-top').css('display', 'inline');\n }else{\n $('#header-logo-big').toggleClass('active-logo', true);\n $('#header-logo-small').toggleClass('active-logo', false);\n $('#back-to-top').css('display', 'none');\n }\n\n // Refresh the waypoints\n Waypoint.refreshAll(); \n}", "function PagesNavigation() {\n\n}", "function smoothScrollInit() {\r\n\r\n\t \t\t\t\t// Smooth scroll\r\n\t\t $('a[href^=\"#\"]').bind('click.smoothscroll',function (e) {\r\n\t\t e.preventDefault();\r\n\r\n\t\t var target = this.hash,\r\n\t\t $target = $(target);\r\n\r\n\t\t if($target.offset() == undefined) return;\r\n\r\n\t\t $('html, body').stop().animate({\r\n\t\t 'scrollTop': $target.offset().top-110\r\n\t\t }, 900, 'swing', function () {\r\n\t\t if($('body').hasClass('auto-close-menu') && $('.menu-open').length > 0){\r\n\t\t $('#menuToggle, #menuToggleLeft').click();\r\n\t\t }\r\n\t\t \r\n\t\t });\r\n\t\t });\r\n}", "function scrolling(e) {\n var selector;\n if (String(e.className) === \"navbar-links-about\") {\n selector = \".aboutsection\";\n } else if (String(e.className) === \"navbar-links-projects\") {\n selector = \".projectssection\";\n } else if (String(e.className) === \"navbar-links-team\") {\n selector = \".teamsection\";\n } else {\n selector = \".contactsection\";\n }\n document.querySelector(selector).scrollIntoView({ behavior: \"smooth\" });\n document.querySelector(\".navbar-menu\").classList.remove(\"navbar-menu-open\");\n document\n .querySelector(\".navbar-hamburger\")\n .classList.remove(\"navbar-hamburger-open\");\n}", "function scroller(){\n\t\t\t\t\t$('.scrollPage').click(function(){\n\t\t\t\t\t\tvar elementClicked = $(this).attr(\"href\");\n\t\t\t\t\t\tvar destination = $(elementClicked).offset().top;\n\t\t\t\t\t\t$(\"html:not(:animated),body:not(:animated)\").animate({\n\t\t\t\t\t\t\tscrollTop: destination - 1 //Number being the pixel distance from destination.\n\t\t\t\t\t\t}, 1000, 'easeInOutQuint');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t}", "function handleMobileNav_desktop(item){\n\n\t\tvar page_prev = item.attr(\"href\").split(\"#\")[0];\n\t\tvar page_id = item.attr(\"href\").split(\"#\")[1];\n\n\t\t//its not a normal link like \"blog.html\"\n\t\tif (page_id != undefined && (page_prev == undefined || page_prev == \"\")){\n\n\t\t\tif (page_id != 'home'){\n\t\t\t\t$('body').animate({scrollTop:$('.page#' + page_id).offset().top}, 750);\n\t\t\t}else{\n\t\t\t\t$('body').animate({scrollTop:0}, 750);\n\t\t\t}\n\n\t\t\t//navigation classes swap\n\t\t\t$(\".navigation li.active\").removeClass(\"active\");\n\t\t\t$('.navigation li a[href=\"#'+page_id+'\"]').parent().addClass(\"active\");\n\n\n\t\t\treturn false;\n\t\t}\n\n\t}", "function simpleOnePage() {\n \"use strict\";\n $('nav .menu').onePageNav({\n currentClass: 'current-menu-item',\n changeHash: false,\n scrollSpeed: 750,\n scrollThreshold: 0.5,\n });\n }", "redrawNavPanel()\n {\n \tlet self = this;\n \t\n \tlet b = 0;\n \tlet sect = false;\n \tfor( let a in self.sections )\n\t\t{\n\t\t\tif( a == self.activeSection )\n\t\t\t\tsect = self.sections[ a ];\n\t\t}\n\t\tif( !sect ) return;\n\t\t\n\t\t// Make next prev\n\t\tif( !this.#navbarAdded )\n\t\t{\n\t\t\tthis.#navbarAdded = true;\n\t\t\tlet str = '';\n\t\t\tstr += '<div class=\"Previous\"><span>Previous</span></div><div class=\"Pages\"></div><div class=\"Next\"><span>Next</span></div>';\n\t\t\tthis.navpanel.innerHTML = str;\n\t\t}\n\t\t\n\t\tthis.navpanel.querySelector( '.Pages' ).innerHTML = '';\n\t\tthis.navpanel.querySelector( '.Pages' ).classList.add( 'SmoothScrolling' );\n\t\t\n\t\tlet offset = 0;\n\t\t\n\t\tif( sect.pages )\n\t\t{\n\t\t\t// First pass, check active page\n\t\t\tif( !self.currentPage )\n\t\t\t{\n\t\t\t\tfor( let a = 0; a < sect.pages.length; a++ )\n\t\t\t\t{\n\t\t\t\t\tif( sect.pages[a].ID == self.storedActivePage || ( self.storedActivePage == -1 && a == 0 ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tself.currentPage = a;\n\t\t\t\t\t\t//console.log( 'Found current page ' + a + ' where stored is ' + self.storedActivePage + ' and this page is ' + sect.pages[a].ID );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet activePage = false;\n\t\t\tfor( let a = 0; a < sect.pages.length; a++ )\n\t\t\t{\n\t\t\t\tlet p = document.createElement( 'div' );\n\t\t\t\tp.className = 'PageElement';\n\t\t\t\tp.style.left = ( ( a * 40 ) - offset ) + 'px';\n\t\t\t\tif( self.currentPage == a )\n\t\t\t\t{\n\t\t\t\t\tp.classList.add( 'ActivePage' );\n\t\t\t\t\tactivePage = p;\n\t\t\t\t}\n\t\t\t\tp.innerHTML = '<span>' + ( a + 1 ) + '</span>';\n\t\t\t\t( function( pag, num )\n\t\t\t\t{\n\t\t\t\t\tif( self.getCurrentSection().Navigation == '1' )\n \t\t\t\t{\n\t\t\t\t\t\tpag.onclick = function()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif( self.completed ) return;\n\t\t\t\t\t\t\tself.currentPage = num;\n\t\t\t\t\t\t\tself.renderElements();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} )( p, a );\n\t\t\t\tthis.navpanel.querySelector( '.Pages' ).appendChild( p );\n\t\t\t}\n\t\t\t\n\t\t\tlet pid = sect.pages[ self.currentPage ].ID;\n\t\t\t\n\t\t\t//console.log( 'Setting current page: ', self.currentPage + ' ' + pid );\n\t\t\t\n\t\t\t// Set active page\n\t\t\tlet csid = this.#courseSessionId;\n\t\t\t\n\t\t\t// Scroll into view\n\t\t\tif( activePage )\n\t\t\t{\n\t\t\t\tactivePage.parentNode.scrollTo( activePage.offsetLeft - 100, 0 );\n\t\t\t}\n\t\t\t\n\t\t\t// Workaround on saving issue..\n\t\t\tsetTimeout( function()\n\t\t\t{\n\t\t\t\tlet mo = new Module( 'system' );\n\t\t\t\tmo.execute( 'appmodule', {\n\t\t\t\t\tappName: 'Courses',\n\t\t\t\t\tcommand: 'setsessioninfo',\n\t\t\t\t\tcurrentPageId: pid,\n\t\t\t\t\tcourseSessionId: csid\n\t\t\t\t} );\n\t\t\t}, 250 );\n\t\t}\n\t\t\n\t\t// Set active section\n\t\tlet m = new Module( 'system' );\n\t\tm.execute( 'appmodule', {\n\t\t\tappName: 'Courses',\n\t\t\tcommand: 'setsessioninfo',\n\t\t\tcurrentSectionId: self.getCurrentSection().ID,\n\t\t\tcourseSessionId: this.#courseSessionId\n\t\t} );\n\t\t\n\t\tthis.navpanel.querySelector( '.Previous' ).onclick = function()\n\t\t{\n\t\t\tif( self.completed ) return;\n\t\t\tif( self.getCurrentSection().Navigation == '1' )\n\t\t\t{\n\t\t\t\tself.currentPage--;\n\t\t\t\tif( self.currentPage < 0 ) \n\t\t\t\t{\n\t\t\t\t\tself.currentPage = 0;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tself.renderElements();\n\t\t\t}\n\t\t}\n \t\t\n\t\tthis.navpanel.querySelector( '.Next' ).onclick = function()\n\t\t{\n\t\t\tif( self.completed ) return;\n\t\t\tif( self.pageCompleted() )\n\t\t\t{\n\t\t\t\tself.currentPage++;\n\t\t\t\tif( self.currentPage >= self.sections[ self.activeSection ].pages.length )\n\t\t\t\t{\n\t\t\t\t\t// Check if there's a next section\n\t\t\t\t\tlet b = 0;\n\t\t\t\t\tlet current = 0;\n\t\t\t\t\tfor( let a in self.sections )\n\t\t\t\t\t{\n\t\t\t\t\t\tif( a == self.activeSection )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcurrent = b;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tb++;\n\t\t\t\t\t}\n\t\t\t\t\tb = 0;\n\t\t\t\t\tfor( let a in self.sections )\n\t\t\t\t\t{\n\t\t\t\t\t\t// This is the next section\n\t\t\t\t\t\tif( b == current + 1 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tself.activeSection = a;\n\t\t\t\t\t\t\tself.currentPage = 0;\n\t\t\t\t\t\t\tself.refreshStructure();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tb++;\n\t\t\t\t\t}\n\t\t\t\t\tself.currentPage--;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tself.renderElements();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tconsole.log( 'This page is not solved.' );\n\t\t\t}\n\t\t}\n }", "function focusOnScroll() {\n sections.forEach(section => section.classList.remove('section-active'));\n if (isElementInViewport(heading)) {\n navList.childNodes[0].classList.add('nav-active');\n navList.childNodes.forEach((navLink, index) =>\n index && navLink.classList.remove('nav-active'));\n } else {\n const actIndex = sections.findIndex(section => isElementInViewport(section.childNodes[1].childNodes[1]));\n const actSection = sections[actIndex];\n const actLink = navList.childNodes[actIndex + 1];\n actSection && actSection.classList.add('section-active');\n actLink && actLink.classList.add('nav-active');\n navList.childNodes.forEach((navLink, index) =>\n index !== (actIndex + 1) && navLink.classList.remove('nav-active'));\n }\n}", "function navActive(){\n let navItem = document.querySelectorAll('li');\n for(let i=0;i<5;i++){\n navItem[i].scrollIntoView({behavior: \"smooth\", block: \"end\", inline: \"nearest\"});\n navItem[i].addEventListener('mouseover',function(e){//to appear or disappear active point\n setTimeout(()=>{\n //to remove active from other\n for(let j=0;j<navItem.length/2;j++){\n if(navItem[j].querySelector('span').className.indexOf('active')!=-1){\n navItem[j].querySelector('span').classList.remove('active');\n }\n }\n if(e.target.querySelector('span')!=null){\n e.target.querySelector('span').classList+=' active';}//to add active point}\n },200);\n \n });\n // to smooth return to top\n navItem[i].addEventListener('click',function(e){\n e.preventDefault();//prevent default to make smooth scroll\n // to go to the specific part which user want to go\n let partName = '#'+e.target.innerHTML.split('<')[0].toLowerCase();//get name of section we want to go \n let sectionName = document.querySelector(''+partName+'');//to go to specific part\n sectionName.scrollIntoView({behavior: \"smooth\", block: \"start\", inline: \"nearest\"});\n });\n }\n}", "function scrollControls() {\r\n\r\n\r\n\t//Scroll down navigation function\r\n\t//scroll down\r\n\t$('.tags__item--comment').click(function (ev) {\r\n\t\tev.preventDefault();\r\n\t\t$('html, body').stop().animate({'scrollTop': $('#comment-start').offset().top-100}, 900, 'swing');\r\n\t});\r\n\r\n\t$('.tags__item--user').click(function (ev) {\r\n\t\tev.preventDefault();\r\n\t\t$('html, body').stop().animate({'scrollTop': $('#user-post-start').offset().top-100}, 900, 'swing');\r\n\t});\r\n}", "function toggleNavigation() {\n $(\"body\").toggleClass(\"no-scroll\");\n $(\".hamburger\").toggleClass(\"open\");\n $(\".main-nav ul\").toggleClass(\"open\");\n $(\".main-nav ul li\").toggleClass(\"open\");\n $(\".gallery-nav ul\").toggleClass(\"open\");\n $(\".gallery-nav ul li\").toggleClass(\"open\");\n $(\".overlay\").toggleClass(\"open\");\n }", "goTop() {\n refs.galleryList.scrollIntoView({\n block: \"start\",\n behavior: \"smooth\",\n });\n }", "function menuScroll() {\n var navMenu = $('.nav-menu');\n\n if ($(window).scrollTop() > 50) {\n navMenu.addClass('is-scrolling');\n } else {\n navMenu.removeClass(\"is-scrolling\");\n }\n }", "function onePageFixedNav() {\n if ($('body').length) {\n // Add scrollspy to \n $('body').scrollspy({ target: \".theme-main-header\", offset: 70 });\n\n // Add smooth scrolling on all links inside the one-page-menu\n $(\".one-page-menu li a\").on('click', function (event) {\n // Make sure this.hash has a value before overriding default behavior\n if (this.hash !== \"\") {\n // Prevent default anchor click behavior\n event.preventDefault();\n\n // Store hash\n var hash = this.hash;\n\n // Using jQuery's animate() method to add smooth page scroll\n // The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area\n $('html, body').animate({\n scrollTop: $(hash).offset().top\n }, 1000, function () {\n\n // Add hash (#) to URL when done scrolling (default click behavior)\n window.location.hash = hash;\n });\n } // End if\n });\n }\n}", "function smoothScroll () {\n\t$('div.headContainer').on('click', 'a', function() {\n\t \tvar menuID = $(this).attr(\"href\");\n\n \t\t$(\"body, html\").animate({scrollTop: $(menuID).offset().top}, \"slow\");\n\t\treturn false;\n\n\t});\n}", "function work() {\n var scrollPos = $(\".case-studies\").offset().top - 80;\n TweenLite.to(window, 2, {scrollTo: {y: scrollPos}, ease: Power2.easeOut});\n }", "function scrollSuave() {\n var $doc = $('html, body');\n $('.menu-principal-lista a, .footer-menu a').click(function () {\n $doc.animate({\n scrollTop: $($.attr(this, 'href')).offset().top\n }, 1700);\n return false;\n });\n}", "function handler() {\n let scrpos=window.pageYOffset || document.scrollingElement.scrollTop;\n let vh=window.innerHeight\n let homePos=scrpos+home.getBoundingClientRect().top;\n let aboutPos=scrpos+about.getBoundingClientRect().top;\n let servicesPos=scrpos+services.getBoundingClientRect().top;\n let portfolioPos=scrpos+portfolio.getBoundingClientRect().top;\n let contactPos=scrpos+contact.getBoundingClientRect().top;\n\n if(scrpos>=homePos && scrpos<=(homePos+home.clientHeight)){\n //make it active\n document.querySelector(\".menu-item.home a\").classList.add('active')\n document.querySelector(\".nav-item.home\").classList.add('active')\n\n //home paralax effect\n let parax=home.querySelectorAll('[data-paralax]');\n parax.forEach(elm=>{\n paralax(elm,scrpos)\n })\n }else{\n document.querySelector(\".menu-item.home a\").classList.remove('active')\n document.querySelector(\".nav-item.home\").classList.remove('active') \n }\n if(scrpos>=aboutPos && scrpos<=(aboutPos+about.clientHeight)){\n //just incase about me pGW DOES NOT occupiy the whole of viewport\n document.querySelector(\".menu-item.home a\").classList.remove('active')\n document.querySelector(\".nav-item.home\").classList.remove('active') \n \n //make it active\n document.querySelector(\".menu-item.about a\").classList.add('active')\n document.querySelector(\".nav-item.about\").classList.add('active')\n }else{\n document.querySelector(\".menu-item.about a\").classList.remove('active')\n document.querySelector(\".nav-item.about\").classList.remove('active')\n }\n if(scrpos>=servicesPos && scrpos<=(servicesPos+services.clientHeight)){\n //make it active\n document.querySelector(\".menu-item.services a\").classList.add('active')\n document.querySelector(\".nav-item.services\").classList.add('active')\n }else{\n document.querySelector(\".menu-item.services a\").classList.remove('active')\n document.querySelector(\".nav-item.services\").classList.remove('active')\n }\n if(scrpos>=portfolioPos && scrpos<=(portfolioPos+portfolio.clientHeight)){\n //make it active\n document.querySelector(\".menu-item.portfolio a\").classList.add('active')\n document.querySelector(\".nav-item.portfolio\").classList.add('active')\n }else{\n document.querySelector(\".menu-item.portfolio a\").classList.remove('active')\n document.querySelector(\".nav-item.portfolio\").classList.remove('active')\n }\n\n if(scrpos>=contactPos || scrpos>=(document.scrollingElement.scrollHeight-vh)){\n //make it active\n //disblae portfolio active class since contact me is not a full page section\n document.querySelector(\".menu-item.portfolio a\").classList.remove('active')\n document.querySelector(\".nav-item.portfolio\").classList.remove('active')\n\n document.querySelector(\".menu-item.contact-me a\").classList.add('active')\n document.querySelector(\".nav-item.contact-me\").classList.add('active')\n }else{\n document.querySelector(\".menu-item.contact-me a\").classList.remove('active')\n document.querySelector(\".nav-item.contact-me\").classList.remove('active')\n }\n}", "function enableScroll() { \n window.onscroll = function() {fix_navbar()}; \n}", "function scrollHandler() { \n\t\tif ( isNextSceneReached(true) ) {\n runNextScene();\n\t\t} else if ( isPrevSceneReached(true) ) {\n runPrevScene();\n\t\t}\n }", "function HeaderController($scope, $location, anchorSmoothScroll)\r\n{\r\n\r\n $scope.gotoElement = function (eID) {\r\n\r\n console.log(\"gotoElement\");\r\n // set the location.hash to the id of\r\n // the element you wish to scroll to.\r\n $location.hash('home-intro');\r\n\r\n // call $anchorScroll()\r\n anchorSmoothScroll.scrollTo(eID);\r\n\r\n };\r\n\r\n /*-----------------------------------------------------*/\r\n /* Mobile Menu\r\n ------------------------------------------------------ */\r\n var menu_icon = $(\"<span class='menu-icon'>Menu</span>\");\r\n var toggle_button = $(\"<a>\", {\r\n id: \"toggle-btn\",\r\n html : \"\",\r\n title: \"Menu\",\r\n href : \"#\" });\r\n\r\n var nav_wrap = $('nav#nav-wrap')\r\n var nav = $(\"ul#nav\");\r\n\r\n /* if JS is enabled, remove the two a.mobile-btns\r\n and dynamically prepend a.toggle-btn to #nav-wrap */\r\n nav_wrap.find('a.mobile-btn').remove();\r\n toggle_button.append(menu_icon);\r\n nav_wrap.prepend(toggle_button);\r\n\r\n toggle_button.on(\"click\", function(e) {\r\n e.preventDefault();\r\n nav.slideToggle(\"fast\");\r\n });\r\n\r\n if (toggle_button.is(':visible')) nav.addClass('mobile');\r\n $(window).resize(function() {\r\n if (toggle_button.is(':visible')) nav.addClass('mobile');\r\n else nav.removeClass('mobile');\r\n });\r\n\r\n $('ul#nav li a').on(\"click\", function() {\r\n if (nav.hasClass('mobile')) nav.fadeOut('fast');\r\n });\r\n}" ]
[ "0.7460926", "0.6954371", "0.6928883", "0.67696565", "0.6713572", "0.66679347", "0.66178805", "0.655814", "0.6512086", "0.65032536", "0.6481224", "0.64692056", "0.6465416", "0.64551944", "0.6419625", "0.64136887", "0.641122", "0.64104104", "0.639461", "0.6390729", "0.63702226", "0.63607955", "0.63544476", "0.63509375", "0.6348766", "0.63486356", "0.6343101", "0.6331377", "0.6329898", "0.6321299", "0.63105917", "0.6308089", "0.62879896", "0.628422", "0.6275185", "0.627201", "0.6244545", "0.62437326", "0.62419355", "0.62314683", "0.6228174", "0.6219357", "0.62149876", "0.6207944", "0.6204227", "0.6193272", "0.61856073", "0.61839473", "0.6183133", "0.6173465", "0.61722124", "0.6171294", "0.61676526", "0.61584187", "0.61576587", "0.6153858", "0.614801", "0.61354", "0.61332434", "0.61259675", "0.612501", "0.6116865", "0.61158156", "0.61144334", "0.61060375", "0.6105939", "0.61026454", "0.6099175", "0.609497", "0.60909504", "0.60876185", "0.60826087", "0.6068151", "0.6064168", "0.6049102", "0.60486114", "0.6047066", "0.6031354", "0.6030348", "0.6030297", "0.60251105", "0.60243964", "0.60230345", "0.6010904", "0.60092366", "0.60052794", "0.6005279", "0.6000047", "0.5993009", "0.5987902", "0.59815794", "0.5978931", "0.5974815", "0.5973977", "0.5968914", "0.59637046", "0.59624875", "0.59569126", "0.5953015", "0.5952455", "0.59521395" ]
0.0
-1
to be used to show the os buttons which just remove the 'hidden' class
function show(id) { document.querySelectorAll(id).forEach((element) => { element.classList.remove("hidden"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "show() {\n this.button.removeClass(\"hidden\");\n }", "function _hideOtherButtons(hide){\n\t\t\t$('.btn_addremove').show();\n\t\t\t$('.btn_download').show();\n\t\t\t$('.btn_delete').show();\n\t\t\t\n\t\t\t/*if (hide) {\n\t\t\t\t$('.btn_addremove').hide();\n\t\t\t\t$('.btn_download').hide();\n\t\t\t\t$('.btn_delete').hide();\n\t\t\t}*/\n\t\t}", "function hideUselessBtns() {\n $(\"#navCat\").attr(\"class\",\"hide\");\n $(\"#navFav\").attr(\"class\",\"hide\");\n disableCopy();\n}", "hideButton() {\n if (this._installButton) {\n this._installButton.classList.toggle('hidden', true);\n }\n }", "function hideButtonsAndText() {\n $(\"sport-btn\").classList.add(\"hidden\");\n qs(\"textarea\").classList.add(\"hidden\");\n $(\"player-btn\").classList.add(\"hidden\");\n $(\"back-btn\").classList.remove(\"hidden\");\n }", "function button_visibility(class_name) {\n var all_buttons = document.getElementsByClassName('opbutton');\n for (var i=0; i<all_buttons.length; i++) {\n var e = all_buttons[i];\n e.style.display = 'none';\n }\n\n var active_buttons = document.getElementsByClassName(class_name);\n for (var i=0; i<active_buttons.length; i++) {\n var e = active_buttons[i];\n e.style.display = 'inline-block';\n }\n}", "hide() {\n this.button.addClass(\"hidden\");\n this.button.removeClass(\"active\");\n }", "function invisibleBtn() {\n let buttonsDiv = this.querySelector(\"#buttonsDiv\")\n buttonsDiv.classList.add(\"invisible\")\n buttonsDiv.classList.remove(\"visible\")\n}", "_updateButtons() {\n const hideButton = action =>\n this.$header.querySelector(`.osjs-window-button[data-action=${action}]`)\n .style.display = 'none';\n\n const buttonmap = {\n maximizable: 'maximize',\n minimizable: 'minimize',\n closeable: 'close'\n };\n\n if (this.attributes.controls) {\n Object.keys(buttonmap)\n .forEach(key => {\n if (!this.attributes[key]) {\n hideButton(buttonmap[key]);\n }\n });\n } else {\n Array.from(this.$header.querySelectorAll('.osjs-window-button'))\n .forEach(el => el.style.display = 'none');\n }\n }", "showVerifyInfoButton() {\n this.buttons.verifyButton.classList.remove(\"hidden\");\n }", "function hideAllProductBtns(){\n addProductBtnVisible(false);\n deleteProductBtnVisible(false);\n updateProductBtnVisible(false);\n }", "hideVerifyInfoButton() {\n this.buttons.verifyButton.classList.add(\"hidden\");\n }", "function displayHomeButton() {\n homeButton.classList.remove('hidden');\n}", "function hideButtons () {\n\t\t_this.disable(true);\n\t\tfade(buttons, false);\n\t\tfade(yesnos, false);\n\n\t\tif (_this.agent.visible) { _this.agent.eyesFollowPointer(true); }\n\t}", "hideButtons() {\n this.visible = false;\n for (const button of this.buttonsAsArray) {\n button.hideButton();\n }\n }", "function hideIcons() {\n\t$(this).find(\".upload_button\").hide();\n\t$(this).find(\".close_button\").hide();\n}", "function showDeleteButton() {\n if (deleteButton.classList.contains('invisible')) {\n deleteButton.classList.remove('invisible');\n }\n}", "function toggleConfShowButtons(){\n\tshowButtons = toggleConfBool('botones', showButtons);\n\tget('wcr_botones').style.display = showButtons ? '' : 'none';\n}", "showAddButton() {\n this.buttons.addButton.classList.remove(\"hidden\");\n }", "function showButtonVersion(acc) {\n elm = $('.version__button .invoice_button');\n acc == 'S'\n ? elm.css({ visibility: 'visible' })\n : elm.css({ visibility: 'hidden' });\n}", "function showhideliveicon(unit, statushow) {\r\n\r\n\t//ignore args\r\n\r\n\t//Go through all icons hide/show as needed depending on checkbox status\r\n\tplaceliveicons();\r\n\r\n}", "function hideAllBtn () {\n\t\t\toffBtn ('btnCopy');\n\t\t\toffBtn ('btnDel');\n\t\t\toffBtn ('btnUp');\n\t\t\toffBtn ('btnDn');\n\t\t\toffBtn ('btnFlipH');\n\t\t\toffBtn ('btnFlipV');\n\t\t\toffBtn ('btnLock');\n\t\t\toffBtn ('sectEdit');\n\t\t\toffBtn ('colorelement');\n\t\t\t//Hide Font Button\n\t\t\t/*offBtn ('btnBold');\n\t\t\toffBtn ('btnItalic');\n\t\t\toffBtn ('fntLeft');\n\t\t\toffBtn ('fntCenter');\n\t\t\toffBtn ('fntRight');\n\t\t\toffBtn ('fontFamily');\n\t\t\toffBtn ('btnEditT');\n\t\t\t*/\n\t\t}", "function hideButtons() {\n $(\".private\").css(\"display\", \"none\");\n $(\"#signOff\").css(\"display\", \"none\"); //Ocultamos el boton cerrar sesion\n $(\"#signUp\").css(\"display\", \"inherit\"); //Mostramos el boton iniciar sesion\n}", "function showButtons() {\n $(\".private\").css(\"display\", \"inherit\");\n $(\"#signUp\").css(\"display\", \"none\"); //Ocultamos el boton iniciar sesion\n}", "function hideHomeButton() {\n homeButton.classList.add('hidden');\n}", "hiddenTools() {\n this.panelTool.classList.remove(\"hidden\");\n this.panelTool.classList.add(\"show\");\n }", "function showButtons() {\n // when users are not connected, we want start game button disabled\n // document.getElementById('start-game').style.display = 'inline';\n\n document.getElementById('button-invite').style.display = 'inline';\n // document.getElementById('button-preview').style.display = 'inline';\n document.getElementById('grab-username').style.display = 'inline';\n document.getElementById('username').style.display = 'inline';\n document.getElementById('invite-to').style.display = 'inline';\n\n // document.getElementById('end-call').style.display = 'none';\n\n // ensure that local media removes on firefox\n $('#local-media > video').remove();\n }", "function hideOriginalBtns() {\n form.classList.remove(\"photo__form-nojs\");\n submit.classList.add(\"hidden\");\n browse.classList.add(\"off-screen\", \"photo__browse\");\n }", "function updateButtons() {\n\n var uploadMoreBtnClasses = document.getElementById('btn_more_photos').classList;\n\n if (uploadMoreBtnClasses.contains('btnHide')) {\n uploadBtnClasses.add('btnHide');\n uploadMoreBtnClasses.remove('btnHide');\n }\n }", "function showIcons() {\n\t$(this).find(\".upload_button\").show();\n\t$(this).find(\".close_button\").show();\n}", "function hideTools() {\n\t\t\thideAllBtn();\n\t\t\t$('#colorelement').css('display','none');\n\t\t\t$('#fntEdit').css('display','none');\n\t\t}", "hideAddButton() {\n this.buttons.addButton.classList.add(\"hidden\");\n }", "function sfShowButtons(evt) {\n var elem = evt.element();\n var data_div = elem.up(\"div\");\n\n data_div.descendants().each(function(elem) {\n if (elem.type === 'submit') {\n elem.removeClassName('hidden_option');\n }\n });\n elem.hide();\n evt.stop();\n}", "function showApp() {\n if (!isHidden) {\n return;\n }\n\n Object(external_lodash_[\"forEach\"])(hiddenElements, function (element) {\n element.removeAttribute('aria-hidden');\n });\n hiddenElements = [];\n isHidden = false;\n}", "showButtons(show = true) {\n this.settingsButton.visible = show;\n this.deleteButton.visible = show;\n }", "function hideWorkflowEditButton()\n {\n $.PercDataList.enableButtons(container);\n $(\"#perc-wf-update-editor\").hide();\n $(\"#perc-wf-name-wrapper\").hide();\n dirtyController.setDirty(false);\n }", "function resetInfoPaneDisplay() {\n gees.dom.setClass('poly_button', '');\n gees.dom.setClass('hand_button', 'clicked_button');\n gees.dom.setClass('CutButtonBlue', 'button blue');\n}", "show() {\n this.$mainContainer.classList.remove(\"hidden\");\n }", "show() {\n this.element.classList.remove(\"hidden\");\n }", "function offBtn (nameBtn) {\n\t\t\t$('#' + nameBtn).css('display','none');\n\t\t}", "function unhideControls() {\n\tdocument.querySelector('.hidden').style.visibility = 'visible';\n}", "function hideConnectedButtons(){\n\n $(\"#addPinItem\").hide();\n $(\"#deletePinButton\").hide();\n $(\"#commentPinButton\").hide();\n $(\"#editPinButton\").hide();\n $(\"#myFriendsItem\").hide();\n $(\"#myMapsItem\").hide();\n $(\"#requestItem\").hide();\n $(\"#logoutButtonCont\").hide();\n $(\"#findWayButton\").hide();\n $(\"#photoButton\").hide();\n $(\"#directionTypeCont\").hide();\n\n}", "show(child){\n\t\tvar c = Konekti.vc(child).className || ''\n\t\tc = c.replace('w3-hide', 'w3-show')\n\t\tKonekti.vc(child).className = c\n\t}", "doHidden( root ) {\n root.style.display = 'none';\n }", "function hideButtons() {\n\tdocument.getElementById(\"controller\").style.visibility = \"hidden\"; \n document.getElementById(\"subtract\").style.visibility = \"hidden\"; \n\t document.getElementById(\"add\").style.visibility = \"hidden\"; \n document.getElementById(\"reset\").style.visibility = \"hidden\"; \n}", "function hideDeleteButton() {\n if (!deleteButton.classList.contains('invisible')) {\n deleteButton.classList.add('invisible');\n }\n}", "function hideInicio(name){\n $(name).hide();\n if(name=='inicio') $('btn-inicio').removeClassName('press');\n}", "static get hiddenClass() {\n return 'hidden';\n }", "function showRepayBtn(){\n repayBtn.hidden = false\n}", "setVisible() {\n element.removeClass('hidden');\n }", "setVisible() {\n element.removeClass('hidden');\n }", "function TUI_toggle_class(className)\n{\n var hidden = toggleRule('tui_css', '.'+className, 'display: none !important');\n TUI_store(className, hidden ? '' : '1');\n TUI_toggle_control_link(className);\n}", "showButtons() {\n this.visible = true;\n for (const button of this.buttonsAsArray) {\n button.showButton();\n }\n }", "function showButton(buttonName){\n\t\t $(\".control-panel-button-\"+buttonName).fadeIn('slow').removeClass(\"hide\");\n\t\t}", "function hideSaveDeleteButtons() {\n artworkInfo.style.display = \"none\"\n}", "function showButtons() {\n document.getElementById(\"twoButtons\").removeAttribute(\"hidden\");\n document.getElementById(\"newRound\").removeAttribute(\"hidden\");\n}", "function switchButtons() {\n\t\t $darkThemeButton.toggleClass('hide');\n\t\t $lightThemeButton.toggleClass('hide');\n\t }", "function showButton(buttonDetail, buttonEdit, buttonDelete) {\n $(buttonDetail).removeAttr('hidden');\n $(buttonEdit).removeAttr('hidden');\n $(buttonDelete).removeAttr('hidden');\n}", "function _hideContent() {\n btn_intro_launchButton.style.display = \"none\";\n txt_intro_welcomeTxt1.style.display = \"none\";\n txt_intro_welcomeTxt2.style.display = \"none\";\n txt_intro_welcomeTxt3.style.display = \"none\";\n txt_intro_welcomeTxt4.style.display = \"none\";\n txt_intro_welcomeTxt5.style.display = \"none\";\n txt_intro_welcomeTxt6.style.display = \"none\";\n }", "function show(el) {\n el.className = el.className.replace(/ ?hidden/gi, '');\n}", "get hidden() { return this.window.classed('window-inactive'); }", "function showLinks(){\n\t$body.classList.remove('mcl-hide-links');\n\thidenLinks = false;\n}", "function hideAllMenuAction() {\n $$('.third-toolbar').removeClass('show');\n $$('.floating-product-color ').removeClass('show');\n}", "function showtableGeneratorButton() {\ndocument.getElementById(\"tableGeneratorButton\").hidden = false;\n}", "function removeHide() {\n // Remove the hide button from each planet folder if it exists and add the view button into the gui if it's not in the folder\n planets.forEach(function(planet) {\n if (planet.userData.remove_button!=undefined) {\n planet.userData.folder.remove(planet.userData.remove_button);\n planet.userData.remove_button = undefined;\n }\n if (planet.userData.add_button==undefined)\n planet.userData.add_button = addButton(planet.userData.properties, planet.userData.folder, 'view');\n });\n // Remove the hide button from each moon folder\n // if it exists and add the view button into the gui if it's not in the folder\n // and remove the path of each moon if it's in the scene\n moons.forEach(function(moon) {\n if (path!=undefined)\n moon.userData.centreMass.remove(path);\n if (moon.userData.remove_button!=undefined) {\n moon.userData.folder.remove(moon.userData.remove_button);\n moon.userData.remove_button = undefined;\n }\n if (moon.userData.add_button==undefined)\n moon.userData.add_button = addButton(moon.userData.properties, moon.userData.folder, 'view');\n if (path_on) {\n scene.remove(path);\n moon.userData.centreMass.remove(path);\n path_on = false;\n }\n });\n // Remove the hide button from each star folder if it exists and add the view button into the gui if it's not in the folder\n stars.forEach(function(star) {\n if (star.userData.remove_button!=undefined) {\n star.userData.folder.remove(star.userData.remove_button);\n star.userData.remove_button = undefined;\n }\n if (star.userData.add_button==undefined)\n star.userData.add_button = addButton(star.userData.properties, star.userData.folder, 'view');\n })\n}", "function HideDirectionBtn() {\n $('#btnSfTourNext').hide();\n $('#btnSfTourPrev').hide();\n }", "function displaySaveCoverButton() {\n saveCoverButton.classList.remove('hidden');\n}", "function hideButtons (btn_array)\n{\n\tfor (var i = 0; i < btn_array.length; i++)\n\t{\n\t\tbtn_array[i].style.visibility=\"hidden\";\n\t}\n}", "hide() {\n\t\tthis.isVisible = false;\n this.element.classList.remove('hide')\n\t\tthis.element.classList.remove('showCarousel')\n\t\tthis.element.classList.add('hideCarousel')\n\t\tthis.buttons.style.paddingTop = \"72px\"\n\t\t\n\t}", "function hideIcon(hide) {\n if (typeof Main.panel.statusArea.appMenu._iconBox != 'undefined') {\n let iconBox = Main.panel.statusArea.appMenu._iconBox; \n hideElement(iconBox, hide);\n }\t\n}", "function invisibleOptionBtn() {\n $('.item-options').addClass('invisible');\n $('.item-content').css('transform', 'translate3d(0, 0, 0)');\n }", "function HideEverything() {\n let x = document.getElementsByClassName(\"button-outcome\");\n // console.log(x);\n for(let i = 0; i<x.length; i++) {\n x[i].classList.remove('non-hidden');\n x[i].classList.add('hidden');\n }\n}", "toggleIcon_() {\n this.toggleIconEls_.forEach((el) => {\n if (el.classList.contains(cssClass.HIDE)) {\n el.classList.remove(cssClass.HIDE);\n } else {\n el.classList.add(cssClass.HIDE);\n }\n });\n }", "function toggleVisible() {\n setVisible(false)\n\n }", "function hide_download_icons_node(){\n if(node_enable() === true){\n CSSLoad(\"style_hide_download_section.css?v01\");\n //CSSLoad(\"style_hide_window_control_section.css?v03\");\n }\n}", "function hideState() {\n let checkboxes = document.querySelectorAll(UISelectors.checkbox_ADDRESS)\n checkboxes.forEach((checkbox) => {\n checkbox.classList.remove('show')\n })\n UISelectors.btn_back.classList.remove('show')\n UISelectors.btn_delete.textContent = 'Select Delete'\n }", "function devMode(){\n\tdocument.getElementById('devButtons').style.display = 'block';\n}", "showTools() {\n this.panelTool.classList.remove(\"show\");\n this.panelTool.classList.add(\"hidden\");\n }", "function mobileBits() {\n\t\t\t\t\t\t $(\".mobile-button\").show();\n\t\t\t\t\t\t $(\".menu-primary\").hide(); \n\t\t\t\t\t\t}", "function hideButtons() {\n button.hide();\n button2.hide();\n button4.hide();\n button5.hide();\n}", "function hideChangeInterface() {\n updateDuckStatus(\"\");\n document.getElementById(\"js-buttons-area\").hidden = true;\n}", "function show(element) {\n element.classList.remove('hidden');\n }", "function hideNonContextButtons(type) {\n\tvar currentId = window.localStorage.getItem(\"divIdGlobal\"),\n\t\theaderShare = $('#headerShare' + currentId),\n\t\theaderRefresh = $('#headerRefresh' + currentId),\n\t\theaderWallMenu = $('#headerWallMenu' + currentId);\n\tif (headerShare.length > 0) {\n\t\theaderShare.hide();\n\t}\n\tif (headerRefresh.length > 0) {\n\t\theaderRefresh.hide();\n\t}\n\tif (headerWallMenu.length > 0 && type !== \"wallpaper\") {\n\t\theaderWallMenu.hide();\n\t}\n}", "isSupported() {\n return hidden !== undefined;\n }", "_hideAll() {\n this.views.directorySelection.hide();\n this.views.training.hide();\n this.views.messages.hide();\n this.views.directorySelection.css('visibility', 'hidden');\n this.views.training.css('visibility', 'hidden');\n this.views.messages.css('visibility', 'hidden');\n }", "function hideSaveCoverButton() {\n saveCoverButton.classList.add('hidden');\n}", "function btnShowClass() {\n\tvar btn \t\t= document.querySelectorAll('.button'),\n\t\tbtnHead\t\t= document.createElement('p');\n\tfor (var i = 0; i < btn.length; i++) {\n\t\tbtn[i].onclick = function() {\n\t\t\t\n\t\t\t//Show ClassList\n\t\t\tbtnHead.classList.add('item__heading');\n\t\t\tbtnHead.innerHTML = (this.classList.value);\n\t\t\tthis.parentNode.insertBefore(btnHead, this);\n\t\t\t\n\t\t\t//Select button classes \n\t\t\twindow.getSelection().removeAllRanges(); \n\t\t\tvar range = document.createRange(); \n\t\t\trange.selectNode(btnHead); \n\t\t\twindow.getSelection().addRange(range); \t\t\t \n\t\t\t\n\t\t\t//link cancelattion\n\t\t\treturn false;\n\t\t\t\n\t\t}\n\t};\n\n}", "function hideShowButtons(x, y) {\n $(\".control\").hide();\n $(x).show();\n $(y).show();\n }", "function showOrHideDialogButtons(aShow)\n{\n let buttonContainer = document.getAnonymousElementByAttribute(\n document.documentElement, \"anonid\", \"buttons\");\n if (!buttonContainer)\n {\n // The wizard uses \"Buttons\" (capital 'B').\n buttonContainer = document.getAnonymousElementByAttribute(\n document.documentElement, \"anonid\", \"Buttons\");\n }\n\n if (buttonContainer)\n {\n if (aShow)\n buttonContainer.removeAttribute(\"hidden\");\n else\n buttonContainer.hidden = true;\n }\n}", "function hideConnectedIndicator() {\n $(\".music-banner-icon\").removeAttr(\"title\").removeClass(\"ppconnected\").off(\"click\");\n }", "function displayCoverButton() {\n coverButton.classList.remove('hidden');\n}", "toggleBtnEmpezar(){\n\n if (btnEmpezar.classList.contains('hide')){\n btnEmpezar.classList.remove('hide')\n } else {\n btnEmpezar.classList.add('hide')\n }\n\n }", "resetDeleteButtons() {\n const buttonsDelete = this.elements.content.getElementsByClassName('button-delete');\n\n buttonsDelete.forEach((e) => {\n e.style.display = 'block';\n });\n\n const buttonsReallyDelete = this.elements.content.getElementsByClassName('button-really-delete');\n\n buttonsReallyDelete.forEach((e) => {\n e.style.display = 'none';\n });\n }", "function whatHide(){\r\n\t\r\n\t\r\n\tdocument.querySelector(\".what-bookmarking-hide\").style.display=\"none\";\r\n\tdocument.querySelector(\".how-request-hide\").style.display=\"block\";\r\n\tdocument.querySelector(\".is-app-hide\").style.display=\"block\";\r\n\tdocument.querySelector(\".what-about-hide\").style.display=\"block\";\r\n\t// xs\r\n\tdocument.querySelector(\".what-bookmarking-hide-xs\").style.display=\"none\";\r\n\tdocument.querySelector(\".how-request-hide-xs\").style.display=\"block\";\r\n\tdocument.querySelector(\".is-app-hide-xs\").style.display=\"block\";\r\n\tdocument.querySelector(\".what-about-hide-xs\").style.display=\"block\";\r\n\t\r\n\tdocument.querySelector(\".what-bookmarking-show\").style.display=\"block\";\r\n\tdocument.querySelector(\".how-request-show\").style.display=\"none\";\r\n\tdocument.querySelector(\".is-app-show\").style.display=\"none\";\r\n\tdocument.querySelector(\".what-about-show\").style.display=\"none\";\r\n\t//xs\r\n\tdocument.querySelector(\".what-bookmarking-show-xs\").style.display=\"block\";\r\n\tdocument.querySelector(\".how-request-show-xs\").style.display=\"none\";\r\n\tdocument.querySelector(\".is-app-show-xs\").style.display=\"none\";\r\n\tdocument.querySelector(\".what-about-show-xs\").style.display=\"none\";\r\n\t\r\n\t}", "function showBtnP1() {\n\t$(\".three\").removeClass(\"hide\");\n\t$(\".four\").addClass(\"hide\");\n}", "function hideButton() {\n _panelWindow.document.getElementById('treeContainer').removeChild(timeTravelButton);\n }", "function hidePanic(){\n\n document.getElementById(\"panicButton\").style.display = \"none\";\n\n }", "static hide(v) {\n // Set style to none\n UI.find(v).setAttribute(\"hidden\", \"true\");\n }", "function hideButtons() {\n $(\"#back-button\").hide();\n $(\"#next-button\").hide();\n }", "function hideGUIForever () {\r\n $('#buttonsPanel')\r\n .add('#player-logo')\r\n .add('#presentation-info')\r\n .add('.leftButton')\r\n .add('.rightButton')\r\n .add('#menu-container')\r\n .add('#timelinebutton').removeClass('show').addClass('hidden');\r\n\r\n // Disable all GUI handlers\r\n $('html').off(\"mouseenter\", showGUI);\r\n $('html').off(\"mouseleave\", hideGUI);\r\n $('#scene').off('mousemove');\r\n }", "hideDragButtons() {\n if (this.dragButtons) this.dragButtons.setVisible(false);\n }" ]
[ "0.71597713", "0.7149847", "0.69949055", "0.69526863", "0.68610835", "0.6848672", "0.68109757", "0.67959195", "0.67907095", "0.6773016", "0.67519385", "0.6699986", "0.66837823", "0.66500396", "0.66240895", "0.66235036", "0.6618629", "0.6614034", "0.65944606", "0.6588004", "0.6558275", "0.65457916", "0.65403813", "0.65268344", "0.65218496", "0.6521257", "0.65110123", "0.6500211", "0.64809126", "0.64700466", "0.64618593", "0.6451874", "0.6438336", "0.64275205", "0.6427363", "0.6425512", "0.641693", "0.640283", "0.64024633", "0.6371313", "0.6367609", "0.6358932", "0.6356294", "0.6345387", "0.63418156", "0.633976", "0.63309085", "0.6317922", "0.6302392", "0.6295048", "0.6295048", "0.6291271", "0.62882906", "0.6267265", "0.62607867", "0.62572116", "0.6253032", "0.62429947", "0.6237301", "0.62359357", "0.6235049", "0.6219095", "0.6215266", "0.62087405", "0.6206281", "0.6206266", "0.6202671", "0.61985356", "0.6198204", "0.6191879", "0.6191671", "0.6189961", "0.618427", "0.6182971", "0.6182527", "0.61733", "0.6173273", "0.61720335", "0.6171521", "0.61647755", "0.6158938", "0.61549556", "0.61541283", "0.61532974", "0.6152803", "0.61489606", "0.61464185", "0.61452705", "0.6144115", "0.6141222", "0.6139925", "0.6138331", "0.6132877", "0.612974", "0.6129024", "0.6126344", "0.61228526", "0.61200476", "0.6118429", "0.6116067", "0.6114526" ]
0.0
-1
do what it says
function read() { fs.readFile("random.txt", "utf8", function(err, data) { if (err) { return console.log(err); } var output = data.split(","); value = output[1]; commands(output[0], value); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "execute(message,args){\n // bot replys good bye\n message.reply('Good bye Friend !!! :(')\n }", "function BOT_onTell() {\r\n\tvar thebotobject = eval(BOT_theBotId);\r\n\tvar thebottopicid = thebotobject.topicId;\r\n\tif(BOT_theReqTopic == thebottopicid) { BOT_reqSay(false,\"ANGRY\",\"NOFACTSABOUTBOT\"); return }\r\n\tif( !BOT_theReqEqual || !BOT_theReqAttribute || !BOT_theReqValue) { BOT_reqSay(false,\"WARNING\",\"BADFACTFORMAT\"); return }\r\n\t// topic.attribute <- value\r\n\tif (!BOT_reqExistAttribute(BOT_theReqAttribute)) return;\r\n\tBOT_set(BOT_theReqTopic,BOT_theReqAttribute,\"VAL\",BOT_theReqValue);\r\n\tBOT_reqSay(true,\"HAPPY\",\"FACTSTORED\",BOT_theReqAttribute,BOT_theReqTopic,BOT_theReqValue);\r\n}", "function BOT_onWhy() {\r\n\tvar why;\r\n\tif(BOT_theReqAttribute) {\r\n\t\twhy = BOT_get(BOT_theReqTopic,BOT_theReqAttribute,\"WHY\");\r\n\t\tif (why) BOT_reqSay(true,\"HAPPY\",\"TELLWHY\",BOT_theReqAttribute,BOT_theReqTopic,why);\r\n\t\telse BOT_reqSay(false,\"SORRY\",\"DONTKNOWWHY\",BOT_theReqTopic,BOT_theReqAttribute); \r\n\t}\r\n\telse if(BOT_theLastAttribute) { // often when ask is followed by why without args\r\n\t\tBOT_traceString += \"LAST TOPIC \" + BOT_theReqTopic + \"\\n\";\r\n\t\tBOT_traceString += \"LAST ATTRIB \" + BOT_theLastAttribute + \"\\n\";\r\n\t\twhy = BOT_get(BOT_theReqTopic,BOT_theLastAttribute,\"WHY\");\r\n\t\tif (why) BOT_reqSay(true,\"HAPPY\",\"TELLWHY\",BOT_theReqTopic,BOT_theLastAttribute,why);\r\n\t\telse BOT_reqSay(false,\"SORRY\",\"DONTKNOWWHY\",BOT_theReqTopic,BOT_theLastAttribute); \r\n\t}\r\n\telse BOT_reqSay(false,\"SORRY\",\"CANTSAYWHY\"); \r\n}", "function doWhatItSaysInfo() {\n // console.log(\"do what it says\")\n fs.readFile('random.txt', 'utf8', function (err, data) {\n if (err) {\n return console.log(err + \"has occurred\");\n }\n var dataArray = data.split(',');\n console.log(dataArray);\n if (dataArray[0] !== \"do-what-it-says\") {\n run(dataArray[0], dataArray[1]);\n } else {\n console.log(\"do-what-it-says not valid for random.txt\")\n }\n });\n}", "function doThis(){\n\tcommand.readFile(\"random.txt\", \"utf8\", function(error, data) {\n\t\tif(error){\n\t\t\tconsole.log(error);\n\t\t}\n\t\telse {\n\t\t\targList = data.split(',');\n\t\t\tfunctionCalled = argList[0];\n\t\t\tparameter = argList[1];\n\t\t\t\n\t\t\tif (functionCalled == \"my-tweets\"){\n \t\tretrieveTweets();\n\t\t\t}\n\t\t\t\n\t\t\tif (functionCalled == \"spotify-this-song\"){\n\t\t\t\tsongName = parameter;\n\t\t\t\tspotifyThis(songName);\n\t\t\t}\n\n\t\t\tif (functionCalled == \"movie-this\"){ \n\t\t\t\tmovie = parameter;\n\t\t\t\tmovieThis(movie);\n \t\t}\n\t\t}\n\t});\n}", "inform() { }", "function doAThing(thing) {\n console.log('did my thing:', thing);\n }", "function talk() {\n\tconsole.log(\"It's like well you know I wasn't really it's not this isn't so much as well anyway umm so like...\");\n}", "function whatDoYouKnow (parameter)\n{\n\tif( parameter == \"incoming\")\n\t{\n\t\tconsole.log(\"incoming\")\n\t}\n\n}", "function BOT_onAsk() {\r\n\tif(!BOT_theReqAttribute && BOT_theReqFeeling) { \r\n\t\tBOT_traceString += \"GOTO command feel\" + \"\\n\"; // change performative\r\n\t\tBOT_onFeel(); \r\n\t\treturn;\r\n\t\t} \r\n\tif(!BOT_theReqAttribute && BOT_theReqAction) {\r\n\t\tBOT_traceString += \"GOTO command effect\" + \"\\n\"; // change performative\r\n\t\tBOT_onEffect();\r\n\t\treturn\r\n\t\t}\r\n\tif(BOT_theReqAttribute) {\r\n\t\t// general ask handling\r\n\t\tvar ta,res,restype,onaskfunc;\r\n\t\tta = BOT_getTopicAttribute(BOT_theReqTopic, BOT_theReqAttribute);\r\n\t\tBOT_traceString += \"ASK LINE \" + ta + \"\\n\";\r\n\t\tif(!ta) return (BOT_reqSay(false,\"SORRY\",\"ATTRIBUTENOTFOUND\",BOT_theReqTopic, BOT_theReqAttribute)) \r\n\t\telse {\r\n\t\t\tres = BOT_getTopicAttributeTagValue(ta,\"VAL\");\r\n\t\t\tif(typeof(res) == \"function\") res = res(BOT_theReqTopic,BOT_theReqAttribute,\"VAL\"); // it is an internal function\r\n\t\t\t\t\r\n\t\t\t// check for ONASK postprocessing operation\r\n\t\t\t// it can be a string or a javascript function : function(){} or functionName\r\n\t\t\t// 3 args are passed to function: VAL value, topic, attribute\r\n\t\t\tonaskfunc = BOT_getTopicAttributeTagValue(ta,\"ONASK\");\r\n\t\t\tif(onaskfunc) {\r\n\t\t\t\tif(typeof(onaskfunc) == \"function\") res = onaskfunc(res,BOT_theReqTopic,BOT_theReqAttribute); \t// func in ONASK\r\n\t\t\t\telse if(typeof(onaskfunc) == \"string\") res = onaskfunc; \t\t// string in ONASK\r\n\t\t\t\telse res = \"It is: \"+ res;\r\n\t\t\t}\r\n\t\t\trestype = BOT_getTopicAttributeTagValue(ta,\"TYPE\");\r\n\t\t\tBOT_traceString += \"VALUE \" + res + \"\\n\";\r\n\t\t\tif(res != undefined) return (BOT_reqSay(true,\"HAPPY\",\"TELLRESULT\",BOT_theReqAttribute,BOT_theReqTopic,res,restype)) \r\n\t\t\telse return (BOT_reqSay(false,\"SORRY\",\"TAGNOTFOUND\",BOT_theReqAttribute,BOT_theReqTopic))\r\n\t\t}\r\n\t}\r\n\tif(BOT_theReqText) { BOT_reqSay(false,\"PUZZLED\",\"BADATTTRIBUTE\",BOT_theReqText); return }\r\n\tBOT_reqSay(false,\"PUZZLED\",\"NEEDSATTTRIBUTE\");\r\n}", "function redactInfo (obj) {\n \n}// CODE HERE", "function sayThis(data) {\n\tdata = data.substr(data.indexOf(' ') + 1);\n\tOutput('<span class=\"green\">[say]:</span><span>' + data + '</span></br>');\n}", "talk() {}", "function checkRunMe() {\n if (runMe == 'Lupus') {\n Lupus();\n }\n if (runMe == 'EmbarrassingSymptom')\t{\n\tEmbarrassingSymptom();\n }\n\n if (runMe == 'Respiratory') {\n respiratory();\n }\n\n if (runMe == 'Feet') {\n feet();\n }\n\n if (runMe == 'Rash') {\n rash();\n }\n\n if (runMe == 'Balding') {\n bald();\n\t};\n\n}", "function badCommand() {\n printLine('Bad command. See <a class=\"yellow\" onclick=\"helpWalkthrough()\">help</a> or use the links to browse.');\n}", "function bye() {\n \n}", "say(text) {\n \t\tlet queue = []\n \t\ttext.split(/[.,&\"\\n]/).forEach((shortText) => {\n \t\tqueue.push(shortText)\n \t\t//queue.push(this.__sayThis(shortText))\n \t\t})\n \t\treturn this.__sayNext(queue).then(() => {\n \t\t\tconsole.log('all my speaking should be done now')\n \t\t})\n\t}", "run(msg) {\n\t\tmsg.say(doc_msg.msg);\n\t}", "function doWhatISay(){\n fs.readFile('random.txt', 'utf8', function(error, data) {\n if (error) {\n return console.log(error);\n }\n //assigned command value to the data \n command = data.slice(0,12);\n song = data.slice(14, data.length);\n //command to run if data matches spotify command\n if(command === \"spotify-this\"){\n spotifyThis()\n }\n \n \n });\n }", "function says(str){\n console.log(str);\n}", "function bang()\n{\n\tpost(\"bang \\n\");\n\tfindTrans();\n\tfindBounds(); \n\toverdrive(); \n\tfindFilter();\n\tlineTime(); \n\tdelay(); \n\t// repeat(); \n}", "function somethingCrazy(agent) {\n agent.add(\n `If you are driving down the road and pass a field with hay bales laying in it, point at the field and yell 'Hey'.`\n );\n agent.end(\"\");\n }", "entered(welcome) {}", "function BOT_reqSay (success,emote,reason,arg1,arg2,arg3) { \r\n\tBOT_reqSuccess = success;\r\n\tBOT_reqEmote = emote;\r\n\tvar short = \"\";\r\n\tvar long = \"\";\r\n\tswitch (reason) { \r\n \tcase \"ATTRIBUTENOTFOUND\": \r\n\t\tshort += \"Not found\";\r\n\t\tlong += \"I found no attribute \"+arg2+\" for \"+BOT_expressTopic(arg1); \r\n\t\tbreak;\r\n\tcase \"ACTIONNOTFOUND\": \r\n\t\tshort += \"Not found\";\r\n\t\tlong += \"I found no action \"+arg2+\" for \"+BOT_expressTopic(arg1); \r\n\t\tbreak;\r\n \tcase \"TAGNOTFOUND\":\r\n\t\tshort += \"Not found\";\r\n\t\tlong += \"I found nothing for \"+arg2+\" for \"+BOT_expressTopic(arg1);\r\n\t\tbreak;\r\n\t case \"FEELINGNOTFOUND\": \r\n\t\tshort += \"Not found\";\r\n\t\tlong += \"I found no feeling \"+arg2+\" for \"+BOT_expressTopic(arg1); \r\n\t\tbreak;\r\n\tcase \"RELATIONFOUND\": \r\n\t\tshort += \"Not found\";\r\n\t\tlong += \"I found no relation \"+arg2+\" for \"+BOT_expressTopic(arg1); \r\n\t\tbreak;\r\n\tcase \"NEEDSATTTRIBUTE\":\r\n\t\tshort += \"No attribute\";\r\n\t\tlong += \"Command '\"+BOT_theReqPerformative + \"' needs an attribute name\";\r\n\t\tif(BOT_reqHintMode) BOT_buildHintText(\"ATTRIBUTELIST\");\r\n\t\tbreak;\r\n\tcase \"NEEDSACTION\":\r\n\t\tshort += \"No action\";\r\n\t\tlong += \"Command '\"+BOT_theReqPerformative + \"' needs an action name\";\r\n\t\tif(BOT_reqHintMode) BOT_buildHintText(\"ACTIONLIST\");\r\n\t\tbreak;\r\n\tcase \"BADATTTRIBUTE\":\r\n\t\tshort += \"Bad attribute\";\r\n\t\tlong += \"May be \" + arg1 + \" is not an attribute name\"; \r\n\t\tif(BOT_reqHintMode) BOT_buildHintText(\"ATTRIBUTELIST\");\r\n\t\tbreak;\r\n\tcase \"BADACTION\":\r\n\t\tshort += \"Bad action\";\r\n\t\tlong += \"May be \" + arg1 + \" is not an action name\"; \r\n\t\tif(BOT_reqHintMode) BOT_buildHintText(\"ACTIONLIST\");\r\n\t\tbreak;\r\n\tcase \"BADAGENT\":\r\n\t\tshort += \"Bad agent\";\r\n\t\tlong += \"May be \" + arg1 + \" is not an agent name\"; \r\n\t\tif(BOT_reqHintMode) BOT_buildHintText(\"AGENTTLIST\");\r\n\t\tbreak;\r\n\t case \"TELLRESULT\": // managed by ask, how\r\n\t\tshort += arg3;\r\n\t\tlong += arg3; \r\n\t\tbreak;\r\n\tcase \"THANKYOU\":\r\n\t\tshort += \"Thanks\";\r\n\t\tlong += \"Thank you very much\";\r\n\t\tbreak;\r\n\tcase \"USERLIKEREMEMBER\":\r\n\t\tshort += \"I learn your liking\";\r\n\t\tlong += \"Thank you very much! I will remember that you like \"+BOT_expressTopicAttribute(arg1,arg2);\r\n\t\tbreak;\r\n\tcase \"USERDISLIKEREMEMBER\":\r\n\t\tshort += \"I learn your disliking\";\r\n\t\tlong += \"I will remember that you don't like \"+BOT_expressTopicAttribute(arg1,arg2);\r\n\t\tbreak;\r\n\tcase \"HEU\":\r\n\t\tshort += \"Heu..\";\r\n\t\tlong += \"Heu, I am not sure about \"+ arg1;\r\n break;\r\n\tcase \"GOODNEWS\":\r\n\t\tshort += \"Fine\";\r\n\t\tlong += \"I am happy to hear that\";\r\n break;\r\n\tcase \"BADNEWS\":\r\n\t\tshort += \"Too bad\";\r\n\t\tlong += \"I am sad to hear that\";\r\n\t\tbreak;\r\n\tcase \"MAKESMEHAPPY\":\r\n\t\tshort += \"Makes me happy\";\r\n\t\tlong += \"Now, that makes me feel happy\";\r\n\t\tbreak;\r\n\tcase \"MAKESMESAD\":\r\n\t\tshort += \"Makes me sad\";\r\n\t\tlong += \"That makes me sad suddenly\";\r\n\t\tbreak;\r\n\tcase \"YOUAREIRONIC\":\r\n\t\tshort += \"Its ironic\";\r\n\t\tlong += \"I am a bit puzzled because I think that you are being ironic\";\r\n\t\tbreak;\r\n\tcase \"PING\":\r\n\t\tshort += \"Hi\";\r\n\t\tlong += \"Yes, I am here\";\r\n\t\tbreak;\r\n\tcase \"HELLO\":\r\n\t\tshort += \"Hi\";\r\n\t\tlong += \"Hello, I am here\";\r\n\t\tbreak;\r\n\tcase \"HELLONAME\":\r\n\t\tshort += \"Hi\";\r\n\t\tlong += \"Hello, I am \"+arg1;\r\n\t\tbreak;\r\n\tcase \"TOPICCANTDOACTION\":\r\n\t\tshort += \"Can't do it\";\r\n\t\tlong += \"It is not possible to perform action \"+arg1+ \" with \"+BOT_expressTopic(arg2) ;\r\n break;\r\n case \"DONE\":\r\n\t\tshort += \"Done\";\r\n\t\tlong += \"Action \"+arg1+ \" has been successfully executed\";\r\n\t\tbreak;\r\n\tcase \"DONEWITHREPLY\": // when an action returns a string its is replied\r\n\t\tshort += arg1;\r\n\t\tlong += \"the answer is: \"+arg1;\r\n\t\tbreak;\r\n\tcase \"DONTREMEMBERLASTACTION\":\r\n\t\tshort += \"Don't know how\";\r\n\t\tlong += \"I don't remember last performed action\";\r\n\t\tbreak;\r\n\tcase \"CANTUNDO\":\r\n\t\tshort += \"Can't undo\";\r\n\t\tlong += \"I am confused with topic \"+ BOT_topicToName(arg2) + \", so I can't undo action \"+arg1;\r\n\t\tbreak;\r\n\tcase \"NEEDSEXECUTEBEFORE\":\r\n\t\tshort += \"Previous command is not 'x'\";\r\n\t\tlong += \"Sorry, to do that previous command must be 'execute'\";\r\n\t\tbreak;\r\n\tcase \"USERQUITS\":\r\n\t\tshort += \"Bye\";\r\n\t\tlong += \"Now this session is terminated. Bye Bye ...\";\r\n\t\tbreak;\r\n\tcase \"USERSAIDNO\":\r\n\t\tshort += \"Ok no\";\r\n\t\tlong += \"Hem, you said no...\";\r\n\t\tbreak;\r\n\tcase \"USERSAIDYES\":\r\n\t\tshort += \"Ok yes\";\r\n\t\tlong += \"Hem, you said no...\";\r\n\t\tbreak;\r\n\tcase \"CONFIRMYESNO\":\r\n\t\tshort += \"Confirm by yes or no\";\r\n\t\tlong += \"Hem, are you sure about that? just say Yes or No\";\r\n\t\tbreak;\r\n\tcase \"CONFUSEDINDIALOG\":\r\n\t\tshort += \"I am lost\";\r\n\t\tlong += \"Hem, Somehow, I got confused in the dialog. Can we start again?\";\r\n\t\tbreak;\r\n\tcase \"VALUENEEDED\":\r\n\t\tshort += \"Value needed\";\r\n\t\tlong += \"Yous should have provide an information\";\r\n\t\tbreak;\r\n\tcase \"NONREQUIREDVALUE\":\r\n\t\tshort += \"Not required\";\r\n\t\tlong += \"You said \"+arg1+\" but I don't know what to do about it\";\r\n\t\tbreak;\r\n\tcase \"TELLWHY\":\r\n\t\tshort += arg3;\r\n\t\tlong += \"Here is my best educated guess: \"+ arg3;\r\n\t\tbreak;\r\n\tcase \"DONTKNOWWHY\":\r\n\t\tshort += \"Don't know why\";\r\n\t\tlong += \"I don't know the reason why \"+BOT_expressTopicAttribute(arg1,arg2)+\" is like that\";\r\n\t\tbreak;\r\n\tcase \"CANTSAYWHY\":\r\n\t\tshort += \"Can't say why\";\r\n\t\tlong += \"I m sorry, I really can't say why things are like that\";\r\n\t\tbreak;\r\n\tcase \"DONTKNOWHOW\":\r\n\t\tshort += \"Don't know how to do\";\r\n\t\tlong += \"I don't know how one can perform action \"+arg1;\r\n\t\tbreak;\r\n\tcase \"CANTSAYHOW\":\r\n\t\tshort += \"Can't say how\";\r\n\t\tlong += \"I m sorry, I really can't answer upon how things should be carried out\";\r\n\t\tbreak;\r\n\tcase \"FACTSTORED\":\r\n\t\tshort += \"Fact learned\";\r\n\t\tlong += \"Thank you, I will remember that the \"+arg1+\" is \"+arg3;\r\n\t\tbreak;\r\n\tcase \"BADFACTFORMAT\":\r\n\t\tshort += \"Bad fact format\";\r\n\t\tlong += \"This command needs a fact of the form: [topic] attribute is value\";\r\n\t\tbreak;\r\n\tcase \"NOFACTSABOUTBOT\":\r\n\t\tshort += \"I Don't care\";\r\n\t\tlong += \"That's no use telling facts about ME!\";\r\n\t\tbreak;\r\n\tcase \"FACTVERIFIED\":\r\n\t\tshort += \"True\";\r\n\t\tlong += \"This fact is true\";\r\n\t\tbreak;\r\n\tcase \"FACTNOTVERIFIED\":\r\n\t\tshort += \"False\";\r\n\t\tlong += \"This fact is false\";\r\n\t\tbreak;\r\n\tcase \"NOEXTENSIONSYET\":\r\n\t\tshort += \"No extensions\";\r\n\t\tlong += \"Sorry, language extensions are not yet available\";\r\n\t\tbreak;\r\n\tcase \"KNOWTOPIC\":\r\n\t\tshort += \"I know about it\";\r\n\t\tlong += \"I am happy to say that I know \"+BOT_expressTopic(arg1);\r\n\t\tbreak;\r\n\tcase \"DONTKNOWTOPIC\":\r\n\t\tshort += \"I dont know about it\";\r\n\t\tlong += \"I am happy to say that I know nothing about \"+BOT_expressTopic(arg1);\r\n\t\tbreak;\r\n\tcase \"KNOWATTRIBUTE\":\r\n\t\tshort += \"I know about it\";\r\n\t\tlong += \"I am happy to say that I know about \"+ BOT_expressTopicAttribute(arg1,arg2);\r\n\t\tbreak;\r\n\tcase \"DONTKNOWATTRIBUTE\":\r\n\t\tshort += \"I don't know about it\";\r\n\t\tlong += \"I am sorry to say that I don't know about \"+ BOT_expressTopicAttribute(arg1,arg2);\r\n\t\tbreak;\r\n\tcase \"KNOWACTION\":\r\n\t\tshort += \"I know it\";\r\n\t\tlong += \"I am happy to say that I know about action \"+arg1+\" for \"+ BOT_expressTopic(arg2);\r\n\t\tbreak;\r\n\tcase \"DONTKNOWACTION\":\r\n\t\tshort += \"I don't know about it\";\r\n\t\tlong += \"I am sorry to say that I don't know any action \"+arg1+\" for \" +BOT_expressTopic(arg2);\r\n\t\tbreak;\r\n\tcase \"COMMANDNEEDSARGUMENT\":\r\n\t\tshort += \"Needs more\";\r\n\t\tlong += \"I am sorry to say that command '\"+arg1+\"' needs more information. For example: \"+arg2;\r\n\t\tbreak;\r\n\tcase \"BADFEELING\":\r\n\t\tshort += \"Bad feeling\";\r\n\t\tlong += \"May be \"+arg1+\" is not a known feeling\";\r\n\t\tif(BOT_reqHintMode) BOT_buildHintText(\"FEELINGLIST\");\r\n\t\tbreak;\r\n\tcase \"NOFEELING\":\r\n\t\tshort += \"No feeling\";\r\n\t\tlong += \"Sorry to say that command 'f' needs a feeling name\";\r\n\t\tif(BOT_reqHintMode) BOT_buildHintText(\"FEELINGLIST\");\r\n\t\tbreak;\r\n\tcase \"USERPOSITIVENEWS\":\r\n\t\tshort += \"Good for you\";\r\n\t\tlong += \"I am such happy to hear that about you\";\r\n\t\tbreak;\r\n\tcase \"USERNEGATIVENEWS\":\r\n\t\tshort += \"Bad for you\";\r\n\t\tlong += \"I am very sorry to hear that about you\";\r\n\t\tbreak;\r\n\tcase \"CONFIRM\":\r\n\t\tshort += \"Yes\";\r\n\t\tlong += \"Yes! Certainly\";\r\n\t\tbreak;\r\n\tcase \"CONTRADICT\":\r\n\t\tshort += \"No\";\r\n\t\tlong += \"No! On the contrary\";\r\n\t\tbreak;\r\n\tcase \"NOTPARTICULARLY\":\r\n\t\tshort += \"Not really\";\r\n\t\tlong += \"Well yes but not particularly ...\";\r\n\t\tbreak;\r\n\tcase \"BADJUDGEMENTWORD\":\r\n\t\tshort += \"Bad judgement word\";\r\n\t\tlong += \"May be \"+arg1+\" is not a known judgement word\";\r\n\t\tif(BOT_reqHintMode) BOT_buildHintText(\"JUDGEMENTLIST\");\r\n\t\tbreak;\r\n\tcase \"NOJUDGEMENTWORD\":\r\n\t\tshort += \"No judgement\";\r\n\t\tlong += \"You should provide a judgement word for command 'j'\";\r\n\t\tif(BOT_reqHintMode) BOT_buildHintText(\"JUDGEMENTLIST\");\r\n\t\tbreak;\r\n\tcase \"NOUSERJUDGEMENT\":\r\n\t\tshort += \"Not handled\";\r\n\t\tlong += \"Sorry there is no support for handling user's judjements\";\r\n\t\tbreak;\r\n\tcase \"USERREPEATJUDGEMENT\":\r\n\t\tshort += \"Judgement repeated\";\r\n\t\tlong += \"You have just repeated the same judgement on \"+ BOT_expressTopicAttribute(arg1,arg2);\r\n\t\tbreak;\r\n\tcase \"USERCHANGEJUDGEMENT\":\r\n\t\tshort += \"Judgement reversed\";\r\n\t\tlong += \"I note that you have changed your mind about \" + BOT_expressTopicAttribute(arg1,arg2);\r\n\t\tbreak;\r\n\tcase \"USERNEWPOSITIVEJUDGEMENT\":\r\n\t\tshort += \"I learn your positive judgement\";\r\n\t\tlong += \"I am happy to hear and bear in mind your positive judgement on \" + BOT_expressTopicAttribute(arg1,arg2);\r\n\t\tbreak;\r\n\tcase \"USERNEWNEGATIVEJUDGEMENT\":\r\n\t\tshort += \"I learn your negative judgement\";\r\n\t\tlong += \"I am sorry to hear and bear in mind your negative judgement on \" + BOT_expressTopicAttribute(arg1,arg2);\r\n\t\tbreak;\r\n\tcase \"THANKSFORSUGGESTION\":\r\n\t\tshort += \"Suggestion granted\";\r\n\t\tlong += \"I thank you for your suggestion to do action \" + arg1 +\", I will use this advice\";\r\n\t\tbreak;\r\n\tcase \"TAKEOBJECTION\":\r\n\t\tshort += \"Objection taken\";\r\n\t\tlong += \"I will take your objection not to do action \" + arg1;\r\n\t\tbreak;\r\n\tcase \"TAKEINTENTION\":\r\n\t\tshort += \"Intention taken\";\r\n\t\tlong += \"Ok I take notice of your intention to do action \" + arg1;\r\n\t\tbreak;\r\n\tcase \"ACTIONPOSSIBLE\":\r\n\t\tshort += \"It is possible\";\r\n\t\tlong += \"Yes, action \"+arg2+\" is possible with \"+BOT_expressTopic(arg1);\r\n\t\tbreak;\r\n\tcase \"ACTIONIMPOSSIBLE\":\r\n\t\tshort += \"Not possible\";\r\n\t\tlong += \"Sorry but action \"+arg2+\" is possible with \"+BOT_expressTopic(arg1);\r\n\t\tbreak;\r\n\tcase \"NYI\":\r\n\t\tshort += \"Not yet available\";\r\n\t\tlong += \"I am sorry to say that command '\"+arg1+\"' is not yet available\";\r\n\t\tbreak;\r\n\tcase \"UNKNOWNERROR\":\r\n\t\tshort += \"Error\";\r\n\t\tlong += \"I am confused because of some inside error...\";\r\n\t\tbreak;\r\n \tdefault: alert(\"ERROR: BOT_reqSay\"); break;\r\n\t}\r\n\tBOT_reqFilled = true;\r\n\tBOT_reqAnswerShort = short;\r\n\tBOT_reqAnswerLong = long;\r\n\treturn success\r\n}", "function says(){\n \n fs.readFile(\"random.txt\", \"utf8\", function(error,data){\n if(error){\n return console.log(error);\n }\n var theCommand = data.split(',');\n request = theCommand[0];\n input = theCommand[1];\n \n commandCheck();\n \n });\n }", "onMistake() {\n\n }", "function checknotes(){\r\n\r\n}", "function doWhatItSays() {\n //create intruct object\n var instruction = {\n cmd: \"\",\n search: \"\"\n };\n\n //Load Text and write data temp variable\n fs.readFile(\"random.txt\", \"utf8\", function(error, data) {\n //Check error\n if (error) {\n return console.log(error);\n }\n //No error, read data.\n else {\n instruction.cmd = data.split(\",\")[0];\n instruction.search = data.split(\",\")[1];\n\n switch (instruction.cmd) {\n case \"spotify-this-song\":\n spotifyThis(instruction.search);\n break;\n case \"concert-this\":\n concertThis(instruction.search);\n break;\n case \"movie-this\":\n movieThis(instruction.search);\n break;\n }\n }\n });\n}", "function doThis(){\n fs.appendFile(\"./log.txt\", \"\\n\" + new Date().toISOString().replace('T', ' ').substr(0, 19) + \" ==> Ran the do-what-it-says function\\n--------------------------------------------------------------------\", function(err){\n if(err){\n throw err;\n }\n });\n \n fs.readFile(\"./random.txt\", \"utf8\", function(err, data){\n // Split the contents of random.txt at the ','\n var random = data.split(\",\");\n // Makes command equal to the first half of the text in random.txt\n command = random[0];\n //Conditionals to set songName and movieName to their new values if those functions will be called by random.txt\n if (command === \"spotify-this-song\"){\n songName = random[1];\n logic();\n }\n else if(command === \"movie-this\"){\n movieName = random[1];\n logic();\n }\n else {\n logic();\n }\n });\n}", "function wa(){}", "function successfulChange(response){\n response.tell('Merry Christmas!');\n}", "function greetings() {\n\n \n}", "function process(msg) {\n var p = Math.round(100 * twss.prob(msg));\n var t = \"THAT'S WHAT SHE SAID ! (c'est sur à \" + p + \"% !)\";\n bot.log(msg + ' -> ' + p + '%');\n if (matchIUT(msg)) {\n client.say(channel, \"C'EST NORMAAAAAL A L'IUTTTTTTT\");\n } else if (twss.is(msg)) {\n client.say(channel, t);\n }\n}", "function handleIt(type)\t{\n\t\t\t\t\tif(Number(sfo[index]) === 1)\t{\n\t\t\t\t\t\tr.push(index.replace('+','=')); // input name is navcat+.something, so simply changing + to = makes it macroesque-ready.\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "function check_and_report() {\n \n }", "function int_msg(){\r\n\t//if(inlet == x)\r\n}", "function whatIWantToDo() {\n console.log('Hey waiter!!! Get yer arse here and serve!');\n}", "function says() {\n\tfs.readFile(\"random.txt\", \"utf8\", function(error, data){\n\t\tif(error) {\n\t\t\treturn console.log(error);\n\t\t}\n\t\t\tconsole.log(data);\n\tvar dataArr = data.split(\",\");\n\tconsole.log(dataArr);\n\tcommand2 = dataArr[1];\n\t\t//Switch command data\n\t\tswitch (dataArr[0]) {\n\t\tcase \"my-tweets\":\n\t\t\ttweets();\n\t\t\tbreak;\n\t\tcase \"spotify-this-song\":\n\t\t\tsong();\n\t\t\tbreak;\n\t\tcase \"movie-this\":\n\t\t\tmovie();\n\t\t\tbreak;\n\t\tcase \"do-what-it-says\":\n\t\t\tsays();\n\t\t\tbreak;\n\t\t}\n\t})\n}", "function go(){\n\n\tif (age>16) {\n\t\tconsole.log('добро пожаловать');\n\n\t}\n\telse if (age < 16) {\n\t\tconsole.log('вы еще молоды');\n\t}\n\telse {\n\t\tconsole.log('введите возраст');\n\t}\n}", "function BOT_onKnow() {\r\n\tvar thebotobject = eval(BOT_theBotId);\r\n\tvar thebottopicid = thebotobject.topicId;\r\n\tif(BOT_theReqTopic != thebottopicid) {\r\n\t\tBOT_traceString += \"NEW TOPIC \" + BOT_theReqTopic + \"\\n\";\r\n\t\tif(!BOT_hasRight(thebottopicid,BOT_theReqTopic,\"_read\")) return (BOT_reqSay(true,\"SORRY\",\"DONTKNOWTOPIC\",BOT_theReqTopic));\r\n\t\telse if(!BOT_theReqAttribute && !BOT_theReqAction) return (BOT_reqSay(true,\"HAPPY\",\"KNOWTOPIC\",BOT_theReqTopic));\r\n\t}\r\n\tif(BOT_theReqAttribute) {\r\n\t\tvar ta = BOT_getTopicAttribute(BOT_theReqTopic, BOT_theReqAttribute);\r\n\t\tBOT_traceString += \"TOPIC LINE \" + ta + \"\\n\";\r\n\t\tif(ta) return (BOT_reqSay(false,\"HAPPY\",\"KNOWATTRIBUTE\",BOT_theReqTopic,BOT_theReqAttribute)) \r\n\t\telse return (BOT_reqSay(false,\"SORRY\",\"DONTKNOWATTRIBUTE\",BOT_theReqTopic,BOT_theReqAttribute)) \r\n\t}\r\n\tif(BOT_reqFilled) return;\r\n\tif(BOT_theReqAction) {\r\n\t\tif(BOT_reqExistAction(BOT_theReqTopic,BOT_theReqAction)) return (BOT_reqSay(true,\"HAPPY\",\"KNOWACTION\",BOT_theReqAction,BOT_theReqTopic))\r\n\t\telse return (BOT_reqSay(true,\"HAPPY\",\"DONTKNOWACTION\",BOT_theReqAction,BOT_theReqTopic))\r\n\t}\r\n\tBOT_reqSay(false,\"WARNING\",\"COMMANDNEEDSARGUMENT\",BOT_theReqPerformative,\"a topic, an attribute or an action\")\r\n}", "jump() {\n\t\t// \n\t}", "function kp() {\n $log.debug(\"TODO\");\n }", "function Mechanism() {\n\t }", "function Mechanism() {\n\t }", "function Mechanism() {\n\t }", "function Mechanism() {\n\t }", "analyze(input){ return null }", "onrecord() {}", "private public function m246() {}", "function toDo() {\n console.log(\" \");\n console.log(\"TODO LIST\");\n console.log(\" 1. In file ajax_requests, uncomment 'check_actual_tags' \\\n \");\n console.log(\" \");\n}", "function helpJohn(action) {\r\n\r\n\r\n\tswitch (action) {\r\n\t\tcase 'explore':\r\n\t\t\ttextDialogue(narrator, \"Narocube: Good choice, we can keep stealing stuff, sounds like that will take a while.\", 1000);\r\n\t\t\texploreship(gameobj.explore);\r\n\t\t\tgameobj.explore++;\r\n\t\tbreak;\r\n\r\n\t\tcase 'sit tight':\r\n\t\t\ttextDialogue(narrator, \"Narocube: Good choice, Nothing puts me to sleep like the screems of my friends\", 1000);\r\n\t\t\tgameobj.sittight++;\r\n\t\tbreak;\r\n\t}\r\n}", "function BOT_onLike() {\r\n\tBOT_traceString += \"GOTO command judge\" + \"\\n\"; // change performative\r\n\tBOT_theReqJudgement = \"likeable\";\r\n\tBOT_onJudge(); \t\r\n\tif(BOT_reqSuccess) {\r\n\t\tvar ta = [BOT_theReqTopic,BOT_theReqAttribute]; \r\n\t\tBOT_del(BOT_theUserTopicId,\"distaste\",\"VAL\",ta);\r\n\t\tBOT_add(BOT_theUserTopicId,\"preference\",\"VAL\",ta);\r\n\t}\r\n}", "async 'after sunbath' () {\n console.log( 'see? I appear here because of the first custom above' )\n }", "function run() {}", "static private internal function m121() {}", "action () {\n var text = \"<br>”Redigera bild...” är en planerad framtida länk<br>till något bildredigeringsprogram\"; // i18n\n var yes = \"Ok\" // i18n\n infoDia (null, null, \"\", text, yes, true);\n return;\n }", "function doWhatItSays() {\n\tfs.readFile('random.txt', 'utf8' , function(err, data) {\n\t\tif(err) throw err;\n\t\tconsole.log(data);\n\n\t\tvar dataArr = data.split(',');\n\n\t\tfunctionName = dataArr[0].trim();\n\t\tfunctionParameters = dataArr[1].trim();\n\n\n\n\t// re-use switch for search parameters\n\t \n\tswitch (functionName) {\n\t\tcase 'my-tweets':\n\t \t showTweets();\n \t break;\n\t \tcase 'spotify-this-song': \n\t \t mySpotify(functionParameters);\n\t\t break;\n\t \tcase 'movie-this':\n\t \t movieThis(functionParameters);\n\t \t break;\n\t \tcase 'do-what-it-says':\n\t \t doWhatItSays();\n\t\t break;\n\t \tdefault:\n\t \t console.log(\"Invalid Command. Please try again!\");\n\t\t}\n\t});\n\n\n}", "function feedDog(){\r\n\r\n\r\n\r\n\r\n}", "function doWhatItSays() {\n // Append the command to the log file\n fs.appendFile('./log.txt', '**************************************************************************\\nUser Command: node liri.js do-what-it-says\\n\\n', (err) => {\n if (err) throw err;\n });\n\n // Read in the file containing the command\n fs.readFile('./random.txt', 'utf8', function (error, data) {\n if (error) {\n console.log('ERROR: Reading random.txt -- ' + error);\n return;\n } else {\n // Split out the command name and the parameter name\n var cmdString = data.split(',');\n var command = cmdString[0].trim();\n\n var param = cmdString[1].trim();\n console.log(cmdString);\n console.log(command);\n console.log(param);\n\n\n switch (command) {\n case 'spotify-this-song':\n spotifySong(param);\n break;\n\n case 'movie-this':\n retrieveOMDBInfo(param);\n break;\n\n case 'concert-this':\n retrieveBandsInTown(param);\n break;\n }\n }\n });\n}", "private internal function m248() {}", "correct() {\n\n\n }", "function run() {\n }", "function run() {\n\n }", "function sayThanks() {console.log(\"Thank you for your purchase! We appreciate your business.\"); }", "handle() {}", "function mainSwitch(){\n\nswitch (action) {\n case \"spotify-this-song\":\n giveMeMusic();\n break;\n case \"concert-this\":\n findConcert();\n break;\n case \"movie-this\":\n entertainMe();\n break;\n case \"do-what-it-says\":\n readRandom();\n break;\n default:\n console.log(\"I don't know what you want from me!\");\n}\n}", "function tellStory() {\n var pause = '\\\\pau=0\\\\';\n if (game.p == game.quiz.length - 1) pause = '\\\\pau=2500\\\\';\n if (game.quiz[game.p].story != '') speakOut(game.quiz[game.p].story + pause);\n}", "function main()\r\n\t{\r\n\t\tif ($(\"font[color*='#007700']\").length>0)\r\n\t\t{\r\n\t\t\tvar captchars = $(\"img[src*='cap_']\");\r\n\t\t\tvar capText='';\r\n\t\t\t$(\"img[src*='slow_1']\").each(function(){capText+= GetCapchar(captchars[GetImgNumber(this.src)-1].src);});\r\n\t\t\t$(\"[onpaste*='return false;']\").attr('onpaste','return true;')\r\n\t\t\t$(\"input[name*='kod']\").attr('value','KAV2009-377333');\r\n\t\t\t$(\"input[name*='captcha']\").attr('value',capText);\r\n\t\t\t$(\"input[name*='zatwierdz']\").attr('value','Register');\r\n\t\t\t$(\"textarea[name*='adres']\").attr('value','Wydział do Foresight\\r\\nul. Wspólna 1/2\\r\\n00-519 Warszawa 52');\r\n\t\t\t$($(\"b\")[2]).html('Code');\r\n\t\t\t$($(\"b\")[3]).html('Your Name');\r\n\t\t\t$($(\"b\")[4]).html('<span>Your Email address</span><font color=\"red\">*</font>');\r\n\t\t\t$($(\"small\")[0]).html('This e-mail will be used to send the activation code');\r\n\t\t\t$($(\"b\")[5]).html('Your address');\r\n\t\t\t$($(\"tr\")[23]).hide();\r\n\t\t\t$($(\"tr\")[24]).hide();\r\n\t\t\t$($(\"tr\")[25]).hide();\r\n\t\t\t$($(\"tr\")[26]).hide();\r\n\t\t}\r\n\t}", "function doWhatItSays() {\n\t//using fs it will read the text file \"random.txt\"\n\tfs.readFile(\"random.txt\", \"utf8\", function(err, data) {\n\t\tvar dataArray = data.split(\",\");\n\t\tparameters = dataArray[0];\n\t\tif (dataArray.length > 1) {\n\t\t\tinput = dataArray[1];\n\t\t}\n\t\tspotifyThisSong();\n\t});\n}", "function johnHelpsHimself(action) {\r\n\tswitch (action) {\r\n\t\tcase 'explore':\r\n\t\t\ttextDialogue(narrator, \"Narocube: Who knows sarcasim better than you \" + player.name + \" Lets take a peak\", 1000);\r\n\t\t\texploreship(gameobj.explore);\r\n\t\t\tgameobj.explore++;\r\n\t\tbreak;\r\n\r\n\t\tcase 'sit tight':\r\n\t\t\ttextDialogue(narrator, \"Narocube: Good choice, Nothing passive aggression like more passive aggression!\", 1000);\r\n\t\t\tgameobj.sittight++;\r\n\t\tbreak;\r\n\t}\r\n}", "say() { //method\n\t\t\tconsole.log('Saying');\n\t\t}", "function next(e1, file) {//in a new event, the platform gives us e1 here\n\t\tif (e1) a(e1);\n\t}", "function doWhatItSays() {\n\n fs.readFile(\"random.txt\", \"utf8\", function (err, data) {\n if (err) {\n return outputAndLog(err);\n }\n data = data.split(',');\n if (data[0] === \"concert-this\") {\n concertThis(data[1]);\n } else if (data[0] === \"spotify-this-song\") {\n spotifyThisSong(data[1]);\n } else if (data[0] === \"movie-this\") {\n movieThis(data[1]);\n }\n })\n}", "function esBasics(){ askAboutInsert(insertableText.esBasics.text); }", "say(thing){\n alert(thing);\n }", "function standardsMaker(myString){ \n console.log (\"I will write questions if I'm stuck\");\n}", "protected internal function m252() {}", "function choice_made(string) {\n add_count();\n add_points();\n change_link_status(string);\n}", "function doWhatItSays() {\n fs.readFile(\"random.txt\", \"utf8\", function(error, data) {\n if (error) {\n return console.log(error);\n }\n //variable to take text from random.txt and split it\n var output = data.split(\",\");\n // new action variable\n action = output[0];\n // new input varible \n var textInput = output[1];\n console.log(action,textInput);\n //call the spotify-this function to run new input\n spotifyThis(textInput);\n \n });\n\n }", "function handleCommand(sentence) {\n if (sentence == 'show kb') {\n alert(storage.getKnowledgeBaseAsText());\n } else if (sentence == 'show transcript') {\n alert(storage.getTranscript());\n } else {\n return false; // was not a command\n }\n}", "function itSays(){\n\n\tfs.readFile('random.txt', 'utf8', function (err, data){\n\n \t\tvar content = data.split(\",\");\n \t\tvar action = content[0];\n\n\n\t\t\t// Print each element (item) of the array/ \n\t\t\t\n\n\t\t\t\n\t\t\tswitch(content){\n\t\t\t\tcase 'my-tweets':\n\t\t\t\t\ttweets();\n\t\t\t\tbreak;\n\t\t\t\tcase 'spotify-this-song':\n\t\t\t\t\tspotify();\n\t\t\t\tbreak;\n\t\t\t\tcase 'movie-this':\n\t\t\t\t\tmovie();\n\t\t\t\tbreak;\n\t\t\t\tcase 'do-what-it-says':\n\t\t\t\t\titSays();\n\t\t\t\tbreak;\n\t\t\t}\t\n\t})\n}", "function questionOneQ () {\n\t\t\t$(\"#main\").html(\"1) Best recent Bond Film?\");\n\t\t\t}", "function spell(){ \n if(count == 1 ) return ' вопрос';\n if(count == 2 || count == 3 || count == 4 ) { \n return ' вопроса';\n } else {\n return ' вопросов'\n }\n }", "function doneTyping () {\n //do something\n }", "function whatToDo(index){\n switch (index.weapon){\n case \"bomb\":\n if(index.bombs>0){\n throwBomb(bomb,index);\n index.bombs--;\n console.log(\"bombs left: \"+index.bombs)\n break;\n }else{\n console.log(\"no more bombs\")\n break;\n } \n case \"teleport\":\n if(index.teleports>0){\n teleport(index);\n index.teleports--;\n console.log(\"teleports left: \"+index.teleports)\n break;\n }else{\n console.log(\"no more teleports\");\n break;\n\t\t\t}\n\t\tcase \"move\":\n\t\t\tif(index.moves<10){\n\t\t\tindex.moves++;\n\t\t\tmove(index);\n\t\t\tbreak;\n\t\t\t}else{\n\t\t\t\tbreak;\n\t\t\t}\n default:\n console.log(\"nothing to do\")\n break;\n }\n}", "function showComingMsg(data) {\r\n addMsg(data, \"someone-else\");\r\n}", "function displayResponce ( responce, probe, targetBoard, targetBasin, targetStatPanel, targetStat, sourceMesPanel ) {\n if ( probe.length!==2 ) throw new Error (\"Invalid probe:\"+probe+\"!\");\n if ( responce==\"n\" ) {\n sourceMesPanel.add(\"Strike on already marked square \"+probe[0]+probe[1]);\n return;\n }\n if ( responce==\"h\" || responce==\"m\" ) {\n targetBoard.put(responce,probe);\n return;\n }\n if ( responce==\"w\" || responce==\"f\" ) {\n targetBoard.fromBasin(targetBasin);\n targetStatPanel.showStat(targetStat.shipsAlive,targetStat.biggestShip,targetStat.shipsSunk);\n return;\n }\n}", "function processAnswers(answers) {\n\tconsole.log(\"Does this look right?\", answers);\n}", "onLineEnd() { }", "function mistake1() {\n\ttoss(\"data\");\n}", "function answer(result,change = 0){\n // console.log(result)\n if(change === 1){\n read(\"hello \"+result)\n messageTemplate(\"hello \"+result,\"left\")\n }\n else{\n read(result)\n messageTemplate(result,\"left\")\n }\n \n}", "function youAction(thing, trigger) {\r\n\tif(trigger == \"exits\") {\r\n\t\tget(\"bottom-display\").innerHTML = \"You move to the \" + thing + \".\";\r\n\t}\r\n\telse if(trigger == \"items\") {\r\n\t\t//match up thing to code in itemStorageArray.\r\n\t\t//display simpleName from itemStorageArray.\r\n\t\tfor(var i = 0; i < itemStorageArray.length; i++) {\r\n\t\t\tif(thing == itemStorageArray[i].code) {\r\n\t\t\t\tget(\"bottom-display\").innerHTML = \"You pick up the \" + itemStorageArray[i].simpleName + \".\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function Ha(){}", "function BOT_standardSwitchToChar(newbotid) {\r\n\tvar newbotobject = eval(newbotid);\r\n\tvar newbottopicid = newbotobject.topicId;\r\n\tvar name = BOT_get(newbottopicid,\"name\",\"VAL\");\r\n\tif(name) {\r\n\t\tBOT_chatboxMainProcess(\"greet \"+name);\r\n\t\tBOT_agentSpeech(); \r\n\t}\r\n}", "function BOT_agentSpeech() {\r\n\tswitch (BOT_theInterface) {\r\n \t\tcase \"STANDARD\":\tBOT_printStandardChar(); break;\r\n \t\tcase \"DEVELOPER\":\tBOT_printDevelopperChar(); break;\r\n \t\tcase \"DIVALITE\":\tBOT_printDivaliteChar(BOT_reqEmote, BOT_reqAnswerLong); break;\r\n\t\tdefault: \t\t\tBOT_printStandardChar();\r\n\t}\r\n}", "execute(message,args){\n //bot replys hello friend\n message.reply(' Welcome to math bot :)')\n }", "speakWisdom(){\n console.log(\"What one programmer can do in one month, two programmers can do in two months.\");\n }", "function userSwitcharoonie() {\n //arguOne for main switch = user input\n switch (arguOne) {\n\n case 'my-tweets':\n myTweeters();\n // dataLog();\n break;\n\n case 'spotify-this-song':\n spotifySong();\n // dataLog();\n break;\n\n case 'movie-this':\n movieThis();\n // dataLog();\n break;\n\n case 'do-what-it-says':\n doWhat();\n // dataLog();\n break;\n\n }\n}", "function Mechanism() {\n }", "function Mechanism() {\n }", "function say()\r\n{\r\n alert('how are you?')\r\n}" ]
[ "0.55687785", "0.5554342", "0.554594", "0.55365187", "0.5478175", "0.5469185", "0.54681426", "0.540565", "0.5401134", "0.5392705", "0.53839976", "0.5379608", "0.5363641", "0.5347159", "0.5344978", "0.5325285", "0.5314752", "0.529731", "0.52912796", "0.5269058", "0.5266312", "0.5264013", "0.5262785", "0.52562344", "0.52561224", "0.5233481", "0.5231935", "0.5229333", "0.52222234", "0.5221117", "0.52169615", "0.52062166", "0.5205591", "0.5205126", "0.52010536", "0.5200019", "0.5194368", "0.5191971", "0.51901376", "0.5185664", "0.5184156", "0.5181243", "0.5179891", "0.5179891", "0.5179891", "0.5179891", "0.51741236", "0.51726186", "0.51591176", "0.5150586", "0.5150496", "0.51493657", "0.51462775", "0.5145666", "0.51414824", "0.51360524", "0.5134117", "0.5128105", "0.5126434", "0.5122566", "0.51207983", "0.5116965", "0.5116048", "0.5113455", "0.51109076", "0.5108014", "0.51073164", "0.5105732", "0.5101962", "0.51006967", "0.5095513", "0.50945073", "0.50911266", "0.5088277", "0.5083186", "0.50826335", "0.5076861", "0.5075618", "0.50755185", "0.507022", "0.5068755", "0.50596064", "0.50582045", "0.50576156", "0.50549734", "0.50445294", "0.50399166", "0.50380373", "0.50379455", "0.5037481", "0.5035695", "0.5035343", "0.50308406", "0.50285405", "0.5026721", "0.5025002", "0.5024889", "0.5021476", "0.5019408", "0.5019408", "0.50181574" ]
0.0
-1
Complete the hourglassSum function below.
function hourglassSum(arr) { let max = -Infinity for (let x = 0; x <= arr.length - 3; x++) { for (let y = 0; y <= arr.length - 3; y++) { // sum the top row let sum = arr[x][y] + arr[x][y + 1] + arr[x][y + 2] // sum the middle row sum += arr[x + 1][y + 1] // sum the bottom row sum += arr[x + 2][y] + arr[x + 2][y + 1] + arr[x + 2][y + 2] max = Math.max(max, sum) } } return max }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hourglassSum(arr) {\n let a = [...arr[0], ...arr[1], ...arr[2], ...arr[3], ...arr[4], ...arr[5]]\n\n let total;\n let i = 0;\n\n\n while (i < 32) {\n if ((i > -1 && i < 4) || (i > 5 && i < 10) || (i > 11 && i < 16) || (i > 17 && i < 22) || (i > 23 && i < 28) || (i > 29 && i < 34)) {\n const two = i + 1;\n const three = i + 2;\n const four = i + 7;\n const five = i + 12;\n const six = i + 13;\n const seven = i + 14;\n const tot = a[i] + a[two] + a[three] + a[four] + a[five] + a[six] + a[seven]\n if (total == undefined || tot > total) total = tot\n }\n i++\n }\n return total\n}", "function hourglassSum(arr) {\n\n let sumOfHourglasess = []\n\n for (let i = 0; i < arr.length; i++) {\n for (let j = 0; j < arr[i].length; j++) {\n if (arr[j + 1] && arr[j + 2] && arr[i + 1] && arr[i + 2]) {\n let sum = arr[i][j] + arr[i][j + 1] + arr[i][j + 2] + arr[i + 1][j + 1] + arr[i + 2][j] + arr[i + 2][j + 1] + arr[i + 2][j + 2]\n sumOfHourglasess.push(sum)\n }\n }\n }\n return Math.max(...sumOfHourglasess)\n}", "function computeHourGlassSum(hourglass) {\n return (\n hourglass.a +\n hourglass.b +\n hourglass.c +\n hourglass.d +\n hourglass.e +\n hourglass.f +\n hourglass.g\n );\n}", "function hourglassSum(arr) {\n const sumsHolder = [];\n for (let y = 1, rows = arr.length; y < rows - 1; y++) {\n for (let x = 1, columns = arr[y].length; x < columns - 1; x++) {\n // prettier-ignore\n sumsHolder.push(\n arr[y - 1][x - 1] +\n arr[y - 1][x] +\n arr[y - 1][x + 1] +\n arr[y][x] +\n arr[y + 1][x - 1] +\n arr[y + 1][x] +\n arr[y + 1][x + 1]\n );\n }\n }\n return Math.max(...sumsHolder);\n}", "function hourglassSum(arr) {\n\n // collect all of the hourglasses into a list\n const hourglassSums = [];\n\n for (let i = 0; i < arr.length - 2; i++) {\n for (let j = 0; j < arr[i].length - 2; j++) {\n\n hourglassSums.push(\n computeHourGlassSum(\n getHourglass(arr, i, j)\n )\n );\n }\n }\n\n // sort\n const sorted = hourglassSums.sort((h1, h2) => {\n return h2 - h1;\n });\n return sorted[0];\n\n}", "function hourglassSum(arr) {\n // HELPERS\n const sumOfRow = (i, j) => {\n let sum = 0;\n let pos = 0;\n\n for (let k = 0; k < 3; k++) {\n sum += arr[i][j + k];\n console.log(`arr[${i}][${j + k}] = ${arr[i][j + k]} and sum is ${sum}`);\n }\n\n console.log(`Sum of row starting from [${i},${j}] is ${sum}`);\n return sum;\n };\n\n const sumOfHourGlass = (i, j) => {\n let sum = 0;\n\n // Top row\n sum += sumOfRow(i, j);\n // bottom row\n sum += sumOfRow(i + 2, j);\n // middle num\n sum += arr[i + 1][j + 1];\n console.log(`arr[${i + 1}][${j + 1}] = ${arr[i + 1][j + 1]}`);\n return sum;\n };\n\n let maxSum = 0;\n for (let i = 0; i < 4; i++) {\n for (let j = 0; j < 4; j++) {\n const sum = sumOfHourGlass(i, j);\n console.log(`Sum of HourGlass starting from [${i},${j}] is ${sum}`);\n if (sum > maxSum) maxSum = sum;\n }\n }\n return maxSum;\n}", "function hourglassSum(arr) {\n let hourglass = [];\n for (let row = 0; row <= 3; row++) {\n for (let col = 0; col <= 3; col++) {\n let sum = 0;\n sum += arr[row][col]\n sum += arr[row][col + 1]\n sum += arr[row][col + 2]\n sum += arr[row + 1][col + 1]\n sum += arr[row + 2][col]\n sum += arr[row + 2][col + 1]\n sum += arr[row + 2][col + 2]\n hourglass.push(sum)\n }\n }\n\n return (hourglass.length > 0 ? Math.max(...hourglass) : 0);\n\n}", "function hourglassSum(arr) {\nlet largestSum = -63;\n for (let i = 0; i < 4; i++) {\n for (let j = 0; j < 4; j++) {\n let sum = arr[i][j] + arr[i][j+1] +\n arr[i][j+2] + arr[i+1][j+1] + \n arr[i+2][j] + arr[i+2][j+1] + \n arr[i+2][j+2];\n if(sum > largestSum) {\n largestSum = sum;\n }\n }\n }\n return largestSum;\n}", "function hourglassSum(arr) {\n // arrays for value-sum of top of hour glass, middle, bottom\n let min = -9 * 7; // min as per -9 <= arr[i][j] <= 9 constraint\n for (let i = 1; i < 5; i++) {\n for (let j = 1; j < 5; j++) {\n let curr = 0;\n curr += arr[i - 1][j - 1] + arr[i - 1][j] + arr[i - 1][j + 1] // row above it\n curr += arr[i][j] // middle row\n curr += arr[i + 1][j - 1] + arr[i + 1][j] + arr[i + 1][j + 1] // row below it\n if (curr > min) {\n min = curr;\n }\n }\n }\n return min;\n}", "function hourglassSum(arr) {\n const r = arr.length, c = arr[0].length\n let maxSum = Number.NEGATIVE_INFINITY\n for(let row = 1; row < r - 1; row++) {\n for(let col = 1; col < c - 1; col++) {\n maxSum = Math.max(maxSum, hourglass(arr, row, col))\n }\n }\n return maxSum\n}", "function hourglassSum(arr) {\n const mLength = arr.length;\n if (mLength < 3) { return; }\n \n let sum;\n const sumArr = [];\n for (let i = 0; i < mLength - 2; i++){\n const nLength = arr[i].length;\n if (nLength < 3) { return; }\n for(let j = 0; j < nLength -2; j++) {\n sumArr.push(arr[i][j] + arr[i][j+1] + arr[i][j+2] + arr[i+1][j+1] +\n arr[i+2][j] + arr[i+2][j+1] + arr[i+2][j+2]);\n }\n }\n \n return Math.max(...sumArr);\n}", "function hourglassSum(arr) {\n const itemToSum = 3\n let totalSum = undefined\n\n arr.forEach((row, rowIndex) => {\n const rowLength = arr.length\n row.forEach((elemA, index) => {\n const lineLength = row.length\n if (index + itemToSum <= lineLength && rowIndex + itemToSum <= rowLength) {\n const secondIndex = index + 1\n const thirdIndex = index + 2\n\n const rowD = rowIndex + 1\n const rowE = rowIndex + 2\n\n const elemB = row[secondIndex]\n const elemC = row[thirdIndex]\n const elemD = arr[rowD][secondIndex]\n const elemE = arr[rowE][index]\n const elemF = arr[rowE][secondIndex]\n const elemG = arr[rowE][thirdIndex]\n\n const elemSum = elemA + elemB + elemC + elemD + elemE + elemF + elemG\n\n if (totalSum === undefined || totalSum < elemSum) {\n totalSum = elemSum\n }\n }\n })\n })\n\n return totalSum\n}", "function hourglassSum(arr) {\n //min value posible for any index is -9\n let max = -63\n //16 hourglasses = 4 rows x 4 columns\n for(let i = 0; i < 4; i++) {\n for(let j = 0; j < 4; j++) {\n let sum = 0\n sum = (arr[i][j] + arr[i][j+1] + arr[i][j+2] + arr[i+1][j+1] + arr[i+2][j] + arr[i+2][j+1] + arr[i+2][j+2])\n max = max < sum ? sum : max\n }\n }\n return max\n}", "function hourglassSum(arr) {\n const hourglass = [\n [0, 0],\n [0, 1],\n [0, 2],\n [1, 1],\n [2, 0],\n [2, 1],\n [2, 2],\n ];\n let max = -100000;\n for (let i = 0; i < arr.length; ++i) {\n for (let j = 0; j < arr[0].length - 2; ++j) {\n let isInRange = true;\n let sum = 0;\n for (let k = 0; k < hourglass.length; ++k) {\n const newX = i + hourglass[k][0];\n const newY = j + hourglass[k][1];\n if (\n !(0 <= newX && newX < arr.length && 0 <= newY && newY < arr[0].length)\n ) {\n isInRange = false;\n break;\n }\n sum += arr[newX][newY];\n }\n\n if (isInRange) {\n max = max > sum ? max : sum;\n }\n }\n }\n\n return max;\n}", "function hourglassSum(arr) {\n let maxSum = -Infinity;\n for (let i = 0; i < arr.length - 2; i++) {\n for (let j = 0; j < arr[0].length - 2; j++) {\n let currSum =\n arr[i][j] +\n arr[i][j + 1] +\n arr[i][j + 2] +\n arr[i + 1][j + 1] +\n arr[i + 2][j] +\n arr[i + 2][j + 1] +\n arr[i + 2][j + 2];\n if (currSum > maxSum) {\n maxSum = currSum;\n }\n }\n }\n return maxSum;\n}", "function hourglassSum(arr) {\n let rows = arr.length; // 6\n let columns = arr[0].length; // 6\n\n let maxSum = Number.NEGATIVE_INFINITY; // To solve this at best case, we need to get the MIN value, since the array can have negative numbers...Therefore, we initialize to -Infinity\n\n // Loop through the 2D array\n for(let i = 0; i < rows - 2; i++) { // We subtract rows by 2 because the hourglass only has 3 indeces of ROWS\n for(let j = 0; j < columns - 2; j++) { // We subtract columns by 2 because the hourglass only has 3 indeces of COLUMNS\n let sum = 0;\n\n //Let's sum up the top of the hourglass...\n sum = arr[i][j] + arr[i][j + 1] + arr[i][j + 2];\n\n //Let's add on the middle of the hourglass...\n sum += arr[i + 1][j + 1];\n\n //Last, add the bottom of the hourglass...\n sum += arr[i + 2][j] + arr[i + 2][j + 1] + arr[i + 2][j + 2];\n\n maxSum = Math.max(maxSum, sum);\n }\n }\n return maxSum;\n}", "function hourglassSum(arr) {\n var height = arr.length;\n var length = arr[0].length;\n var max\n\n for (var i = 0; i < height - 2; i++){\n for (var x = 0; x < length - 2; x++){\n if (arr[i][x] !== undefined && arr[i][x + 1] !== undefined && arr[i][x + 2] !== undefined && arr[i + 1][x + 1] !== undefined && arr[i + 2][x] !== undefined && arr[i + 2][x + 1] !== undefined && arr[i + 2][x + 2] !== undefined) {\n var sum = arr[i][x] + arr[i][x + 1] + arr[i][x + 2] + arr[i + 1][x + 1] + arr[i + 2][x] + arr[i + 2][x + 1] + arr[i + 2][x + 2]\n if (max === undefined){\n max = sum\n } else if (max < sum){\n max = sum\n }\n }\n }\n }\n return max\n}", "function hourglassSum(arr) {\n//starting from the top left corner\n //iterate over the matrix looking for hourglasses\n //hourglass will be:\n //starting point + 3 column-wise in first row\n //move down one row, and forward one column\n //move down two rows, count point + 2\n //sum all of those together, you ge an hourglass sum\n //store in an array\n//loop through storage array and return the largest value\n //set highest = 0\n //if storage[i] > highest\n //highest = storage[i]\n\n \n let sums = [];\n\n for (let row = 0; row < arr.length - 2; row++) {\n for (let col = 0; col < arr[0].length - 2; col++) {\n let top = arr[row][col] + arr[row][col + 1] + arr[row][col + 2];\n let bottom = arr[row + 2][col] + arr[row + 2][col + 1] + arr[row + 2][col + 2];\n let sum = top + bottom + arr[row + 1][col + 1];\n sums.push(sum);\n }\n }\n\n let highest = sums[0];\n for (let i = 0; i < sums.length; i++) {\n if (sums[i] >= highest) {\n highest = sums[i];\n }\n }\n return highest;\n\n}", "function hourglassSum(arr) {\n let max = -Infinity\n let sum //Note initializing to zero gave an error\n for(let i = 0; i < arr.length; i++) {\n for(let j = 0; j < arr.length; j++) {\n if(i > 0 && i < arr.length-1 && j > 0 && j < arr.length-1){\n let a = arr[i-1][j-1]\n let b = arr[i-1][j]\n let c = arr[i-1][j+1]\n let d = arr[i][j]\n let e = arr[i+1][j-1]\n let f = arr[i+1][j]\n let g = arr[i+1][j+1]\n sum = a+b+c+d+e+f+g\n }\n if(sum > max) {\n max = sum\n }\n }\n }\n return max\n}", "function hourglassSum(arr) {\n // Write your code here\n let max = Number.MIN_SAFE_INTEGER;\n for(let i = 1;i<arr.length-1;i++){\n for(let j = 1;j<arr[0].length-1;j++){\n const total = \n arr[i][j] // number itself \n + arr[i-1][j+1] // top right \n + arr[i-1][j] // top\n + arr[i-1][j-1] // top left\n + arr[i+1][j] // bottom\n + arr[i+1][j+1] // bottom right\n + arr[i+1][j-1]; // bottom left\n if(total>max){\n max = total;\n }\n \n }\n }\n return max;\n}", "function hourglassSum(arr) {\n let highestSum = -100;\n for (let i = 0; i < 4; i++) {\n for (let j = 0; j < 4; j++) {\n const sum = calculateSum(arr, [i,j]);\n if (sum > highestSum) {\n highestSum = sum;\n }\n }\n }\n return highestSum\n}", "function hourglassSum(arr) {\n const MaxRowHour = 3, MaxColHour = 3;\n let maxISum = Number.MIN_SAFE_INTEGER;\n \n for (let j = 0; j <= MaxColHour; j++) {\n for (let row = 0; row <= MaxRowHour; row++) {\n const currentISum = arr[row][j] + arr[row][j+1] + arr[row][j+2] +\n arr[row+1][j+1] +\n arr[row+2][j] + arr[row+2][j+1] + arr[row+2][j+2];\n // console.log(`currentISum: `, currentISum);\n maxISum = Math.max(maxISum, currentISum);\n }\n }\n \n return maxISum;\n}", "function hourglassSum(arr) {\n let max = -100;\n for(let row=0;row<4;row++){\n for(let col=0;col<4;col++){\n let sum = arr[row][col]+arr[row][col+1]+arr[row][col+2]+arr[row+1][col+1]+arr[row+2][col]+arr[row+2][col+1]+arr[row+2][col+2];\n if(sum>max){\n max = sum;\n }\n }\n }\n return max;\n}", "function hourGlassSum(arr) {\n let hourglasses = []\n\n for (let row = 0; row <= 3; row++) {\n for (let col = 0; col <= 3; col++) {\n let sum = 0;\n sum += arr[row][col];\n sum += arr[row][col + 1];\n sum += arr[row][col + 2];\n sum += arr[row + 1][col + 1];\n sum += arr[row + 2][col];\n sum += arr[row + 2][col + 1];\n sum += arr[row + 2][col + 2];\n hourglasses.push(sum)\n }\n }\n\n return Math.max(...hourglasses)\n}", "function getHourGlassSum(x, y, arr){\n\tvar sum = 0;\n\t//get sum of top\n\tsum += arr[x][y] + arr[x][y + 1] + arr[x][y + 2];\n\t//get sum of middle\n\tsum += arr[x + 1][y + 1];\n\t//get sum of bottom\n\tsum += arr[x + 2][y] + arr[x + 2][y + 1] + arr[x + 2][y + 2];\n\n\treturn sum;\n}", "function hourglassSum(arr) {\n let count = 0;\n for (let i = 0; i < arr.length; i++) {\n console.log(arr[i])\n for (let j = 0; j < arr[i].length; j++) {\n console.log('[i][j]', arr[i][j])\n }\n }\n return arr;\n}", "function TotalHours(flag)\n{\n\tvar timeObject;\n\tvar Sum = 0.00;\n\tvar Hours = 0;\n\tOver24Flag = false;\n\n\tif(TimeCard.StartDate == TimeCard.EndDate)\n\t{\n\t\tNumRec = emssObjInstance.emssObj.teDailyLines;\n\t}\n\telse\n\t{\n\t\tNumRec = getDteDifference(TimeCard.StartDate, TimeCard.EndDate) + 1;\n\t}\n\n\tfor (var i=1; i<=NumRec; i++)\n\t{\n\t\tif (typeof(eval(\"self.TABLE.document.TimeEntry.HOURS_\" + i)) == \"undefined\")\n\t\t{\n\t\t\tHours = 0;\n\t\t\tfor (var j=1; j<TimeCard.Form.length; j++)\n\t\t\t{\n\t\t\t\ttimeObject = self.TABLE.document.TimeEntry[TimeCard.Form[j].FormField +'_'+ i];\n\t\t\t\tif (timeObject && timeObject.value != \"\" && typeof(timeObject.value)!=\"undefined\")\n\t\t\t\t{\n\t\t\t\t\tif (__View == \"Exception\" && !isNaN(timeObject.value))\n\t\t\t\t\t{\n\t\t\t\t\t\tHours += parseFloat(timeObject.value);\n\t\t\t\t\t}\n\t\t\t\t\telse if (TimeCard.Form[j].FormField == \"HOURS\" && !isNaN(timeObject.value))\n\t\t\t\t\t{\n\t\t\t\t\t\tHours += parseFloat(timeObject.value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tHours = roundToDecimal(Hours,2);\n\t\t\tif (Hours != \"\")\n\t\t\t{\n\t\t\t\tSum += parseFloat(Hours);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tHours = 0;\n\t\t\ttimeObject = eval(\"self.TABLE.document.TimeEntry.HOURS_\" + i);\n\t\t\tif (timeObject && timeObject.value != \"\" && !isNaN(parseFloat(timeObject.value)))\n\t\t\t{\n\t\t\t\tHours = parseFloat(timeObject.value);\n\t\t\t\tHours = roundToDecimal(Hours,2);\n\t\t\t\tif (Hours != \"\")\n\t\t\t\t{\n\t\t\t\t\tSum += parseFloat(Hours);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (TimeCard.StartDate != TimeCard.EndDate && emssObjInstance.emssObj.tePeriod24HourEdit && Hours > 24)\n\t\t{\n\t\t\tOver24Flag = true;\n\t\t}\n\t}\n\n\tSum = roundToDecimal(Sum,2);\n\t\n\tself.TABLE.document.getElementById(\"TotalHoursSpan\").innerHTML = Sum;\n\n\tif (TimeCard.StartDate == TimeCard.EndDate && emssObjInstance.emssObj.teDaily24HourEdit && Sum > 24)\n\t{\n\t\tOver24Flag = true;\n\t}\n\t\n\t// PTs 102449, 105365: always return the total number of hours so that the 24-hour edit can\n\t// be enforced. This number is used by the Check24HourEdit function to produce the alert.\n\treturn Sum;\n}", "function TotalHours(flag)\n{\n\tvar timeObject;\n\tvar Sum = 0.00;\n\tvar Hours = 0;\n\tOver24Flag = false;\n\n\tif(TimeCard.StartDate == TimeCard.EndDate)\n\t{\n\t\tNumRec = emssObjInstance.emssObj.teDailyLines;\n\t}\n\telse\n\t{\n\t\tNumRec = getDteDifference(TimeCard.StartDate, TimeCard.EndDate) + 1;\n\t}\n\n\tfor (var i=1; i<=NumRec; i++)\n\t{\n\t\tif (typeof(eval(\"self.TABLE.document.TimeEntry.HOURS_\" + i)) == \"undefined\")\n\t\t{\n\t\t\tHours = 0;\n\t\t\tfor (var j=1; j<TimeCard.Form.length; j++)\n\t\t\t{\n\t\t\t\ttimeObject = self.TABLE.document.TimeEntry[TimeCard.Form[j].FormField +'_'+ i];\n\t\t\t\tif (timeObject && timeObject.value != \"\" && typeof(timeObject.value)!=\"undefined\")\n\t\t\t\t{\n\t\t\t\t\tif (__View == \"Exception\" && !isNaN(timeObject.value))\n\t\t\t\t\t{\n\t\t\t\t\t\tHours += parseFloat(timeObject.value);\n\t\t\t\t\t}\n\t\t\t\t\telse if (TimeCard.Form[j].FormField == \"HOURS\" && !isNaN(timeObject.value))\n\t\t\t\t\t{\n\t\t\t\t\t\tHours += parseFloat(timeObject.value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tHours = roundToDecimal(Hours,2);\n\t\t\tif (Hours != \"\")\n\t\t\t{\n\t\t\t\tSum += parseFloat(Hours);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tHours = 0;\n\t\t\ttimeObject = eval(\"self.TABLE.document.TimeEntry.HOURS_\" + i);\n\t\t\tif (timeObject && timeObject.value != \"\" && !isNaN(parseFloat(timeObject.value)))\n\t\t\t{\n\t\t\t\tHours = parseFloat(timeObject.value);\n\t\t\t\tHours = roundToDecimal(Hours,2);\n\t\t\t\tif (Hours != \"\")\n\t\t\t\t{\n\t\t\t\t\tSum += parseFloat(Hours);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (TimeCard.StartDate != TimeCard.EndDate && emssObjInstance.emssObj.tePeriod24HourEdit && Hours > 24)\n\t\t{\n\t\t\tOver24Flag = true;\n\t\t}\n\t}\n\n\tSum = roundToDecimal(Sum,2);\n\t\n\tself.TABLE.document.getElementById(\"TotalHoursSpan\").innerHTML = Sum;\n\n\tif (TimeCard.StartDate == TimeCard.EndDate && emssObjInstance.emssObj.teDaily24HourEdit && Sum > 24)\n\t{\n\t\tOver24Flag = true;\n\t}\n\t\n\t// PTs 102449, 105365: always return the total number of hours so that the 24-hour edit can\n\t// be enforced. This number is used by the Check24HourEdit function to produce the alert.\n\treturn Sum;\n}", "function hourglassSum(arr) {\n let highest = 0;\n let length = Math.floor(arr.length/2);\n \n for(let i = 0; i <= length; i++) {\n for(let j = 0; j <= length; j++) {\n let sumRoll1 = arr[i][j] + arr[i][j+1] + arr[i][j+2];\n let sumRoll2 = arr[i+1][j+1];\n let sumRoll3 = arr[i+2][j] + arr[i+2][j+1] + arr[i+2][j+2];\n let sum = sumRoll1 + sumRoll2 + sumRoll3;\n (i === 0 && j === 0) ? highest = sum : 0;\n (sum > highest) ? highest = sum : 0;\n console.error(sum + \" \" + highest);\n }\n }\n return highest;\n}", "function main() {\n let arr = [];\n for(let arr_i = 0; arr_i < 6; arr_i++){\n \tarr[arr_i] = readLine().split(' ');\n \tarr[arr_i] = arr[arr_i].map(Number);\n }\n\n function get_sum_of_hourglass_at(arr, x, y) {\n return arr[y][x] + arr[y][x+1] + arr [y][x+2] +\n arr[y+1][x+1] +\n arr[y+2][x] + arr[y+2][x+1] + arr [y+2][x+2]\n }\n\n let max_sum = -100000000000\n for(let x = 0; x < 4; x++) {\n for(let y = 0; y < 4; y++) {\n const sum = get_sum_of_hourglass_at(arr, x, y)\n max_sum = Math.max(max_sum, sum)\n }\n }\n console.log(max_sum)\n}", "function addAllTheHours() {\n\n\tctrl.totalJobSiteHours = 0;\n\n\tfor (var i = 0; i < dailyTCArray.length; i++) {\n\t\tfor (var j = 0; j < dailyTCArray[i].employees_worked.length; j++) {\n\n\t\t\tctrl.totalJobSiteHours += dailyTCArray[i].employees_worked[j].hours_worked;\n\t\t};\t\n\t};\n\tconsole.log(\"total hours\", ctrl.totalJobSiteHours);\n}", "function CalculateHour()\n{\n\tfor(var i = 0;i < 43;i++)\n\t{\n\t\thourInt = Math.floor(startHour/60);\n\t\tminuteInt = Math.round(startHour % 60);\n\t\tif(hourInt < 10)\n\t\t{\n\t\t\thour = String.format(\"0\"+hourInt);\n\t\t}\n\t\telse\n\t\t{\n\t\t\thour = String.format(hourInt);\t\n\t\t}\n\t\tif(minuteInt == 0)\n\t\t{\n\t\t\tminute = String.format(\"0\"+minuteInt);\n\t\t}else{minute = String.format(minuteInt);}\n\t\ttime = String.format(hour+\":\"+minute);\n\t\tcolOfTime.push(time);\n\t\tstartHour += 20;\n\t}\n\tConvertToRangesOfHours();\n}", "function countRealWorkingTime(wantedProcentageAsInt, fullWorkDayNumber){\n let originalArray = []\n \n let wantedProcentageInDouble = wantedProcentageAsInt/100\n let currentWorkDayLength = Math.trunc(fullWorkDayMinutes*wantedProcentageInDouble)\n let allValues = document.querySelectorAll(\".header-balance-part\")\n //Counts total of days showing currently on kellokortti by counting the plus icons on right side of each day working time marking\n let howManyDaysIsShowing = document.querySelectorAll(\".float-right.glyphicon.glyphicon-plus-sign\").length\n //let workingDaysCount = howManyDaysIsShowing-countShowingfreeDays()\n originalArray = preProcessOriginalArray(allValues, originalArray) \n let combinedArray = createCombinedArray(originalArray)\n let minutesArray = transformArrayToMinutes(combinedArray, currentWorkDayLength, fullWorkDayNumber)\n let total = gainTotalBalance(minutesArray)\n return returnTotalHoursAndMinutesAsString(total)\n}", "function callTotal() {\n var totRow = document.getElementById('timeTot');\n\n // Make sure our row is empty\n while (totRow.lastChild) {\n totRow.removeChild(totRow.lastChild);\n }\n\n var totLabel = document.createElement('th');\n totLabel.textContent = 'Hourly Totals';\n totRow.appendChild(totLabel);\n\n var grandTotal = 0;\n\n for (var k = 0; k < hours.length - 1; k++) {\n\n var currentHour = hours[k]; // e.g. \"8:00AM\";\n var currentHourSales = [];\n\n for (var l = 0; l < data.length; l++) {\n var currentStore = data[l];\n currentHourSales.push(currentStore.sales[currentHour]);\n }\n\n // currentHourSales.push(pike.stats[k], seaTac.stats[k], seaCtr.stats[k], capHill.stats[k], alki.stats[k]);\n\n var sum = currentHourSales.reduce(function (a, b) { return a + b; }, 0);\n grandTotal += sum;\n\n var tot = document.createElement('td');\n tot.textContent = Math.round(sum);\n totRow.appendChild(tot);\n domTable.appendChild(totRow);\n }\n //var allTots = [];\n //allTots.push(pike.sums, seaTac.sums, seaCtr.sums, capHill.sums, alki.sums);\n\n //console.log('parseint' + allTots);\n //var sums = parseInt(allTots[0]) + parseInt(allTots[1]) + parseInt(allTots[2]) + parseInt(allTots[3]) + parseInt(allTots[4]);\n\n //console.log(sums);\n\n var grandTotalElement = document.createElement('td');\n grandTotalElement.textContent = Math.round(grandTotal);\n totRow.appendChild(grandTotalElement);\n}", "function hourglass (arr) {\n\n // const arr1 = arr.slice(6)\n // console.log(arr1)\n\n\n\n let value = 0;\n let hourglasses = []\n // let value = arr[0][0] + arr[0][1] + arr[0][2] + \n // arr[1][1] + \n // arr[2][0] + arr[2][1] + arr[2][2];\n for (i = 0; i < arr.length-2; i++) {\n for (j = 0; j < arr.length-2; j++) {\n value = arr[i][j] + arr[i][j+1] + arr[i][j+2] + \n arr[i+1][j+1] + \n arr[i+2][j] + arr[i+2][j+1] + arr[i+2][j+2];\n hourglasses.push(value);\n }\n }\n\n console.log(value);\n console.log(hourglasses);\n console.log(Math.max.apply(Math, hourglasses));\n return Math.max.apply(Math, hourglasses)\n // return value\n}", "upperTableTotalSum(game){\n let count = (game.game_rounds-1) % game.number_of_players;\n let playerId = game.players[count].id\n let playerPoints = Array.from(document.getElementsByClassName(\"column-\"+playerId)).map(e=>Number(e.innerHTML)).filter((e,index)=>index<6);\n \n let playerSum = document.getElementById(\"sum-\"+playerId); \n \n return playerPoints.reduce((previous_value, current_die) => {\n return playerSum.innerHTML = previous_value + current_die;\n }, 0); \n }", "function hourlyTotal (hour) {\n var total = 0;\n for (var i = 0; i < allLocations.length; i++) {\n total += allLocations[i].arrCookies[hour];\n }\n return total;\n}", "function drawSumOfDataThroughHoursSubscriberGraph(r, fragmentId, query, aggregateRes, startHeight) {\r\n var maxUsage = aggregateRes.maxUsage;\r\n var colors = aggregateRes.colors;\r\n var aggregate = aggregateRes.aggregate;\r\n\r\n // sum the aggregate\r\n var hourlySum = [];\r\n for (var y = 0; y < aggregate[0].length; y++) {\r\n hourlySum[y] = {};\r\n for (var x = 0; x < aggregate.length; x++) {\r\n for (var prop in aggregate[x][y]) {\r\n if (x == 0) {\r\n hourlySum[y][prop] = 0;\r\n }\r\n hourlySum[y][prop] += aggregate[x][y][prop];\r\n }\r\n }\r\n }\r\n\r\n var maxHourlySum = 0;\r\n for (var i = 0; i < 24; i++) {\r\n var hourTot = 0;\r\n for (var tu in hourlySum[i]) {\r\n hourTot += hourlySum[i][tu];\r\n }\r\n if (hourTot > maxHourlySum) {\r\n maxHourlySum = hourTot;\r\n }\r\n }\r\n\r\n var width = $(fragmentId).innerWidth();\r\n var height = ($(\"#top\").height() - $(\".ui-tabs-nav\").outerHeight()) * (0.95 - mainGraphHeight);\r\n height = Math.floor(height);\r\n var availHeight = height - 20;\r\n var barHeight = 20;\r\n var xSpace = (width * mainGraphWidth - leftGutter - 20) / axisX.length;\r\n var correctionFactor = 5;\r\n for (i = 0; i < 24; i++) {\r\n var hourData = hourlySum[i];\r\n var hourTotal = 0;\r\n var yMove = 0;\r\n\r\n if (i >= 1 && i <= 5) {\r\n correctionFactor += i * 0.6;\r\n } else if ((i >= 6 && i <= 10) || (i >= 17 && i <= 21)) {\r\n correctionFactor += i * 0.1;\r\n } else if (i == 12) {\r\n correctionFactor += i * 0.2;\r\n }\r\n\r\n for (tu in hourData) {\r\n r.rect(leftGutter + xSpace * i + 10 + correctionFactor,\r\n startHeight + yMove,\r\n barHeight,\r\n (hourData[tu] / maxHourlySum) * availHeight\r\n ).attr({\r\n stroke: \"none\",\r\n fill: \"#\" + colors[tu]\r\n });\r\n hourTotal += hourData[tu];\r\n yMove += (hourData[tu] / maxHourlySum) * availHeight;\r\n }\r\n\r\n hourTotal = toFixed(hourTotal, 2);\r\n r.text(leftGutter + xSpace * i + 10 + correctionFactor, startHeight + yMove + 10, hourTotal).attr(defaultFont);\r\n }\r\n}", "function computeHours() {\n if (saldoAdp == undefined) {\n saldoAdp = 0;\n }\n saldoAdp = saldoAdpToMinutes(saldoAdpBruto);\n var saldoAtual = totalMinutos - toMinutes(totalHorasMes + ':00') + saldoAdp + toMinutes(horasAbonadas);\n\n var comp = document.getElementById('saldoHoras');\n var stringHoras = toHours(saldoAtual);\n\n comp.innerHTML = stringHoras;\n //comp.innerHTML = toMinutes(totalHorasMes + ':00');\n\n if (stringHoras.includes('-')) {\n comp.style.color = 'red';\n } else {\n comp.style.color = '#0F0';\n }\n}", "function calculateTotalTime()\n{\n\tvar overallTotalTime = 0;\n\tvar overallTotalTimeHoursMins = 0;\n\n\tfor (var i=0; i < numOfTimeEntries; i++)\n\t{\n\t\t// Get the values from the form\n\t\tvar startHour = $('#startHour' + i).val();\n\t\tvar startMin = $('#startMin' + i).val();\n\t\tvar endHour = $('#endHour' + i).val();\n\t\tvar endMin = $('#endMin' + i).val();\n\t\tvar task = $('#task' + i).val();\n\t\tvar subTotal = $('#subTotal' + i).is(':checked');\n\t\t\n\t\t// Store in an object\n\t\tvar rowStorage = {\n\t\t\t'rowKey': i,\n\t\t\t'startHour': startHour,\n\t\t\t'startMin': startMin,\n\t\t\t'endHour': endHour,\n\t\t\t'endMin': endMin,\n\t\t\t'task': task,\n\t\t\t'subTotal': subTotal\t\t\t\n\t\t};\n\n\t\t// Make sure all fields are filled out for that row\n\t\tif ((startHour != '') && (startMin != '') && (endHour != '') && (endMin != ''))\n\t\t{\n\t\t\t// Work out the time difference in hours and round to 2dp\n\t\t\tvar timeDifferenceInHours = calculateTimeDifference(startHour, startMin, endHour, endMin);\n\t\t\tvar timeDifferenceInHoursMins = formatToHoursMins(timeDifferenceInHours);\n\n\t\t\t// Update the total time field on each row\n\t\t\t$('#totalTimeRow' + i).html(timeDifferenceInHours);\n\t\t\t$('#totalTimeRowHoursMins' + i).html(timeDifferenceInHoursMins);\n\t\t\trowStorage['totalTimeRow'] = timeDifferenceInHours;\n\t\t\trowStorage['totalTimeRowHoursMins'] = timeDifferenceInHoursMins;\n\t\t\t\n\t\t\t// Update overall total time running total\n\t\t\toverallTotalTime = (overallTotalTime + timeDifferenceInHours);\t\t\t\n\t\t}\n\t\telse {\n\t\t\t// Otherwise set the time calc to 0 if not filled out properly\n\t\t\t$('#totalTimeRow' + i).html(0);\n\t\t\t$('#totalTimeRowHoursMins' + i).html('');\n\t\t\trowStorage['totalTimeRow'] = 0;\t\n\t\t\trowStorage['totalTimeRowHoursMins'] = '';\t\n\t\t}\n\t\t\n\t\t// Put row object & values into the main object\n\t\ttimeStorage[i] = rowStorage;\t\n\t}\n\t\n\t// Store date values\n\tvar displayDate = $('#displayDate').val();\n\tvar backendDate = $('#backendDate').val();\t\n\ttimeStorage['displayDate'] = displayDate;\n\ttimeStorage['backendDate'] = backendDate;\n\t\n\t// Calculate overall sub total\n\tcalculateSubTotal(numOfTimeEntries);\n\t\n\t// Round total time to 2dp (fixes bug when adding two floats together it doesn't add properly)\n\toverallTotalTime = roundNumber(overallTotalTime, 2);\n\toverallTotalTime = overallTotalTime;\n\toverallTotalTimeHoursMins = formatToHoursMins(overallTotalTime);\t\n\n\t// Update overall total time on page\n\t$('#overallTotalTime').html(overallTotalTime);\n\t$('#overallTotalTimeHoursMins').html(overallTotalTimeHoursMins);\n\ttimeStorage['overallTotalTime'] = overallTotalTime;\n\ttimeStorage['overallTotalTimeHoursMins'] = overallTotalTimeHoursMins;\n\t\n\t// Store everything into HTML local storage\n\tlocalStorage.setObject('timeStorage', timeStorage);\n}", "function calculate_sum() {\n cell_sum = 0;\n for(var i=0; i<cellList.length; i++){\n console.log(cellList[i]);\n if (cellList[i].length == 0){\n console.log(\"empty day\");\n }\n else{\n for(var j=0; j <cellList[i].length; j++) {\n cell_sum += (cellList[i][j][1]+1-cellList[i][j][0])/2;\n }\n }\n }\n console.log(\"sum: \",cell_sum);\n}", "function hourlyTotals () {\r\n var hourlyTotal=0;\r\n var grandTotal = 0;\r\n for( var i =0; i < hours.length; i++) {\r\n for( var j=0; j < cityArray.length; j++) {\r\n hourlyTotal = hourlyTotal + cityArray[j].cookiesSoldPerHour[i];\r\n }\r\n grandTotal = grandTotal + hourlyTotal;\r\n }\r\n}", "function calculateTotalPrice() {\n var peak_hours_text = document.querySelector(\".peak-hour-holder\").innerHTML;\n var daySelected = document.querySelector(\".dateHolder\").value.substr(0,3);\n var peak_hours_object = JSON.parse(peak_hours_text);\n var peak_starting_hour = peak_hours_object[daySelected][\"startingPeakHour\"];\n var peak_closing_hour = peak_hours_object[daySelected][\"closingPeakHour\"];\n var bookingStartTime = document.querySelector(\"input.startTime\").value;\n var bookingEndTime = document.querySelector(\"input.endTime\").value;\n //console.log(bookingStartTime, bookingEndTime, peak_starting_hour, peak_closing_hour);\n var costAndTimes = generateIncrements(bookingStartTime, bookingEndTime, peak_starting_hour, peak_closing_hour);\n //console.log(totalCost);\n return costAndTimes; // [totalCost, times outside the peak, times inside the peak period]\n }", "function calcTotalTotal() {\n totalTotal = 0;\n for (var i = 0; i < hours.length; i++) {\n totalTotal += combinedHourlyCookies[i];\n }\n}", "sum() {}", "function calculate_total_worked_time()\n{\n var totalh = 0;\n var totalm = 0;\n $('.StTotalTime').each(function () {\n\n if (($(this).val())) {\n var h = parseInt(($(this).val()).split(':')[0]);\n var m = parseInt(($(this).val()).split(':')[1]);\n totalh += h;\n totalm += m;\n }\n });\n //alert('Total Hour is '+totalh+'Total Minutes is '+totalm);\n totalh += Math.floor(totalm / 60);\n totalm = totalm % 60;\n\n totalh = totalh < 10 ? '0' + totalh : totalh;\n totalm = totalm < 10 ? '0' + totalm : totalm;\n\n $('#hours_total').text(totalh + ':' + totalm);\n $('button.disabled').removeAttr('disabled').removeClass('disabled');\n}", "forAllDays() {\n if (this.breakDown() !== 'No Information to display') {\n let totalCost = this.breakDown().reduce((acc, item) => acc += item.totalCost, 0)\n return totalCost || 0;\n }\n }", "function findTotalHours() {\n var totalHours = 48; \n for (i = 0; i < flashTeamsJSON[\"events\"].length; i++) {\n var eventObj = flashTeamsJSON[\"events\"][i];\n var eventStart = eventObj.startTime;\n var eventDuration = eventObj.duration;\n var eventEnd = eventStart + eventDuration;\n var hours = (eventEnd - (eventEnd%60))/60; \n if (hours > totalHours) totalHours = hours;\n }\n //NOTE: the above cut off minutes past the hour, must add at least 1 extra hour to return val\n totalHours++; \n return totalHours + 2; //THE 2 IS ARBITRARY FOR PADDING\n}", "function findTotalHours() {\n var totalHours = 48; \n for (i = 0; i < flashTeamsJSON[\"events\"].length; i++) {\n var eventObj = flashTeamsJSON[\"events\"][i];\n var eventStart = eventObj.startTime;\n var eventDuration = eventObj.duration;\n var eventEnd = eventStart + eventDuration;\n var hours = (eventEnd - (eventEnd%60))/60; \n if (hours > totalHours) totalHours = hours;\n }\n //NOTE: the above cut off minutes past the hour, must add at least 1 extra hour to return val\n totalHours++; \n return totalHours + 2; //THE 2 IS ARBITRARY FOR PADDING\n}", "function getLaborTotalForWeek(regular_hours, overtime_hours, total_hours, hourly_wage){\n\n var regular_labor_total = 0;\n var overtime_labor_total = 0;\n var overtime_daily_hours = 0;\n var labor_total = 0;\n\n _.each(regular_hours, function(o){\n regular_labor_total += o.hourly_wage * o.hours;\n });\n\n _.each(overtime_hours, function(o){\n overtime_labor_total += o.hourly_wage * o.hours;\n overtime_daily_hours += o.hours;\n });\n\n if(window.OvertimeSettings.enabled && window.OvertimeSettings.weekly_hours && total_hours > window.OvertimeSettings.weekly_hours){\n var total_extra_hours = total_hours - window.OvertimeSettings.weekly_hours;\n\n if(overtime_daily_hours > total_extra_hours){\n labor_total = regular_labor_total + overtime_labor_total;\n } else {\n var total_extra_labor = total_extra_hours * (hourly_wage * window.OvertimeSettings.weekly_times);\n labor_total = regular_labor_total - (total_extra_hours * hourly_wage) + total_extra_labor;\n }\n } else {\n labor_total = regular_labor_total + overtime_labor_total;\n }\n\n return labor_total;\n}", "function getTotalPerhour() {\n var totalPerHour = [];\n var sumTotalPerHour = 0;\n for (var z = 0; z < salmonObjs[0].times.length; z++) {\n var perHour = 0;\n for (var y = 0; y < salmonObjs.length; y++) {\n perHour = perHour + salmonObjs[y].cookiesRandomNums[z];\n }\n totalPerHour.push(perHour);\n sumTotalPerHour = sumTotalPerHour + perHour;\n }\n return [totalPerHour, sumTotalPerHour];\n}", "function renderHourlyTotals(table){\n var tfoot = makeNewRow(table,'tfoot');\n var tr = document.createElement('tr');\n tfoot.appendChild(tr);\n appendElement(tr,'th','Totals:');\n // add data\n for (var i = 0; i < getTotals().length; i++){\n appendElement(tr,'td',getTotals(table)[i]);\n }\n}", "function vectorTimerHour(time, hourOn, hourOff, minOn, minOff){\n print('[vectorTimerHour] Build Hour vector timer ...');\n\n let hourOn = JSON.parse(hourOn);\n let hourOff = JSON.parse(hourOff);\n let minOn = JSON.parse(minOn);\n let minOff = JSON.parse(minOff);\n\n if (hourOff > hourOn){\n for(let i = 0; i < 24; i++){\n yHour[i] = 0;\n if (time[i] >= hourOn && time[i] < hourOff){\n yHour[i] = 1;\n }\n }\n }\n\n if (hourOn > hourOff){\n for(let i = 0; i < 24; i++){\n yHour[i] = 1;\n if (time[i] >= hourOff && time[i] < hourOn){\n yHour[i] = 0;\n }\n }\n }\n\n if (hourOn === hourOff){\n if (minOn > minOff){\n for(let i = 0; i < 24; i++){\n yHour[i] = 1;\n }\n yHour[hourOn] = 0;\n }\n\n if (minOff > minOn){\n for(let i = 0; i < 24; i++){\n yHour[i] = 0;\n }\n yHour[hourOn] = 1;\n }\n \n }\n\n return yHour\n}", "function treadmillTotal(hours, hrsInDay){\n var totalDays = Math.floor(hours / hrsInDay); // set totalDays to be hours divided by hrsInDay rounded down.\n var remainingHours = Math.floor(hours % hrsInDay); // set remainingHours to be the remainder of hours divided by hrsInDay rounded down.\n var totalTime = [totalDays, remainingHours]; // set totalTime to be and array of totalDays, and remainingHours.\n return totalTime; // return the value of totalTime.\n}", "function arrSum (array, start, end, hops){\n sum = 0\n for(var i = start; i < end; i++){\n if ((i - start)%hops == 0){\n sum = sum + array[i];\n }\n }\n\n return sum\n}", "function countBellRings(startIn, endIn) {\n var start = moment(startIn, 'HH:mm');\n var end = moment(endIn, 'HH:mm');\n\n // validate the input values...\n if (!start.isValid()) {\n return 'Invalid start value!';\n }\n if (!end.isValid()) {\n return 'Invalid end value!';\n }\n\n // set our individual hour and minute values for start and end...\n let startHr = start.hours(),\n startMin = start.minutes(),\n endHr = end.hours();\n\n // we need to handle the midnight case - if it's 24:00...\n if (startHr === 0) {\n startHr = 24;\n }\n\n // if the start minutes aren't zero, we need to use the next hour as the start...\n if (startMin !== 0) {\n startHr = startHr + 1;\n }\n\n // array where we store our hour values...\n var hrsArr = [];\n\n if (startHr > endHr) {\n // the start IS bigger than the end push the start to the array\n var n;\n // iterate through the hours from start value to 24\n for (let i = startHr; i <= 24; i++) {\n // convert 24 hour to 12 hour...\n i > 12 ? (n = i - 12) : (n = i);\n\n hrsArr.push(n);\n }\n\n // iterate through the hours from 1 to the end value\n for (let i = 1; i <= endHr; i++) {\n // convert 24 hour to 12 hour...\n i > 12 ? (n = i - 12) : (n = i);\n hrsArr.push(n);\n }\n } else {\n // the start isn't bigger than the end\n\n // iterate through the hours and push to our array...\n for (let hr = startHr; hr <= endHr; hr++) {\n // convert 24 hour to 12 hour...\n hr > 12 ? (n = hr - 12) : (n = hr);\n\n hrsArr.push(n);\n }\n }\n\n // return the total of all values in the array...\n try {\n return hrsArr.reduce((accumulator, value) => accumulator + value);\n } catch (errorMessage) {\n console.error(errorMessage);\n }\n}", "countSumOfRange() {\n \twhile (this.rangeStart <= this.rangeFinish) {\n this.sum = this.sum + this.rangeStart;\n this.rangeStart++;\n }\n this.resultSum.textContent = this.sum;\n }", "function makeTotalRow(tableElement){\n //compute total per hour of all locations\n hourlyTotal = calculateHourlyTotal();\n //add total\n tableElement.append(makeTableRow('Totals', hourlyTotal, getSum(hourlyTotal) ));\n}", "calcAvgTotalHrs() {\n let sum = this.data.map(currentData => {\n return currentData.hoursSlept\n }).reduce((acc, hoursSlept) => acc + hoursSlept);\n\n return sum / this.data.length;\n }", "function main() {\n var arr = [];\n for(arr_i = 0; arr_i < 6; arr_i++){\n arr[arr_i] = readLine().split(' ');\n arr[arr_i] = arr[arr_i].map(Number);\n }\n\n // going to use a forloop that goes throught the legnth of 4 because this is the limits of the hoursglass top to bottom for the matrix size.\n let answer = -100;\n\n for (let i = 0; i < 4; i++){\n for (let j = 0; j < 4; j++){\n let pH = 0;\n // need to define the shape of the hourglass?\n pH = arr[i][j] + arr[i][j+1] + arr[i][j+2] + arr[i+1][j+1] + arr[i+2][j] + arr[i+2][j+1] + arr[i+2][j+2];\n if (pH > answer){\n answer = pH;\n };\n\n };\n };\n console.log(answer);\n}", "function onHourChange() {\r\n clearTimer();\r\n //casy prevedene na cisla\r\n var t1,t2;\r\n //Pozice bunky\r\n var index = td==null?0:td.cellIndex+1;\r\n if(tr.cells.length<=index)\r\n return false;\r\n //Nalezeni bunky aktualni hodiny\r\n if(td==null) {\r\n //Prvni spusteni: Najit bunku odpovidajici nasemu casu\r\n \r\n for(var i=0,l=casy2.length; i<l; i++) {\r\n //Rozdelim casy na hodiny a minuty\r\n t1 = casy2[i][0].split(\":\");\r\n t2 = casy2[i][1].split(\":\");\r\n //console.log(t1,t2,[hr,min]);\r\n //Zjistim, zda se aktualni cas nachazi v intervalu\r\n if(isTimeBigger(hr, min, 1*t1[0], 1*t1[1]) && isTimeBigger(1*t2[0], 1*t2[1], hr, min)) {\r\n //Skocim na bunku\r\n var pos = 0; //pocet projitych bunek\r\n var ipos = 0; //pocet projitych casu\r\n while(ipos<i) {\r\n pos++;\r\n ipos+=1+getSpan(tr.cells[pos+cell_padding]);\r\n }\r\n td = tr.cells[pos+cell_padding];\r\n console.log(td);\r\n //taky si ulozim pozici v poli casu\r\n timepos = ipos-getSpan(td); //ipos je pocet hodin pred touhle bunkou, ale vcetne tehle bunky a jejiho poctu, odecitam vsak pouze jeji span, pokud ma bunka span, muzem zacinat uprostred, ale vse se pocita z rozmeru bunky\r\n //nactu skutecne casove hodnoty\r\n getTimeVals(td, timepos); \r\n console.log(i, ipos, pos, getSpan(td));\r\n break;\r\n }\r\n else\r\n console.log(hr,min,t1,t2);\r\n }\r\n if(td==null) {\r\n console.error(hr,min,tr, t1, t2);\r\n throw new Error(\"No suitable cell was found!\");\r\n } \r\n }\r\n else {\r\n //Skok o hodinu dale\r\n timepos++;\r\n //Skok i o vic, pokud posledni pole zahrnovalo vic hodin\r\n timepos+=getSpan(td);\r\n //Preskocit na dalsi bunku, spocitat casy\r\n td = tr.cells[index];\r\n getTimeVals(td, timepos);\r\n }\r\n //Zapamatovat si puvodni CSS tridu pro pripadne obnoveni\r\n if(td.oldClassName==null) {\r\n td.oldClassName = td.className;\r\n td.className+=\" timer\";\r\n }\r\n //Vykreslit casoznacku\r\n updateTimer();\r\n }", "function getHours() {\n var hours = 0; \n\n for(var i=1; i<6; i++) {\n hours = hours + parseInt(document.getElementById(\"hours_\" + i).value);\n }\n return hours;\n }", "function sum(elen, e, flen, f, h) {\n let Q, Qnew, hh, bvirt;\n let enow = e[0];\n let fnow = f[0];\n let eindex = 0;\n let findex = 0;\n if ((fnow > enow) === (fnow > -enow)) {\n Q = enow;\n enow = e[++eindex];\n } else {\n Q = fnow;\n fnow = f[++findex];\n }\n let hindex = 0;\n if (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = enow + Q;\n hh = Q - (Qnew - enow);\n enow = e[++eindex];\n } else {\n Qnew = fnow + Q;\n hh = Q - (Qnew - fnow);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n while (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n } else {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n }\n while (eindex < elen) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n while (findex < flen) {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n if (Q !== 0 || hindex === 0) {\n h[hindex++] = Q;\n }\n return hindex;\n }", "function updateTotal(ts,days,silent){\n\ttry{\n var err=false;\n var curDay = document.getElementsByClassName('time4day['+ts+']['+days+']');\n var nbline = curDay.length;\n var TotalList=document.getElementsByClassName('Total['+ts+']['+days+']');\n var nblineTotal = TotalList.length;\n if(time_type==\"hours\")\n {\n var total = new Date(0);\n total.setHours(0);\n total.setMinutes(0);\n\n for (var i=0;i<nbline;i++)\n { \n //var id='task['+i+']['+days+']'; \n var taskTime= new Date(0);\n var element=curDay[i];\n \n if(element)\n {\n if (element.value)\n { \n parseTime(element.value,taskTime);\n }\n else if(element.innerHTML)\n {\n parseTime(element.innerHTML,taskTime);\n }else\n {\n parseTime(\"00:00\",taskTime);\n }\n \n total.setHours(total.getHours()+taskTime.getHours());\n total.setMinutes(total.getMinutes()+taskTime.getMinutes());\n }\n }\n if(total.getDate()>1 || (total.getHours()+total.getMinutes()/60)>day_max_hours){\n if( silent == 0)$.jnotify(err_msg_max_hours_exceded ,'error',false); //\n err=true;\n }else if((total.getHours()+total.getMinutes()/60)>day_hours){\n if( silent == 0)$.jnotify(wng_msg_hours_exceded ,'warning',false); \n }\n \n for (var i=0;i<nblineTotal;i++)\n {\n if(!err){\n TotalList[i].innerHTML = pad((total.getDate()-1)*24+total.getHours())+':'+pad(total.getMinutes());\n TotalList[i].style.backgroundColor = TotalList[i].style.getPropertyValue(\"background\");\n }else if(TotalList[i].innerHTML =\"&nbsp;\"){\n TotalList[i].innerHTML = day_max_hours+\":00\";\n TotalList[i].style.backgroundColor = \"red\";\n }\n }\n return !err;\n \n \n\t\t//addText(,total.getHours()+':'+total.getMinutes());\n }else\n {\n\t\tvar total =0;\n\t\tfor (var i=0;i<nbline;i++)\n\t\t{ \n //var id='task['+i+']['+days+']'; \n var taskTime= new Date(0);\n var element=curDay[i];\n if(element)\n {\n if (element.value)\n { \n total+=parseFloat(element.value);\n }\n else if(element.innerHTML)\n {\n total+=parseFloat(element.innerHTML);\n }else\n {\n total+=0;\n }\n }\n\t\t}\n if(total>day_max_hours/day_hours){\n if( silent == 0)$.jnotify(err_msg_max_hours_exceded ,'error',false); //\n err=true;\n }else if(total>1 ){\n if( silent == 0)$.jnotify(wng_msg_hours_exceded ,'warning',false); \n }\n\n for (var i=0;i<nblineTotal;i++)\n {\n if(!err){\n TotalList[i].innerHTML = total;\n TotalList[i].style.backgroundColor = TotalList[i].style.getPropertyValue(\"background\");\n }else if(TotalList[i].innerHTML =\"&nbsp;\"){\n TotalList[i].innerHTML = day_max_hours/day_hours;\n TotalList[i].style.backgroundColor = \"red\";\n }\n }\n return !err;\n \n\n }\n\t}\n\tcatch(err) {\n if(silent == 0)$.jnotify(\"updateTotal \"+err,'error',true);\n\t}\n}", "function averageTempByhour(day,callback){\n var countElem = 0;\n var sumElem = 0;\n var insidetabTemp = [];\n db[\"Temps\"].findAndCountAll({\n where: {\n date: day\n },\n order: [\n 'hour'\n ]\n }).then(data => {\n db[\"Temps\"].sum('value', {\n where: {\n date: day\n }\n }).then(sum => {\n //console.log(\"T+++++\" + sum / data.count);\n for(var i = 0; i < 24; i++){\n data.rows.forEach((elem) => {\n if(i == elem.hour){\n countElem += 1;\n sumElem += elem.value;\n }\n });\n if((countElem) === 0)\n insidetabTemp.push(0);\n else insidetabTemp.push(sumElem / countElem);\n\n countElem = 0;\n sumElem = 0;\n }\n\n //console.log(\"-->\"+tabTemp);\n callback(insidetabTemp);\n });\n });\n \n}", "function calc_aadt(unmapper,sum_variables,ts_column){\n\n return function(data){\n\n // data is all the data to sum up,by column. Theoretically a\n // subset of the big data, but really I don't care inside this\n // code\n\n // start is the starting point for the map summing function\n var start=new Array(sum_variables.length)\n // zero volume at start of summation\n for(var i=0,j=sum_variables.length; i<j; i++){\n start[i]=0\n }\n var days={}\n\n // make two passes max. first pass computes aadt. then check\n // that all intervals put out less than aadt. if not, drop\n // those periods, and recompute aadt in second pass\n function sum_aadt(memo,rec){\n // simple sums of volumes, ignore the rest\n _.each(sum_variables\n ,function(v,i){\n memo[i]+=rec[unmapper[v]]\n });\n var d = new Date(rec[unmapper[ts_column]])\n var day = day_formatter(d)\n if(days[day]===undefined){\n days[day]=1\n }\n return memo\n }\n var end = _.reduce(data,sum_aadt,start)\n // have the sum of volumes. Divide by days to get average annual daily\n var numdays=_.size(days)\n end = _.map(end\n ,function(value,veh_type){\n return value / numdays\n });\n var grouped = _.groupBy(data\n ,function(rec){\n return rec[unmapper[sum_variables[0]]]/end[0] > 1 ? 'outlier':'okay'\n })\n var final_result = {}\n if(grouped.outlier !== undefined && grouped.outlier.length > 0 ){\n console.log('redo aadt computation, '+(grouped.outlier.length) + ' out of '+data.length+' are putting out hourly volumes that are higher than computed AADT.')\n console.log('computed aadt')\n console.log(end)\n\n var iterate = 10\n var prior = grouped.outlier.length - 1\n while (iterate-- >0 && grouped.outlier !== undefined && grouped.outlier.length > 0 && grouped.outlier.length > prior){\n // if this is true, we have outliers, and must prune them.\n prior = grouped.outlier.length\n final_result.outliers=grouped.outlier\n\n // reset reduce\n // zero volume at start of summation\n for(var i=0,j=sum_variables.length; i<j; i++){\n start[i]=0\n }\n days={}\n // redo reduce\n end = _.reduce(grouped.okay,sum_aadt,start)\n numdays=_.size(days)\n end = _.map(end\n ,function(value,veh_type){\n return value / numdays\n });\n grouped = _.groupBy(data\n ,function(rec){\n return rec[unmapper[sum_variables[0]]]/end[0] > 1 ? 'outlier':'okay'\n })\n console.log('outlier removal iteration '+(10-iterate))\n }\n console.log('recomputed aadt')\n console.log(end)\n // okay, the worst outliers just got dropped. Not\n // perfect, but better\n }\n _.each(end\n ,function(value,veh_type){\n final_result[sum_variables[veh_type]] = value\n });\n return final_result\n }\n}", "function gastoTotalEletronico(qtdHorasLigado, consumoPorHora){\n\treturn qtdHorasLigado*consumoPorHora;\n}", "function sum() {\n \n}", "SumPoints()\n {\n let sum = 0;\n\n for(let i = 0; i < this.scoreOverTime.length; i++)\n {\n sum += this.scoreOverTime[i];\n }\n\n return sum;\n }", "function sum() {\n return mid + final;\n}", "function calcAddHours(currentHours) {\n timelineHours = currentHours + Math.floor(currentHours/3);\n hours = timelineHours * Y_WIDTH;\n \n SVG_WIDTH = timelineHours * 100 + 50;\n XTicks = timelineHours * 2;\n}", "function sumAll(arr) {\n var max = Math.max(arr[0], arr[1]);\n var min = Math.min(arr[0], arr[1]);\n var temp = 0;\n for(var i = min; i<= max; i++){\n temp += i;\n 6+4\n }\n return temp;\n }", "function getTotalHoursForTimeChunk(timeChunk) {\n var start = timeChunk.startTime.split(':');\n var end = timeChunk.endTime.split(':');\n var total = (Number(end[0]) * 60 + Number(end[1])) - (Number(start[0]) * 60 + Number(start[1]));\n return (total / 60);\n}//end of getTotalHoursForTimeChunk", "function checaHora(diaEscolhido) {\n var mesId = \"d\";\n var mesAt = mes + 1;\n mesId = mesId.replace(\"d\", mesAt);\n \n\n var checaDia = \"d\";\n var checaDia = checaDia.replace(\"d\", diaEscolhido);\n\n tirarHoraGasta(horaIntervalo.inicio, horaIntervalo.fim);\n\n if (agMes[mesId] != null) {\n for (var i = 0; i < agMes[mesId].length; i++) {\n\n if (agMes[mesId][i].dia == checaDia) {\n\n var minutoM = 0; //minuto marcado\n var horaM = 0; //hora marcada\n\n //se for igual a 3 para saber se a hora é\n //menor que 10\n if (agMes[mesId][i].hora.length == 3) {\n horaM = parseInt(agMes[mesId][i].hora[0]);\n minutoM = agMes[mesId][i].hora[1] + agMes[mesId][i].hora[2];\n minutoM = parseInt(minutoM);\n }\n else {\n horaM = agMes[mesId][i].hora[0] + agMes[mesId][i].hora[1];\n minutoM = agMes[mesId][i].hora[2] + agMes[mesId][i].hora[3];\n horaM = parseInt(horaM);\n minutoM = parseInt(minutoM);\n }\n var horaG = agMes[mesId][i].horaGasta; //hora gasta\n var minutoG = agMes[mesId][i].minutoGasto; // minuto gasto\n horaG = parseInt(horaG);\n minutoG = parseInt(minutoG);\n\n var horaS = horaM + horaG; //hora somada\n var minutoS = minutoM + minutoG; //minuto somado\n \n if (minutoS > 30) {\n minutoS = 0;\n ++horaS;\n }\n\n var tMinuto = \"d\"; //texto Minuto\n var tHora = \"d\"; //texto hora\n if (minutoS == 0) {\n tMinuto = tMinuto.replace(\"d\", \"00\");\n }\n else {\n tMinuto = tMinuto.replace(\"d\", minutoS);\n }\n\n tHora = tHora.replace(\"d\", horaS);\n\n var fim = tHora + tMinuto;\n fim = parseInt(fim);\n var inicio = agMes[mesId][i].hora;\n tirarHoraGasta(inicio, fim);\n }\n }\n }\n}", "function eulersMethod(t0, T0, t1, h) {\n // T0 is initial temperature at time t0\n // h step size\n // Find temperature at t1\n const findCoolingRate = (temp) => -0.07 * (temp - 20);\n let coolingRate = findCoolingRate(T0);\n t0 += h;\n while(t0 <= t1){\n T0 = T0 + h * coolingRate;\n coolingRate = findCoolingRate(T0);\n t0 += h;\n }\n \n return T0\n}", "function sum(awalderet, akhirderet, step){\n if(awalderet != null && akhirderet != null && step == null){ //jika step kosong maka nilainya 1\n step = 1;\n var tampung = rangeWithStep(awalderet, akhirderet, step);\n var total = 0;\n\n for(i = 0; i < tampung.length; i++){\n total += tampung [i]\n }\n return total;\n\n }//jika semua parameter tidak null maka masuk ke sini\n else if(awalderet != null && akhirderet != null && step != null){\n var tampung = rangeWithStep(awalderet, akhirderet, step);\n var total = 0;\n\n for(i = 0; i < tampung.length; i++){\n total += tampung [i]\n }\n return total;\n\n }//jika hanya terdapat parameter awalderet maka sum bernilai awalderet\n else if(awalderet != null && akhirderet == null && step == null){\n total = awalderet;\n return total;\n }//jika parameter kosong semua maka return 0;\n else{\n return 0;\n }\n\n}", "function get_total_hours(index)\n\t\t{\n\t\t\tvar total = 0;\n\t\t\tvar $rows = $(\"#issuetable tbody tr\");\n\n\t\t\t$rows.each(function(i) {\n\n\t\t\t\tvar $est_cell = $(this).find(\"td:eq(\" + index + \")\");\n\t\t\t\tvar value = $est_cell.html();\n\n\t\t\t\tif (value !== '')\n\t\t\t\t{\n\t\t\t\t\tvar re = /(\\d+)\\s{1}(\\w+)/;\n\t\t\t\t\tvar parts = value.split(',');\n\n\t\t\t\t\t// loop through times\n\t\t\t\t\tfor (var j = 0; j < parts.length; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar part = parts[j];\n\n\t\t\t\t\t\tif (re.test(part))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar items = part.match(re);\n\t\t\t\t\t\t\tvar count = parseInt(items[1], 10);\n\t\t\t\t\t\t\tvar unit = items[2].charAt(0);\n\n\t\t\t\t\t\t\tvar hours = count * unit_factors[unit];\n\t\t\t\t\t\t\ttotal += hours;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn total;\n\t\t}", "function add(arr1, arr2) {\n\n// console.log(arr1[0]);\n var result = [0, 0, 0, 0, 0, 0, 0];\n var start = halfAdder(arr1[7], arr2[7]);\n\n result[7] = start.s;//SUM\n var c = start.c; //CARRY\nconsole.log(result);\n\n for (var i = 6; i >= 0; i--) {\n var a = arr1[i];\n var b = arr2[i];\n\n var temp = fullAdder(a, b, c);\n console.log(temp);\n result[i] = temp.s;\n c = temp.c;\n }\n\n if(c === 1){\n alert(\"Overflow\");\n return [0, 0, 0, 0, 0, 0, 0, 0];\n }\n else{\n return result;\n }\n\n}", "function sumData(data) {\n {\n var printOut = 0;\n\n//sum together all the values in the selected range\n for (var x = 0 ; x < data.length; x++) {\n for (var y = 0; y < data[x].length; y++) {\n printOut += data[x][y];\n }\n }\n//print results in task pane\n\t\tdocument.getElementById(\"results\").innerText = printOut;\n }\n}", "function bindingReportByHour(day, month, year) {\n\tif (!reportByHour || reportByHour.length === 0) {\n\t\tconsole.log('reportByHour is empty');\n\t\t$('#table-container-report-by-hour').html('');\n\t\treturn;\n\t}\n\tvar filter = [];\n\treportByHour.map(function(r) {\n\t\tif (day !== 0 && month !== 0 && year !== 0 && r._id.day === day && r._id.month === month && r._id.year === year) {\n\t\t\tfilter.push(r);\n\t\t} else if (day === 0 || month === 0 || year === 0) {\n\t\t\t// All day\n\t\t\tfilter.push(r);\n\t\t}\n\t});\n\n\tif (day === 0 || month === 0 || year === 0) {\n\t\tvar uniqueHours = [], flags = [], tmp = [];\n\t\tfor (var i = 0; i < filter.length; i++) {\n\t\t\tif (flags[filter[i]._id.hour]) continue;\n\t\t\tflags[filter[i]._id.hour] = true;\n\t\t\tuniqueHours.push(filter[i]._id.hour);\n\t\t}\n\t\tuniqueHours.map(function(h) {\n\t\t\ttmp.push(\n\t\t\t\tfilter.reduce(function(obj, i) {\n\t\t\t\t\tif (obj._id.hour == i._id.hour) {\n\t\t\t\t\t\tobj.connected += i.connected;\n\t\t\t\t\t\tobj.totalCall += i.totalCall;\n\t\t\t\t\t\tobj.callDuration += i.callDuration;\n\t\t\t\t\t\tobj.avgCallDuration += i.avgCallDuration;\n\t\t\t\t\t}\n\t\t\t\t\treturn obj;\n\t\t\t\t}, {\n\t\t\t\t\t\"_id\": {\n\t\t\t\t\t\t\"hour\": h\n\t\t\t\t\t},\n\t\t\t\t\t\"connected\": 0,\n\t\t\t\t\t\"totalCall\": 0,\n\t\t\t\t\t\"callDuration\": 0,\n\t\t\t\t\t\"avgCallDuration\": 0\n\t\t\t\t})\n\t\t\t);\n\t\t});\n\t\tfilter = tmp;\n\t}\n\n\tvar html = '';\n\tvar sum = {};\n\tfilter.map(function(o){\n\t\tvar avg = 0;\n\t\tif (o.callDuration && o.connected) {\n\t\t\tavg = o.callDuration / 1000 / o.connected;\n\t\t} else {\n\t\t\tavg = o.avgCallDuration || 0;\n\t\t}\n\t\tavg = Math.floor(avg);\n\n\t\thtml += '<tr> ' +\n\t\t\t'<td>' + (o._id.hour + ':00:00 -' + (o._id.hour + 1) + ':00:00') + '</td> ' +\n\t\t\t'<td>' + (o.totalCall ? o.totalCall : 0) + '</td> ' +\n\t\t\t'<td>' + (o.connected ? o.connected : 0) + '</td> ' +\n\t\t\t'<td>' + (o.callDuration ? hms(o.callDuration / 1000) : '00:00:00') + '</td>' +\n\t\t\t'<td>' + (o.callDuration ? Math.floor(o.callDuration / 1000).toLocaleString('vn') : 0) + '</td> ' +\n\t\t\t'<td>' + hms(avg) + '</td> ' +\n\t\t\t'<td>' + avg.toLocaleString('vn') + '</td> ' +\n\t\t\t'<td>' + (o.totalCall ? (o.totalCall - o.connected) : 0) + '</td> ' +\n\t\t\t'<td>' + (o.totalCall ? ((o.totalCall - o.connected) * 100 / o.totalCall).toFixed(2) : 0) + '%</td> ' +\n\t\t\t'</tr>';\n\n\t\tsum = {\n\t\t\tavgCallDuration: avg + (sum['avgCallDuration'] || 0),\n\t\t\ttotalCall: o.totalCall + (sum['totalCall'] || 0),\n\t\t\tconnected: o.connected + (sum['connected'] || 0),\n\t\t\tcallDuration: o.callDuration + (sum['callDuration'] || 0)\n\t\t}\n\t});\n\tif (filter.length === 0) {\n\t\tconsole.log('filter reportByHour is empty');\n\t\t$('#table-container-report-by-hour').html('');\n\t\treturn;\n\t}\n\tvar tmpAvgCallDuration = 0;\n\tif (sum.callDuration && sum.connected) {\n\t\ttmpAvgCallDuration = Math.floor((sum.callDuration / 1000) / sum.connected)\n\t} else {\n\t\ttmpAvgCallDuration = (filter.reduce(function(s, i){\n\t\t\treturn s + i.callDuration / 1000;\n\t\t}, 0) / 1000 / result1.reduce(function (s, i) {\n\t\t\treturn s + i.connected;\n\t\t}));\n\t}\n\n\thtml += '<tr>' +\n\t\t'<th>Tổng</th>' +\n\t\t'<td>' + sum.totalCall + '</td>' +\n\t\t'<td>' + sum.connected + '</td>' +\n\t\t'<td>' + hms(sum.callDuration / 1000) + '</td>' +\n\t\t'<td>' + Math.floor(total.callDuration / 1000).toLocaleString('vn') + '</td>' +\n\t\t'<td>' + hms(tmpAvgCallDuration) + '</td>' +\n\t\t'<td>' + (Math.floor(tmpAvgCallDuration).toLocaleString('vn')) + '</td>' +\n\t\t'<td>' + (sum.totalCall - sum.connected) + '</td>' +\n\t\t'<td>' + ((sum.totalCall - sum.connected) * 100 / sum.totalCall).toFixed(2) + ' %</td>' +\n\t\t'</tr>';\n\t$('#table-container-report-by-hour').html(html);\n\n\t// Chart binding\n\tvar data = {};\n\tdata.hours = [];\n\tdata.total = [];\n\tdata.connected = [];\n\t_.each(filter, function(o){\n\t\tdata.hours.push(o._id.hour + '-' + (o._id.hour + 1));\n\t\tdata.total.push(o.totalCall);\n\t\tdata.connected.push(o.connected);\n\t});\n\tchartOptions = {\n\t\ttitle: {\n\t\t\ttext: 'Báo cáo theo giờ' + ((day !== 0 && month !== 0 && year !== 0) ? '(' + day + '/' + month + '/' +year + ')' : ' (Tổng)'),\n\t\t\tx: -20 //center\n\t\t},\n\t\txAxis: {\n\t\t\tcategories: data.hours\n\t\t},\n\t\tyAxis: {\n\t\t\ttitle: {\n\t\t\t\ttext: 'Số cuộc gọi'\n\t\t\t}\n\t\t},\n\t\tlegend: {\n\t\t\tlayout: 'vertical',\n\t\t\talign: 'right',\n\t\t\tverticalAlign: 'middle',\n\t\t\tborderWidth: 0\n\t\t},\n\t\tseries: [{\n\t\t\tname: 'Số lượng kết nối queue',\n\t\t\tdata: data.total\n\t\t}, {\n\t\t\tname: 'Cuộc gọi được phục vụ',\n\t\t\tdata: data.connected\n\t\t}]\n\t};\n\t$('#hour-chart-container').highcharts(chartOptions);\n\n\tscrollToTagById('exceldataReportByHour');\n}", "function sum() {\n for (var i = 0; i < 10; i++) {\n var weeks = 0;\n weeks = weeks + workingHours[i] * 25;\n }\n console.log(weeks);\n}", "function reducer(total, current) {\n return total + current.hour;\n }", "function reducer(total, current) {\n return total + current.hour;\n }", "function calcAddHours(currentHours) {\n TIMELINE_HOURS = currentHours + Math.floor(currentHours/3);\n TOTAL_HOUR_PIXELS = TIMELINE_HOURS * HOUR_WIDTH;\n SVG_WIDTH = TIMELINE_HOURS * HOUR_WIDTH + 50;\n XTicks = TIMELINE_HOURS * 2;\n}", "finalData(hrData) {\r\n const scope = this;\r\n let totalOccupancy, counter;\r\n scope.tempData.occupancy = [];\r\n\r\n scope.tempData.forEach(v => {\r\n totalOccupancy = 0;\r\n counter = 0;\r\n hrData.forEach(d => {\r\n if((new Date(d.Time)).getHours() === v.time){\r\n v.occupancy.push(d.mean);\r\n totalOccupancy = totalOccupancy + d.mean;\r\n counter++;\r\n }\r\n });\r\n\r\n if(counter > 0)\r\n v.average = totalOccupancy / counter;\r\n else\r\n v.average = 0;\r\n });\r\n\r\n return scope.tempData;\r\n }", "function CalculateHeatIndex(t, rh) {\n var tRounded = Math.floor(t + 0.5);\n\n // return null outside the specified range of input parameters\n if (tRounded < 76 || tRounded > 126)\n return null;\n if (rh < 0 || rh > 100)\n return null;\n\n // according to the NWS, we try this first, and use it if we can\n var tHeatEasy = 0.5 * (t + 61.0 + ((t - 68.0) * 1.2) + (rh * 0.094));\n\n // The NWS says we use tHeatEasy if (tHeatHeasy + t)/2 < 80.0\n // This is the same computation:\n if ((tHeatEasy + t) < 160.0)\n return tHeatEasy;\n\n // need to use the hard form, and possibly adjust.\n var t2 = t * t; // t squared\n var rh2 = rh * rh; // rh squared\n var tResult =\n -42.379 +\n (2.04901523 * t) +\n (10.14333127 * rh) +\n (-0.22475541 * t * rh) +\n (-0.00683783 * t2) +\n (-0.05481717 * rh2) +\n (0.00122874 * t2 * rh) +\n (0.00085282 * t * rh2) +\n (-0.00000199 * t2 * rh2);\n\n // these adjustments come from the NWA page, and are needed to\n // match the reference table.\n var tAdjust;\n if (rh < 13.0 && 80.0 <= t && t <= 112.0)\n tAdjust = -((13.0 - rh) / 4.0) * Math.sqrt((17.0 - Math.abs(t - 95.0)) / 17.0);\n else if (rh > 85.0 && 80.0 <= t && t <= 87.0)\n tAdjust = ((rh - 85.0) / 10.0) * ((87.0 - t) / 5.0);\n else\n tAdjust = 0;\n\n // apply the adjustment\n tResult += tAdjust;\n\n // finally, the reference tables have no data above 183 (rounded),\n // so filter out answers that we have no way to vouch for.\n if (tResult >= 183.5)\n return null;\n else\n return tResult;\n}", "function hourGlassEncounter() {\n if (board[shape.i][shape.j] == HOURGLASS) {\n game_time = game_time + 10;\n hour_glass_eaten = true;\n }\n}", "function payMeterDailyTallies() {\n arrCounts = [0, 0, 0, 0, 0, 0, 0]\n\n for (var i = 0; i < dataArray.length; i++) {\n var arr = payMeterDailyTally(i)\n for (var j = 0; j < 7; j++) {\n if (arrCounts[j] == null) {\n k = 0\n }\n else arrCounts[j] += arr[j]\n }\n }\n\n return arrCounts\n\n}", "function calculateAllTotals() {\n\tfor (var i = 0; i < sumSlots.length; i++) {\n\t\tsumStatTotal(sumSlots[i]);\n\t}\n\t\n\tif ($(\"#wep\").find(\".ticks\").val() != \"\") {\n\t\t$(\"#total\").find(\".ticks\").val($(\"#wep\").find(\".ticks\").val());\n\t}\n}", "function totalFooter() {\n var updateFooter = document.getElementById('hourly-totals');\n if (updateFooter) {\n updateFooter.parentNode.removeChild(updateFooter);\n }\n var tableFoot = document.createElement('tfoot');\n tableFoot.setAttribute('id', 'hourly-totals');\n var cookieTable = document.getElementById('cookie-table');\n cookieTable.appendChild(tableFoot);\n var hourlyTotals = document.getElementById('hourly-totals');\n var firstFoot = document.createElement('th');\n firstFoot.textContent = 'Total';\n hourlyTotals.appendChild(firstFoot);\n var grandTotal = 0;\n for (var i = 0; i < eachHour.length; i++) {\n var footerTotals = document.createElement('td');\n footerTotals.textContent = eachHour[i];\n hourlyTotals.appendChild(footerTotals);\n grandTotal += eachHour[i];\n }\n var finalFoot = document.createElement('td');\n finalFoot.textContent = grandTotal;\n tableFoot.appendChild(finalFoot);\n}", "function sumaKolFunc(niz, ajdi)\n{\n\tvar tmp = 0;\n\tfor (var i=0; i<6; ++i)\n\t{\n\t\tif(niz[i] >= 0)\n\t\t\ttmp += niz[i];\n\t\n\t}\n\n\ttmp = (tmp > 59) ? tmp+30 : tmp;\n\n\tdocument.getElementById(ajdi).innerText=tmp;\n\n\tvar i1 = Number(document.getElementById(\"suma1\").innerText);\n\tvar i2 = Number(document.getElementById(\"suma2\").innerText);\n\tvar i3 = Number(document.getElementById(\"suma3\").innerText);\n\tvar i4 = Number(document.getElementById(\"suma4\").innerText);\n\ti1 = i1 + i2 + i3 + i4;\n\tdocument.getElementById(\"suma13\").innerText=i1;\n\n\tvar i1 = Number(document.getElementById(\"suma13\").innerText);\n\tvar i2 = Number(document.getElementById(\"suma14\").innerText);\n\tvar i3 = Number(document.getElementById(\"suma15\").innerText);\n\t\n\ti1 = i1 + i2 + i3;\n\tdocument.getElementById(\"konrez\").innerText=i1;\n}", "function footerRow() {\n let tr = document.createElement('tr');\n table.appendChild(tr);\n let th = document.createElement('th');\n tr.appendChild(th);\n th.textContent = 'Total';\n\n /*\n let thTotal = document.createElement('th');\n tr.appendChild(thTotal)\n thTotal.textContent='Totals';\n */\n\n let sum;\n let megaTotal = 0;\n for (let i = 0; i < hourWork.length; i++) {\n sum = 0;\n\n for (let j = 0; j < arr.length; j++) {\n\n sum = sum + arr[j].arrcookiesPerHour[i];\n\n }\n\n megaTotal = megaTotal + sum;\n th = document.createElement('th');\n tr.appendChild(th);\n th.textContent = sum;\n }\n let Ttotal = document.createElement('th');\n tr.appendChild(Ttotal);\n Ttotal.textContent = megaTotal;\n\n\n}", "function createFooter() {\n\n let trfooEl =document.createElement('tr');\n let tdEl=document.createElement('td');\n tdEl.textContent = 'Totals';\n trfooEl.appendChild(tdEl);\n tableEl.appendChild(trfooEl);\n let megaTotal = 0;\n\n for (let h=0 ; h < openhours.length ; h++ ) {\n\n let tdEl=document.createElement('td');\n let sum=0;\n \n for (let s=0 ; s < locations.length ; s++){\n\n\n sum = sum + locations[s].cookiesinhour[h];\n\n }\n megaTotal += sum;\n tdEl.textContent = sum;\n trfooEl.appendChild(tdEl);\n\n }\n let totalTdEl = document.createElement('td');\n totalTdEl.textContent = megaTotal;\n trfooEl.appendChild(totalTdEl);\n }", "function countHours(index){\n if(mostActiveHours[index].hasOwnProperty([hour])){\n mostActiveHours[index][hour]++\n } else {\n mostActiveHours[index][hour] = 1\n }\n mostActiveHours[index].total++\n }", "function showHours() {\n var start = 0;\n var idstr = '';\n var hour = 0;\n var meridian = '';\n var calcDay = null;\n var cd = currDate;\n var currDay = new Date(cd.getFullYear(), cd.getMonth(), cd.getDate());\n var viewDiv = null;\n var timeLineWidth = 0;\n var workingHoursBarWidth = 3;\n\n // Subtract one px for border per asinine CSS spec\n var halfHourHeight = (HOUR_UNIT_HEIGHT/2) - 1;\n\n viewDiv = timelineNode;\n timeLineWidth = parseInt(viewDiv.offsetWidth);\n // Subtract 1 for 1px border\n timeLineWidth = timeLineWidth - workingHoursBarWidth - 1;\n\n var str = '';\n var row = '';\n // Timeline of hours on left\n for (var j = 0; j < 24; j++) {\n hour = j == 12 ? _('App.Noon') : cosmo.datetime.util.hrMil2Std(j);\n meridian = j > 11 ? ' PM' : ' AM';\n meridian = j == 12 ? '' : '<span>' + meridian + '</span>';\n row = '';\n\n // Upper half hour\n // ==================\n row += '<div class=\"hourDivTop';\n row += '\" style=\"height:' +\n halfHourHeight + 'px; width:' +\n timeLineWidth + 'px; float:left;\">';\n // Hour plus AM/PM\n row += '<div class=\"hourDivSubLeft\">' + hour +\n meridian + '</div>';\n row += '</div>\\n';\n row += '<br class=\"clearAll\"/>'\n\n idstr = i + '-' + j + '30';\n\n // Lower half hour\n // ==================\n row += '<div class=\"hourDivBottom\"';\n // Make the noon border thicker\n if (j == 11) {\n row += ' style=\"height:' + (halfHourHeight-1) +\n 'px; border-width:2px;';\n }\n else {\n row += ' style=\"height:' + halfHourHeight + 'px;';\n }\n row += ' width:' + timeLineWidth +\n 'px; float:left;\">&nbsp;</div>\\n';\n row += '<br class=\"clearAll\"/>'\n\n str += row;\n }\n viewDiv.innerHTML = str;\n\n str = '';\n viewDiv = hoursNode;\n\n // Do a week's worth of day cols with hours\n for (var i = 0; i < 7; i++) {\n calcDay = cosmo.datetime.Date.add(viewStart, cosmo.datetime.util.dateParts.DAY, i);\n str += '<div class=\"dayDiv\" id=\"dayDiv' + i +\n '\" style=\"left:' + start + 'px; width:' +\n (cosmo.view.cal.canvas.dayUnitWidth-1) +\n 'px;\"';\n str += '>';\n for (var j = 0; j < 24; j++) {\n idstr = i + '-' + j + '00';\n row = '';\n row += '<div id=\"hourDiv' + idstr + '\" class=\"hourDivTop\" style=\"height:' + halfHourHeight + 'px;\">';\n row += '</div>\\n';\n idstr = i + '-' + j + '30';\n row += '<div id=\"hourDiv' + idstr + '\" class=\"hourDivBottom\" style=\"';\n if (j == 11) {\n row += 'height:' + (halfHourHeight-1) +\n 'px; border-width:2px;';\n }\n else {\n row += 'height:' + halfHourHeight + 'px;';\n }\n row += '\">&nbsp;</div>';\n str += row;\n }\n str += '</div>\\n';\n start += cosmo.view.cal.canvas.dayUnitWidth;\n }\n\n viewDiv.innerHTML = str;\n return true;\n }", "allDataHoursSummary(data) {\n let uniqueTypeNames = this.getUniqueNames(data)\n let allSummaryObject = []\n\n for (var j = 0; j < uniqueTypeNames.length; j++) {\n let hoursSubTotal = 0\n for (var i = 0; i < data.length; i++) {\n\n if (data[i].type === uniqueTypeNames[j]) {\n hoursSubTotal += parseInt(data[i].hours, 10)\n }\n if (i === data.length - 1) {\n let typeName = uniqueTypeNames[j]\n allSummaryObject.push({\n x: typeName, y: hoursSubTotal\n })\n }\n }\n }\n return allSummaryObject\n }", "function updateRectData(hour) {\n _.each(tweetData, function(t,idx) {\n var tweetHour = diffTopOfHour(moment(t.created_at), earliestTweetDate);\n if (tweetHour > hour) {\n //nothing to do\n return;\n }\n\n var count = t.hourlyRetweetCount[hour - tweetHour] || 0;\n if (tweetHour < hour) {\n // Tweet has happened.\n if (count > 0) {\n cumulativeRetweetCount[t.id] += count;\n rectData.push({ \"tweet\" : t, \"startHour\" : hour, \"tweetIndex\": idx, \"retweetCount\": cumulativeRetweetCount[t.id] });\n }\n }\n\n if (tweetHour == hour) {\n cumulativeRetweetCount[t.id] = count;\n // Tweet happened this hour.\n rectData.push({ \"tweet\" : t, \"startHour\" : hour, \"tweetIndex\": idx , \"retweetCount\": count });\n }\n });\n }", "function hourlyFunction() {\naddNewLineChartFunction('hourlyId', 'hourly', hourlyData, ctLine, 'line' );\naddNewBarChartFunction('hourlyId', 'hourly', hourlyData, ctBar, 'bar' );\naddNewDoughnutChartFunction('hourlyId', 'hourly', hourlyDataDoughnut, ctDoughnut, 'doughnut' );\n}", "between(start, end){\n\n //Initialize our usage variable\n let total = 0;\n\n //Go through every hour between the times specified\n for(let i=start+1; i<=end; i++) {\n\n //If we have a record for this hour\n if(this.hours[i] !== undefined) {\n\n //Add the usage to our running total\n total += this.hours[i];\n }\n\n }\n\n //Return the total amount of power used during the specified time frame\n return total;\n }", "function Hourglass() {\n\t\tthis.timerbodies = [];\n\t\tthis.timers = [];\n\t}" ]
[ "0.73884106", "0.7219805", "0.7212039", "0.70581204", "0.6989196", "0.6941539", "0.69231576", "0.68983644", "0.68602854", "0.6853072", "0.684322", "0.6836446", "0.681284", "0.67920554", "0.6745531", "0.6712606", "0.6646706", "0.6636153", "0.65583897", "0.65434927", "0.6531547", "0.6530943", "0.6516895", "0.6465047", "0.6450469", "0.6272899", "0.62669873", "0.62669873", "0.6265736", "0.62608856", "0.61897635", "0.61829215", "0.60536957", "0.5952582", "0.5914925", "0.57947886", "0.57696944", "0.57604563", "0.5732791", "0.57285464", "0.5709319", "0.5642327", "0.56272703", "0.5597233", "0.5586595", "0.55238885", "0.55164033", "0.5514148", "0.5514148", "0.551088", "0.55021757", "0.54662496", "0.5465691", "0.5455221", "0.5453669", "0.54511607", "0.54510814", "0.544166", "0.5418326", "0.5410708", "0.54091024", "0.540648", "0.54064333", "0.539181", "0.5375192", "0.53696334", "0.5366423", "0.53512096", "0.5333055", "0.53276485", "0.53229773", "0.53084", "0.53079456", "0.52686363", "0.5265997", "0.5263318", "0.52560246", "0.5237425", "0.523084", "0.5203231", "0.5201754", "0.5199838", "0.5199838", "0.5193214", "0.51922107", "0.5180453", "0.5176658", "0.517658", "0.5173336", "0.51731724", "0.5165062", "0.51607245", "0.51601493", "0.5159573", "0.5158799", "0.51476187", "0.5142647", "0.5139238", "0.5135027", "0.51274365" ]
0.6380032
25
Utils a function to convert from miles/kilometers/feet to meters
function normalize(value, units) { switch(units) { case "mi": return value * 1609; case "km": return value * 1000; case "ft": return value / 3.281; case "m": return value; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function metersToMiles(meters) {\n return meters / 1609.344;\n }", "function milesToMeters(miles) {\n return miles * 1069.344;\n}", "function milesToMeters(miles) {\n return miles * 1069.344;\n}", "function milesToMeters(miles) {\n return miles * 1069.344;\n}", "function metersToMiles( meters ) {\n\treturn Math.round( ( meters * 0.000621371 ) * 100 ) / 100;\n}", "function convertMeters(meters, units) {\n\t\t\tif (units == UNITS_MI)\n\t\t\t\treturn meters/1609.34;\n\t\t\treturn meters/1000; //return KM\n\t\t}", "function convertToKilometers(miles) {\n return miles * 1.60934\n}", "function convertMeters(meters) {\n let feet = meters * 3.2804;\n feet = Math.round(feet);\n return feet;\n}", "function kilometersToMiles(kilometers) {\n\tvar miles = kilometers * 0.621371;\n\treturn miles;\n}", "function metersToMiles(meters, decimals) {\n\n //Use basic function\n return metersToSomething(meters, decimals, 'mi');\n }", "function tfnewGetMeters( miles ) {\n\n return miles * 1609.344;\n\n}", "function metersToMilesFixed(meters) {\n var num = meters * 0.00062137;\n return num.toFixed(1);\n }", "function kmToMiles(km){\n miles = km*0.621371;\n return miles;\n}", "function kilometersToMiles(km) {\n\tmiles = km / 1.609;\n\tmessage = km + ' kilometers is ' + miles + ' miles.'\n\treturn message;\n}", "function metersToInches(meters){\n return (meters * 39.3701);\n}", "function metersToInches(meters) {\n return meters * 39.3701;\n}", "function millimetersToInchToFeetToYardsToMilesToCentimetersToMetersToKilometers() {\n const millimetersLength = parseFloat(millimetersInput.value);\n const inchLength = millimetersLength / 25.4;\n const feetLength = millimetersLength / 304.8;\n const yardsLength = millimetersLength / 914.4;\n const milesLength = millimetersLength / 1.609e+6;\n const centimetersLength = millimetersLength / 10;\n const metersLength = millimetersLength / 1000;\n const kilometersLength = millimetersLength / 1e+6;\n inchInput.value = roundNum(inchLength);\n feetInput.value = roundNum(feetLength);\n yardsInput.value = roundNum(yardsLength);\n milesLength.value = roundNum(milesLength);\n centimetersInput.value = roundNum(centimetersLength);\n metersInput.value = roundNum(metersLength);\n kilometersInput.value = roundNum(kilometersLength);\n}", "function kilometersToMiles(distance) {\n return distance * 0.62;\n}", "function distanceToMiles(distance) {\r\n\tswitch(distance) {\r\n\t\tcase \"miles\":\r\n\t\t\treturn 1.00;\r\n\t\tcase \"km\":\r\n\t\t\treturn 0.621371;\r\n\t\tcase \"m\":\r\n\t\t\treturn 0.000621371;\r\n\t\tcase \"yds\":\r\n\t\t\treturn 0.000568182;\r\n\t\tdefault:\r\n\t\t\treturn \"\";\r\n\t}\r\n}", "function kmToMiles(km) {\n return km * 0.62137;\n }", "function kilometerToMeter(km){\n var meter = km * 1000;\n return meter;\n}", "function convertToMeters(number, metric) {\n let inMeters = 0;\n switch (metric) {\n case 'km': inMeters = number * 1000; break;\n case 'm': inMeters = number * 1; break;\n case 'cm': inMeters = number * 0.01; break;\n case 'mm': inMeters = number * 0.001; break;\n case 'mi': inMeters = number * 1609.34; break;\n case 'yrd': inMeters = number * 0.9144; break;\n case 'ft': inMeters = number * 0.3048; break;\n case 'in': inMeters = number * 0.0254; break;\n }\n return inMeters;\n }", "function kilometerToMeter(km) \n{\n var meter =km*1000; \n return meter;\n}", "function distanceConversion(meters) {\n return Math.round((meters * 0.000621371) * 10) / 10;\n}", "function metersToFeet(meters, decimals) {\n\n //Use basic function\n return metersToSomething(meters, decimals, 'ft');\n }", "function getMiles (distanceInMeters) {\n return (distanceInMeters*0.000621371192).toFixed(1)\n}", "function paceToMiles(distance) {\r\n\tswitch(distance) {\r\n\t\tcase \"mile\":\r\n\t\t\treturn 1.00;\r\n\t\tcase \"km\":\r\n\t\t\treturn 0.621371;\r\n\t\tcase \"220\":\r\n\t\t\treturn 0.125;\r\n\t\tcase \"440\":\r\n\t\t\treturn 0.25;\r\n\t\tcase \"880\":\r\n\t\t\treturn 0.50;\r\n\t\tcase \"200\":\r\n\t\t\treturn 0.124274;\r\n\t\tcase \"400\":\r\n\t\t\treturn 0.248548;\r\n\t\tcase \"800\":\r\n\t\t\treturn 0.497097;\r\n\t\tcase \"1500\":\r\n\t\t\treturn 0.932057;\r\n\t\tdefault:\r\n\t\t\treturn \"\";\r\n\t}\r\n}", "function kilometerToMeter(kiloMeter){\n return kiloMeter * 1000;\n}", "function convertMetersPerSec (milesPerHour) {\n return (milesPerHour * (1397/3125)).toFixed(2);\n} // end convertMetersPerSec()", "function meterstoFeet(meters) {\n //calculate meters to feet\n let f = meters * 0.3048;\n console.log(f);\n // round to nearest integer\n f = Math.floor(f);\n return f;\n}", "function convertCentimetersToMeters(centimeters) {\n var meters = centimeters / 100;\n return meters;\n}", "function metersToInches(meterNum){\n return `${meterNum*39.3701} in.`;\n}", "function metersToInches(meters, decimals) {\n\n //Use basic function\n return metersToSomething(meters, decimals, 'in');\n }", "function convertMilesPerHour (metersPerSec) {\n return (metersPerSec * (3125/1397)).toFixed(2);\n} // end convertMilesPerHour()", "function kilometerToMeter(meter){\n var kilometer = meter*1000;\n return kilometer;\n}", "function meters(km) {\n\treturn km * 1000;\n}", "function convertDistance(miles, units, invert = false) {\n miles = parseFloat(miles);\n let distance = miles;\n switch (units) {\n case 'Car/ Light Van':\n distance = miles ;\n break;\n case 'Medium Van':\n distance = miles;\n break;\n case 'Large Van':\n distance = miles;\n break;\n default:\n }\n return distance.toFixed(2);\n}", "function ConvertKmToMile(km){\n\n return km * 0.621371;\n}", "function formatLengthMiles(meters) {\n var sMeters = meters * 0.621371192;\n var miles = parseInt(sMeters / 1000);\n var commaMiles = parseInt((sMeters - miles * 1000 + 50) / 100);\n var ret = miles + \".\" + commaMiles + \" miles\";\n return(ret);\n}", "function convertDist(meters) {\n var dist = '';\n var km = 1000;\n var kilometers = Math.round((meters / km) * 10) / 10;\n dist = dist.concat(kilometers.toString() + ' km');\n\n return dist;\n}", "function metersToKilometers(meters, decimals) {\n\n //Use basic function\n return metersToSomething(meters, decimals, 'km');\n }", "function metersToSeamiles(meters, decimals) {\n\n //Use basic function\n return metersToSomething(meters, decimals, 'sm');\n }", "function kilometerToMeter(meter) {\n var kilometer = meter * 1000;\n return kilometer;\n}", "function kilometerToMeter(kilo) {\n var meter = kilo * 1000;\n return meter;\n}", "function kilometerToMeter(kilometer) {\n var meter = kilometer * 1000;\n return meter\n}", "getMeters(inches) {\n return inches === 'unknown' ? '---' : `${Math.round((parseInt(inches) * .0254) * 100) / 100}<i>m</i>`;\n }", "function convertToMiles (km) {\n console.log(\"This is the Answer to Task 5a ----> \" + km + \" km is equal to \" + km * 0.62137119 + \" miles.\");\n}", "function distanceInMeter() {\n var lat1, lat2, lng1, lng2, e, f, g, h,\n cos = Math.cos,\n sin = Math.sin,\n args = arguments;\n if (args[0] instanceof gm.LatLng) {\n lat1 = args[0].lat();\n lng1 = args[0].lng();\n if (args[1] instanceof gm.LatLng) {\n lat2 = args[1].lat();\n lng2 = args[1].lng();\n } else {\n lat2 = args[1];\n lng2 = args[2];\n }\n } else {\n lat1 = args[0];\n lng1 = args[1];\n if (args[2] instanceof gm.LatLng) {\n lat2 = args[2].lat();\n lng2 = args[2].lng();\n } else {\n lat2 = args[2];\n lng2 = args[3];\n }\n }\n e = Math.PI * lat1 / 180;\n f = Math.PI * lng1 / 180;\n g = Math.PI * lat2 / 180;\n h = Math.PI * lng2 / 180;\n return 1000 * 6371 * Math.acos(Math.min(cos(e) * cos(g) * cos(f) * cos(h) + cos(e) * sin(f) * cos(g) * sin(h) + sin(e) * sin(g), 1));\n }", "function distanceInMeter() {\n var lat1, lat2, lng1, lng2, e, f, g, h,\n cos = Math.cos,\n sin = Math.sin,\n args = arguments;\n if (args[0] instanceof gm.LatLng) {\n lat1 = args[0].lat();\n lng1 = args[0].lng();\n if (args[1] instanceof gm.LatLng) {\n lat2 = args[1].lat();\n lng2 = args[1].lng();\n } else {\n lat2 = args[1];\n lng2 = args[2];\n }\n } else {\n lat1 = args[0];\n lng1 = args[1];\n if (args[2] instanceof gm.LatLng) {\n lat2 = args[2].lat();\n lng2 = args[2].lng();\n } else {\n lat2 = args[2];\n lng2 = args[3];\n }\n }\n e = Math.PI * lat1 / 180;\n f = Math.PI * lng1 / 180;\n g = Math.PI * lat2 / 180;\n h = Math.PI * lng2 / 180;\n return 1000 * 6371 * Math.acos(Math.min(cos(e) * cos(g) * cos(f) * cos(h) + cos(e) * sin(f) * cos(g) * sin(h) + sin(e) * sin(g), 1));\n }", "function distanceInMeter() {\n var lat1, lat2, lng1, lng2, e, f, g, h,\n cos = Math.cos,\n sin = Math.sin,\n args = arguments;\n if (args[0] instanceof gm.LatLng) {\n lat1 = args[0].lat();\n lng1 = args[0].lng();\n if (args[1] instanceof gm.LatLng) {\n lat2 = args[1].lat();\n lng2 = args[1].lng();\n } else {\n lat2 = args[1];\n lng2 = args[2];\n }\n } else {\n lat1 = args[0];\n lng1 = args[1];\n if (args[2] instanceof gm.LatLng) {\n lat2 = args[2].lat();\n lng2 = args[2].lng();\n } else {\n lat2 = args[2];\n lng2 = args[3];\n }\n }\n e = Math.PI * lat1 / 180;\n f = Math.PI * lng1 / 180;\n g = Math.PI * lat2 / 180;\n h = Math.PI * lng2 / 180;\n return 1000 * 6371 * Math.acos(Math.min(cos(e) * cos(g) * cos(f) * cos(h) + cos(e) * sin(f) * cos(g) * sin(h) + sin(e) * sin(g), 1));\n }", "function kilomeerToMeter(kilometer){\n var meter = kilometer * 1000;\n return meter;\n}", "function kilometerToMeter(kilometer){\n if(kilometer > 0){\n // 1 km = 1000 m\n var meter = kilometer * 1000;\n return meter;\n }else{\n return \"Distance cannot be negative!\";\n }\n}", "function latToMeters(dLat) {\n\t return dLat * 110946.257617;\n\t}", "function kilometerToMeter(distanceInKilometer) {\n if (distanceInKilometer < 0) {\n return \"Not accessable! You must input a positive number.\";\n }\n var distanceInMeter = distanceInKilometer * 1000; // 1 km = 1000 m.\n return distanceInMeter;\n}", "function converter(mpg) {\n const perLitre = mpg / 4.54609188\n const kilometers = (perLitre * 1.609344).toFixed(2)\n return parseFloat(kilometers)\n}", "function distanceMeter(km)\n {\n var meters=km*1000;\n return meters;\n\n }", "function changeToMiles(place) {\n var distance = place.distance;\n distance = distance / 1609.34;\n var integer = Math.floor(distance);\n var decimal = distance - integer;\n if (decimal <= 0.5) {\n distance = Math.floor(distance);\n } else {\n distance = Math.ceil(distance);\n }\n place.distance = distance;\n}", "function centimeterToMeter(centimeter) {\n const meter = centimeter / 100;\n return meter;\n}", "function kilometerToMeter(kilometer) {\n if (kilometer < 0) {\n return \"Distance cannot be negative\";\n }\n var meter = kilometer * 1000;\n return meter;\n}", "function toMm(val) {\n if (val === undefined) {\n return undefined;\n }\n var unit = val.substring(val.length - 2);\n var value = stripUnit(val);\n if (unit === \"cm\") {\n return value * 10;\n } else if (unit === \"in\") {\n return value * 25.4;\n } else if (unit === \"pt\" || unit === \"px\") {\n return value * 25.4 / 72;\n } else if (unit === \"pc\") {\n return value * 25.4 / 72 * 12;\n } else if (unit === \"mm\") {\n return value;\n } else {\n return undefined;\n }\n\n function stripUnit(val) {\n return new Number(val.substring(0, val.length - 2));\n}\n\n}", "function kilometerToMeter(num) {\n // to get positive number.\n if (num < 0) { \n return (\"distance cannot be negative.\");\n }\n // 1 kilometer=1000 meter;\n return num * 1000; \n\n}", "function kilometerToMeter(kilometer) {\n if (kilometer < 0) {\n return \"Distance can not be Negative\";\n }\n // 1 kilometer = 1000 meter\n\n\n var meter = 1000 * kilometer;\n\n return meter;\n\n}", "function eventsToMiles(distance) {\r\n\tswitch(distance) {\r\n\t\tcase \"marathon\":\r\n\t\t\treturn 26.2188;\r\n\t\tcase \"halfMarathon\":\r\n\t\t\treturn 13.1094;\r\n\t\tcase \"5k\":\r\n\t\t\treturn 3.10686;\r\n\t\tcase \"8k\":\r\n\t\t\treturn 4.97097;\r\n\t\tcase \"10k\":\r\n\t\t\treturn 6.21371;\r\n\t\tcase \"15k\":\r\n\t\t\treturn 9.32057;\r\n\t\tcase \"20k\":\r\n\t\t\treturn 12.4274;\r\n\t\tcase \"25k\":\r\n\t\t\treturn 15.5343;\r\n\t\tcase \"50k\":\r\n\t\t\treturn 31.0686;\r\n\t\tcase \"100k\":\r\n\t\t\treturn 62.1371;\r\n\t\tcase \"5m\":\r\n\t\t\treturn 5.00;\r\n\t\tcase \"10m\":\r\n\t\t\treturn 10.00;\r\n\t\tcase \"15m\":\r\n\t\t\treturn 15.00;\r\n\t\tcase \"20m\":\r\n\t\t\treturn 20.00;\r\n\t\tcase \"50m\":\r\n\t\t\treturn 50.00;\r\n\t\tcase \"100m\":\r\n\t\t\treturn 100.00;\r\n\t\tdefault:\r\n\t\t\treturn;\r\n\t}\r\n}", "function feetToMile(feet){\n const invalidMassege = \"Please input valid number.\";\n const validOutput = `${(feet/5280).toFixed(2)} miles`;\n // use conditional ternary operator \n return (feet <= 0)? invalidMassege : validOutput;\n }", "function centimeterToMetre(cm) {\n const meter = cm / 100;\n return meter;\n}", "function getMetertFromMile(mile) {\nreturn mile * 1609.34;\n}", "function getDistanceInMiles(p1, p2) {\n return kilometersToMiles(getDistanceInKilometers(p1, p2));\n}", "function toFeet(meter) {\n return meter * 3.28;\n }", "function lonToMeters(dLon, atLat) {\n\t return Math.abs(atLat) >= 90 ? 0 :\n\t dLon * 111319.490793 * Math.abs(Math.cos(atLat * (Math.PI/180)));\n\t}", "function kilometerToMeter(kilometer) {\n let meter = 1000 * kilometer;\n return meter;\n}", "function getDistance(unit) {\n if (unit === undefined) unit = \"meters\";\n\n if (unit === \"miles\") return util.math.metersToMiles(getProperty(\"distance\"));\n else if (unit === \"feet\") return util.math.metersToFeet(getProperty(\"distance\"));\n else if (unit === \"kilometers\") return util.math.metersToKilometers(getProperty(\"distance\"));\n else if (unit === \"meters\") return getProperty(\"distance\");\n else {\n console.error(\"Unit must be miles, feet, kilometers, or meters. Given: \" + unit);\n return getProperty(\"distance\");\n }\n }", "function kilometerToMeter(kilometer) {\n var meter = kilometer*1000;\n if ( kilometer < 0 ){\n return \"Distance cannot be negative\";\n } else{\n return meter;\n }\n}", "function toMilesPerHour(knots) {\r\n var speedInMilesPerHour = Math.round(knots * 1.15077945); //1 Knot = 1.15077945 mph\r\n return speedInMilesPerHour + ' mph';\r\n }", "function feetToMetre(feet) {\r\n\tvar m = parseFloat(feet / 3.281);\r\n\r\n\tif (isNaN(m)) {\r\n\t\tconsole.log(\"Error: non numeric metre calculated for \" + feet + \" feet. Calculated value = \" + m);\r\n\t\treturn null;\r\n\t} else {\r\n\t\treturn m;\r\n\t}\r\n}", "function milesToLngDegrees(miles, lat) {\n return miles / calculateMilesPerDegreeLng(lat);\n }", "function feetToMile(feet){\n\n if(feet < 0){\n console.log(\"Invalid! feet cannot be a negative number.\");\n }\n else{\n var mile = feet * 0.000189394; // 1 feet = 0.000189394 mile.\n return mile;\n }\n}", "function getMiles(i) {\n let n = i*0.000621371192;\n return Math.round( n * 100 ) / 100;\n}", "function kilometerToMeter(kilometer) {\n if (kilometer < 0) {\n return \"Distance Cannot be Negative\"; // error massage, if input is negative\n }\n var meter = 1000 * kilometer;\n return meter;\n}", "function metersToPixels(meters){\n\tvar ret = (meters/metersPerPixel)+400;\n\treturn ret;\n}", "function feetToCm(feet){\n let cm = 0;\n feet = cm*30.48;\n return feet;\n}", "function formatDistance (meters) {\n var miles = (meters * 0.000621371192);\n\n return decFixed(miles, 1);\n }", "function kilometerToMeter(kilometer){\n var meter = kilometer * 1000;\n if(kilometer<0){\n return \"Distance can not be negative\"\n }\n\n return meter;\n }", "function metersToSomething(meters, decimal, targetUnit) {\n\n //Arguments validation\n if (typeof meters === 'undefined' || meters === null)\n throw new Error(\"Argument 'meters' is invalid\");\n if (!targetUnit)\n throw new Error(\"Argument 'targetUnit' is invalid\");\n\n //Check if is a number\n if (isNaN(meters))\n throw new Error(\"Provided meters value should be number\");\n\n //Check if value is greater equals o\n if (meters < 0)\n throw new Error(\"Provided meters value cannot be lower then 0\");\n\n //If equals 0, just return 0\n if (meters === 0)\n return 0;\n\n //Use geolib to do convert\n return geolib.convertUnit(targetUnit, meters, decimal);\n }", "function kilometerToMeter(kilo){\n\n if(kilo<0 ){\n return \"invalid input\";\n }\n \n else{\n var meter = kilo*1000; // 1 kilometer = 1000 meter\n \n return meter;\n }\n}", "function kilometerToMeter(kilometer){\n if(kilometer == (null || undefined) || kilometer < 0){\n return \"negative or undefined\";\n }\n var meter = kilometer*1000; // 1 kilometer = 1000 meter.\n return meter;\n}", "function kilometerToMeter(kmUnit) {\n \n var meter = kmUnit * 1000;\n\n if (kmUnit > 0) {\n return meter;\n }\n else {\n return \"Length cannot be Negative\";\n }\n}", "function kilometerToMeter(meter){\n if(meter<0){\n return (\"This is a nagetive Value\")\n }\n else{\n var kilometer = meter*1000;\n return kilometer;\n }\n}", "function kilometerToMeter(km) {\n\n // Validating Input\n /* \n if (typeof(km) == \"undefined\") { // Check wheathe the value is empty\n return \" Your input value can not be empty!\";\n } else */\n if (typeof (km) != 'number') { // Check if it's a Number\n\n return \"Please provide a valid Number!\";\n\n } else if (km < 0) { // Check if it's not a Negative Number\n\n return km + \" is not a Positive Number!\";\n\n } else { // calculating the meter\n\n // 1 kilometre = 1000 meter\n var meter = km * 1000;\n\n // returns the result\n return meter;\n }\n}", "function kilometerToMeter(kilometer) {\n if (typeof kilometer == 'string' || kilometer < 0) {\n return 'Distance cant be negative.Please input a positive number.';\n } \n else {\n var meter = kilometer * 1000;\n return meter;\n }\n}", "function metersToLat(m) {\n\t return m / 110946.257617;\n\t}", "function kilometerToMeter(kilometer) {\n if (kilometer > 0) {\n //checking input whether it is valid or not\n\n var meter = kilometer * 1000; //convert kilometer to meter.\n return meter;\n } else {\n return 'Invalid input';\n }\n}", "function heightconverter(feet, inch) {\n let Meters = feet * 0.3048 + inch\n * 0.0254;\n Meters = Meters.toFixed(2);\n return Meters;\n}", "function milesToLatDegrees(miles) {\n const MILES_IN_ONE_DEGREE_LAT_AT_EQUATOR = 69.0;\n return miles / MILES_IN_ONE_DEGREE_LAT_AT_EQUATOR;\n }", "function meterToFeet(meter){\n\tvar feetLen = meter * 3.28084\n\treturn feetLen.toFixed(2)\n}", "function kilometerToMeter(kiloMeterUnit) {\n if (kiloMeterUnit > 0) {\n var meterUnit = kiloMeterUnit*1000;\n return meterUnit;\n\n\n }\n else {\n return \"The meter unit value can not be negative\";\n }\n}", "function kilometerToMeter(km) {\n var meter;\n if (km <= 0) {\n var msg = 'Input Error! Please enter a valid number (greater than 0).';\n return msg;\n } else {\n meter = km * 1000;\n return meter;\n }\n}", "function distanceInMeter(lat1, lon1, lat2, lon2) {\n\tvar R = 6371;\n\tvar dLat = (lat2-lat1) * Math.PI / 180;\n\tvar dLon = (lon2-lon1) * Math.PI / 180;\n\tvar a = Math.sin(dLat/2) * Math.sin(dLat/2) +\n\t\tMath.cos(lat1 * Math.PI / 180 ) * Math.cos(lat2 * Math.PI / 180 ) *\n\t\tMath.sin(dLon/2) * Math.sin(dLon/2);\n\tvar c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\n\tvar d = R * c;\n\treturn d * 1000;\n}", "function calculateMilesPerDegreeLng(lat) {\n const latRadians = degreesToRadians(lat);\n return Math.cos(latRadians) * MILES_IN_ONE_DEGREE_LAT_AT_EQUATOR;\n }", "function kilometerToMeter(km) {\n let numToMeter = km * 1000;\n if (km < 0) {\n console.log(\"Error Input!\");\n }\n else {\n return numToMeter;\n }\n\n}", "function KilToMet(distance) {\n return new Distance(distance.length * 1000);\n}" ]
[ "0.8397667", "0.835207", "0.835207", "0.835207", "0.808114", "0.8035501", "0.8033715", "0.79948246", "0.7928369", "0.781191", "0.7796408", "0.77754235", "0.77565444", "0.77528155", "0.7701453", "0.7595433", "0.7583631", "0.75721693", "0.7423896", "0.7411904", "0.73843", "0.7352694", "0.7332746", "0.7304332", "0.72907585", "0.7271143", "0.7271041", "0.72640973", "0.72395957", "0.7237138", "0.7234954", "0.7231303", "0.7222074", "0.72164196", "0.7165533", "0.71618724", "0.7135734", "0.7127582", "0.7102903", "0.70752525", "0.7046599", "0.70452327", "0.7021928", "0.7002003", "0.698706", "0.698111", "0.69748425", "0.69519186", "0.69519186", "0.69519186", "0.6938114", "0.69340295", "0.69268125", "0.6917628", "0.6910933", "0.690245", "0.6884144", "0.6882387", "0.6861919", "0.6827498", "0.68219644", "0.6804613", "0.6797469", "0.6789449", "0.6777401", "0.67765725", "0.6770317", "0.6765204", "0.6764825", "0.6744758", "0.67430925", "0.6736608", "0.6707134", "0.6703926", "0.67004836", "0.66911346", "0.66519535", "0.6647727", "0.66475487", "0.6643588", "0.66304886", "0.6626399", "0.66243136", "0.6604665", "0.6599559", "0.65710306", "0.6568502", "0.65586364", "0.6541674", "0.65312934", "0.65287083", "0.6484315", "0.6473171", "0.6472138", "0.6456753", "0.6436174", "0.6425249", "0.6392874", "0.63753676", "0.6372986" ]
0.66281724
81
Adapted from convertsourcemap (MIT)
function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; return '/*# ' + data + ' */'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extractSourceMap(fs, logger, file) {\n var inline = convert_source_map_1.commentRegex.test(file.text);\n var external = convert_source_map_1.mapFileCommentRegex.exec(file.text);\n if (inline) {\n var inlineSourceMap = convert_source_map_1.fromSource(file.text);\n return {\n source: convert_source_map_1.removeComments(file.text).replace(/\\n\\n$/, '\\n'),\n map: inlineSourceMap,\n isInline: true,\n };\n }\n else if (external) {\n var externalSourceMap = null;\n try {\n var fileName = external[1] || external[2];\n var filePath = file_system_1.resolve(file_system_1.dirname(file_system_1.absoluteFromSourceFile(file)), fileName);\n var mappingFile = fs.readFile(filePath);\n externalSourceMap = convert_source_map_1.fromJSON(mappingFile);\n }\n catch (e) {\n if (e.code === 'ENOENT') {\n logger.warn(\"The external map file specified in the source code comment \\\"\" + e.path + \"\\\" was not found on the file system.\");\n var mapPath = file_system_1.absoluteFrom(file.fileName + '.map');\n if (file_system_1.basename(e.path) !== file_system_1.basename(mapPath) && fs.exists(mapPath) &&\n fs.stat(mapPath).isFile()) {\n logger.warn(\"Guessing the map file name from the source file name: \\\"\" + file_system_1.basename(mapPath) + \"\\\"\");\n try {\n externalSourceMap = convert_source_map_1.fromObject(JSON.parse(fs.readFile(mapPath)));\n }\n catch (e) {\n logger.error(e);\n }\n }\n }\n }\n return {\n source: convert_source_map_1.removeMapFileComments(file.text).replace(/\\n\\n$/, '\\n'),\n map: externalSourceMap,\n isInline: false,\n };\n }\n else {\n return { source: file.text, map: null, isInline: false };\n }\n }", "function computeSourceMap(\n code,\n filePath,\n {compiledFilename},\n) {\n let mappings = \"AAAA\";\n for (let i = 0; i < code.length; i++) {\n if (code.charCodeAt(i) === charCodes.lineFeed) {\n mappings += \";AACA\";\n }\n }\n return {\n version: 3,\n file: compiledFilename || \"\",\n sources: [filePath],\n mappings,\n names: [],\n };\n}", "_generateSourceMap(baseDir, code, units){\n const sections = [];\n for (let unit of Array.from(units)) {\n const unitDir = path.dirname(unit.fpath);\n if (unit.sm) {\n // TODO: should support http, https, etc...\n var i, s, sm, sp;\n const url = path.resolve(unitDir, unit.sm.url);\n try {\n sm = JSON.parse(fs.readFileSync(url));\n } catch (e) {\n log(`Skipped invalid source map file ${path.relative(baseDir,url)}`);\n continue;\n }\n\n // if sm itself consists of concatenated sections, merge them\n if (sm.sections) {\n const iterable = sm.sections || [];\n for (i = 0; i < iterable.length; i++) {\n const sec = iterable[i];\n sec.offset.line += unit.smline;\n for (i = 0; i < sec.map.sources.length; i++) {\n s = sec.map.sources[i];\n sp = path.resolve(unitDir, s);\n sec.map.sources[i] = path.relative(baseDir, sp);\n }\n }\n sections.push(...Array.from(sm.sections || []));\n } else {\n // concatenate sources into sections, with path resolved\n for (i = 0; i < sm.sources.length; i++) {\n s = sm.sources[i];\n sp = path.resolve(unitDir, s);\n sm.sources[i] = path.relative(baseDir, sp);\n }\n sections.push({\n offset: {line : unit.smline, column : 0},\n map : sm\n });\n }\n } else { // js file has no matching source map file, generate it\n var line;\n const { SourceMapGenerator } = sourceMap;\n const srcfile = path.relative(baseDir, unit.fpath);\n const map = new SourceMapGenerator({file:srcfile});\n const lc = fuse._lc(unit.src);\n if (lc > 0) {\n for (line = 1, end = lc, asc = 1 <= end; asc ? line <= end : line >= end; asc ? line++ : line--) { // 1 to 1 mapping for each line\n var asc, end;\n map.addMapping({\n source: srcfile,\n original : {line, column:0},\n generated : {line, column:0}\n });\n }\n }\n sections.push({\n offset: {line: unit.smline, column: 0},\n map: map.toJSON()\n });\n }\n }\n return sections.length === 0 ? null : {\n version : 3,\n file : '',\n sections\n };\n }", "function SourceMap(){\n this.lines = [];\n }", "_parseMappings(aStr, aSourceRoot) {\n const generatedMappings = (this.__generatedMappingsUnsorted = [])\n const originalMappings = (this.__originalMappingsUnsorted = [])\n for (let i = 0; i < this._sections.length; i++) {\n const section = this._sections[i]\n\n const sectionMappings = []\n section.consumer.eachMapping((m) => sectionMappings.push(m))\n\n for (let j = 0; j < sectionMappings.length; j++) {\n const mapping = sectionMappings[j]\n\n // TODO: test if null is correct here. The original code used\n // `source`, which would actually have gotten used as null because\n // var's get hoisted.\n // See: https://github.com/mozilla/source-map/issues/333\n let source = util.computeSourceURL(\n section.consumer.sourceRoot,\n null,\n this._sourceMapURL\n )\n this._sources.add(source)\n source = this._sources.indexOf(source)\n\n let name = null\n if (mapping.name) {\n this._names.add(mapping.name)\n name = this._names.indexOf(mapping.name)\n }\n\n // The mappings coming from the consumer for the section have\n // generated positions relative to the start of the section, so we\n // need to offset them to be relative to the start of the concatenated\n // generated file.\n const adjustedMapping = {\n source,\n generatedLine:\n mapping.generatedLine + (section.generatedOffset.generatedLine - 1),\n generatedColumn:\n mapping.generatedColumn +\n (section.generatedOffset.generatedLine === mapping.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name,\n }\n\n generatedMappings.push(adjustedMapping)\n if (typeof adjustedMapping.originalLine === 'number') {\n originalMappings.push(adjustedMapping)\n }\n }\n }\n }", "function w(e,t){if(!he)\n// with no source maps, generated is either an\n// array or a string. if an array, flatten it.\n// if a string, just return it\n// with no source maps, generated is either an\n// array or a string. if an array, flatten it.\n// if a string, just return it\nreturn Q(e)?y(e):e;if(null==t){if(e instanceof $)return e;t={}}return null==t.loc?new $(null,null,he,e,t.name||null):new $(t.loc.start.line,t.loc.start.column,he===!0?t.loc.source||null:he,e,t.name||null)}", "function updateSourceMap(sourceMapText, fileName) {\n var sourceMap = JSON.parse(sourceMapText);\n sourceMap.file = fileName;\n sourceMap.sources = [fileName];\n delete sourceMap.sourceRoot;\n return JSON.stringify(sourceMap);\n}", "function renderSourceAndMap(sourceFile, input, output) {\n var outputPath = file_system_1.absoluteFromSourceFile(sourceFile);\n var outputMapPath = file_system_1.absoluteFrom(outputPath + \".map\");\n var relativeSourcePath = file_system_1.basename(outputPath);\n var relativeMapPath = relativeSourcePath + \".map\";\n var outputMap = output.generateMap({\n source: outputPath,\n includeContent: true,\n });\n // we must set this after generation as magic string does \"manipulation\" on the path\n outputMap.file = relativeSourcePath;\n var mergedMap = mergeSourceMaps(input.map && input.map.toObject(), JSON.parse(outputMap.toString()));\n var result = [];\n if (input.isInline) {\n result.push({ path: outputPath, contents: output.toString() + \"\\n\" + mergedMap.toComment() });\n }\n else {\n result.push({\n path: outputPath,\n contents: output.toString() + \"\\n\" + convert_source_map_1.generateMapFileComment(relativeMapPath)\n });\n result.push({ path: outputMapPath, contents: mergedMap.toJSON() });\n }\n return result;\n }", "findSourceMapUrl(contents) {\n const lines = contents.split('\\n');\n for (let l = lines.length - 1; l >= Math.max(lines.length - 10, 0); l--) {\n const line = lines[l].trim();\n const matches = EagerSourceMapTransformer.SOURCE_MAPPING_MATCHER.exec(line);\n if (matches && matches.length === 2) {\n return matches[1].trim();\n }\n }\n return null;\n }", "function SourceMap(input) {\n if (!(this instanceof SourceMap)) {\n return new SourceMap(input);\n }\n this.file = [];\n this.mappings = [];\n this.filemap = {};\n if (input && typeof input == 'object') {\n if (input instanceof SourceMap) {\n return input;\n } else {\n this.append(input);\n }\n }\n}", "function w(e,t){if(!ht)// with no source maps, generated is either an\n// array or a string. if an array, flatten it.\n// if a string, just return it\n// with no source maps, generated is either an\n// array or a string. if an array, flatten it.\n// if a string, just return it\nreturn Q(e)?y(e):e;if(null==t){if(e instanceof $)return e;t={}}return null==t.loc?new $(null,null,ht,e,t.name||null):new $(t.loc.start.line,t.loc.start.column,ht===!0?t.loc.source||null:ht,e,t.name||null)}", "function toComment(sourceMap) {\n\tvar base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n\tvar base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n\tvar base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "function $i__NM$$css$$_$$loader$lib$css$$_$$base__toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "function SourceMapGenerator(aArgs){if(!aArgs){aArgs={};}this._file=util.getArg(aArgs,'file',null);this._sourceRoot=util.getArg(aArgs,'sourceRoot',null);this._skipValidation=util.getArg(aArgs,'skipValidation',false);this._sources=new ArraySet();this._names=new ArraySet();this._mappings=new MappingList();this._sourcesContents=null;}", "function computeSourceMap(\n {code: generatedCode, mappings: rawMappings},\n filePath,\n options,\n source,\n tokens,\n) {\n const sourceColumns = computeSourceColumns(source, tokens);\n const map = new (0, _genmapping.GenMapping)({file: options.compiledFilename});\n let tokenIndex = 0;\n // currentMapping is the output source index for the current input token being\n // considered.\n let currentMapping = rawMappings[0];\n while (currentMapping === undefined && tokenIndex < rawMappings.length - 1) {\n tokenIndex++;\n currentMapping = rawMappings[tokenIndex];\n }\n let line = 0;\n let lineStart = 0;\n if (currentMapping !== lineStart) {\n _genmapping.maybeAddSegment.call(void 0, map, line, 0, filePath, line, 0);\n }\n for (let i = 0; i < generatedCode.length; i++) {\n if (i === currentMapping) {\n const genColumn = currentMapping - lineStart;\n const sourceColumn = sourceColumns[tokenIndex];\n _genmapping.maybeAddSegment.call(void 0, map, line, genColumn, filePath, line, sourceColumn);\n while (\n (currentMapping === i || currentMapping === undefined) &&\n tokenIndex < rawMappings.length - 1\n ) {\n tokenIndex++;\n currentMapping = rawMappings[tokenIndex];\n }\n }\n if (generatedCode.charCodeAt(i) === _charcodes.charCodes.lineFeed) {\n line++;\n lineStart = i + 1;\n if (currentMapping !== lineStart) {\n _genmapping.maybeAddSegment.call(void 0, map, line, 0, filePath, line, 0);\n }\n }\n }\n const {sourceRoot, sourcesContent, ...sourceMap} = _genmapping.toEncodedMap.call(void 0, map);\n return sourceMap ;\n}", "function relocateSourceMapSources({ artefacts, entryPoint }) {\n return __awaiter(this, void 0, void 0, function* () {\n yield json_1.modifyJsonFiles(`${artefacts.stageDir}/+(bundles|esm2015|esm5)/**/*.js.map`, (sourceMap) => {\n sourceMap.sources = sourceMap.sources\n .map((path) => {\n let trimmedPath = path;\n // Trim leading '../' path separators\n while (trimmedPath.startsWith('../')) {\n trimmedPath = trimmedPath.substring(3);\n }\n return `ng://${entryPoint.moduleId}/${trimmedPath}`;\n });\n return sourceMap;\n });\n });\n}", "function getSourceMap(outFile, sourceMap) {\n let resolvedSourceMap = sourceMap;\n\n // dynamic source map; run the given iterator function\n if (typeof sourceMap === 'function') {\n resolvedSourceMap = sourceMap(outFile);\n }\n\n // source map is a boolean; use the output file\n if (sourceMap === true) {\n resolvedSourceMap = outFile;\n }\n\n // source map is a directory; append the output's basename\n if (!isFile(resolvedSourceMap)) {\n resolvedSourceMap = path.join(\n resolvedSourceMap,\n path.basename(outFile)\n );\n }\n\n // resolve and ensure '.map' extension\n return path.resolve(resolvedSourceMap.replace(/(\\.map)?$/, '.map'));\n}", "function createJsIdentitySourcemap(sourceUrl, sourceContent, lineOffset, firstLineCharOffset) {\n const generator = new source_map_1.SourceMapGenerator();\n const tokens = espree.tokenize(sourceContent, { loc: true, ecmaVersion: 2017, sourceType: 'module' });\n tokens.forEach(token => {\n if (!token.loc) {\n return null;\n }\n let mapping = {\n original: {\n line: token.loc.start.line + lineOffset,\n column: token.loc.start.column +\n (token.loc.start.line === 1 ? firstLineCharOffset : 0)\n },\n generated: token.loc.start,\n source: sourceUrl\n };\n if (token.type === 'Identifier') {\n mapping.name = token.value;\n }\n generator.addMapping(mapping);\n });\n return generator.toJSON();\n}", "function SourceMap(options) {\n options = defaults(options, {\n file : null,\n root : null,\n orig : null,\n\n orig_line_diff : 0,\n dest_line_diff : 0,\n });\n var generator = new MOZ_SourceMap.SourceMapGenerator({\n file : options.file,\n sourceRoot : options.root\n });\n var orig_map = options.orig && new MOZ_SourceMap.SourceMapConsumer(options.orig);\n function add(source, gen_line, gen_col, orig_line, orig_col, name) {\n if (orig_map) {\n var info = orig_map.originalPositionFor({\n line: orig_line,\n column: orig_col\n });\n if (info.source === null) {\n return;\n }\n source = info.source;\n orig_line = info.line;\n orig_col = info.column;\n name = info.name;\n }\n generator.addMapping({\n generated : { line: gen_line + options.dest_line_diff, column: gen_col },\n original : { line: orig_line + options.orig_line_diff, column: orig_col },\n source : source,\n name : name\n });\n };\n return {\n add : add,\n get : function() { return generator },\n toString : function() { return generator.toString() }\n };\n}", "function SourceMap(options) {\n options = defaults(options, {\n file : null,\n root : null,\n orig : null,\n\n orig_line_diff : 0,\n dest_line_diff : 0,\n });\n var generator = new MOZ_SourceMap.SourceMapGenerator({\n file : options.file,\n sourceRoot : options.root\n });\n var orig_map = options.orig && new MOZ_SourceMap.SourceMapConsumer(options.orig);\n function add(source, gen_line, gen_col, orig_line, orig_col, name) {\n if (orig_map) {\n var info = orig_map.originalPositionFor({\n line: orig_line,\n column: orig_col\n });\n if (info.source === null) {\n return;\n }\n source = info.source;\n orig_line = info.line;\n orig_col = info.column;\n name = info.name;\n }\n generator.addMapping({\n generated : { line: gen_line + options.dest_line_diff, column: gen_col },\n original : { line: orig_line + options.orig_line_diff, column: orig_col },\n source : source,\n name : name\n });\n };\n return {\n add : add,\n get : function() { return generator },\n toString : function() { return generator.toString() }\n };\n}", "function updateSourcemapLocations(document, ast) {\n // We need to serialize and reparse the dom for updated location information\n const documentContents = parse5.serialize(ast);\n ast = astUtils.parse(documentContents, { locationInfo: true });\n const reparsedDoc = new polymer_analyzer_1.ParsedHtmlDocument({\n url: document.url,\n contents: documentContents,\n ast: ast,\n isInline: document.isInline,\n locationOffset: undefined,\n astNode: null\n });\n const inlineScripts = dom5.queryAll(ast, matchers.inlineJavascript);\n inlineScripts.forEach(script => {\n let content = dom5.getTextContent(script);\n const sourceMapUrlParts = content.match(sourceMappingUrlExpr);\n if (!sourceMapUrlParts) {\n return;\n }\n const sourceMapContentParts = sourceMapUrlParts[1].match(inlineSourceMapExpr);\n if (!sourceMapContentParts) {\n return;\n }\n const sourceRange = reparsedDoc.sourceRangeForStartTag(script);\n const sourceMap = base64StringToRawSourceMap(sourceMapContentParts[2]);\n const updatedMap = offsetSourceMap(sourceMap, sourceRange.end.line, sourceRange.end.column);\n const base64Map = rawSourceMapToBase64String(updatedMap);\n content = content.replace(sourceMappingUrlExpr, `${inlineSourcemapPrefix}${base64Map}\\n`);\n dom5.setTextContent(script, content);\n });\n return ast;\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function remapping(input, loader, options) {\n const opts = typeof options === 'object' ? options : { excludeContent: !!options, decodedMappings: false };\n const tree = buildSourceMapTree(input, loader);\n return new SourceMap(traceMappings(tree), opts);\n}", "dumpSource(filename) {\n const config = this.getConfigFor(filename);\n const resolved = config.resolve();\n const sources = resolved.transformFilename(filename);\n return sources.reduce((result, source) => {\n result.push(`Source ${source.filename}@${source.line}:${source.column} (offset: ${source.offset})`);\n if (source.transformedBy) {\n result.push(\"Transformed by:\");\n result = result.concat(source.transformedBy.reverse().map((name) => ` - ${name}`));\n }\n if (source.hooks && Object.keys(source.hooks).length > 0) {\n result.push(\"Hooks\");\n for (const [key, present] of Object.entries(source.hooks)) {\n if (present) {\n result.push(` - ${key}`);\n }\n }\n }\n result.push(\"---\");\n result = result.concat(source.data.split(\"\\n\"));\n result.push(\"---\");\n return result;\n }, []);\n }", "function simpleShimSourceMap(sourceMap) {\n if (sourceMap === undefined) {\n return undefined; //undefined case\n }\n else if (typeof sourceMap === \"object\") {\n return sourceMap.pc_pos_map_compressed; //Vyper object case\n }\n else {\n try {\n return JSON.parse(sourceMap).pc_pos_map_compressed; //Vyper JSON case\n }\n catch (_) {\n return sourceMap; //Solidity case\n }\n }\n}" ]
[ "0.69679236", "0.69377637", "0.67660517", "0.644171", "0.63287604", "0.62983114", "0.6256009", "0.6210124", "0.61941147", "0.61812603", "0.6174446", "0.6158444", "0.6158444", "0.6158444", "0.6154958", "0.60953784", "0.6039884", "0.5989862", "0.5980611", "0.5979347", "0.5979151", "0.5979151", "0.5962547", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.5933014", "0.59271747", "0.58930284" ]
0.0
-1
Generate new random values for x and y until there is no overlapping
function generateXY(xy, objWidth, objHeight, updateCondition) { let x = xy[0]; let y = xy[1]; x = getRandomInt(0, game.canvas.width - objWidth); y = getRandomInt(0, game.canvas.height - objHeight); condition = updateCondition(x, y, objWidth, objHeight); if (condition) { return generateXY([x, y], objWidth, objHeight, updateCondition); // Recursion } else { return [x, y]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRandomPoints() {\n let count = 0,\n x = 0,\n y = 0,\n y_function = 0;\n\n while (count < cant_points) {\n x = Math.random() * (x_to - x_from) + x_from;\n y = Math.random() * (y_to - y_from) + y_from;\n\n y_function = evaluate(x, funcion);\n\n if (y > 0) {\n y < y_function\n ? insidePoints.push({ x: x, y: y })\n : outsidePoints.push({ x: x, y: y });\n } else {\n y > y_function\n ? insidePoints.push({ x: x, y: y })\n : outsidePoints.push({ x: x, y: y });\n }\n\n count++;\n }\n }", "function randOvalCoordinate(i){\r\n // overlapping = 0;\r\n var r = screenScale.height/2 - CurPos.scale,\r\n R = screenScale.width/2 - CurPos.scale;\r\n var _r = Math.sqrt(Math.random()*(R*R-r*r)+r*r);\r\n var theta = Math.random()*2*Math.PI;\r\n // var theta = Math.random()*2*Math.PI;\r\n passerbyPos[i] = {x:Math.abs(_r*Math.cos(theta)+(screenScale.width/2- CurPos.scale*2)),y:Math.abs(_r*Math.sin(theta)/4+(screenScale.height/2- CurPos.scale*2))};\r\n // plot(_r*Math.cos(theta),_r*Math.sin(theta)/4);\r\n imgOverlapping(i);\r\n}", "function getRand(x, y) {\r\n return Math.floor(Math.random()*y)+x;\r\n }", "randomBetween(x, y, s){\n return x + Math.ceil(Math.random() * (y - x)) + s\n }", "function generateXY () {\n var x = parseInt(Math.ceil(Math.random() * (900 - 200)));\n var y = parseInt(Math.ceil(Math.random() * (500 - 200)));\n\n return [x, y];\n}", "function getRand(x, y) {\n return Math.floor(Math.random()*y)+x;\n}", "getRandomCoordinateAtStart() {\n\t\tlet space = 80, width = window.innerWidth, height = this.gameHeight;\n\t\tlet searching = true, attempts = 0, maxAttempts = 10, xy;\n\n\t\twhile (searching && attempts < maxAttempts) {\n\t\t\txy = getRandomCoordinateAtStartHelper(this.util.randomInt);\n\t\t\tif (!this.isLocationOccupiedByGameObject(xy, this.util.getDistanceBetweenPoints)) {\n\t\t\t\tsearching = false;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tattempts++;\n\t\t\t}\n\t\t}\n\t\treturn xy;\n\n\t\tfunction getRandomCoordinateAtStartHelper(randomIntFunc) {\n\t\t\treturn { x: randomIntFunc(-width * 3 / 4, width * 3 / 4), y: randomIntFunc(-height / 3 - space, height) };\n\t\t}\n\t}", "function generateCoords() {\r\n do {\r\n var X = Math.random() * (canvas.width - 80) + 80;\r\n } while (X + 320 > canvas.width);\r\n\r\n var Y = Math.random() * (-260 - 60) - 60;\r\n return [X, Y];\r\n}", "function random(x1, x2, y1, y2) {\n return new Point(util.random(x1, x2), util.random(y1, y2));\n }", "place_pins(start_x, start_y, end_x, end_y, normx, normy, pin_nb){\n\n var i;\n\n var increment_x = (start_x == end_x ? 0 : 1);\n var increment_y = (start_y == end_y ? 0 : 1);\n\n for(i = 0; i < pin_nb; i++){\n if(Math.random() > 0.4){ //prob to have a pin here\n this.pins.push(new Pin(start_x+increment_x*i, start_y+increment_y*i, normx, normy, 0));\n occupation[start_x+increment_x*i][start_y+increment_y*i] = 1;\n }\n }\n }", "randomPositionGenerator(){\n let x = Math.floor(Math.random() * BOARD_WIDTH);\n let y = Math.floor(Math.random() * BOARD_HEIGHT);\n x -= (x % this.cellWidth);\n y -= (y % this.cellWidth);\n return([x, y]);\n }", "function randRange(a, b) {return Math.round(Math.random() * (b + 1)) + a;}", "function bugSpawnRand(){\n //x = rand; y = 50\n // x:(5, 395)\n return getRandomIntInclusive(10, 395);\n}", "function generateRandomShipLocations(){\n let axis = 1; // 1 = vertical, -1 = horizantal\n ships.forEach(function(ship){\n let shipPlaced = false;\n while (shipPlaced == false){\n let x = Math.floor(Math.random() * 10);\n let y = Math.floor(Math.random() * 10);\n if (checkFit(compArray,x,y,ship.size,axis) == true){\n // console.log(x,y,ship.size,axis)\n placeShip(compArray,x,y,ship.size,axis);\n shipPlaced = true;\n axis *= -1;\n }\n } \n })\n}", "generatePoints() {\n this.points = [];\n this.currPointY = [];\n var i;\n var min = 0.1;\n var max = 0.98;\n for(i = 0; i < this.numPoints; i++ ){\n this.points[i] = Math.random() * (max - min) + min;\n this.currPointY[i] = 0;\n }\n this.poi = -1; //reset\n }", "function getRandom(x1, x2) {\n return Math.random() * (x2 - x1) + x1\n }", "constructor(){\n this.x = random(0, width); //x-coordinate is randomized\n this.y = random(0, -height/2);//y-coordinate is randomized as well\n }", "function generateNewCoords() {\n\tlet x = Math.floor(Math.random() * (canvas_width - client_start_size));\n\tlet y = Math.floor(Math.random() * (canvas_height - client_start_size));\n\treturn {x, y};\n}", "function randomArrayMaker() {\n\n let count = 0; //helper number counts up\n\n let nameRand = btnValue;\n\n let xPosRand = int(random(0, 100)); //random x coordinate to start\n let yPosRand = int(random(0, 100)); //random y coordinate to start\n let xMoveRand = int(random(0, 5)); //random distance from first x to second x value\n let yMoveRand = int(random(0, 5)); //same for y\n\n let xDirRand = 1; //initial movement direction is positive for x and y\n let yDirRand = 1;\n\n randomArray[count] = new RandomCoordSet(nameRand, xPosRand, yPosRand); //save first \"random\" coordinate\n\n while (count < 10) { //create nine more coordinates\n\n if ((xMoveRand == 0) && (yMoveRand == 0)) {//if the dot gets stuck, draw again\n xMoveRand = int(random(0, 5));\n yMoveRand = int(random(0, 5));\n }\n\n //create a new x coordinate that is xDirRand from the initial coordinate\n for (let i = 0; i < xMoveRand; i++) {\n xPosRand += xDirRand;\n \n //and when you hit a wall as you move horizontally, decide a new distance variable for both x and y\n //and change the direction of x to its opposite, increment \"count\", and save the location of the wall hit\n //as the nth coordinate and break\n if ((xPosRand <= 0) || (xPosRand >= 100)) { \n xMoveRand = int(random(0, 5));\n yMoveRand = int(random(0, 5));\n xDirRand *= -1;\n count++;\n randomArray[count] = new RandomCoordSet(nameRand, xPosRand, yPosRand);\n break;\n }\n }\n\n //same process as above for the y direction\n for (let i = 0; i < yMoveRand; i++) {\n yPosRand += yDirRand;\n if ((yPosRand <= 0) || (yPosRand >= 100)) {\n xMoveRand = int(random(0, 5));\n yMoveRand = int(random(0, 5));\n yDirRand *= -1;\n count++;\n randomArray[count] = new RandomCoordSet(nameRand, xPosRand, yPosRand);\n break;\n }\n }\n }//end while loop\n \n //create modal popup showing the \"random\" coordinates array\n newRandModal();\n}", "function random() {\n random1 = Math.floor((Math.random() * startupX.length));\n random2 = Math.floor((Math.random() * startupY.length));\n\n}", "function generateTopLeft(x,y){\r\n var x = floor(random(ppg.width/2));\r\n var y = floor(random(ppg.height/2));\r\n var maxX=width/2;\r\n var maxY=height/2;\r\n for (i=0; i<=21;i++){\r\n x+=1;\r\n y+=1;\r\n maxX=maxX-x;\r\n maxY=maxY-y;\r\n let pixelN = ppg.get((width/2)-x , (height/2)-y);\r\n fill(pixelN);\r\n noStroke();\r\n rect(maxX, maxY,12,3);\r\n }\r\n}", "function generateLowerRight(x,y){\r\n var x = floor(random(ppg.width/2));\r\n var y = floor(random(ppg.height/2));\r\n var maxX=width/2;\r\n var maxY=height/2;\r\n for (i=0; i<=21;i++){\r\n x+=1;\r\n y+=1;\r\n maxX=maxX+x;\r\n maxY=maxY+y;\r\n let pixelN = ppg.get((width/2)+x , (height/2)+y);\r\n fill(pixelN);\r\n noStroke();\r\n rect(maxX, maxY,12,3);\r\n }\r\n}", "function checkSecondRandom() {\n\t\t\tif (x === y) {\n\t\t\t\ty = Math.floor(Math.random() * 20);\n\t\t\t\tcheckSecondRandom();\n\t\t\t}\n\t\t}", "function randRange(a, b){ \n return Math.random() * (Math.max(a, b) - Math.min(a, b)) + Math.min(a, b);\n}", "assignCoords () {\n let assignedCoord = this.generateRandomCoords();\n\n // If the coordinates is already in gameState.numCoordinates, then other set of coordinates are generated until there is one not in use\n while (gameState.numCoordinates[`x${assignedCoord.x}y${assignedCoord.y}`]) {\n assignedCoord = this.generateRandomCoords()\n }\n\n gameState.numCoordinates[`x${assignedCoord.x}y${assignedCoord.y}`] = true\n\n return assignedCoord\n }", "createRandomCoord(min, max) {\n return Math.random() * (max - min) + min;\n }", "generateRandomCoords () {\n const randomX = Math.floor(Math.random() * 5) * 90 + 25\n const randomY = Math.floor(Math.random() * 5) * 100 + 25\n return { x: randomX, y: randomY }\n }", "function generateTopRight(x,y){\r\n var x = floor(random(ppg.width/2));\r\n var y = floor(random(ppg.height/2));\r\n var maxX=width/2;\r\n var maxY=height/2;\r\n for (i=0; i<=20;i++){\r\n x+=1;\r\n y+=1;\r\n maxX=maxX+x;\r\n maxY=maxY-y;\r\n let pixelN = ppg.get((width/2)+x , (height/2)-y);\r\n fill(pixelN);\r\n noStroke();\r\n rect(maxX, maxY,12,7);\r\n }\r\n}", "function sand (n, v, w, t, offset) {\n\n let xs = linspace (n, v.x, w.x);\n let ys = linspace (n, v.y, w.y);\n\n for (let times = 0; times < t; times++) {\n\n for (let i = 0; i < n; i++) {\n point (xs[i], ys[i]);\n //line (xs[i], ys[i], xs[i], ys[i] + 10);\n }\n\n xs = xs.map (e => e += random (-offset, offset));\n ys = ys.map (e => e += random (-offset, offset));\n }\n}", "function getRandomPosition(){\n min = 0;\n var [width, height] = getResolution();\n a = Math.floor(Math.random()*(width-min+1)+min);\n b = Math.floor(Math.random()*(height-min+1)+min);\n return([a, b]);\n}", "function randomNum(x, y) {\r\n num = [Math.floor(Math.random() * (y-x+1) + x)]\r\n return num;\r\n}", "function getRandomData() {\n if (data.length > 0) data = data.slice(1);\n // do a random walk\n while (data.length < totalPoints) {\n var prev = data.length > 0 ? data[data.length - 1] : 50;\n var y = prev + Math.random() * 10 - 5;\n if (y < 0) y = 0;\n if (y > 100) y = 100;\n data.push(y);\n }\n // zip the generated y values with the x values\n var res = [];\n for (var i = 0; i < data.length; ++i) {\n res.push([i, data[i]]);\n }\n\n return res;\n}", "function random(){\n\t\tfor(var i = 0 ; i < 1000; i ++){\n\t\t\tvar neighbor = [];\n\t\t\t// check if the surrounding squares are movable\n\t\t\tif(movable(emptyrow + 1, emptycol)){\n\t\t\t\tneighbor.push(document.getElementById(parseInt(emptyrow + 1) + \"-\" + emptycol));\n\t\t\t}if(movable(emptyrow-1, emptycol)){\n\t\t\t\tneighbor.push(document.getElementById(parseInt(emptyrow - 1) + \"-\" + emptycol));\n\t\t\t}if(movable(emptyrow, emptycol + 1)){\n\t\t\t\tneighbor.push(document.getElementById(emptyrow + \"-\" + parseInt(emptycol + 1)));\n\t\t\t}if(movable(emptyrow, emptycol - 1)){\n\t\t\t\tneighbor.push(document.getElementById(emptyrow + \"-\" + parseInt(emptycol - 1)));\n\t\t\t}\n\t\t\tif(neighbor.length != 0){\n\t\t\t\tvar temp = Math.round(Math.random()* (neighbor.length - 1));\n\t\t\t\tmove2(neighbor[temp]);\n\t\t\t}\n\t\t}\n\t}", "function spawnLocation() {\n // Breaking the entire canvas into a grid of tiles.\n let rows = width / tileSize;\n let cols = (height - 40) / tileSize;\n let xPos, yPos;\n let overlap = false;\n // To prevent an overlap of the food/barrier and the snake's body.\n do {\n xPos = Math.floor(Math.random() * rows) * tileSize;\n yPos = Math.floor(Math.random() * cols) * tileSize;\n overlap = elementsOverlap({ x: xPos, y: yPos });\n } while (overlap);\n return { x: xPos, y: yPos };\n}", "function randomY() {\n let yLocation = [60, 130, 210, 290, 370];\n return yLocation[Math.floor(Math.random() * yLocation.length)];\n}", "function randYPos() {\n return Math.floor(Math.random() * (450 - 50)) + 50;\n}", "generateRandomLocation(){\n let x = Math.floor(Math.random() * this.height + 1);\n let y = Math.floor(Math.random() * this.width + 1);\n if (this.mine[x][y] === 0) {\n return [x,y];\n } else {\n return this.generateRandomLocation();\n }\n }", "generate () {\n return Utils.getRandomVectorBetween(this.min, this.max)\n }", "function randomXToY(minVal, maxVal) {\r\n\tvar randVal = minVal + (Math.random() * (maxVal - minVal));\r\n\treturn Math.round(randVal);\r\n}", "function getRandomData() {\n if (data.length > 0) data = data.slice(1);\n // do a random walk\n while (data.length < totalPoints) {\n var prev = data.length > 0 ? data[data.length - 1] : 50;\n var y = prev + Math.random() * 10 - 5;\n if (y < 0) y = 0;\n if (y > 100) y = 100;\n data.push(y);\n }\n // zip the generated y values with the x values\n var res = [];\n for (var i = 0; i < data.length; ++i) res.push([i, data[i]])\n return res;\n }", "function randomX() {\n let xLocation = [0, 100, 200, 300, 400, 500, 600, 700, 800];\n return xLocation[Math.floor(Math.random() * xLocation.length)] * -1;\n}", "function randomCoords() {\n const x = getRandomArbitrary(0, boxWidth);\n const y = getRandomArbitrary(0, boxHeight);\n\n return {\n x: Math.ceil(x), \n y: Math.ceil(y)\n }\n}", "function getRandomData() {\r\n if (data.length > 0) data = data.slice(1);\r\n // do a random walk\r\n while (data.length < totalPoints) {\r\n var prev = data.length > 0 ? data[data.length - 1] : 50;\r\n var y = prev + Math.random() * 10 - 5;\r\n if (y < 0) y = 0;\r\n if (y > 100) y = 100;\r\n data.push(y);\r\n }\r\n // zip the generated y values with the x values\r\n var res = [];\r\n for (var i = 0; i < data.length; ++i) res.push([i, data[i]])\r\n return res;\r\n }", "function randomCoordinates(startingLength, scale) {\n var x = Math.floor(Math.random() * loadingVisWidth) + 1;\n var y = Math.floor(Math.random() * loadingVisHeight) + 1;\n\n // Ensure that coordinates will not position image outside of visualization bounds, even after transition\n while (x > loadingVisWidth - (startingLength + 0.5 * scale) || x < (0.5 * scale) || y < (0.5 * scale) || y > loadingVisHeight - (startingLength + 0.5 * scale)) {\n x = Math.floor(Math.random() * loadingVisWidth) + 1;\n y = Math.floor(Math.random() * loadingVisHeight) + 1;\n }\n\n return { x: x, y: y };\n\n\n\n}", "function updatePositionsRandincident() {\n var positions = new Array(4);\n\n for(var i =0 ;i<4 ; i++) {\n positions[i] = new Array(MAX_POINTS * 3);\n positions[i] = randAllLines[i].geometry.attributes.position.array;\n }\n\n var x = [-16,-16,-16,-16]; \n var y = [-0.5,-0.3,0.3,0.5]; \n var y2 = [1,0.5,1.5,2];\n var z = -2.5;\n var index = 0;\n\n for ( var i = 0, l = MAX_POINTS; i < l; i ++ ) {\n for(var j=0;j<4;j++){\n positions[j][ index ++ ] = x[j];\n positions[j][ index ++ ] = y[j];\n positions[j][ index ++ ] = z;\n\n x[j] += ((4.5)/MAX_POINTS);\n if(j==0 || j==1){\n y[j] -= ((y2[j])/MAX_POINTS);\n } else {\n y[j] += ((y2[j])/MAX_POINTS);\n }\n index-=3;\n }\n index+=3;\n }\n}", "function getRandomData() {\n if (data.length > 0) data = data.slice(1);\n // do a random walk\n while (data.length < totalPoints) {\n var prev = data.length > 0 ? data[data.length - 1] : 50;\n var y = prev + Math.random() * 10 - 5;\n if (y < 0) y = 0;\n if (y > 100) y = 100;\n data.push(y);\n }\n // zip the generated y values with the x values\n var res = [];\n for (var i = 0; i < data.length; ++i) res.push([i, data[i]])\n return res;\n }", "function rnd_bmt() {\n\tvar x = 0, y = 0, rds, c;\n\n\t// Get two random numbers from -1 to 1.\n\t// If the radius is zero or greater than 1, throw them out and pick two new ones\n\t// Rejection sampling throws away about 20% of the pairs.\n\tdo {\n\tx = Math.random()*2-1;\n\ty = Math.random()*2-1;\n\trds = x*x + y*y;\n\t}\n\twhile (rds == 0 || rds > 1)\n\n\t// This magic is the Box-Muller Transform\n\tc = Math.sqrt(-2*Math.log(rds)/rds);\n\n\t// It always creates a pair of numbers. I'll return them in an array. \n\t// This function is quite efficient so don't be afraid to throw one away if you don't need both.\n\treturn [x*c, y*c];\n}", "function pickRandom() {\n x = random(20, width - 20);\n}", "spawn() {\n this.x = getRandomInt(0, 25) * this.grid;\n this.y = getRandomInt(0, 25) * this.grid;\n }", "function randomPoint(){\n\tx =(Math.random()*200)-100;\n\ty =(Math.random()*200)-100;\n\n\treturn new Point(x,y);\n}", "function doubleRandom() {\n background(color1, 20);\n stroke(color2);\n fill(color2);\n var rand = 0;\n for (var i = 1; i < steps; i++) {\n point((width/steps) * i, (height / 2) + random(-rand, rand));\n rand = heart*random(-500, 500);\n }\n}", "move() {\n this.x = this.x + random(-2, 2);\n this.y = this.y + random(-2, 2);\n }", "function generate_uniform(n,a,b){\n min_y = Number.POSITIVE_INFINITY;\n max_y = Number.NEGATIVE_INFINITY;\n proc[0] = 0;\n\n for(var i = 0 ; i<n;i++){\n y[i] = a+Math.random()*(b-a);\n proc[i+1] = proc[i]+y[i];\n if(y[i]<min_y)\n min_y = y[i];\n if(y[i]>max_y)\n max_y = y[i];\n }\n}", "function randomAlong(axisLength, pixelSize){\r\n\tvar max = Math.floor(axisLength / pixelSize) - 1;\r\n\tvar min = 0;\r\n\treturn randomInclusive(min, max);\r\n}", "function GetCordinates() {\r\n this.x1co = Math.round(Math.random() * 1)\r\n this.y1co = Math.round(Math.random() * innerWidth)\r\n this.x2co = Math.round(Math.random() * 600)\r\n if ((Math.abs(this.x1co - this.x2co)) < 50) {\r\n this.x2co += 300\r\n }\r\n }", "function randomCoords(range, resolution) {\n return [\n randomGen(range[0], resolution),\n randomGen(range[1], resolution),\n randomGen(range[2], resolution)\n ];\n }", "function generate(){\n for (let i=0;i<randomInt(40,300);i++){\n var x = randomInt(50,1150);\n var y = randomInt(50,650);\n var r = randomInt(10,30);\n cond = false;\n if(i!==0){\n do{\n x = randomInt(50,1150);\n y = randomInt(50,650);\n r = randomInt(10,30);\n for(j = 0; j < ballarray.length; j++){\n if (dist(x,y,ballarray[j].x,ballarray[j].y) -(r + ballarray[j].size)< 10){\n cond = true;\n break;\n }\n else{ \n cond =false;\n }\n }\n }while(cond);\n } \n ballarray.push(new ball(x,y,r));\n }\n}", "function genChkptLocations(){\n for(let i=1; i<20; i++){\n let newX=Math.random()*480+160, newY = Math.random()*479;\n let prevChkpt = chkpt.locations[i-1];\n while( newX<160 || newY<1 ||\n newX>592 || newY>432 ||\n distance([newX, newY], [prevChkpt[0], prevChkpt[1]]) < 125){\n newX = Math.random()*479+160;\n newY = Math.random()*479;\n }\n chkpt.locations.push([newX, newY]);\n }\n}", "function setLoc() {\n xLoc = random(60, width - 60);\n yLoc = random(60, height - 60);\n}", "function getRandom(start,end) {\n\treturn Math.floor((end-start)*Math.random()) + start;\n}", "generate()\n {\n return Utils.getRandomVectorBetween(this.min, this.max);\n }", "function assignNewPosition() {\n\tvar pos = {};\n\tdo {\n\t\tpos.x = Math.floor(Math.random() * gridW);\n\t\tpos.y = Math.floor(Math.random() * gridH);\n\t} while (filledPositions[pos.x][pos.y]);\n\t\n\tfilledPositions[pos.x][pos.y] = true;\n\t\n\tpos.x=pos.x*40+30+Math.floor(Math.random()*26-13);\n\tpos.y=pos.y*40+30+Math.floor(Math.random()*26-13);\n\t\n\treturn pos;\n}", "function placeX() {\r\n let ranX = Math.floor(Math.random() * randMultiply) + xX;\r\n let ranY = Math.floor(Math.random() * randMultiply) + xY;\r\n for (let i = 0; i < xLength; i++) {\r\n let newXOb = {\r\n x: (ranX + i) * moveUnit,\r\n y: (ranY + i) * moveUnit\r\n };\r\n if (i != xLength % 5)\r\n xOb.unshift(newXOb);\r\n }\r\n for (let i = 0; i < xLength; i++) {\r\n let newXOb = {\r\n x: (ranX + 8 - i) * moveUnit,\r\n y: (ranY + i) * moveUnit\r\n };\r\n if (i != xLength % 5)\r\n xOb.unshift(newXOb);\r\n }\r\n }", "getRandomCoordinateOffScreen() {\n\t\tlet space = 80, width = window.innerWidth, height = this.gameHeight;\n\t\tlet searching = true, attempts = 0, maxAttempts = 10, xy;\n\n\t\twhile (searching && attempts < maxAttempts) {\n\t\t\txy = getRandomCoordinateOffScreenHelper(this.util.randomInt);\n\t\t\tif (!this.isLocationOccupiedByGameObject(xy, this.util.getDistanceBetweenPoints)) {\n\t\t\t\tsearching = false;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tattempts++;\n\t\t\t}\n\t\t}\n\n\t\treturn xy;\n\n\t\tfunction getRandomCoordinateOffScreenHelper(randomIntFunc) {\n\t\t\tswitch (randomIntFunc(0, 3)) {\n\t\t\tcase 0:\n\t\t\t\t// offscreen left\n\t\t\t\treturn { x: randomIntFunc(-width * 3 / 4, -width / 2 - space), y: randomIntFunc(-height / 3 - space, height * 2 / 3) };\n\t\t\tcase 1:\n\t\t\t\t// offscreen right\n\t\t\t\treturn { x: randomIntFunc(width / 2, width * 3 / 4), y: randomIntFunc(-height / 3 - space, height * 2 / 3) };\n\t\t\tdefault:\n\t\t\t\t// offscreen down\n\t\t\t\treturn { x: randomIntFunc(-width * 3 / 4, width * 3 / 4), y: randomIntFunc(height * 2 / 3, height) };\n\t\t\t}\n\t\t}\n\t}", "function generateStartingGrid() {\n Mobile();\n let Gaps = emptyGrid();\n let n = 1;\n let m = 0;\n for (let i = 0; i < x; i++) {\n for (let j = 0; j < y; j++) {\n // People point generater\n if (Gaps.includes(n)) {\n } else {\n var dotOffWid = getRandomArbitrary(0.2, 0.8) * refWid;\n var dotOffHei = getRandomArbitrary(0.2, 0.8) * refHei;\n let xData = refWid * i + dotOffWid;\n let yData = refHei * j + dotOffHei;\n dotData[m] = [xData, yData, 0, 0, 0, 0, 0,\"blue\"];\n resetData[m] = [xData, yData];\n m++;\n }\n n++;\n }\n }\n //console.log(\"generateStartingGrid: \" + dotData)\n}", "getRandomPixelCoordinate() {\n // get random pixel coords\n const x = Math.round(Math.random() * this.pixelWidth);\n const y = Math.round(Math.random() * this.pixelHeight);\n\n return { x, y };\n }", "function generateStartPos(){\n firstPlayerStartPos = randomInteger(0, 39);\n secondPlayerStartPos = randomInteger(50, 89);\n}", "function randomCells(){\n for (let y = 0; y < resolution; y++){\n for (let x = 0; x < resolution; x++){\n if ( Math.random() < 0.5 ) \n cells[y][x] = true; \n }\n } \n}", "randomRange(r1, r2){\n\t r1 = Math.ceil(r1);\n\t r2 = Math.floor(r2);\n\t return Math.floor(Math.random() * (r2 - r1 + 1)) + r1;\n\t}", "getRandomPixelCoordinate() {\n // get random pixel coords\n const x = Math.round(Math.random() * this.pixelWidth);\n const y = Math.round(Math.random() * this.pixelHeight);\n\n return { x, y };\n }", "function randPoint () {\n\t\treturn allPoints[Math.floor(Math.random() * allPoints.length)];\n\t}", "function randomInterval(min, max) {\n return Math.random() * (max - min) + min;\n}", "function randomXY()\r\n{\r\n\r\n\t// var bodyWidth = document.body.clientWidth-150;\r\n\t// var bodyHeight = document.body.clientHeight-150;\r\n\tvar bodyWidth = document.getElementById(\"graphContainer\").offsetWidth-120;\r\n\tvar bodyHeight =document.getElementById(\"graphContainer\").offsetHeight-120;\r\n\trandPosX =Math.floor(Math.random()*bodyWidth);\r\n\trandPosY =Math.floor(Math.random()*bodyHeight);\r\n}", "function genSwapPoints(numCities) {\n let i = 0;\n let j = 0;\n while (j-i < 2) {\n i = Math.floor(Math.random() * numCities);\n j = Math.floor(Math.random() * (numCities+1));\n }\n return [i, j];\n}", "generatePOI() {\n this.poi = Math.floor(Math.random() * this.numPoints); //point we want to select \n }", "function RandInt(x, y) {\n\tcc.assert(y >= x, '<RandInt>: y is less than x');\n\treturn Math.floor(Math.random() * (y - x + 1) + x);\n}", "function randy(min, max){ \n let rand = Math.floor((Math.random()*(max - min)) + min);\n return rand;\n}", "function randomPos(bound) {\n return Math.random() * bound;\n}", "function rando(min,max) {\n return (min + (Math.random()*(max-min)))\n}", "function populateRandom(n) {\n var x, y;\n for (var i = 0; i < n; i++) {\n do {\n x = Math.floor(Math.random() * 100);\n y = Math.floor(Math.random() * 100);\n } while (world[x][y]);\n world[x][y] = true;\n }\n }", "function returnArrayOfRandomNumbers(x, y){\nif(x > y){\n var max = x;\n var min = y;\n arr =[];\n for(i=0 ; i<10 ; i++){\n arr.push(Math.floor(Math.random() * (max - min + 1) + min)); \n }\n return arr\n} else if(x < y){\n var max = y;\n var min = x;\n arr =[];\n for(i=0 ; i<10 ; i++){\n arr.push(Math.floor(Math.random() * (max - min + 1) + min)); \n }\n return arr\n} else(x == y);{\n return \"Please enter valid range\"\n}\n}", "function randomPointOf(n, bias, val) {\n let h = (y - 2) * refHei;\n let w = ((x - bx) / 2) * refWid;\n let spread = Math.sqrt(bias);\n let xs = w / spread;\n let ys = h / spread;\n n = n % bias;\n let ny = (n % spread) * ys;\n let nx = (n / spread) * xs;\n let xx = 0;\n let yy = 0;\n let offsetY = 0;\n if(is_mobile == true){\n offsetY = refHei*1.5;\n } else{\n offsetY = refHei*1.2;\n }\n if (val == 1) {\n xx = containerWidth - (Math.random() * xs + nx);\n yy = (Math.random() * ys + ny) + (offsetY);\n } else {\n xx = (Math.random() * xs + nx);\n yy = (Math.random() * ys + ny) + (offsetY); \n }\n \n return [xx.toFixed(1), yy.toFixed(1)];\n}", "function generate_random_pattern() {\n var j;\n while(generated_tile_ids.length < trial.loading_magnitude) {\n j = Math.floor(Math.random() * trial.grid_size);\n // valuex = 'tile_' + j;\n var index = generated_tile_ids.indexOf(j);\n if (index == -1) {\n generated_tile_ids.push(j);\n }\n }\n }", "function randomPosition ()\n{\n\treturn { \"x\": Math.ceil(Math.random() * CANVAS_WIDTH), \"y\": Math.ceil(Math.random() * CANVAS_HEIGHT) };\n}", "function startingPositionZombie() {\n\n yZombiePos = Math.floor(Math.random() * 7);\n xZombiePos = Math.floor(Math.random() * 7);;\n}", "fillCellsRandomly(cellsY, cellsX, colors){\n let colorsPool = colors.flat()\n let randomPoolIndex;\n this.cells = new Array(cellsY);\n for (let y = 0; y<cellsY; y++){\n this.cells[y] = new Array(cellsX)\n for (let x = 0; x<cellsX; x++){\n randomPoolIndex = Math.round( Math.random()*colorsPool.length)-1;\n let randomColor = colorsPool.splice(randomPoolIndex,1);\n this.cells[y][x]= new Cell(randomColor[0], y, x, this.cellWidth, this.cellHight, this.node);\n }\n }\n }", "function generatePosition() {\n //return false if the board is full\n if (isFull() === true) {\n return false;\n }\n var randX, randY, time = 0;\n do {\n time++;\n randX = Math.floor(Math.random() * 4);\n randY = Math.floor(Math.random() * 4);\n } while (all_numbers[randX][randY] && (time < 20))\n // if it cannot find a valid position after 20 tries,\n // traverses the board for a valid one\n if (time == 20) {\n for (var i = 0; i < 4; i++) {\n for (var j = 0; j < 4; j++) {\n if (!all_numbers[i][j]) {\n randX = i;\n randY = j;\n return [randX, randY];\n }\n }\n }\n }\n return [randX, randY];\n}", "function randomInsideRect(rect) {\r\n return new components_1.Vector(rect.x + randomRange(0, rect.width), rect.y + randomRange(0, rect.height));\r\n}", "function generate() {\n\tfor (var i = 0; i < rows * columns; i++) {\n\t\t// Loop through every spot in our 2D array and check spots neighbors\n\t\tx = floor(random(columns));\n\t\ty = floor(random(rows));\n\t\t// pick a random orthogonal neighbor and set state to match\n\t\tvar n = floor(random(4));\n\t\tif (n == 0) board[x][y] = board[x][bounded(y-1, 0, rows-1)];\n\t\telse if (n == 1) board[x][y] = board[x][bounded(y+1, 0, rows-1)];\n\t\telse if (n == 2) board[x][y] = board[bounded(x-1, 0, columns-1)][y];\n\t\telse board[x][y] = board[bounded(x+1, 0, columns-1)][y];\n\n\t\tif ((board[x][y] == 1)) fill(0);\n\t\telse fill(255);\n\t\trect(x*w, y*w, w-1, w-1);\n\t}\n}", "function randomNumbersBetweenRange(start, end){\n\treturn Math.floor(Math.random() * (end - start + 1)) + start;\n}", "function assignNewTarget() {\n randCol1 = Math.floor(Math.random()*rowLength);\n randRow1 = Math.floor(Math.random()*columnLength);\n\n // while the chosen location is inside the snake, no good!\n // keep repeating until this is not the case\n while (snakeState.containsList([randCol1,randRow1])) {\n randCol1 = Math.floor(Math.random()*rowLength);\n randRow1 = Math.floor(Math.random()*columnLength);\n }\n\n return [randCol1,randRow1];\n}", "initConfettoVelocity (xRange, yRange) {\n const x = randomRange(xRange[0], xRange[1]);\n const range = yRange[1] - yRange[0] + 1;\n let y = yRange[1] - Math.abs(randomRange(0, range) + randomRange(0, range) - range);\n if (y >= yRange[1] - 1) {\n // Occasional confetto goes higher than the max\n y += (Math.random() < .25) ? randomRange(1, 3) : 0;\n }\n return {x: x, y: -y};\n }", "randomize() {\n for (let y = 0; y < this.height; y++) {\n for (let x = 0; x < this.width; x++) {\n this.buffer[this.currentBufferIndex][y][x] = Math.floor(Math.random() * 2);\n }\n }\n }", "function randRange( fromValue, toValue ) {\n\treturn Math.random() * (toValue-fromValue) + fromValue;\n}", "function patternV() {\n\tvar t = 1;\n\tvar n = randomSP;\n\tvar spawnTotal = 2;\n\tspawn(spawnObjects[randomObj], spawnPoints[randomSP]);\n\tyield WaitForSeconds(0.5);\n\t\n\tfor (var i = 0; i < spawnTotal; i++) {\n\t\tvar left = n - t;\n\t\tvar right = n + t;\n\t\tif (left < 0) { left += 23; }\n\t\tif (right > 23) { right -= 23; }\n\t\tspawn(spawnObjects[randomObj], spawnPoints[left]);\n\t\tspawn(spawnObjects[randomObj], spawnPoints[right]);\n\t\tyield WaitForSeconds(0.5);\n\t\tt++;\n\t}\n}", "function coerceOverlaps(positions) {\n var x, y;\n var point;\n\n var maxTries = 50; // tries before giving up\n var tries = 0; // current tries\n var numToResample = 0; // guess at number of shapes to resample\n var overlapPercentage = computeOverlapPercentage(positions); // initial overlap\n\n // keep trying until tries are exhausted or we're close enough\n while((++tries < maxTries) &&\n Math.abs(overlapPercentage - desiredOverlapPercentage) > 0.025) {\n\n // guess half the difference between overlaps, or 1\n numToResample = Math.max(Math.abs(overlapPercentage - desiredOverlapPercentage) * 50, 1);\n\n // console.log('try: ', tries, overlapPercentage, desiredOverlapPercentage, numToResample);\n\n // if too many overlaps\n if(overlapPercentage - desiredOverlapPercentage > 0) {\n // console.log('get rid of some overlaps');\n\n // resample some overlapping shapes (from gaussian distribution)\n for(var i = 0; i < numToResample; i++) {\n var idx = findOverlapping(positions); // get index of an overlap\n // if valid index...\n if(idx > 0 && idx < positions.length) {\n // find a new valid non-overlapping point\n do {\n point = sampleGaussian();\n } while(!validOverlapPoint(point, positions) || countOverlapsForPoint(point, positions) > 0 );\n\n // replace the point\n positions[idx] = point;\n }\n }\n } else { // not enough overlaps\n // console.log('add some overlaps');\n\n // resample a non-overlapping shape (from gaussian distribution)\n for(var i = 0; i < numToResample; i++) {\n var idx = findNonOverlapping(positions); // get index of a non-overlap;\n // if valid index...\n if(idx > 0 && idx < positions.length) {\n // find a new valid overlapping point\n do {\n point = sampleGaussian();\n } while(!validOverlapPoint(point, positions) || countOverlapsForPoint(point, positions) === 0 );\n\n // replace the point!\n positions[idx] = point;\n }\n }\n }\n\n // update overlapPercentage before next try\n overlapPercentage = computeOverlapPercentage(positions);\n }\n\n return positions;\n}", "function random_nums() {\n\t\t\tvar max = all_coords.length + 1;\n\t\t\treturn Math.floor(Math.random() * max) \n\t\t}", "function randomInterval(min,max)\r\n{\r\n return Math.floor(Math.random()*(max-min+1)+min);\r\n}", "randomize () {\n\n // loop for the x coordinates\n for (let x = 0; x < this.config.get(colsKey); ++x) {\n\n // loop over the y coordinates\n for (let y = 0; y < this.config.get(rowsKey); ++y) {\n\n // assign a random 0 or 1\n this.grid.set((x + y * this.config.get(colsKey)), Math.round(Math.random()));\n }\n }\n }", "function drawRandomFigure(context, start, stop, x1, y1, x2, y2) {\n context.beginPath();\n context.moveTo(start, stop);\n context.lineTo(start + x1, stop + y1);\n context.lineTo(x1, stop + y1);\n context.lineTo(x1, y2);\n context.lineTo(x2, y2);\n context.lineTo(start, stop);\n context.fillStyle = \"blue\";\n context.fill()\n context.stroke();\n}" ]
[ "0.69807976", "0.66435057", "0.6626163", "0.6602893", "0.6568605", "0.6540433", "0.6518605", "0.65176606", "0.6514639", "0.6430906", "0.640136", "0.63774514", "0.6366932", "0.63449013", "0.6327585", "0.63002944", "0.62860495", "0.6279405", "0.622127", "0.6220236", "0.6201995", "0.61988366", "0.61887145", "0.6176641", "0.6172963", "0.61640865", "0.61188334", "0.6095792", "0.60645705", "0.6043947", "0.6022744", "0.60207593", "0.60077435", "0.599024", "0.59857184", "0.59850657", "0.5984514", "0.59797513", "0.59769756", "0.59528977", "0.5952722", "0.59438306", "0.5939215", "0.59372395", "0.5927842", "0.59205896", "0.59135365", "0.59127355", "0.59064865", "0.59044164", "0.58838505", "0.5877637", "0.5876807", "0.5874989", "0.5867821", "0.58621526", "0.5856939", "0.58469695", "0.584495", "0.58315414", "0.5827071", "0.5825121", "0.58085096", "0.5806576", "0.5801081", "0.5799599", "0.5794654", "0.5788922", "0.5781335", "0.5763081", "0.5752457", "0.5751383", "0.57502043", "0.5747014", "0.5737022", "0.573392", "0.5731662", "0.57301974", "0.57260007", "0.57215863", "0.5719649", "0.57089645", "0.57065666", "0.5706091", "0.57029116", "0.56988627", "0.569536", "0.5688537", "0.56860435", "0.56825906", "0.5681262", "0.5673299", "0.567146", "0.5666271", "0.5663717", "0.5660804", "0.56595105", "0.56513786", "0.56506276", "0.5647705" ]
0.58433384
59
Update new Score to records
function updateRecord(newScore) { let data = localStorage.getItem("records"); let newScoreAdded = false; // Track if newScore has been added to records let records = []; if (data) { records = data.toString().split("\n"); records = records.map((x) => x.split(",")); // Add new Score to records for (let i = 0; i < records.length; i++) { if (parseInt(records[i][0]) < parseInt(newScore[0])) { records.splice(i, 0, newScore); newScoreAdded = true; break; } } } if (!newScoreAdded && records.length < 10) { records.push(newScore); } records = records.splice(0, 10); let newString = records.map((x) => x.join(",")); newString = newString.join("\n"); localStorage.setItem("records", newString); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateScores(score, index, id) {\n setDetails({ ...details, score });\n setUpdate({ score, index, id });\n }", "UpdateScore(newScore){\n this.currentScore += newScore;\n }", "updateScore(itemId, score = 0.5){\n return Score.findOrCreate({where: {itemId, questionId: this.id}})\n .then(([foundScore]) => {\n let oldScore = foundScore.score;\n let newScore = (oldScore + score) / 2;\n return foundScore.update({score: newScore});\n })\n }", "function updateScore() {\n store.score++;\n}", "function score(option, score, id) {\n option.score += score;\n return option.save();\n }", "function updateScore(value) {\n addScore(value);\n displayScore();\n}", "function incrScore() {\n DATA['score'] = DATA.score + 1;\n}", "function update_score() {\n\t\t$('[id$=-score]').val(score);\n\t}", "function updateUserScore(userId, leaderboardId, score, done) {\n db.UserScore.update(\n {userId: userId, leaderboardId: leaderboardId},\n {$set: {score: score}},\n {},\n done\n )\n}", "function addScore(id, score) {\n let sql = '' +\n 'UPDATE appuser ' +\n 'SET score = score + ? ' +\n 'WHERE id = ?';\n\n db.run(sql, [score, id], function (err) {\n if (err) {\n console.log(`err updating score for ${id}: ${err.message}`);\n } else {\n console.log(`updated score for user ${id}`);\n }\n });\n}", "function updateRecord(score) {\n console.log(\"Updating high score\");\n if ( score == \"points\" ) {\n window.highScores[window.gameMode][score] = window.currentScore;\n }\n\n if ( score == \"words\" ) {\n window.highScores[window.gameMode][score] = window.wordsAnswered;\n }\n}", "updateScore( score ){\n this.score += score;\n this.playerDB.update(this.props());\n }", "updateScore() {\n const points = splitNumber(this.points);\n\n this.scoreClass(3, points[3]);\n this.scoreClass(2, points[2]);\n\n if (this.points < 0) {\n this.scoreClass(1, '-minus');\n } else {\n this.scoreClass(1, points[1]);\n }\n }", "function updateScores() {\n scope.$el.find('.js-score-value').text(model.prediction[team])\n }", "function updateScore(scores) {\n if (scores[0].score <= score) {\n scores[0].score = score;\n scores[0].name = playerName;\n console.log(chalk.green.bold('Hurray!! you Got the First Place on the scoreBoard. \\n'));\n } else if (scores[1].score <= score) {\n scores[1].score = score;\n scores[1].name = playerName;\n console.log(chalk.green.bold('Hurray!! you Got the Second Place on the scoreBoard. \\n'));\n } else if (scores[2].score <= score) {\n scores[2].score = score;\n scores[2].name = playerName;\n console.log(chalk.bgBlack.green.bold('Hurray!! you Got the Third Place on the scoreBoard. \\n'));\n }else {\n console.log(chalk.bgBlack.green.bold('Sorry!! you Got no place on the scoreBoard. \\n'));\n }\n\n \n}", "function updateScore() {\n score++;\n}", "function updateScore() {\n totalScore = totalScore + 10; // add 10 points to the score\n $score.text(totalScore); // displays the new score on the screen\n console.log(totalScore); // logs the new score in the console\n }", "function updateScore(newScore){\n if(newScore > fbScore){\n database.ref(\"/users/\" + uid).update({\n score: newScore\n })\n fbScore = newScore;\n return true;\n }\n else{\n return false;\n }\n\n }", "function increaseScore(){\r\n\tplayerData.newScore += totalScore;\r\n\tupdateScore(true);\r\n}", "_addScore(incr) {\n\t\tthis._setScore(this._score + incr);\n\t}", "function updateScores() {\n dealerScore = getScore(dealerCards);\n playerScore = getScore(playerCards);\n}", "function updateScore(newScoreArray) {\n for (let i = 0; i < 13; i++) {\n if (!currentPlayer.selectedScores[i]) {\n currentPlayer.eachScore[i] = newScoreArray[i];\n currentPlayer.scoreDisplay[i].textContent = currentPlayer.eachScore[i];\n }\n }\n}", "function submitScore() {\n db.collection(\"scores\").doc().set({\n score: score,\n name: ('fill')\n\n\n })\n}", "set score(aValue) {\n this._score = aValue;\n }", "function updateScore() {\n $score.text(score);\n}", "function saveScore() {\n //update the stress and grade\n $(\"#stress-display\").html(stress);\n $(\"#grade-display\").html(score);\n\n let data = {\n currentScore: score,\n currentStress: stress,\n currentQuestionId: question\n };\n $.ajax({\n method: \"PUT\",\n url: \"/api/users/\" + user,\n data: data\n }).then(function(result) {});\n }", "function addOneToScore () {\n STORE.score++;\n}", "applyQuestionGrades() {\n let grades = this.question.gradePlayers();\n for (let uid in grades) {\n this.players[uid].updateScore(grades[uid]);\n }\n }", "_setScore(score) {\n\t\tthis._score= score;\n\t\tthis._updateScore();\n\t}", "function addOneToScore(){\r\n store.score++; \r\n}", "async function addToScoreboard(data) {\n data.map(async (data) => {\n const client = await MongoClient.connect(url, options)\n await client.db(dbName).collection('unsplash_scores').findOneAndUpdate({\n \"id\": data.id\n }, {\n $inc: {\n \"score\": 1\n },\n $setOnInsert: {\n id: data.id,\n url: data.url,\n width: data.width,\n height: data.height,\n color: data.color,\n alt_description: data.alt_description,\n photographer: data.photographer,\n location: data.location,\n photoid: data.photoid\n }\n }, {\n upsert: true,\n multi: true,\n })\n client.close()\n })\n}", "function addNewScore(userName, score){\n firebase.database().ref('/scores/userName').set({\n userName: userName,\n score: score\n });\n }", "addAndUpdate(){\n if(this.state.score > 0){\n _storeData(this.state.score);\n }\n updateData(); \n }", "updateScore(points) {\n\t\tthis.points += points;\n\t\t//set max score\n\t\tif (maxScore < this.points) {\n\t\t\tmaxScore = this.points;\n\t\t}\n\t}", "function update(data) {\n\t var grade = this.find(data);\n\t grade.count++;\n\t return grade;\n}", "function updateScoreRecord(newItem) {\n var scores = [];\n var index = 0;\n if (localStorage.getItem(\"scores\")) {\n scores = JSON.parse(localStorage.getItem(\"scores\"));\n }\n for (; index < scores.length; index++) {\n if (scores[index].score < newItem.score) {\n break;\n }\n }\n scores.splice(index, 0, newItem);\n localStorage.setItem(\"scores\", JSON.stringify(scores));\n}", "function UpdateScore(netPlr : NetworkPlayer, score : int){\n\tvar user : UserClass = networkController.GetUser(netPlr);\n\tuser.score = score;\t\t\n}", "updateScore() {\n if(Dashboard.candyMachted.length) {\n this.score += 1;\n this.levelUp();\n this.scoreUpdateView();\n Dashboard.candyMachted.pop();\n }\n }", "function updateScore() {\n document.querySelector(\"#score\").innerHTML = \"Score: \" + score;\n }", "updateScore() {\n\t\tthis.score++;\n\t\tthis.drawScore();\n\t\tif (this.score >= this.highestScore) {\n\t\t\tthis.highestScore = this.score;\n\t\t\tlocalStorage.setItem(STORAGE_KEY, this.highestScore);\n\t\t}\n\t}", "function updateHighscore(req, res, callback) {\n let bikeScore = 0;\n let thumbScore = 0;\n let totalScore = 0;\n\n if (req.body.thumb_score !== undefined) thumbScore = JSON.parse(req.body.thumb_score);\n if (req.body.bike_score !== undefined) bikeScore = JSON.parse(req.body.bike_score);\n\n // if bike or thumb score arent provided they are 0 and doesn't change totalScore (that start=0)\n totalScore += (bikeScore + thumbScore);\n\n userModel.User.findOneAndUpdate(\n { username: req.body.user_name },\n {\n $inc: {\n 'game_score.thumb_score': thumbScore,\n 'game_score.bike_score': bikeScore,\n 'game_score.total_score': totalScore,\n },\n },\n { new: true },\n (err, user) => {\n if (err) callback(cbs.cbMsg(true, err));\n else if (!user) callback(cbs.cbMsg(true, 'No user by that user_name found'));\n else callback(cbs.cbMsg(false, user));\n },\n );\n}", "function updateScore () {\n incrementScore ();\n $('.js-score').text(score);\n}", "function addToScore () {\n userScore++;\n}", "function refreshTargetScore() {\n\t\t$(\"#targetScore\").text(targetScore);\n\t}", "function ScoreRecord(name, score) {\r\n this.name = name;\r\n this.score = score;\r\n}", "function updateScore () {\n score++;\n $('.score').text(score);\n}", "function updateScores() {\r\n var scores = $('table#round-' + roundNumber + ' input[type=number]'),\r\n i = 0;\r\n scores.each(function() {\r\n var score = $(this),\r\n name = score.data('playername'),\r\n mu;\r\n for (i = 0; i < matchUps.length; i++) {\r\n if (matchUps[i].p1.name === name || matchUps[i].p2.name === name) {\r\n mu = matchUps[i];\r\n break;\r\n }\r\n }\r\n\r\n var amt = parseInt(score.val());\r\n if (!mu.score) {\r\n mu.score = [0, 0, 0];\r\n }\r\n\r\n if (score.hasClass('draws')) {\r\n mu.score[1] += amt;\r\n } else { //wins\r\n if (mu.p1.name === name) {\r\n mu.score[0] += amt;\r\n } else {\r\n mu.score[2] += amt;\r\n }\r\n }\r\n });\r\n for (i = 0; i < matchUps.length; i++) {\r\n var mu = matchUps[i],\r\n p1Wins = mu.score[0],\r\n p2Wins = mu.score[2];\r\n if (p1Wins > p2Wins) {\r\n mu.p1.wins++;\r\n mu.p2.losses++;\r\n } else if (p2Wins > p1Wins) {\r\n mu.p2.wins++;\r\n mu.p1.losses++;\r\n } else {\r\n mu.p1.draws++;\r\n mu.p2.draws++;\r\n }\r\n }\r\n\r\n scoresSaved = true;\r\n }", "AddScore(score) {\n this.m_score += score;\n }", "function updateScore (score){\n\n\tvar scoreDisplay = document.getElementById('score');\n\t\n\tscoreDisplay.innerHTML = 'Score '+ score;\n\n\n\t}", "function updateScore() {\n score++;\n $('.score').text(score);\n}", "function updateScore() {\n score++;\n $('.score').text(score);\n}", "function updateScore() {\n score += questions[currentQuestionId - 1].worth;\n scoreElement.textContent = score;\n}", "increaseScore() {\n this.score++;\n }", "function updateScore(score) {\n\tdocument.querySelector('.score').innerHTML = `Score: ${score}`\n}", "function _updateScores(heroArray){\n for(var i = 0; i < heroArray.length; i++){\n heroArray[i].score = _calculatePoints(heroArray[i]);\n }\n}", "addScore(value) { \n this.setScore(this.score += value)\n this.updateLevel(); \n }", "updateTotalScore() {\n this.score =\n this.calculatedRedScore +\n this.calculatedYellowScore +\n this.calculatedGreenScore +\n this.calculatedBlueScore -\n this.penaltyScore;\n this.displayCurrentScore();\n }", "function updateScore(pts = 0, span) {\n score += pts;\n // Update scoreboard at top of screen\n SCOREBOARD.innerText = score;\n // In span, flash points earned with CSS animation\n if(span) {\n span.classList.add(\"fade-in-out\");\n span.textContent = `+$${pts}`;\n }\n}", "function updateScore(value) {\n gState.score += value;\n document.querySelector('header > h3 > span').innerText = gState.score;\n displayVictory();\n}", "function updateScore(){\n $('#score').html(score);\n }", "function processNewScore(score)\n{\n\n //set vars\n setUserScore(score);\n \n var LeaderBoard = Parse.Object.extend(\"leader_board\");\n var leader_board = new LeaderBoard();\n //to retrieve \n var query = new Parse.Query(LeaderBoard);\n query.equalTo(\"user_id\", user_id);alert('before find');\n query.find({success:function(res){\n alert('res:'); \n if(res.length>0){\n //update\n updateScore(res);\n } else{\n //create new score\n createNewScore();\n }\n }});\n return true;\n}", "update(){}", "update(){}", "update(){}", "function addTenScore(){\n score+=10;\n updateScore();\n}", "updateScore(){\n this.score += 10;\n CURRENT_SCORE.innerHTML = `Score: ${this.score}`;\n }", "function updateScore(newScore) {\n localStorage.setItem('keymasher_score', newScore);\n scoreNode.innerHTML = newScore;\n}", "function updateScore(currentScore) {\n $('#score').text(currentScore);\n}", "function updatePlayerScore(newScore) {\n player.score = newScore;\n document.getElementById(\"player-score\").innerText = newScore;\n}", "async function saveScore() {\n let body, tmp, stockId;\n let params;\n const date = new Date().toISOString().slice(0, 10);\n const stockList = await getIdList();\n\n try {\n body = (await axios.get(naverApiUrl(stockList.query))).data.result.areas[0]\n .datas;\n delete stockList.query;\n } catch (e) {}\n for (const item of body) {\n stockId = item.cd;\n console.log('Working on: ' + stockId);\n tmp = stockList[stockId];\n tmp.tradePrice = item.nv;\n tmp.expYield = tmp.priceAvg / item.nv;\n tmp.per = item.nv / item.eps;\n tmp.pbr = item.nv / item.bps;\n tmp.roe = item.eps / item.bps;\n tmp.fData = await getFinancialData(stockId);\n tmp.popularity = await getPopularity(stockId);\n tmp.financial = await calGFinancial(tmp);\n tmp.score = calScore(tmp);\n\n if (!isNaN(tmp.score) && tmp.score !== '-') {\n params = {\n TableName: 'scoreData',\n Item: {\n stockId: { S: stockId },\n score: { S: tmp.score + '' },\n date: { S: date }\n }\n };\n ddb.putItem(params, function (err) {\n if (err) {\n console.log('Error ', err);\n }\n });\n }\n\n docClient.update(scoreQuery2(stockId, tmp.score, date), function (err) {\n if (err) {\n console.log('[scoreTask]: Error ', err);\n }\n });\n }\n return stockList;\n}", "function updateScore(value) {\n gState.score += value;\n document.querySelector('header > h3 > span').innerText = gState.score;\n}", "function updateScore(value) {\n gState.score += value;\n document.querySelector('header > h3 > span').innerText = gState.score;\n}", "function updateScore(value) {\n gState.score += value;\n document.querySelector('header > h3 > span').innerText = gState.score;\n}", "function updateScores(){\n currentScore = currentGame.length;\n if (bestScore <= 0){\n //update best score from storage.\n var prevScore = scorestorage.getRecord(KEY_BEST_SCORE); \n if (prevScore){\n bestScore = prevScore;\n }\n scoreboard.updateBestScore(bestScore );\n }\n if (bestScore < currentScore ){\n scoreboard.updateBestScore(bestScore = currentScore );\n scorestorage.setRecord(KEY_BEST_SCORE, bestScore);\n }\n scoreboard.updateCurrentScore(currentScore);\n }", "function updateScore() {\n document.getElementById(\"demo9\").innerHTML = \"Score: \" + score;\n }", "function updateScore() {\n score++;\n\n $('.score').text(score);\n}", "function updateScore () {\n score++;\n $('.js-score').text(`${score} `);\n console.log(`updateScore ran and the score is ${score}`);\n}", "function setScore(newScore) {\n document.getElementById('score').innerHTML = newScore;\n score = newScore;\n}", "increment() {\n this.score++;\n }", "function saveScore() {\n let userInitials = $userInitialsEl.val().trim();\n let savedScore = (userInitials + \" \" + userScore);\n if (userInitials === \"\") {\n return;\n }\n scores.push(savedScore);\n $userInitialsEl.val(\"\");\n showHighScores();\n storeScores();\n renderScores();\n }", "_updateScore() {\n\t\tthis._$scoreBoard.textContent= this._score+'';\n\t}", "function updateScore() {\n $('#scoreNumber').text(score);\n}", "handleScoreUpdate(index, val) {\n\t\tlet newPlayers = this.state.players.slice();\n\t\tnewPlayers[index].score += val;\n\t\t// sort the players based on score\n\t\tnewPlayers.sort((a, b) => b.score - a.score);\n\t\tthis.setState({ players: newPlayers });\n\t}", "function updateScore() {\n\tctx.fillStlye = \"white\";\n\tctx.font = \"16px Arial, sans-serif\";\n\tctx.textAlign = \"left\";\n\tctx.textBaseline = \"top\";\n\tctx.fillText(\"Score: \" + points, 20, 20 );\n}", "function updateScore(newCurrentScore) {\n currentScore = newCurrentScore;\n currentScoreTag.innerText = currentScore;\n\n if (highScore >= 0) {\n highScore = (currentScore >= highScore) ? currentScore : highScore;\n } else {\n highScore = 0;\n }\n highScoreTag.innerText = highScore;\n }", "function addTwoScore(){\n score+=2;\n updateScore();\n}", "function updateScore() {\n const scoreDisplay = document.querySelector(\".user-score\")\n score += 1;\n scoreDisplay.textContent = score.toString();\n}", "function updateScore() {\n $scope.currentPage = \"scores\";\n }", "function addToScore() {\n if ($(\".score\").val() === \"--\") {\n document.getElementById(\"myScore\").value = \"01\";\n }\n game.score += 1;\n displayScore();\n }", "updateScore() {\n\t\tthis.score += 1;\n\t\tthis.gameinfoElement.childNodes[0].innerHTML = \"<h1>Score: \" + this.score + \"</h1>\";\n\t}", "function postUserScore(req, res) {\n\t/*var newScore = Scores(req);\n\tnewScore.save(function(err){\n\t\tif(err){ res.send(err);\t}\n\t\tres.json({\"added\":true});\n\t});*/\n\tres.json({ \"error\": \"Database Closed!\" });\n}", "incScore(amount)\n {\n this.score += amount;\n }", "function updateScoreboard(p) {\n totalPoints(p);\n exactMatchs(p);\n within5(p);\n within10(p);\n attempts();\n}", "function updateScore(){ // displays into HTML new current score counter\n $(\"#current-score\").text(counter);\n $(\"#win-record\").text(wins);\n $(\"#loss-record\").text(losses);\n}", "function updateScore(userRef, userkey, gametype, result) {\n console.log(\"userStats:\", userRef);\n\n var resultCount = userRef.win + 1;\n if (result == \"lose\")\n resultCount = userRef.lose + 1;\n else if (result == \"draw\")\n resultCount = userRef.draw + 1;\n\n firebase.database().ref().child('leaderboard/'+gametype+'/'+userkey).update({ [result]: resultCount});\n}", "function update_score(int) {\n\t\t\t\tvar temp = $(\"#p4_score_p\" + int).html();\n\t\t\t\t$(\"#p4_score_p\" + int).html(temp * 1 + 1);\n\t\t\t}", "function update_score(gamescore) {\n\tvar username = localStorage.getItem('username');\n\tvar input = {\n\t\t\t\tusername: username,\n\t\t\t\thighscore: gamescore\n\t\t\t\t}\n\tvar params = {\n\t\t\t\t\tmethod: \"PUT\",\n\t\t\t\t\turl: \"/api/user_stats/\",\n\t\t\t\t\tdata: input\n\t\t\t\t}\n\t$.ajax(params).done(function(data) {});\n}", "increaseScore(){\n let oldScore = this.state.score\n let newScore = oldScore + 1\n this.setState({score : newScore})\n ScoreManager.saveAppScore(newScore.toString())\n }", "function editSubmission(array, index, score) {\n array[index].score = score;\n let newPassed;\n if (score >= 60) {\n newPassed = true;\n } else {\n newPassed = false;\n } \n array[index].passed = newPassed;\n}", "function update_score(value){\n playerInstance.score = Math.max(0, playerInstance.score + value);\n score_tracker.innerText = playerInstance.score;\n }" ]
[ "0.7361139", "0.7126007", "0.7011713", "0.6831168", "0.6710596", "0.67011744", "0.666821", "0.66526437", "0.66288877", "0.66243935", "0.66197747", "0.6612916", "0.6542168", "0.647161", "0.6461944", "0.64236385", "0.6371391", "0.6370845", "0.63697493", "0.6333554", "0.63209563", "0.6306864", "0.62964946", "0.6279633", "0.6265812", "0.62535596", "0.62503266", "0.6230747", "0.6224357", "0.62124944", "0.62121975", "0.6184013", "0.61835146", "0.6177087", "0.6169337", "0.6165193", "0.61649686", "0.61566216", "0.61278594", "0.6115804", "0.6093443", "0.60928476", "0.60919386", "0.6088847", "0.6084667", "0.6082641", "0.60718125", "0.60670996", "0.6057064", "0.60467786", "0.60467786", "0.6040687", "0.6037131", "0.603639", "0.6016159", "0.60141534", "0.60115695", "0.6009426", "0.6004871", "0.6001458", "0.59942555", "0.5991244", "0.5991244", "0.5991244", "0.59802437", "0.596897", "0.59629923", "0.59577155", "0.5948232", "0.59457326", "0.5942582", "0.5942582", "0.5942582", "0.5941408", "0.5940435", "0.5940298", "0.5940255", "0.5936567", "0.5934279", "0.5922799", "0.5920789", "0.5914746", "0.5910935", "0.5908991", "0.5903814", "0.5893011", "0.5890332", "0.58822936", "0.5870662", "0.58627886", "0.58622974", "0.5862038", "0.5852541", "0.58490396", "0.58425534", "0.5833438", "0.5826373", "0.58238554", "0.5823511", "0.5819434" ]
0.624002
27
Run main functions repeatedly
function main() { if (game.level === evolveLevels[evolveIndex]) { menuPlayed = false; let cacheEvolveIndex = evolveIndex; if (game.level > 1 && !videoPlaying) { videoPlayed = false; game.canvas.style.display = "none"; // Hide game canvas let video = document.createElement("video"); video.width = 960; video.height = 540; video.autoplay = true; video.muted = true; video.src = gameMenu[evolveIndex].videoSource; document.getElementById("game-area").appendChild(video); video.addEventListener("ended", function () { videoPlayed = true; video.remove(); }); videoPlaying = true; video.play(); } if (videoPlayed) { videoPlaying = false; let menu = document.createElement("div"); game.canvas.style.display = "none"; // Show menu of current level menu = displayMenu(evolveIndex, menu); document.getElementById("game-area").appendChild(menu); evolveIndex += 1; } } if (menuPlayed) { game.canvas.style.display = "unset"; // Show canvas update(); render(); // End level if (enemies.filter((e) => e.hp > 0).length === 0) { score += game.level * 2 + game.duration - elapsedTime; if (game.level < LEVEL_DESIGN.enemyCommon.length) { enemies = []; blocks = []; initGame(game.level + 1); loadImages(); document.getElementsByTagName("canvas")[0].remove(); // Remove previous canvas startTime = Date.now(); // Restart timer } else { document.getElementsByTagName("canvas")[0].remove(); // Remove previous canvas win = true; updateRecord([score.toString(), playerName, game.level]); // Update score to records endGame(); // Game over: win return; } } if (game.duration - elapsedTime <= 0) { document.getElementsByTagName("canvas")[0].remove(); // Remove previous canva updateRecord([score.toString(), playerName, game.level]); // Update score to records endGame(); // Game over: lose return; } } requestAnimationFrame(main); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "function main() {\r\n mainLoop()\r\n}", "function init() {\r\n reset();\r\n lastTime = Date.now();\r\n main();\r\n }", "function init() {\n lastTime = Date.now();\n main();\n }", "function init() {\n lastTime = Date.now();\n main();\n }", "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "function main()\n{\n init();\n loop();\n}", "function init() {\n\n// reset();\n lastTime = Date.now();\n main();\n }", "function run() {}", "function run(){ //the only function which is executed.Rest all functions are interconnected by this function.\n initial(); //it creates snakes,food and walls\n int=setInterval(gameloop,interval);\n }", "function mainLoop() {\n\tupdateTicker(false);\n\tsetInterval(function(){ startUpdating(); }, 60*1000); // Recheck every minute (should be a multiple of any trading interval)\n\tupdateHistory();\n}", "function main() {\n if (has_game_ended()) return;\n\n changing_direction = false;\n setTimeout(function onTick() {\n clear_board();\n gridBoard();\n numPathBoard();\n drawFood();\n move_snake();\n drawSnake();\n // Call main again\n main();\n }, delay)\n }", "_setupLoop () {\n this._time = 0\n this._loop()\n }", "function main() {\n client.waitForReady(4000, () => {\n async.series([\n runGetFeature,\n runListFeatures,\n runRecordRoute,\n runRouteChat\n ]); \n });\n}", "function main() {\n init();\n enable();\n}", "function main() {\r\n\r\n if (endGame()) { window.location.reload(); };\r\n\r\n setTimeout(function onTick() {\r\n changingDirection = false;\r\n clearCanvas();\r\n drawFood();\r\n moveSnake();\r\n drawSnake();\r\n\r\n // Call game again\r\n main();\r\n }, speed)\r\n }", "function runAll() {\n synkarKonton();\n synkarGrupper();\n}", "function main() {\n\tif (didGameEnd()) return;\n\tsetTimeout(function onTick() {\n\t\tchangingDirection = false;\n\t\tclearCanvas();\n\t\tdrawFood();\n\t\tadvanceSnake();\n\t\tdrawSnake();\n\t\t//call main function again\n\t\tmain();\n\t}, 100)\n}", "async function main() {\n\n if (dotenv.error) {\n console.log( \"New install: no configuration found, or script not being run in the root directory\" );\n process.exit();\n }\n\n mysql.config({\n host: config.MYSQL_HOST,\n database: process.env.MYSQL_DATABASE||config.MYSQL_DATABASE,\n user: config.MYSQL_USER,\n password: config.MYSQL_PASSWORD\n });\n\n\t// Now get data from soaringspot\n soaringSpot();\n\n console.log( \"Background download from soaring spot enabled\" );\n setInterval( function() {\n soaringSpot();\n }, 5*60*1000 );\n}", "function init() {\n enablePlayAgain(reset);\n reset();\n lastTime = Date.now();\n main();\n }", "function mainLoop () {\n // Hard coded insturction count that each loop runs.\n let insCount = 5\n c8.DELAY = Math.max(0, c8.DELAY - 1)\n while (insCount > 0) {\n const { MEM, PC } = c8\n // Move instruction offset.\n const ins = getIns(MEM[PC] << 8 | MEM[PC + 1])\n try {\n // Perform operation according to instruction.\n ops[ins[0]](ins, c8, view)\n } catch (err) { warning(err, ins, c8) }\n insCount--\n }\n window.requestAnimationFrame(mainLoop)\n }", "function mainLoop() {\n\n\t\tvar timeChecker = setInterval(function() {\n\n\t\t\tstate.videoPlayer.update();\n\t\t\t// Forced update of time. Required for Safari.\n\t\t\ttime = state.videoPlayer.currentTime;\n\n\t\t\t// console.log('time:', time);\n\t\t\t_.each(popUpProblemTimer, function(obj) {\n\t\t\t\tif (time >= obj.start && time < obj.end) {\n\t\t\t\t\t// console.log(obj);\n\t\t\t\t\tvideoActions.actionFunction(time, obj);\n\t\t\t\t} else {\n\t\t\t\t\tvideoActions.actionFunction(time, null);\n\t\t\t\t}\n\t\t\t})\n\t\t}, 500);\n\n\t}", "function main() {\n /* Get our time delta information which is required if your game\n * requires smooth animation. Because everyone's computer processes\n * instructions at different speeds we need a constant value that\n * would be the same for everyone (regardless of how fast their\n * computer is) - hurray time!\n */\n let now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n /* Call our update/render functions, pass along the time delta to\n * our update function since it may be used for smooth animation.\n */\n update(dt);\n render();\n drawUI();\n\n /* Set our lastTime variable which is used to determine the time delta\n * for the next time this function is called.\n */\n lastTime = now;\n\n /* Use the browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n */\n win.requestAnimationFrame(main);\n }", "function main() {\n /* Get our time delta information which is required if your game\n * requires smooth animation. Because everyone's computer processes\n * instructions at different speeds we need a constant value that\n * would be the same for everyone (regardless of how fast their\n * computer is) - hurray time!\n */\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n /* Call our update/render functions, pass along the time delta to\n * our update function since it may be used for smooth animation.\n */\n if (Map.gameRunning) { update(dt); }\n render();\n\n /* Set our lastTime variable which is used to determine the time delta\n * for the next time this function is called.\n */\n lastTime = now;\n\n /* Use the browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n */\n win.requestAnimationFrame(main);\n }", "function main() {\n _readyInterval = window.setInterval(widgetReady, 500);\n }", "function main() {\n board.reset();\n board.bootSounds();\n //board.motorCheck();\n board.openDamper();\n monitorTemperature();\n \n events.on(\"start-alarm\", alarm);\n}", "loop() {}", "loop() {}", "function loop() {\r\n}", "function main() {\n init();\n worker();\n}", "function main() {\n // If the game ended return early to stop game\n if (didGameEnd()) return;\n\n setTimeout(function onTick() {\n snakeOne.changingDirection = false;\n snakeTwo.changingDirection = false;\n clearCanvas();\n drawFood();\n advanceSnake(food.x, food.y, food.FOOD_COLOUR);\n drawSnake();\n\n // Call game again\n main();\n }, GAME_SPEED)\n }", "function main() \n{\n\trender();\n\t// Request to do this again ASAP\n\trequestAnimationFrame(main);\n}", "function main() {\n\t\t// time delta information creates smooth animation based on time\n\t\tvar now = Date.now();\n\t\tvar dt = (now - lastTime) / 1000.0;\n\n\t\t/**\n\t\t * call update function with time delta parameter for smooth\n\t\t * animation and call render to load screen\n\t\t */\n\t\tupdate(dt);\n\t\trender();\n\n\t\t// set lastTime variable to now\n\t\tlastTime = now;\n\n\t\t/**\n\t\t * use browser's requestAnimationFrame function to call main\n\t\t * again when browswer can draw another frame\n\t\t */\n\t\twin.requestAnimationFrame(main);\n\n\t\tkeepScore();\n\t}", "function mainLoop( ) {\n\n\n let segundos = 5;\n let tiempo = segundos * 1000;\n\n\n console.log('Intervalo de '+ segundos );\n console.log('Perioodo: ');\n\n\n REALTIME.actualizarREALTIME( );\n\n setInterval((tiempo) => {\n console.log('-------------------------------------------------------');\n console.log('Intervalo de REALTIME '+ segundos );\n console.log('PERIODO');\n REALTIME.actualizarREALTIME( );\n }, tiempo )\n\n}", "function run() {\n }", "function run() {\n clearInterval(timer);\n timer = setInterval(timerFunc, 1000);\n }", "async function mainLoop() {\n\n\tdrawBoard(currentlyDisplayedCards);\n\twhile (!gameEnded) {\n\t\tlet eventSet = await getEvent(pastEvents);\n\t\tawait handleEvent(eventSet); // handle the event that was just added\n\t}\n}", "function run() {\n\n }", "function main() {\n /* Capturar a informaão de tempo delta que é requirida se o jogo\n * requer uma animação mais suave!\n */\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n /* \n */\n update(dt);\n render();\n\n /* \n */\n lastTime = now;\n\n /* \n */\n win.requestAnimationFrame(main);\n }", "function main() {\n /* Get our time delta information which is required if your game\n * requires smooth animation. Because everyone's computer processes\n * instructions at different speeds we need a constant value that\n * would be the same for everyone (regardless of how fast their\n * computer is) - hurray time!\n */\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n /* Call our update/render functions, pass along the time delta to\n * our update function since it may be used for smooth animation.\n */\n update(dt);\n render();\n\n /* Set our lastTime variable which is used to determine the time delta\n * for the next time this function is called.\n */\n lastTime = now;\n\n /* Use the browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n */\n win.requestAnimationFrame(main);\n }", "function main() {\n /* Get our time delta information which is required if your game\n * requires smooth animation. Because everyone's computer processes\n * instructions at different speeds we need a constant value that\n * would be the same for everyone (regardless of how fast their\n * computer is) - hurray time!\n */\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n /* Call our update/render functions, pass along the time delta to\n * our update function since it may be used for smooth animation.\n */\n update(dt);\n render();\n\n /* Set our lastTime variable which is used to determine the time delta\n * for the next time this function is called.\n */\n lastTime = now;\n\n /* Use the browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n */\n win.requestAnimationFrame(main);\n }", "function main()\n{\n\t// Fetch all stats that exist already\n\tvar fetchAllUrl = baseUrl + \"/apps/fetchstats/\" + appId;\n\tconsole.log(\"Fetching all stats...\");\n\tAppsAjaxRequest(fetchAllUrl, {}, function(results){\n\t\tconsole.log(\"Retrieved results!\");\n\t\texistingStats = results;\n\t\tParseExistingStats();\n\t});\n}", "function main() {\n /* Get our time delta information which is required if your game\n * requires smooth animation. Because everyone's computer processes\n * instructions at different speeds we need a constant value that\n * would be the same for everyone (regardless of how fast their\n * computer is) - hurray time!\n */\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n /* Call our update/render functions, pass along the time delta to\n * our update function since it may be used for smooth animation.\n */\n update(dt);\n render();\n\n /* Set our lastTime variable which is used to determine the time delta\n * for the next time this function is called.\n */\n lastTime = now;\n\n if (running) {\n /* Use the browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n */\n win.requestAnimationFrame(main);\n } else {\n\n hud.textElements.push({\n text: 'Press \\'Y\\' to play again.',\n lineWidth: 2,\n fillStyle: 'white',\n strokeStyle: 'black',\n font: '26pt \\'IMPACT\\'',\n position: 'center center',\n padding: 83\n });\n\n render();\n }\n }", "function main() { // Internal Main function of the engine. Keeps track of time. Calls for updates, renders, and tells the browser to perform an animation. It appears to do so only once.\n \n var now = Date.now(), // The variable now is defined as a method returning the amount of miliseconds that have transpired since 1970...\n dt = (now - lastTime) / 1000.0; //...the variable dt is defined as the difference between the value of the variable \"now\" and the value of the variable \"lastTime\", divided by 1000.\n\n /* Call our update/render functions, pass along the time delta to\n * our update function since it may be used for smooth animation.\n */\n update(dt); // A method which loads messages and returns a promise. \n render(); // Calls the render function.\n\n lastTime = now; // Defines the variable lastTime as the value of Date.now().\n\n /* Use the browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n */\n \n win.requestAnimationFrame(main); // Tells the browser that we wish to perform an animation and requests that the browser perform a function to update the animation before the next repaint.\n victory();\n }", "function main() {\r\n /* Get our time delta information which is required if your game\r\n * requires smooth animation. Because everyone's computer processes\r\n * instructions at different speeds we need a constant value that\r\n * would be the same for everyone (regardless of how fast their\r\n * computer is) - hurray time!\r\n */\r\n var now = Date.now(),\r\n dt = (now - lastTime) / 1000.0;\r\n\r\n /* Call our update/render functions, pass along the time delta to\r\n * our update function since it may be used for smooth animation.\r\n */\r\n update(dt);\r\n render();\r\n\r\n /* Set our lastTime variable which is used to determine the time delta\r\n * for the next time this function is called.\r\n */\r\n lastTime = now;\r\n\r\n /* Use the browser's requestAnimationFrame function to call this\r\n * function again as soon as the browser is able to draw another frame.\r\n */\r\n win.requestAnimationFrame(main);\r\n }", "function mainLoop() {\n //writingHour();\n if (CommandsLoaded) {\n readChat();\n readPMs();\n }\n}", "run () {\n }", "function main() {\n\t\t\ttry{\n\t\t\t\trender();\n\t\t\t} catch(e) {\n\t\t\t\tconsole.log(e);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(rendering == true) {\n\t\t\t\traf(main.bind(this));\n\t\t\t}\n\t\t}", "function main() {\n doCbaam()\n doEcb()\n updateGraphFile()\n}", "function main() {\n // If the game ended, return early to stop the game\n if (didGameEnd()) return;\n\n setTimeout(function onTick() {\n changingDirection = false;\n clearCanvas();\n drawFood();\n advanceSnake();\n drawSnake();\n\n // Call game again\n main();\n }, GAME_SPEED)\n}", "function main() {\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n update(dt);\n render();\n\n lastTime = now;\n win.requestAnimationFrame(main);\n }", "async function main() {\n new p5((p_) => {\n p = p_;\n p.setup = setup;\n p.draw = draw;\n }, elements.container);\n\n if (ENABLE_STATS) {\n stats.showPanel(0);\n elements.stats.appendChild(stats.dom);\n }\n}", "function main() {\n /* Get our time delta information which is required if your game\n * requires smooth animation. Because everyone's computer processes\n * instructions at different speeds we need a constant value that\n * would be the same for everyone (regardless of how fast their\n * computer is) - hurray time!\n */\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n timer += dt;\n\n /* Call our update/render functions, pass along the time delta to\n * our update function since it may be used for smooth animation.\n */\n\n if (!paused) {\n update(dt);\n }\n render();\n\n /* Set our lastTime variable which is used to determine the time delta\n * for the next time this function is called.\n */\n lastTime = now;\n\n /* Use the browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n */\n win.requestAnimationFrame(main);\n }", "Run() {\n\n }", "function main() {\n // console.log('Main');\n // If the game ended return early to stop game\n if (didGameEnd()) {\n resetGame();\n clearCanvas();\n\n // s.drawSnake()\n drawSnake();\n\n createFood();\n\n drawFood();\n\n // s.advanceSnake()\n advanceSnake();\n main()\n }\n else {\n setTimeout(function onTick() {\n changingDirection = false;\n clearCanvas();\n\n drawFood();\n\n naiveAI()\n // s.advanceSnake()\n advanceSnake();\n\n // s.drawSnake()\n drawSnake();\n // checkNearWall()\n // getNearbyObstacles()\n\n // console.log('------------------------------');\n main();\n\n }, GAME_SPEED)\n }\n}", "function start() {\n init();\n run();\n }", "function mainLoop()\r\n{\r\n\tvar startTime = performance.now();\r\n}", "function run() {\n\n}", "function main () {\n\tvar now = Date.now();\n\tvar delta = now - then;\n\n\tupdate(delta / 1000);\n\trender(Math.round(1 / (delta / 1000)));\n\n\tthen = now;\n\n\t// Request to do this again ASAP\n\trequestAnimationFrame(main);\n}", "function main() {\n console.log('Ready!\\n');\n _hcsr04.fn.startMonitoring();\n}", "function main() {\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n update(dt);\n render();\n\n lastTime = now;\n\n win.requestAnimationFrame(main);\n }", "function loop() {\r\n // if (is_loop) {\r\n setTimeout(manage_loop, manager.interval);\r\n // is_loop = false;\r\n // }\r\n }", "function runBasic() {\n initMap();\n initActors();\n display(); \n}", "function main() {\n if(!running) {\n return;\n }\n\n var now = Date.now();\n var dt = (now - then) / 1000.0;\n\n//\tupdate(dt);\n render();\n\n then = now;\n requestAnimFrame(main);\n }", "function mainLoop() {\n // check if the user is drawing and emit xy coords to be pushed into line history on the back end\n if (mouse.click && mouse.move && mouse.pos_prev) {\n // send line to to the server\n client.emit('draw_line', { line: [mouse.pos, mouse.pos_prev] });\n mouse.move = false;\n }\n if (erase) { //user1 erases -> server gets message -> updates client state for all users\n client.emit('erase_board', { message: 'Client to server: User x erased the board' });\n erase = false;\n }\n //if not drawing, assign values to pos_prev to begin the drawing process\n mouse.pos_prev = { x: mouse.pos.x, y: mouse.pos.y };\n setTimeout(mainLoop, 25); //recursive loop every 25ms\n }", "function main() {\n\n //Get our time delta information which is required if your game requires smooth animation.\n\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n /*\n Call our update/render functions, pass along the time delta to our update function\n since it may be used for smooth animation.\n */\n update(dt);\n render();\n\n /*\n Set our lastTime variable which is used to determine the time delta\n for the next time this function is called.\n */\n lastTime = now;\n\n /*\n Use the browser's requestAnimationFrame function to call this\n function again as soon as the browser is able to draw another frame.\n If game's stop value is set to true, the game will end.\n */\n if(!game.stop){\n win.requestAnimationFrame(main);\n }\n }", "_main () {\n const n = Object.keys(this._accessories).length\n if (n > 0) {\n this.log('restored %d accessories from cache', n)\n }\n if (this.listenerCount('heartbeat') > 0) {\n let beat = -1\n setInterval(() => {\n beat += 1\n this.emit('heartbeat', beat)\n }, 1000)\n }\n this._upnpConfig(this._configJson.upnp || {})\n if (this.listenerCount('upnpDeviceAlive') > 0) {\n this._upnpMonitor.listen()\n }\n if (this.listenerCount('upnpDeviceFound') > 0) {\n this._upnpMonitor.search()\n }\n }", "function main() {\n getLogger().clear();\n\n for (var i = 0; i < threads.length; i++) {\n if (i > 0) {\n getLogger().log(\"---\");\n }\n\n getLogger().log(\"Processing thread number \" + i);\n\n if (anyMessageMatchesAnyRuleInThread(threads[i])) {\n runActionsOnThread(threads[i]);\n } else {\n getLogger().log(\"No action taken because none of your rules were matching this thread.\");\n }\n }\n}", "firstRun() { }", "function run(){\r\n\tinit();\r\n\trunInterval=setInterval(gameLoop, 100);\r\n\r\n}", "function main() {\n let game = new Game()\n game.initExample1()\n GAME = game;\n\n // __________________________________________________________________\n // Game Loop\n // ==================================================================\n function loop() {\n game.clearScreen();\n game.step();\n game.drawScreen();\n game.updateDebugger();\n window.requestAnimationFrame(loop);\n }\n\n window.requestAnimationFrame(loop);\n}", "function main(){\n\n\tvar int1 = setInterval(function(){\n\n\t\tif(lex.loaded()){\n\t\t\tgetLexToks();\n\t\t\tclearInterval(int1);\n\t\t}else if(lex.failed()){\n\t\t\tclearInterval(int1);\n\t\t\tclearInterval(int2);\n\t\t}\n\n\t}, 1);\n\n\tvar int2 = setInterval(function(){\n\n\t\tif(toks != undefined){\n\t\t\tstart();\n\t\t\tclearInterval(int2);\n\t\t}\n\n\t},1);\n\n\tfunction getLexToks(){\n\t\ttoks = lex.getLexemes();\n\t}\n\n\t\n}", "function startLoop() {\n\tisrunnning = true;\n}", "static loop(func, time) {\n this.loopId = setInterval(func, time);\n }", "static loop(func, time) {\n this.loopId = setInterval(func, time);\n }", "function run (){\n \t\tconsole.log(\"in screen-splash run in screen-splash.js\");\n \t\tif(firstTime){\n \t\t\tinit();\n \t\t}\n \t\t//do our stuff\n \t}", "function runNow() {\n cancelTimer = null;\n start = null;\n runScheduledForNextTick = false;\n fn.apply(ctx, args);\n }", "function runNow() {\n cancelTimer = null;\n start = null;\n runScheduledForNextTick = false;\n fn.apply(ctx, args);\n }", "function main() {\n constructDisplay()\n gameBoard = new Board()\n timer()\n autoMove()\n update()\n}", "function main() {\n latestSimulationPrediction(),\n simulationPrediction()\n // latestAnalyticalPrediction(),\n // analyticalPrediction()\n // simulationPredictionKPIs(),\n analyticalPredictionKPIs()\n // startEvaluation(),\n // evaluationStatus(),\n // cancelEvaluation(),\n // simulatedEvaluation(),\n // simulatedEvaluationKPIs(),\n // setNowTime(),\n // getNowTime(),\n // ping()\n}", "function main() {\n update((Date.now() - then) / 1000);\n if (game.images == game.imagesLoaded) {\n render();\n }\n then = Date.now();\n}", "function run() { \n\n moveToNewspaper();\n pickBeeper();\n returnHome();\n\n}", "function main () {\n var now = Date.now()\n var delta = now - then\n\n update(delta / 1000)\n render()\n\n then = now\n\n // Request to do this again ASAP\n window.requestAnimationFrame(main)\n}", "function main(){\r\n\tcur_t = 0\r\n\tkill_step = poisson(kill_step);\r\n\tcount_step = 0;\r\n\t//do {\r\n\tvar times = setInterval(function(){\r\n\t\tif (cur_t == steps) clearInterval(times);\r\n\r\n\t\tvar temp = couple_logistic_possison(pop, params, steps);\r\n\t\tif (count_step == kill_step){\r\n\t\t\tcata(kill_percentage, pop);\r\n\t\t\tkill_step = poisson(kill_step);\r\n\t\t\tcount_step = 0;\r\n\t\t}\r\n\r\n\t\tshow_graphics(temp);\r\n\r\n\t\tcur_t += 1;\r\n\t\tcount_step += 1;\r\n\t\treturn temp;\r\n\t\t}, 35);\r\n\t//} while (cur_t < steps)\t\r\n}", "async function main () {\n \n // start with lights off\n await set_lights(\"off\")\n \n // start the camera checking, passing \"false\" for \n // for the current light status (because they're off)\n check_camera(false)\n \n}", "function work() {\n\t\t// Set running to true to prevent more calls until the first one is done\n\t\trunning = true;\n\t\t\n\t\t// Go through the DOM\n\t\twalk(document.body);\n\n\t\t// Set running to false to allow additional calls\n\t\trunning = false;\n\t}", "function run() {\n\tintervalId = setInterval(display, 60000);\n}", "mainloop() {\n this.repetitions++;\n let now = new Date().getTime();\n let relativeOriginal = now - this.realstartts;\n let relative = relativeOriginal * this.config.timeFactor;\n for (let node of this.nodes) {\n node.check(relative);\n };\n if (this.repetitions % 1000 === 0) {\n console.log(\"Repetition:\", this.repetitions, \"Relative time:\", relative);\n };\n }", "function main () \n{\n var now = Date.now();\n var delta = now - then;\n\n\tupdate(delta / 1000);\n\trender();\n\n\tthen = now;\n}", "start(){\n let _this = this;\n // run the main sequence every process_frequency seconds\n _this.logger.info('starting work');\n _this.execute = true;\n _this.run();\n }", "function run() {\n init();\n int = setInterval(gameLoop, interval);\n}", "main() {\n if(this.isRunning)\n {\n /* ENGINE RENDER CHAIN */\n this.engine.renderer.render();\n \n /* UI UPDATES */\n this.update();\n \n /* NEXT FRAME */\n this.timer = requestAnimationFrame(this.main);\n }\n }", "function loop() {\n\t\t// searches textfile to make an array of games, run one of the games, returns whether person won or not\n\t\tconsole.log(\"loop has been called\");\n\n//START SEQUENCE HERE\n\t\t//var game = rungame();\n\t\ttimer();\n\t\tgameLoop = setInterval(timer,12000);\n\t\tscoreLoop = setInterval(scoreChange,100);\n\t\ttimeLoop = setInterval(callTime,1000);\n\t}", "function run() {\n update();\n setInterval(update, 3600000);\n}", "function mainComplete() {\n\t\tconsole.log('it is all loaded up');\n\t\t//Demo.main.initialize();\n\t}", "function printForever1() {\n console.log('forever');\n printForever1();\n}" ]
[ "0.7245325", "0.7245325", "0.723445", "0.7169174", "0.7153774", "0.7153774", "0.71489054", "0.71489054", "0.71489054", "0.71489054", "0.7111461", "0.7059618", "0.69930404", "0.6874546", "0.6868406", "0.67290676", "0.6677542", "0.66472757", "0.6643369", "0.6585214", "0.6561061", "0.65544033", "0.6550719", "0.65403485", "0.6520168", "0.65066427", "0.6505045", "0.6479013", "0.6468934", "0.6459183", "0.6451093", "0.6450931", "0.6450931", "0.6447199", "0.6437102", "0.6429237", "0.6421476", "0.64184254", "0.63952094", "0.63833237", "0.63832235", "0.6351762", "0.63445824", "0.63437814", "0.633688", "0.633688", "0.6312621", "0.6279858", "0.62736356", "0.6264189", "0.6260634", "0.62597126", "0.6250639", "0.6241485", "0.6227689", "0.62144214", "0.62095803", "0.62054473", "0.6203957", "0.6202417", "0.6197343", "0.6192248", "0.618715", "0.6179827", "0.6178005", "0.6173605", "0.6171671", "0.615938", "0.61592853", "0.61585", "0.6155486", "0.6152926", "0.6138405", "0.6137868", "0.6136848", "0.6135724", "0.6120268", "0.6108801", "0.60948944", "0.60948944", "0.6086378", "0.6085377", "0.6085377", "0.6078357", "0.60716736", "0.6066304", "0.60612315", "0.6043064", "0.60414743", "0.6034177", "0.6031335", "0.60269845", "0.60267216", "0.6000156", "0.5995603", "0.5987205", "0.59862685", "0.5985867", "0.59857076", "0.59813386", "0.59791964" ]
0.0
-1
pattern to check postal code
async function check() { if (resetpw == "reset") { pw = bcrypt.hashSync(lname.toLowerCase() + hp.slice(0, 4), 10); // resets password to staff's last name and first 4 numbers of their phone number } else { User.findOne({ where: { staffId: req.params.id } }).then((user) => { pw = user.password // retrieves original password }).catch((err) => { console.log(err); res.redirect('/staff/error'); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isValidPostalcode(postalcode) {\n if (postalcode.search) {\n postalcode = removeSpaces(postalcode);\n if (postalcode.length == 6 && postalcode.search(/^[a-zA-Z]\\d[a-zA-Z]\\d[a-zA-Z]\\d$/) != -1) return true;\n else if (postalcode.length == 7 && postalcode.search(/^[a-zA-Z]\\d[a-zA-Z]-\\d[a-zA-Z]\\d$/) != -1) return true;\n else return false;\n }\n return true;\n}", "function zipvalidate(postcode){\n return /^[12346]\\d{5}$/.test(postcode);\n}", "function checkPostalCodeValidity(form) {\n// Taken from URL: https://stackoverflow.com/questions/15774555/efficient-regex-for-canadian-postal-code-function/26788801\n\tvar value = form.postal_code.value;\n\tvar regex = /^[A-Za-z]\\d[A-Za-z][ -]?\\d[A-Za-z]\\d$/;\n var match = regex.exec(value);\n if (match){\n if ( (value.indexOf(\"-\") !== -1 || value.indexOf(\" \") !== -1 ) && value.length == 7 ) {\n return true;\n } else if ( (value.indexOf(\"-\") == -1 || value.indexOf(\" \") == -1 ) && value.length == 6 ) {\n return true;\n }\n } else {\n\t\t window.alert(\"Postal code must be in the format A0A 0A0.\");\n return false;\n }\n\n}", "function postalCode() {\n var errors = document.querySelector(\"#errors\");\n var pCode = document.querySelector(\"#postalCode\");\n var code = pCode.value.trim();\n var patt = /^[A-Z][0-9][A-Z][0-9][A-Z][0-9]$/ig;\n if(!patt.test(code)) {\n errorMessage(\"<p>Please enter a valid Canadian postal code</p>\");\n return false;\n } else {\n return true;\n }\n}", "function isPostalCode(val) {\n\t// Validate characters only\n\tvar regex = /^[ABCEGHJKLMNPRSTVXYabceghjklmnprstvxy]{1}\\d{1}[A-Za-z]{1}\\d{1}[A-Za-z]{1}\\d{1}$/;\n\treturn val.match(regex);\n}", "function zipCodeValidation(postalCode) {\r\n var pattern = /^[A-Za-z]\\d[A-Za-z][ -]?\\d[A-Za-z]\\d$/;\r\n if (!pattern.test(postalCode)) {\r\n displayError(`The postal code must be in the following format: C1A 1A7`);\r\n } else return pattern.test(postalCode);\r\n}", "function validatePostalCode(x) {\n /* x must be a letter followed by a digit, a letter, optionally a space, a digit, a letter and a digit\n */\n\n if (!/[A-Za-z]\\d[A-Za-z] ?\\d[A-Za-z]\\d/.test(x)) {\n return false; //x is not in an appropriate format\n }\n return true;\n}", "function postalCodeValidate(postal) {\n\n var regex = new RegExp(/^[A-Z]\\d[A-Z]( )?\\d[A-Z]\\d$/i);\n if (!regex.test(postal)){\n document.getElementById('postalcode').value = \"\" ;\n return false;\n }\n else{\n return true;\n }\n}", "function isZipCode(post)\n{\nregex = /^[A-Za-z]\\d[A-Za-z][ -]?\\d[A-Za-z]\\d$/;\n if (regex.test(post))\n {\n return true;\n }\n else\n {\n return false;\n }\n}", "function postalValidation(){\n var valid = false;\n var postal= document.getElementById(\"postal\").value;\n const validPostal= /[a-zA-Z][0-9][a-zA-Z](-| |)[0-9][a-zA-Z][0-9]/;\n \n if(validPostal.test(postal)){\n valid=true;\n }\n else{\n alert(\"You have entered an invalid postal code!\");\n }\n return valid;\n \n }", "function validatePostcode(postcode) {\n\tconst postcodeRegex = /^[0-9]{4}$/;\n\tconst patternMatches = postcodeRegex.test(postcode);\n\treturn patternMatches;\n}", "function zipvalidateBest(postcode){\n return /^[12346]\\d{5}$/.test(postcode)\n}", "function isAvaliablePC(){\n var returnVal = false;\n id = document.getElementById('postCode'); \n postalCode = id.value;\n // converts input value(postal code) to uppercase and trimming.\n postalCode = postalCode.toUpperCase().trim(); \n\n // var postcoderegex = new RegExp(/^[ABCEGHJKLMNPRSTVXY]\\d[ABCEGHJKLMNPRSTVWXYZ]( )?\\d[ABCEGHJKLMNPRSTVWXYZ]\\d$/i);\n // N2L0G8 (6 letters)\n var postcoderegex = new RegExp(/^[ABCEGHJKLMNPRSTVXY]\\d[ABCEGHJKLMNPRSTVWXYZ]\\d[ABCEGHJKLMNPRSTVWXYZ]\\d$/i);\n\n if (postcoderegex.test(postalCode.toString())) { \n // inputs the space when length is 6 \n if(postalCode.length == 7 && postalCode.substring(3,1) == ' '){\n postalCode = postalCode.substring(0,3) + postalCode.substring(4);\n }\n id.value = postalCode;\n document.getElementById('postCode_error').style = \"display:none\"; \n return true;\n }\n else\n {\n document.getElementById('postCode_error').style = \"display:block\";\n return false;\n }\n}", "function validarCodigoPostal(parametro){\n var patron = /(([1-4][0-9][0-9][0-9][0-9])|(0(?=[1-9][0-9][0-9][0-9]))|(5(?=[0-2][0-9][0-9][0-9])))/;\n if(parametro.search(patron)){\n return false;\n }else{\n return true;\n }\n}", "validatePostalCode(postalCode) {\n if(postalCode==='') {\n return 'Postal code required';\n } else if (!/^\\d+$/.test(postalCode)) {\n return 'Postal code invalid'\n } else if (postalCode.length > 10 || postalCode.length < 2) {\n return 'Postal code invalid (must be between 2-10 digits)'\n }\n \n return '';\n }", "function postcodeValid(postcode) {\n var regex = /([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([AZa-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z]))))[0-9][A-Za-z]{2})/\n var postcode = noSpacesPostcode(postcodeInput.value);\n if (regex.test(postcode)) {\n return true\n } else {\n throw new Error('Enter a valid postcode & category')\n }\n}", "function isValidPostalCode(code, country) {\n // debug.info( 'isValidPostalCode', code, country );\n code = $.trim(code);\n var format = getPostalCodeRegexMatrix(country);\n if (format) {\n if (code.length < parseInt(format.minlen)) {\n return false;\n }\n if (code.length > parseInt(format.maxlen)) {\n return false;\n }\n var re = new RegExp(format.regex);\n return re.test(code);\n }\n //getPostalCodeRegexMatrix will check the country as a key in the map postal_code_matrix, so for these countries which doesn't have postal code, we need to return true\n else if (format == '') {\n return true;\n }\n else {\n debug.log('No country found')\n return true;\n }\n}", "function validateCanadaPostalCode(field) {\n // empty fields pass validation\n if (field === undefined || field === null) {\n return true;\n }\n var regex = new RegExp(/(^[A-Za-z0-9]{6}$)|(^[A-Za-z0-9]{3}\\s[A-Za-z0-9]{3}$)/);\n return regex.test(field);\n}", "validateZipCode(zipcode) {\n let re = /(^\\d{5}$)|(^\\d{5}-\\d{4}$)/;\n return re.test(zipcode);\n }", "function validatePostcode(postcode) {\n if (postcode >= 3000 && postcode <= 3207) {\n return true;\n } else if (postcode == 3800) {\n return true;\n } else {\n return false;\n }\n}", "function GHValidateZipCode(source)\n{\n\tif (!ValidateRegular(source, \"\\\\d{5}(-\\\\d{4})?\"))\n\t{\n\t\tsource.select();\n\t\tsource.focus();\n\t\treturn false;\n\t}\n\treturn true;\n}", "function IsValidUSzipcode(zip) {\n var pattern = new RegExp(/(^\\d{5}$)|(^\\d{5}\\-?\\d{4}$)/);\n return pattern.test(zip);\n}", "function pinCode(pc){\n\tvar zip_regex = /^[0-9]+$/;\n}", "function checkFormat(zipcode){\n const regex = /(\\d{5})(\\d{4})/;\n if (zipcode.length === 5){\n return true;\n }else if(zipcode.length === 9){\n ZIP = zipcode.replace(/(\\d{5})(\\d{4})/, \"$1-$2\");\n return true;\n }else \n return false;\n}", "function zipCode(str) {\n var re = /^[0-9]{5}(?:-[0-9]{4})?$/; //-- Solution for bonus test\n //var re = /^\\d{5}$/;\n return re.test(str);\n}", "function validatePO() {\n\n var reg = /^[A-Z]\\d[A-Z]\\d[A-Z]\\d$/;\n if (!reg.test(document.getElementById('postal').value)) {\n\tdocument.getElementById('postal').style.borderColor = \"#ff1a1a\";\n errorMessage.innerHTML = \"The postal you entered is not valid\";\n errorMessageBody.style.display = \"block\";\n return false;\n } else{\n return true;\n }\n }", "function validate_zip_code(type){\r\n var strValidChars = '0123456789';\r\n var zipcode_val = $('#'+type+'_zip_code_new').val();\r\n var flag = 1;\r\n \r\n //zipcode should be only 5 digit long\r\n if(zipcode_val.length < 5 || zipcode_val.length > 5){\r\n flag=0;\r\n }\r\n //if not numeric\r\n for(var i=0;i<zipcode_val.length;i++){\r\n strChar = zipcode_val.charAt(i);\r\n if (strValidChars.indexOf(strChar) == -1){\r\n flag=0;\r\n }\r\n }\r\n \r\n return flag;\r\n \r\n}", "function validAddressZip(value) {\n return /^[A-Z-a-z-0-9\\s]{5,80}$/.test(value)\n }", "function isValidZipCode(str) {\n return /^\\d{5}$/g.test(str);\n}", "function ValidateZipCode(zipCode) \n{\n if (/(^\\d{5}$)/.test(zipCode))\n {\n return (true)\n }\n // alert(\"You have entered an invalid email address!\")\n return (false)\n}", "function CheckString() {\n try {\n //user input field\n var s = $('#regExString').val();\n //Regular expression object is created:\n var regExpression = /^[A-Z,a-z]\\d[A-Z,a-z][\\s{1}]?\\d[A-Z,a-z]\\d/;\n // The test method returns a Boolean to indicate whether the input string matches the regular expression that was created.\n if (regExpression.test(s))\n alert(\"Valid postal code.\");\n else alert(\"Invalid postal code.\");\n } catch (e) {\n alert(e.message);\n }\n}", "function isValidZipcode(zipcode) {\r\n return /(^\\d{5}$)/.test(zipcode) && isBaltimoreZipcode(zipcode); \r\n}", "function checkZipcode() {\n var pattern = new RegExp(/^[0-9]{5}$/i);\n \n if (pattern.test(zipcodeInput.val())) {\n $(\"#zipcode_error_message\").hide();\n zipcodeInput.removeClass('error');\n }\n else {\n $(\"#zipcode_error_message\").html(\"Enter valid zipcode\");\n $(\"#zipcode_error_message\").show();\n zipcodeInput.addClass('error');\n error_zipcode = true;\n }\n }", "function checkPostcode(eatery, input) {\n \t\t return eatery.postcode === input || eatery.suburb === input;\n \t\t}", "function validatePostcode(pc, msg)\n{ \n\t//get element by ID\n\tdocument.getElementById(msg).innerHTML=\"\";\n\t//regular expression\n\tvar postcode = /^[a-zA-Z0-9]{3,9}$/; \n\t//if value matches pattern\n\tif(pc.value.match(postcode))\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\t//get element by ID\n\t\tdocument.getElementById(msg)\n\t\t\t.innerHTML=\"Postcode format not valid. Please ensure no spaces \";\n\t\tpc.focus();\n\t\treturn false;\n\t}\n}", "function isZipValid(zipCode) {\n\tvar zip = /^\\d{5}(?:[-\\s])?\\d{4}$/;\n\tzip.test(zipCode) ? console.log('This is a valid postal code') : console.log('This is not a valid postal code');\n}", "function telephoneCheck(str) {\r\n if (!parseInt(str[0],10)){\r\n if (str[0] !== '('){\r\n return false;\r\n }\r\n }\r\n var n= /\\d/g;\r\n var p= /\\d|\\(|\\)/g;\r\n var base = str.match(n).join('');\r\n var par = str.match(p).join('');\r\n var p1 = -1;\r\n var p2 = -1;\r\n console.log(base);\r\n if (base.length === 10){\r\n console.log(\"added 1 to beginning\");\r\n base = \"1\"+base;\r\n par = \"1\"+par;\r\n }\r\n else if(base.length === 11){\r\n if (base[0] !== \"1\"){\r\n console.log(\"invalid country code\");\r\n return false;\r\n }\r\n }\r\n else{\r\n console.log(\"invalid number of digits\");\r\n return false;\r\n }\r\n p1 = par.indexOf('(');\r\n p2 = par.lastIndexOf(')');\r\n if (p1 >= 0 || p2 >= 0){\r\n console.log(\"contains parenthases\");\r\n console.log(par);\r\n if (p1 >= 0 && p2 >= 0){\r\n if(p1 !== 1){\r\n return false;\r\n }\r\n else{\r\n if (p2 !== 5){\r\n return false;\r\n }\r\n }\r\n }\r\n else{\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "function isZipValid(zipCode) {\n\tvar zip = /^\\d{5}(?:[-\\s]\\d{4})?$/;\n\tzip.test(zipCode) ? console.log('This is a valid postal code') : console.log('This is not a valid postal code');\n}", "function validateZipCode(field) {\n if (field === undefined || field === null) {\n return false;\n }\n var zip_regexp = /^[0-9]+(?:[-\\s]*)?(?:[0-9]*)?$/;\n if (zip_regexp.test(field) !== true) {\n return false;\n }\n return validateMinLength(field, 5) && validateMaxLength(field, 10);\n}", "isPalestinian() {\r\n return this.phoneNumber.match(/^(0[23489]2|05[69]\\d|)\\d{6}$/) !== null;\r\n }", "function isValidZipcode(zipcode) {\n zipcode = removeSpaces(zipcode);\n if (!(zipcode.length == 5 || zipcode.length == 9 || zipcode.length == 10)) return false;\n if ((zipcode.length == 5 || zipcode.length == 9) && !isNumeric(zipcode)) return false;\n if (zipcode.length == 10 && zipcode.search && zipcode.search(/^\\d{5}-\\d{4}$/) == -1) return false;\n return true;\n}", "function validateUSAZipCode(field) {\n // empty fields pass validation\n if (field === undefined || field === null) {\n return true;\n }\n var regex = new RegExp(/(^\\d{5}$)|(^\\d{5}-\\d{4}$)/);\n return regex.test(field);\n}", "function ordersDeliveryPostcodeValid(pc_str) {\n\t\n\tvar result = true;\n\tif (!isEmpty(pc_str))\n\t{\n\t\tif (!isNumeric(pc_str)) // Don't check postcode length in case overseas order\n\t\t/*{\n\t\t\tif (!isLengthOkay(pc_str, 4))\n\t\t\t{\n\t\t\t\talert(\"Postcode needs to be 4 digits. You entered \" + pc_str);\n\t\t\t\tresult = false;\n\t\t\t}\n\t\t}\n\t\telse*/\n\t\t{\n\t\t\talert(\"Delivery postcode must be all digits. You entered \" + pc_str);\n\t\t\tresult = false;\n\t\t}\n\t}\n\telse\n\t{\n\t\talert(\"Delivery postcode is empty. Please enter a value.\");\n\t\tresult = false;\n\t}\n\treturn result;\n}", "function checkAmtPassword(p) { return (p.length > 7) && (/\\d/.test(p)) && (/[a-z]/.test(p)) && (/[A-Z]/.test(p)) && (/\\W/.test(p)); }", "function isValidZipCode() {\r\n var x = document.getElementById(\"Code\");\r\n var regexs = /^\\d{6}$/; \r\n if (!x.value.match(regexs)) {\r\n document.getElementById('validZip').style.display = \"block\";\r\n document.getElementById('validZipSpace').style.display = \"block\";\r\n isCode = false;\r\n }\r\n else {\r\n document.getElementById('validZip').style.display = \"none\";\r\n document.getElementById('validZipSpace').style.display = \"none\";\r\n isCode = true;\r\n }\r\n}", "function codeValidator(code) {\n return code.length === 7 && (code.slice(0,4).match(/^[A-Za-z]+$/) != null) && (code.slice(4).match(/^[0-9]+$/) != null)\n}", "function validatePIN (pin) {\n //return true or false\n if ( (pin.match(/^[0-9]+$/) != null) && (pin.length === 4 || pin.length ===6)){\n return true} else return false\n}", "function validateZip(val, allowCanada) {\n var usZipRegex, caZipRegex, trimmed = trim(val);\n usZipRegex = new RegExp(/^\\d\\d\\d\\d\\d$/);\n caZipRegex = new RegExp(/[ABCEGHJKLMNPRSTVXY][0-9][ABCEGHJKLMNPRSTVWXYZ] ?[0-9][ABCEGHJKLMNPRSTVWXYZ][0-9]/);\n if (usZipRegex.exec(val) != null) return true;\n if (allowCanada && caZipRegex.exec(val.toUpperCase()) != null) return true;\n\n return false;\n}", "function isOkzipCode() {\n //we control de length and the digits were numbers matching their value\n // >9999 --> 5 digits or more && < 100000 less than 5 digits\n if (zipCode.value > 9999 && zipCode.value < 100000 ) {\n cleanErrorMessage(zipCode);\n return true;\n } else if (ccnum.value.includes(' ')) {\n cleanErrorMessage(zipCode);\n errorIndication(zipCode);\n return false;\n } else {\n errorIndication(zipCode);\n return false;\n }\n }", "function validatePIN1 (pin) {\n var reg = new RegExp('^([0-9]{4}|[0-9]{6})$');\n return reg.test(pin);\n}", "verifyPostalCode(postalCode) {\r\n if (this.isPostalCode(postalCode)) {\r\n return postalCode;\r\n }\r\n else {\r\n const message = \"Invalid parameter for postal code; \" + \"\\'\" + postalCode + \"\\'\" + \" is in unacceptable format.\";\r\n throw new InvalidUserParameterException('INVALID POSTAL CODE', message);\r\n }\r\n }", "function isZipValid(zipCode) {\n\tvar zip = /^\\d{5}$/;\n\tzip.test(zipCode) ? console.log('This is a valid postal code') : console.log('This is not a valid postal code');\n}", "function isZipCodeValid (zip) {\r\n return /^\\d{5}$/.test(zip)\r\n}", "function checkzip(inputzip){\n if(!inputzip.value.match(/^([0-9]{5})$/)){\n document.getElementById(\"Zipcode\").innerHTML = \"Zipcode should be consisted of 5 numbers\"+\"<br>\";\n inputzip.value = \"\";\n return false;\n }\n else\n return true;\n}", "function validateZipCode() {\n var e = document.getElementById(\"Zip\").value;\n if (isNumber(e) && e.length == 5) {\n return true;\n } else {\n return false;\n }\n}", "isValidZip(zipCode){\n\t\tif(zipCode.length != 5 || (zipCode.match(/[a-z]/i))){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function validate_us_zip(value) {\n var zip = clean_nonnumbers(value);\n return validate(zip.length,eq,5);\n }", "function isZipCode(strInput, intCountryCode) {\n\tvar re\n\tif (intCountryCode == 840) // USA\n\t\tre = /^\\d{5}([\\-]\\d{4})?$/;\n\telse if (intCountryCode == 124) // Canada\n\t\tre = /^[A-Z]\\d[A-Z][- |]\\d[A-Z]\\d$/i;\n\treturn (re.test(strInput));\n}", "function validatePIN (pin) {\n //return true or false\n return /^(\\d{4}|\\d{6})$/.test(pin)\n}", "function telephoneCheck(str) {\n //Create a regular expression to check our passed phone number\n //(1\\s?) allows for country code 1 if passed\n //(\\d{3}\\)|\\d{3}) checks for zip code with and without parenthesis\n //[\\s\\-]? checks for spaces or dashes in the number\n //$ marks the end of the string\n let regex = /^(1\\s?)?(\\(\\d{3}\\)|\\d{3})[\\s\\-]?\\d{3}[\\s\\-]?\\d{4}$/; \n //test the str with regest.test(str)\n return regex.test(str);\n}", "function validateAddress(){\n var res = false\n if (myForm.F00000035h.toLowerCase() !== \"berlin\"){\n return false;\n }else if (myForm.F00000035h.toLowerCase() == \"berlin\") {\n if (myForm.bzrnr != '') {\n res = true;\n }\n }else{\n res = false\n } \n\treturn res;\n}", "function zipcodeIsValid (zipcode) {\n\t//if zipcode isn't 5 long, automatically wrong\n\tif (zipcode.length != 5) {\n\t\treturn false;\n\t} else {\n\t\t//loop through 5 chars, and make sure each are a number\n\t\tfor (var i = 0; i < 5; i++) {\n\t\t\t//if the current character is a non-number\n\t\t\tif(zipcode.charCodeAt(i) < 48 || zipcode.charCodeAt(i) > 57) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t//if there was not a single non-number and the length is 5, return true\n\t\treturn true;\n\t}\n}", "function chkzip() {\r\n\tvar mydata = document.getElementById(\"zipcode\");\r\n\tvar position = mydata.value.search(/\\d{5}/);\r\n\t\r\n\tif(position != 0) {\r\n\t\talert(\"El zipcode entrado esta en un formato incorrecto.\\nEl formato correcto es #####.\");\r\n\t\tmydata.select();\r\n\t\tmydata.focus();\t\t\r\n\t\treturn false;\r\n\t} else\r\n\t\treturn true;\r\n}", "function validateZip(theForm)\n{\n\tvar str = \"-\";\n zipStr = theForm.zipCode.value;\n if (zipStr.length != 5)\n {\n \tif (zipStr.length == 10 && zipStr.charAt(5) == \"-\") {\n \t\t\n \t} else {\n \talert(\"Invalid zip code syntax.\");\n \treturn false; // abort submission\n \t}\n }\n // length is good ... now check for all digits\n // go thru each of the chars in the zipcode string\n for (var i = 0; i < zipStr.length; i++)\n {\n aChar = zipStr.charAt(i);\n if (!isDigit(aChar) && i != 5) {\n \talert(\"char \" + aChar + \" is NOT a digit\");\n return false; // abort submission\n }\n }\n return true; // proceed with submission\n}", "function validatePostcode(value,data,name,form)\n{\n var message = \"\";\n if(value === \"\")\n message = \"* Required\";\n else if (!value.match(/^[\\d]+$/))\n message = \"* Must be digits characters only\";\n else if (value.length < 3)\n message = \"* Invalid postcode\";\n\n if(message) {\n form.elements[name].define(\"invalidMessage\", message);\n return false\n }\n return true;\n}", "function isItalianZipCode(value) {\n if (notEmpty(value)) {\n if (typeof value !== 'string')\n value = value.toString();\n return regexpr_1.cap.test(value);\n }\n return false;\n}", "function validation(userLocation) {\n if (userLocation.length === 5) {\n for( var i = 0; i < 5; i++) {\n if (userLocation.charCodeAt(i) >= 48 && userLocation.charCodeAt(i) <= 57) {\n console.log(\"it is a zip code\");\n }// end if\n else if ((userLocation.charCodeAt(i) >= 65 && userLocation.charCodeAt(i) <= 90) || (userLocation.charCodeAt(i) >= 97 && userLocation.charCodeAt(i) <= 121) ){\n console.log(\"It is a city\");\n } // end else of\n else {\n console.log(\"it is not a zip code or a city\");\n break;\n }// end else\n }//end for\n }// end if\n}// end function", "function isZipCode(fieldVal) {\r\r\r\n var strValidChars = \"0123456789\";\r\r\r\n var blnResult = true;\r\r\r\n var fldLength = fieldVal.length;\r\r\r\n if(fldLength == 5) {\r\r\r\n for( i = 0; i < fldLength; i++) {\r strChar = fieldVal.charAt(i);\r\r\r\n if(strValidChars.indexOf(strChar) == -1) {\r blnResult = false;\r\r\r\n }\r\r\r\n }\r\r\r\n } else {\r blnResult = false;\r\r\r\n }\r\r\r\n if(blnResult == false) {\r\r\r\n return false;\r\r\r\n } else {\r\r\r\n return true;\r\r\r\n }\r\r\r\n}\r\r// This function is used to open a pop up window. User need to pass only two parameters", "validateAddress(address) {\n if(address==='') {\n return 'Address required';\n } else if (!(/^[A-Za-z\\u00C0-\\u017F\\s\\d]+$/.test(address))) {\n return 'Address invalid (only letters and numbers allowed)'\n }\n \n return '';\n }", "function isZIPCode (s)\r\n{ if (isEmpty(s))\r\n if (isZIPCode.arguments.length == 1) return defaultEmptyOK;\r\n else return (isZIPCode.arguments[1] == true);\r\n return (isInteger(s) &&\r\n ((s.length == digitsInZIPCode1) ||\r\n (s.length == digitsInZIPCode2)))\r\n}", "function isZIPCode (s)\r\n{ if (isEmpty(s))\r\n if (isZIPCode.arguments.length == 1) return defaultEmptyOK;\r\n else return (isZIPCode.arguments[1] == true);\r\n return (isInteger(s) &&\r\n ((s.length == digitsInZIPCode1) ||\r\n (s.length == digitsInZIPCode2)))\r\n}", "function addressCheck(){\r\n\tvar addressRegex = /^[a-zA-Z0-9\\s,.'-]*$/;\r\n\tvar address = getId('address').value;\r\n\tvar addressLines = address.split('\\n');\r\n\t\r\n\tfor(var i = 0; i < addressLines.length; i++){\r\n\t\tif(!addressLines[i].match(addressRegex)){\r\n\t\t\tgetId('address').style.backgroundColor='#fee';\r\n\t\t\tgetId('addressError').innerHTML=\"<br>Sorry, this address in not correct! Please use alphanumeric and no special symbols.\";\t\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "function controlCodePostal () {\nconst codepostal = formValues.codepostal;\n \n if(regexcodePostal(codepostal)){\n document.querySelector(\"#Codepostal_manque\").textContent = \"\";\n \n return true;\n }else{\n document.querySelector(\"#Codepostal_manque\").textContent = \"codePostal: doit étre composé de 5 chiffres\";\n alert(\"codePostal: doit étre composé de 5 chiffres\");\n return false;\n }\n \n }", "function validatePIN(pin) {\n return /^(\\d{4}|\\d{6})$/.test(pin)\n}", "function f_zipcode(){\n var zipcode = document.getElementById(\"zipcode\").value;\n if(zipcode.length !== 5) {\n alert(\"El codigo postal tiene que tener 5 caracteres.\");\n return false;\n } else {\n return true;\n }\n}", "function isValidPostal(card) {\n zip.nextElementSibling.innerText = \"Must be a 5 digits\";\n return /^\\d{5}$/.test(card);\n}", "function validatePIN (pin) {\n return /^(\\d{4}|\\d{6})$/.test(pin);\n}", "function postcodecheck(state, x)\n{\n\tvar result = true;\n\tswitch(state)\n\t{\n\t\tcase \"VIC\":\t\n\t\t\t\t\tif(x!=3 && x!=8 )\n\t\t\t\t\t\tresult = false;\n\t\t\t\t\tbreak;\n\t\tcase \"NSW\":\t\n\t\t\t\t\tif(x!=1 && x!=2 )\n\t\t\t\t\t\tresult = false;\n\t\t\t\t\tbreak;\n\t\tcase \"QLD\":\t\n\t\t\t\t\tif(x!=4 && x!=9 )\n\t\t\t\t\t\tresult = false;\n\t\t\t\t\tbreak;\n\t\tcase \"NT\":\t\n\t\t\t\t\tif(x!=0)\n\t\t\t\t\t\tresult = false;\n\t\t\t\t\tbreak;\n\t\tcase \"WA\":\t\n\t\t\t\t\tif(x!=6)\n\t\t\t\t\t\tresult = false;\n\t\t\t\t\tbreak;\n\t\tcase \"SA\":\t\n\t\t\t\t\tif(x!=5)\n\t\t\t\t\t\tresult = false;\n\t\t\t\t\tbreak;\n\t\tcase \"TAS\":\t\n\t\t\t\t\tif(x!=7)\n\t\t\t\t\t\tresult = false;\n\t\t\t\t\tbreak;\n\t\tcase \"ACT\":\t\n\t\t\t\t\tif(x!=0)\n\t\t\t\t\t\tresult = false;\n\t\t\t\t\tbreak;\t\t\t\n\t}\n\t\n\treturn result;\n}", "function regExpAddress() {\n // Récupération des données saisies\n const addressValid = contact.address;\n // Injection du HTML\n const checkAddress = document.querySelector(\"#addressErrorMsg\");\n\n // Indication de la bonne saisie ou l'erreur dans le HTML\n if (/^[A-Za-z0-9\\s]{3,100}$/.test(addressValid)) {\n checkAddress.innerHTML = \"<i class='fas fa-check-circle form'></i>\";\n return true;\n } else {\n checkAddress.innerHTML = \"<i class='fas fa-times-circle form'></i> format incorrect\";\n }\n }", "function validateTestaddress(strnam, hnur, hnurz, zipcode, city){\n var address = \"\";\n if (city.toLowerCase() !== \"berlin\"){ return \"\";}\n\n adr = callCheckAddress(strnam,hnur,hnurz,zipcode,city);\n address = \"strname: \" + adr.strname + \"; \" + \"strnr: \" + adr.strnr + \"; \" + \"hausnr: \" + adr.hausnr + \"; \" + \"hausnrz: \" + adr.hausnrz + \"; \" + \"plz: \" + adr.plz + \"; \" + \"bezname: \" + adr.bzrname + \"; \" + \"beznr: \" + adr.beznr + \"; \" + \"otname: \" + adr.otname + \"; \" + \"otnr: \" + adr.otnr + \"; \" + \"etrs89_x: \" + adr.etrs89_x + \"; \" + \"etrs89_y: \" + adr.etrs89_y;\n return address;\n}", "function validatePIN (pin) {\n // console.log(parseFloat(pin));\n if (pin.length === 4 || pin.length === 6) {\n if (typeof parseFloat(pin) != \"number\" || /\\D/.test(pin) || /[a-z]/.test(pin)) {\n return false;\n } else {\n return true;\n }\n } else {\n return false;\n }\n}", "function checkStreet(){\r\n var strt=signup.street.value.trim(); \r\n var errors= document.querySelector(\".errmessage\");\r\n var nums=\"1234567890\"; \r\n var numCheck = true; \r\n\r\n for(var i=0; i<strt.length; i++){\r\n if(nums.indexOf(strt.substr(i,1))>=0){\r\n numCheck=false;\r\n }\r\n }\r\n\r\n if(numCheck===false){\r\n clear(); \r\n errors.innerHTML+= \"<p>* Street name cannot contain numbers. <p>\";\r\n signup.street.focus();\r\n return false; \r\n }\r\n\r\n return true;\r\n\r\n}", "function telephoneCheck(str){\n\t// REMOVE WHITESPACE FROM STRING\n\tstr = str.replace(/\\s+/g, '');\n\n\t// CHECK HOW MANY NUMBERS THERE ARE\n\tvar counter = 0;\n\n\tfor(var i = 0; i < str.length; i++){\n\t\tif(str.charAt(i).match(/\\d/) !== null){\n\t\t\tcounter ++;\n\t\t}\n\t}\n\n\t// IF THERE ARE LESS THAN 10 OR MORE THAN 11 NUMBERS, RETURN FALSE\n\tif(counter < 10 || counter > 11){\n\t\tconsole.log(\"less than 10 or more than 11\");\n\t\treturn false;\n\t}\n\n// =========================\n\n\t// AREA CODE IN PARENTHESIS\n\tif(counter === 10){\n\t\tvar areaCodeRegEx = /^(\\(\\d{3}\\)|\\d{3})[-]?[0-9]{3}[-]?[0-9]{4}/;\n\t\tif(areaCodeRegEx.test(str)){\n\t\t\treturn true;\n\t\t} else{\n\t\t\treturn false;\n\t\t}\n\t} else if(counter === 11){\n\t\tvar countryCodePlusArea = /^[1](\\(\\d{3}\\)|\\d{3})[-]?[0-9]{3}[-]?[0-9]{4}/;\n\t\tif(countryCodePlusArea.test(str)){\n\t\t\treturn true;\n\t\t} else{\n\t\t\treturn false;\n\t\t}\n\t} else{\n\t\treturn false;\n\t}\n}", "function validateZipCode() {\r\n var code = document.getElementById(\"zip\");\r\n var regex = /^(?:6[0-9]{5})$/;\r\n if (!code.value.match(regex)) {\r\n code.style.borderColor = \"red\";\r\n document.getElementById(\"ValidZip\").style.display = \"block\";\r\n keycode = false;\r\n }\r\n else {\r\n keycode = true;\r\n code.style.borderColor = \"darkturquoise\";\r\n document.getElementById(\"ValidZip\").style.display = \"none\";\r\n }\r\n}", "function validatePIN (pin) {\n return (pin.match(/^[\\d]{4}$/) || pin.match(/^[\\d]{6}$/) ? true : false)\n}", "function verifyAddress(address) {\n\tlet regex = RegExp(/^[\\d\\w\\s\\,]{10,50}$/);\n\tif (!address || address === '')\n\t\treturn '';\n\telse if (regex.test(address))\n\t\treturn address;\n\tthrow new Error(\"invalid address\");\n}", "function telephoneCheck (str) {\n let countryCode = str.split(/\\({0,1}\\d{3}\\){0,1}/)[0];\n let telephone = str.substring(countryCode.length);\n\n if (/\\d{10,}/.test(str)) {\n countryCode = str.substring(0, str.length - 10);\n telephone = str.substring(str.length - 10);\n }\n\n console.log('---');\n console.log(countryCode || 'NO COUNTRY CODE');\n console.log(telephone);\n\n if (countryCode && parseInt(countryCode) !== 1) {\n return false;\n }\n\n const regexs = [\n new RegExp(/^\\d{3}[\\s-]{0,1}\\d{3}[\\s-]{0,1}\\d{4}/),\n new RegExp(/^\\(\\d{3}\\)\\s{0,1}\\d{3}-\\d{4}/)\n ];\n\n return regexs.some(regex => regex.test(telephone));\n}", "function validateZipCode(){\n\tvar nameFormat = /^\\d{5}$/; // Regex to indicate 5 numerical digits.\n\tvar errorFormat = /Invalid Zip Code<br>/;\n\tvar zipCode = document[formName][\"zipCode\"].value;\n\t\n\tvar errorString=\"\";\n\tif(!nameFormat.test(zipCode)) {\n\t\tif(!errorFormat.test(document.getElementById(p2).innerHTML))\n\t\t\terrorString += \"Invalid Zip Code<br>\";\n\t}\n\telse if(errorFormat.test(document.getElementById(p2).innerHTML)) {\n\t\tvar temp = document.getElementById(p2).innerHTML.split(errorFormat);\n\t\tvar t = \"\";\n\t\tfor (var i = 0 ; i < temp.length; i++) {\n\t\t\tt += temp[i];\n\t\t}\n\t document.getElementById(p2).innerHTML = t;\n\t}\n\tdocument.getElementById(p2).innerHTML += errorString;\n\t\n}", "function checkZipAndCVV(string, inputValue) {\n\n const obj = regrexObj[string];\n\n if(!regrexObj.digitsOnly.test(inputValue)) {\n\n $(obj.selector).text(regrexObj.invalidCharacterMessage);\n\n } else if(!obj.regrex.test(inputValue)) {\n\n $(obj.selector).text(obj.errorMessage);\n\n }else {\n\n $(obj.selector).empty();\n\n return true;\n }\n\n return false;\n\n}", "function checkStreet() {\n let validDiv = '#validGata'\n let invalidDiv = '#invalidGata'\n let address = $('#validationCustom06').val()\n // let regPattern = /^[A-Za-z0-9ZäöåÄÖÅ ]*$/;\n let regPattern =\n /^(?=.*[0-9])(?=.*[a-zA-ZåäöÅÄÖ])(?=.*[\\s])[0-9a-zA-ZåäöÅÄÖ\\s]+$/\n let input = document.getElementById('validationCustom06')\n if (address.trim() == '') {\n $(validDiv).hide()\n $(invalidDiv).text('Adress krävs')\n $(validDiv).text('')\n $(invalidDiv).show()\n $(input).addClass('is-invalid').removeClass('is-valid')\n return false\n } else if (!regPattern.test(address)) {\n $(validDiv).hide()\n $(invalidDiv).text('Ogiltig adress')\n $(validDiv).text('')\n $(invalidDiv).show()\n $(input).addClass('is-invalid').removeClass('is-valid')\n return false\n } else {\n $(invalidDiv).hide()\n $(validDiv).text('Giltig')\n $(validDiv).show()\n $(input).removeClass('is-invalid').addClass('is-valid')\n return true\n }\n}", "function validateZip () {\n var text = $('#zip').val();\n if (!text) return true;\n \n var isValidZip = /(^\\d{5}$)|(^\\d{5}-\\d{4}$)/.test(text);\n \n if (isValidZip) {\n $('#zip').removeClass(\"invalid\");\n return true;\n }\n \n $('#message').html(\"Invalid zip code\");\n $('#zip').addClass(\"invalid\");\n return false;\n}", "function tpostal()\r\n {\r\n var pin_code_js = document.getElementById('to_post');\r\n var pin_code_js_value = pin_code_js.value.trim();\r\n if (pin_code_js_value == null || pin_code_js_value == \"\") {\r\n \tdocument.getElementById(\"tpostal\").innerHTML=\"Postal code must be filled out !\";\r\n $(function(){\r\n $(\"#to_post\").focus() });\r\n \r\n } else if (is_valid = !/^[a-zA-Z0-9 ]+$/.test(pin_code_js_value)) {\r\n \tdocument.getElementById(\"tpostal\").innerHTML=\"Postal code Only charecters and numerics\";\r\n $(function(){\r\n $(\"#to_post\").focus() });\r\n \r\n } else if (pin_code_js_value.length != 6) {\r\n \t document.getElementById(\"tpostal\").innerHTML=\"Postal code must have 6 digits only !\";\r\n $(function(){\r\n $(\"#to_post\").focus() });\r\n \r\n }\r\n else\r\n {\r\n \tcount++;\r\n }\r\n }", "function checkaddress(){\n var address=document.getElementById(\"address\"); \n // var exp=/^([a-zA-Z])+$/;\n var exp=/^[a-zA-Z0-9\\s\\,\\.\\'\\-]+$/\n if(!exp.test(address.value))\n {\n address.style.border=\"solid red\";\n alert(\"Address can contain alphabets,numbers,whitespace, comma(,), dot(.), apostrophe ('), and dash(-),unserscore(_) symbols \");\n address.focus();\n return false;\n }\n else\n {\n address.style.border=\"solid green\";\n return true;\n }\n}", "function validatePIN(pin) {\n if (pin.length === 4 || pin.length === 6) {\n var numbers = '0123456789'\n return pin.split('').every(function (value) {\n return numbers.indexOf(value) > -1;\n });\n }\n return false;\n}", "function testPhoneNumberSearch(){\n validatePhoneNumber(\"3832720339\"); // invalid entry\n\t validatePhoneNumber(\"2125551235\"); // valid entry\n\t validatePhoneNumber(null); // invalid entry\n\t validatePhoneNumber(1312); // invalid entry\n }", "function isphonenumber(inputtxt) {\n var phoneno = /\\(?([0-9]{3,4})\\)?([0-9]{3})?([0-9]{3,4})$/;\n if (inputtxt.match(phoneno)) {\n return true;\n }\n else {\n return false;\n }\n}", "function zipcodeChecker(zipcode) {\n return zipcode > 20000;\n}", "function validateCode (code) {\n code= code.toString()\n return code.startsWith([1])|| code.startsWith([2])|| code.startsWith([3])\n}", "function validatePIN(pin) {\n if (/^(\\d{4}|\\d{6})$/.test(pin)) {\n return true;\n } else {\n return false;\n }\n}", "function allnumeric()\n{ \n\tvar uzip = document.registration.zip;\n\tvar numbers = /^[0-9]+$/;\n\tif(uzip.value.match(numbers))\n\t{\n\t\t// Focus goes to next field i.e. email.\n\t\tdocument.registration.email.focus();\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\talert('ZIP code must have numeric characters only');\n\t\tuzip.focus();\n\t\treturn false;\n\t}\n}", "isLandLine() {\r\n return this.phoneNumber.match(/^0([23489][2356789]|7\\d{2})\\d{6}$/) !== null;\r\n }" ]
[ "0.7870481", "0.78666735", "0.7866659", "0.7685849", "0.76836866", "0.76550883", "0.7566243", "0.75576675", "0.75057405", "0.74874306", "0.74854565", "0.74796134", "0.7398815", "0.73026824", "0.729508", "0.7231197", "0.7224124", "0.7078238", "0.7018291", "0.7014531", "0.7004295", "0.69569874", "0.6953697", "0.68881565", "0.68698186", "0.6838314", "0.68353224", "0.6801737", "0.67981255", "0.67962337", "0.6767342", "0.6752882", "0.67330486", "0.6713407", "0.6707575", "0.67025423", "0.6697343", "0.6683243", "0.66779315", "0.6651845", "0.6651307", "0.66262925", "0.6620208", "0.6558205", "0.65469116", "0.65433764", "0.6509578", "0.6499292", "0.6491316", "0.6458374", "0.6458153", "0.6451613", "0.64502335", "0.6436333", "0.6400882", "0.6388255", "0.6374412", "0.6362514", "0.63591003", "0.63446397", "0.6341726", "0.633609", "0.6324249", "0.6323837", "0.63195497", "0.63039273", "0.63036543", "0.63035035", "0.62986785", "0.6296626", "0.6296626", "0.62916124", "0.6289653", "0.62893015", "0.628657", "0.62854034", "0.62812513", "0.62737304", "0.6262715", "0.6256796", "0.6254715", "0.6252421", "0.6251747", "0.62505466", "0.62414354", "0.62215805", "0.6219328", "0.62168497", "0.6212629", "0.6207543", "0.6198984", "0.6197398", "0.6195092", "0.6189536", "0.6187085", "0.61597615", "0.61547524", "0.6134026", "0.6132747", "0.6127943", "0.61239463" ]
0.0
-1
the router components to navigate through the pages
render() { return ( <Router> <div className="app"> <Switch> <Route path="/" exact render={() => <Home user={this.state.user} />} /> <Route path="/login" exact component={Login} /> <Route path="/register" exact component={Register} /> </Switch> </div> </Router> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initRouter() {\n Router.config(AppConfig.get('routes'));\n \n Router.onBeforeAction((r, p) => {\n const token = Accounts.getToken()\n if(!r.ignoreLogin && !token) Accounts.logout()\n })\n\n /** Login **/\n Router.on('login', (rota, req) => {\n this.component(<LoginComponent />);\n });\n Router.on('/logout', () => {\n Accounts.logout('/login');\n });\n\n /** Inicio **/\n Router.on('home', (rota, req) => {\n Router.redirect(rota.submenu[0].path);\n });\n Router.on('profile', (rota, req) => {\n this.component(<NewsFeed jsonUrl='/feed' userName={req.params.username}/>);\n });\n Router.on('/novidades', (rota, req) => {\n this.component(<NewsFeed jsonUrl='/feed'/>);\n });\n\n Router.on('messages', (rota, req) => {\n Router.redirect(rota.submenu[0].path);\n });\n Router.on('/social/conversations', (rota, req) => {\n this.component(<MessagesList />);\n });\n\n Router.on('settings', (rota, req) => {\n page.redirect(rota.submenu[0].path);\n });\n Router.on('/social/privacy', (rota, req) => {\n this.component(<h1>Privacy</h1>);\n });\n Router.notFound((rota, req) => {\n this.component(<h1>404 {rota.path}</h1>);\n });\n Router.init();\n }", "@action route() {\n this.currentPage = Home\n }", "renderPages(){\n return(\n <HashRouter>\n <div>\n <Redirect from=\"/\" to=\"/overview\" />\n <Route path=\"/overview\" component={POverview} />\n <Route path=\"/mm\" component={PMemoryManagement} />\n </div>\n </HashRouter>\n );\n }", "setupNav() {\n this.router.on({}, () => {\n $('iframe').one('load', function() {\n this.style.height = (document.body.offsetHeight - \n $('iframe').offset().top) + \"px\";\n $('body').css('overflow-y', 'hidden');\n });\n });\n this.router.on({'page': 'quiz1'}, () => {\n this.changePage('https://docs.google.com/forms/d/e/1FAIpQLSdKVApwuQjnD3auoJI8ESKtfS-w6PlCptSHTbkxNGyPH1Iv6A/viewform?usp=sf_link');\n });\n this.router.on({'page': 'quiz2'}, () => {\n this.changePage('https://docs.google.com/forms/d/e/1FAIpQLSdt06Q9VWQHuVUZCfk0fnhMb6InsBAcI3bDrFXcKiSmiqgNvA/viewform?usp=sf_link');\n });\n this.router.on({'page': 'module1'}, () => {\n this.changePage('module1.html');\n });\n this.router.on({'page': 'module2'}, () => {\n this.changePage('module2.html');\n });\n this.router.on({'page': 'module3'}, () => {\n this.changePage('module3.html');\n });\n }", "function router() { // private function\n\n var path = location.hash; \n console.log('path is ' + path);\n // prints something like /home\n\n // Use the url like an index (JS associative array notation) to find the desired\n // component (function) to run. The component will place content in the content\n // area. If a link is clicked for which a route was never set, give error message.\n if (!routes[path]) {\n document.getElementById(contentId).innerHTML = \"<p>Error: unknown link '\" + path +\n \"' never added to the routing table.</p>\";\n } else {\n routes[path](contentId);\n }\n }", "static goPage(params, page) {\n const navigation = NavigationUtil.navigation;\n /*children level router can't jump to parent level router*/\n //const {navigation} = params;\n if (!navigation) {\n console.log('NavigationUtil.navigation can\\'t be null.')\n }\n navigation.navigate(\n page,\n {\n ...params\n }\n );\n }", "function Pages() {\n return (\n <main role=\"application\">\n {/* <Header /> */}\n\n {/* Home */}\n <Match\n pattern=\"/\"\n exactly\n component={Home}\n />\n {/* quienes somos */}\n <Match\n pattern=\"/about\"\n exactly\n component={About}\n />\n {/* servicios */}\n <Match\n pattern=\"/services\"\n exactly\n component={Services}\n />\n {/* Contacto */}\n <Match\n pattern=\"/contact\"\n exactly\n component={Contact}\n />\n {/* Error 404 */}\n <Miss component={Error404}\n />\n </main>\n )\n}", "recarga() {\n this.router.navigate(['/home']);\n }", "function router() {\n\tele(\"error\").innerText = \"\";\n\tele(\"content\").innerHTML = \"\";\n\tif (!state.isSignedIn) return;\n\n\tconst view = (hash) => {\n\t\tif (hash.startsWith(\"#sheet/\")) {\n\t\t\treturn editSheetView(hash.substr(\"#sheet/\".length));\n\t\t} else {\n\t\t\treturn listView()\n\t\t}\n\t}\n\tif (location.hash === \"\") {\n\t\tconst hash = localStorage.getItem(\"lastLocation\") || \"\";\n\t\tif (hash !== \"\") {\n\t\t\tlocation.hash = hash\n\t\t\treturn;\n\t\t}\n\t} else {\n\t\tlocalStorage.setItem(\"lastLocation\", location.hash);\n\t}\n\tloadInc();\n\tview(location.hash).catch(uncaughtErrorHandler).finally(() => {\n\t\tloadDec();\n\t});\n}", "handleNavPage(e) {\n history.push('/GeneralQuestionnarie');\n }", "render() {\n return (\n <div className=\"container-fluid\">\n <Router>\n <div>\n <Route path='/' exact\n render={() =>\n <LandingPage/>\n }/>\n <Route path='/search' exact\n render={() =>\n <SearchDoctor/>\n }/>\n <Route path='/search/:criteria' exact\n component={ResultsPage} />\n <Route path='/details/:location/practice/:practiceId' exact\n component={DetailsPage} />\n <Route path='/profile/:profileId' exact\n component={UserProfile} />\n <Route path='/profile' exact\n component={PersonalProfile} />\n <Route path='/article/:articleId' exact\n component={Article} />\n <Route path='/login' exact\n component={Login} />\n <Route path='/register' exact\n component={Register} />\n </div>\n </Router>\n </div>\n )\n }", "function _routerAndpageInfo(to) {\n console.log('%c\\n## 当前跳转页面的相关信息展示 ##\\n', logStyle('3DTest'));\n console.log('%c========================', logStyle('tit'));\n console.log('%c1、跳转页面:', logStyle('info'));\n console.log('%c' + to.name, logStyle('text'));\n console.log('%c2、跳转路径:', logStyle('info'));\n console.log('%c' + to.path, logStyle('text'));\n console.log('%c3、funcId值:', logStyle('info'));\n console.log('%c' + $store.state.Core.funcId, logStyle('text'));\n console.log('%c============', logStyle('line'));\n console.log('%c4、所有页面相关信息列表如下:', logStyle('info'));\n console.log($store.state.PageInfo.pageinfoList);\n console.log('%c========================', logStyle('tit'));\n}", "goToNextPage(routerHistory) {\n routerHistory.replace(\"/irregularverbs/memorize\");\n }", "toMainPage() {\n this.$router.go(-1);\n }", "on(...pageRoutes) {\n //increment the number of routes registered\n this.numRegistered += 1;\n for (const {route, handler} of pageRoutes) {\n if (Array.isArray(route)) {\n for (const path of route) {\n const [regPath, params] = getRegexFromRouteString(path);\n this.routes.set(path, {pathRoute: regPath, handler: handler, params: params});\n }\n } else {\n const [regPath, params] = getRegexFromRouteString(route);\n this.routes.set(route, {pathRoute: regPath, handler: handler, params: params})\n }\n }\n //route the current url once we've registed all the handlers\n if (this.numRegistered === this.numRoutes) {\n this.match(window.location.pathname);\n }\n }", "function router() {\n\n\t\t// clear last page stuff\n\t\tclearInterval(charInterval);\n\t\tclearInterval(verbInterval);\n\n\t\t// cache page & url\n\t\tpage = page || $('#page');\n\n\t\t// off-page hash\n\n $('#page section').addClass('bringOut');\n\n bringOut = setTimeout(function () {\n page.removeClass('rendered');\n page.addClass('routing');\n\n renderHome();\n\n // setup\n page.addClass('rendered');\n\n $('html,body').animate({\n scrollTop: 0\n }, 512);\n\n clearInterval(bringOut);\n }, 500);\n\t}", "function YourTripComponent(router) {\n this.router = router;\n this.pages = [\n '/your-trip',\n '/your-driver',\n '/your-vehicle',\n '/your-destination'\n ];\n }", "renderPage() {\t\t\n\t\tswitch (this.props.data.active) {\n\t\t\tcase 'user': \n\t\t\t\treturn this.renderUserInfo(this.props.data.body);\t\t\t\n\t\t\tcase 'repos': \n\t\t\t\treturn this.renderRepos(this.props.data.body);\n\t\t\tcase 'about': \n\t\t\t\treturn this.renderAbout();\t\t\t\t\t\n\t\t}\n\t}", "toPage(pageNum){\n this.transitionToRoute('search', {queryParams: {p: pageNum }});\n }", "on(...pageRoutes) {\n //increment the number of routes registered\n this.numRegistered += 1;\n for (const {route, handler} of pageRoutes) {\n if (Array.isArray(route)) {\n for (const path of route) {\n const [regPath, params] = getRegexFromRouteString(path);\n this.routes.set(path, {pathRoute: regPath, handler: handler, params: params});\n }\n } else {\n const [regPath, params] = getRegexFromRouteString(route);\n this.routes.set(route, {pathRoute: regPath, handler: handler, params: params})\n }\n }\n //route the current url once we've registed all the handlers\n if (this.numRegistered === this.numHandlers) {\n this.match(window.location.pathname);\n }\n }", "function go_articulos() {\n $state.go('complex_articles.list');\n }", "render() {\n const {route} = this.props;\n return (\n <div className=\"app route-container\">\n <h1>Layout!</h1>\n <p>Just s demo page!!</p>\n <ul>\n <li><NavLink activeClassName='active' exact to=\"/\">Home</NavLink></li>\n <li><NavLink activeClassName='active' to=\"/test\">Test</NavLink></li>\n </ul>\n {renderRoutes(route.routes)}\n </div>\n );\n }", "render(){\n return(\n\n // Routing works for all the sub components in the BrowserRouter component\n <BrowserRouter>\n\n {/* <Layout> handles the toolbar and the sidedrawers.\n props sent to component - \n username: taken from the redux state\n */}\n <Layout username = {this.props.username} >\n\n {/* Only one of the routes is selected at a time declared within <Switch> */}\n <Switch>\n { /*if user is authenticated then go to the home page otherwise to the login page when \"<baseurl>/\" is typed in url bar*/\n this.props.isAuthenticated ?\n <Route path =\"/\" exact render = {() => (<Redirect to={'/' + this.props.username + \"/home\"} />)} />\n :\n <Route path =\"/\" exact render = {() => (<Redirect to='/login' />)} />\n }\n \n { /* \n following proxyhome concept is used because the <Home> does no rerender otherwise if \n we search for a new user in the toolbar search box\n */}\n <Redirect exact from=\"/:urlUsername/proxyhome\" to='/:urlUsername/home' />\n <Route path= '/:urlUsername/home' exact component = {Home} />\n \n <Route path='/aboutapp' exact component = {AboutApp} />\n <Route path='/signup' exact component = {SignUp} />\n { /* \n if user is authenticated then go to home page otherwise go to login page when user \n types <baseurl>/login in url bar \n */\n this.props.isAuthenticated ?\n <Route path='/login' exact render = {() => (<Redirect to={'/' + this.props.username + \"/home\"} />)} />\n :\n <Route path='/login' exact component = {Auth} />\n }\n \n <Route path='/logout' exact component = {Logout} /> \n\n {/* All the other unmatched urls request will be given response of 404 page not found by the below route */}\n <Route \n render = {() => \n <div className = \"PageNotFound\">\n Error 404: Page not found\n </div> \n } \n />\n </Switch>\n </Layout> \n </BrowserRouter>\n );\n }", "_navigate (){\n this.props.navigator.push({title: 'Filter Page', index: 3})\n }", "onRegisterClicked(){\r\n //this.Nav.push(RegisterPage);\r\n }", "function setupNavigation() {\n\tconsole.log('Rendering Page...');\n\tsetToolTab();\n\tsetContextItem();\n}", "_homeRoute () {\n this.currentView = views.HOME\n }", "navToOverview() {\n\t\tthis.props.history.push(\"/overview\");\n\t}", "parseUrl () {\r\n this.currentIndex = this.getParameter(\"index\");\r\n this.currentFolder = this.findSubnavFolderByIndex(this.currentIndex);\r\n\r\n const page = this.getParameter(\"page\");\r\n\r\n if (this.currentFolder) {\r\n const target = document.querySelector(`#${page}`);\r\n\r\n this.toggleActivePages(target);\r\n this.toggleActiveSubnav(this.currentIndex);\r\n } else {\r\n const target = document.querySelector(\"#flight-ops-home\");\r\n\r\n this.toggleActivePages(target);\r\n this.toggleActiveSubnav(0);\r\n }\r\n }", "function Router({ $page }) {\n\t switch($page) {\n\t case 'scrumb-dashboard':\n\t return ScrumbDashboard;\n\t default:\n\t return Notfound;\n\t }\n\t}", "getPage(page) {\n let pageName = page;\n const that = this;\n\n if (!pageName) {\n pageName = this.MAIN_PAGE;\n }\n\n $.ajax({\n type: 'GET',\n // cut first and navigation in page #/home/#car => home\n url: `${this.PAGES_PATH}/${pageName.replace('#/', '').substring(0, pageName.indexOf('/#') === -1 ? pageName.length : pageName.indexOf('/#') - 2)}.html`,\n dataType: 'html',\n success(msg) {\n $(that.CONTAINER).html(msg);\n // if navigation in page\n if ((/\\/#/).test(pageName)) {\n Router.scrollToId(`${pageName.substring(pageName.indexOf('/#') + 1, pageName.length)}`);\n }\n },\n error(error) {\n $(that.CONTAINER).html(`<h1>${error.status}</h1> <h2>${error.statusText}</h2>`);\n },\n });\n }", "navigate(route){\n let state = null;\n\n switch(route){\n case 'superheroes':\n state = new App.states.SuperHeroes();\n break;\n }\n\n this.container.innerHTML = '';\n this.container.appendChild( state.render() );\n if (route === 'superheroes') {\n document.getElementById('first').onclick = () => state.firstPage()\n document.getElementById('next').onclick = () => state.nextPage()\n document.getElementById('previous').onclick = () => state.previousPage()\n document.getElementById('last').onclick = () => state.lastPage()\n document.getElementById('search').onclick = () => state.findHeroes()\n document.addEventListener('click', (e) => {\n if(e.target.tagName === 'TD') {\n const id = e.target.parentElement.getAttribute('data-ref')\n document.getElementById('modal-'+id).checked = true\n state.loadDetails(id)\n }\n })\n state.load()\n }\n }", "_loadPage() {\n this._loadWithCurrentLang();\n\n let url = navigation.getCurrentUrl();\n if (url != '/') {\n navigation.navigatingToUrl(url, this.lang, this.DOM.pagesContent, false);\n }\n\n navigation.listenToHistiryPages(this.lang, this.DOM.pagesContent);\n }", "function setupPageNavs () {\n\t\t// For any nested list items, wrap the link text in a span so that we can put a border under the text on hover.\n\t\t$mobilemenu.find(\".ibm-mobilemenu-section li li a\").wrapInner(\"<span>\");\n\n\t\tIBM.common.util.a11y.makeTreeAccessible({\n\t\t\tel: $mobilemenu.find(\".ibm-mobilemenu-pagenav > ul\")\n\t\t});\n\t}", "viewThisInvoice() { FlowRouter.go('invoice', { invoiceId: this.props.invoice._id } ) }", "function PagesNavigation() {\n\n}", "render() {\n return (\n <Router basename=\"/react-auth-ui/\">\n <div className=\"App\">\n {/* this is divede page */}\n <div className=\"App__Aside\" />\n <div className=\"App__Form\">\n <div className=\"PageSwitcher\">\n <NavLink\n to=\"/sign-in\"\n activeClassName=\"PageSwitcher__Item--Active\"\n className=\"PageSwitcher__Item\"\n >\n Sign In\n </NavLink>\n <NavLink\n exact\n to=\"/\"\n activeClassName=\"PageSwitcher__Item--Active\"\n className=\"PageSwitcher__Item\"\n >\n Sign Up\n </NavLink>\n </div>\n\n <div className=\"FormTitle\">\n <NavLink\n // this click button for sign-up\n to=\"/sign-in\"\n activeClassName=\"FormTitle__Link--Active\"\n className=\"FormTitle__Link\"\n >\n Sign In\n </NavLink>{\" \"}\n or{\" \"}\n <NavLink\n exact\n to=\"/\"\n activeClassName=\"FormTitle__Link--Active\"\n className=\"FormTitle__Link\"\n >\n Sign Up\n </NavLink>\n </div>\n {/* this will go path to render this part */}\n <Route exact path=\"/\" component={SignUpForm} />\n {/* this will go path fopr render singin page */}\n <Route path=\"/sign-in\" component={SignInForm} />\n </div>\n </div>\n </Router>\n );\n }", "render () {\n return (\n <div>\n <BrowserRouter>\n <Switch>\n <Route exact path=\"/Home\" component={Home}/>\n <Route exact path=\"/Administrator/Authentication/Usuarios\" component={masterPage(Usuarios)}/>\n <Redirect to =\"/Home\"/>\n </Switch>\n </BrowserRouter>\n </div>\n );\n }", "_routePageChanged(page) {\n const routes = ['repository-list'];\n this.page = page || 'repository-list'; // defaults to home route if no page\n\n // if we are trying to access anything other than / or /repository-list return 404 page\n if (routes.indexOf(this.page) === -1){\n this.page = '404';\n }\n }", "function go_articulos() {\n $state.go('articles.list');\n }", "navigate(appRouter) {\r\n let navigatingRouter = this.options.useAppRouter ? appRouter : (this.router || appRouter);\r\n navigatingRouter.navigate(this.url, this.options);\r\n }", "constructor() {\n this.appPages = [\n // { title: 'Inbox', url: '/folder/Inbox', icon: 'mail' },\n // { title: 'Outbox', url: '/folder/Outbox', icon: 'paper-plane' },\n // { title: 'Favorites', url: '/folder/Favorites', icon: 'heart' },\n // { title: 'Archived', url: '/folder/Archived', icon: 'archive' },\n // { title: 'Trash', url: '/folder/Trash', icon: 'trash' },\n // { title: 'Spam', url: '/folder/Spam', icon: 'warning' },\n ];\n }", "render(){\t\t\n\t\treturn (\n\t\t<main><Switch>\n\t\t\t<Route exact path='/' render={() => (<div>home</div>)} />\n\t\t\t<Route path='/test' render={() => (<div>test</div>)} />\n\t\t\t<Redirect to='/' from='/test2' />\n\t\t</Switch></main>\n\t\t);\n\t}", "function Router() {\n return {\n /**\n * navigateToCart - navigate to cart in checkout\n *\n * @param {Object} info - optional info\n * @return {Deferred} promise\n * @api public\n */\n navigateToCart : function(info) {\n info = _.extend({\n route : 'cart'\n }, info);\n return handleAppRoute(info);\n },\n\n /**\n * navigateToCustomer - navigate to customer views\n *\n * @param {Object} info - optional info\n * @return {Deferred} promise\n * @api public\n */\n navigateToCustomer : function(info) {\n info = _.extend({\n route : 'customer'\n }, info);\n return handleAppRoute(info);\n },\n\n /**\n * navigateToCustomerSearchResult - navigate to customer search results\n *\n * @param {Object} info - optional info\n * @return {Deferred} promise\n * @api public\n */\n navigateToCustomerSearchResult : function(info) {\n info = _.extend({\n route : 'customer_search_result'\n }, info);\n return handleAppRoute(info);\n },\n\n /**\n * customerLogout - log out a customer\n *\n * @param {Object} info - optional info\n * @return {Deferred} promise\n * @api public\n */\n customerLogout : function(info) {\n info = _.extend({\n route : 'customer_logout'\n }, info);\n return handleAppRoute(info);\n },\n\n /**\n * presentChangeStorePasswordDrawer - change the store password\n *\n * @param {Object} info - optional info\n * @return {Deferred} promise\n * @api public\n */\n presentChangeStorePasswordDrawer : function(info) {\n info = _.extend({\n route : 'change_store_password'\n }, info);\n return handleAppRoute(info);\n },\n\n /**\n * navigateToHome - navigate to Home\n *\n * @param {Object} info - optional info\n * @return {Deferred} promise\n * @api public\n */\n navigateToHome : function(info) {\n info = _.extend({\n route : 'home'\n }, info);\n\n return handleAppRoute(info);\n },\n\n /**\n * navigateToCategory - navigate to category\n *\n * @param {Object} info - optional info\n * @return {Deferred} promise\n * @api public\n */\n navigateToCategory : function(info) {\n info = _.extend({\n route : 'product_search_result',\n query : ''\n }, info);\n\n return handleAppRoute(info);\n },\n\n /**\n * navigateToProduct - navigate to a product (PDP)\n *\n * @param {Object} info - optional info\n * @return {Deferred} promise\n * @api public\n */\n navigateToProduct : function(info) {\n info = _.extend({\n route : 'product_detail'\n }, info);\n\n return handleAppRoute(info);\n },\n\n /**\n * navigateToProductSearch - navigate to product search results\n *\n * @param {Object} info - optional info\n * @return {Deferred} promise\n * @api public\n */\n navigateToProductSearch : function(info) {\n info = _.extend({\n route : 'product_search_result'\n }, info);\n\n return handleAppRoute(info);\n },\n\n /**\n * navigateToOrderSearchResult - navigate to order search results\n *\n * @param {Object} info - optional info\n * @return {Deferred} promise\n * @api public\n */\n navigateToOrderSearchResult : function(info) {\n info = _.extend({\n route : 'order_search_result'\n }, info);\n\n return handleAppRoute(info);\n },\n\n /**\n * presentAssociateLogin - present associate login\n *\n * @param {Object} info - optional info\n * @return {Deferred} promise\n * @api public\n */\n presentAssociateLogin : function(info) {\n info = _.extend({\n route : 'associate_login'\n }, info);\n return handleAppRoute(info);\n },\n\n /**\n * presentCustomerSearchDrawer - present customer search dialog\n *\n * @param {Object} info - optional info\n * @return {Deferred} promise\n * @api public\n */\n presentCustomerSearchDrawer : function(info) {\n info = _.extend({\n route : 'customer_search'\n }, info);\n return handleAppRoute(info);\n },\n\n /**\n * presentOrderSearchDrawer - present order search dialog\n *\n * @param {Object} info - optional info\n * @return {Deferred} promise\n * @api public\n */\n presentOrderSearchDrawer : function(info) {\n info = _.extend({\n route : 'order_search'\n }, info);\n return handleAppRoute(info);\n },\n\n /**\n * presentProductSearchDrawer - present product search dialog\n *\n * @param {Object} info - optional info\n * @return {Deferred} promise\n * @api public\n */\n presentProductSearchDrawer : function(info) {\n info = _.extend({\n route : 'product_search'\n }, info);\n return handleAppRoute(info);\n },\n\n /**\n * presentPrinterChooserDrawer - present printer chooser dialog\n *\n * @param {Object} info - optional info\n * @return {Deferred} promise\n * @api public\n */\n presentPrinterChooserDrawer : function(info) {\n info = _.extend({\n route : 'printer_chooser'\n }, info);\n return handleAppRoute(info);\n },\n\n /**\n * associateLogout - perform associate logout\n *\n * @param {Object} info - optional info\n * @return {Deferred} promise\n * @api public\n */\n associateLogout : function(info) {\n info = _.extend({\n route : 'associate_logout'\n }, info);\n return handleAppRoute(info);\n },\n\n /**\n * presentCreateAccountDrawer - present create account dialog\n *\n * @param {Object} info - optional info\n * @return {Deferred} promise\n * @api public\n */\n presentCreateAccountDrawer : function(info) {\n info = _.extend({\n route : 'create_account'\n }, info);\n return handleAppRoute(info);\n },\n\n /**\n * checkPaymentDevice - check status of payment device\n *\n * @param {Boolean} verified - if verified\n * @return {Deferred} promise\n * @api public\n */\n checkPaymentDevice : function(verified) {\n return checkPaymentDevice(verified);\n },\n\n /**\n * paymentDeviceConnectionChecked - update device status\n *\n * @param {Boolean} connected - if connected\n * @api public\n */\n paymentDeviceConnectionChecked : function(connected) {\n if (connected != paymentDeviceConnected) {\n paymentDeviceConnected = connected;\n $.header.updateDeviceStatus(false, connected);\n if ($.no_payment_terminal) {\n $.no_payment_terminal.updateDeviceStatus(connected);\n }\n }\n },\n\n /**\n * startup - restart the application\n *\n * @api public\n */\n startup : function() {\n Alloy.eventDispatcher.trigger('app:startup', {\n login : true\n });\n },\n\n /**\n * showActivityIndicator - shows activity indicator until deferred is complete\n *\n * @param {Deferred} deferred\n * @api public\n */\n showActivityIndicator : function(deferred) {\n showActivityIndicator(deferred);\n },\n\n /**\n * showHideHamburgerMenu - show the hamburger menu popover\n *\n * @api public\n */\n showHideHamburgerMenu : function() {\n $.hamburger_menu.showHideHamburgerMenu();\n },\n\n /**\n * hideHamburgerMenu - hide the hamburger menu popover\n *\n * @api public\n */\n hideHamburgerMenu : function() {\n $.hamburger_menu.hideHamburgerMenu();\n },\n\n /**\n * navigate - dynamic routing based on info passed in\n *\n * @param {Object} info - optional info\n * @return {Deferred} promise\n * @api public\n */\n navigate : function(info) {\n // for dynamic routing\n return handleAppRoute(info);\n }\n };\n}", "routes() {\n return (\n <div className=\"h-100\">\n <NavHeader />\n <Switch>\n <Route exact path=\"/apply/\" component={ApplyPage} />\n </Switch>\n </div>\n );\n }", "function routes(router) {\n\n\t\tconst pathwaysManager = new AuthorizedRoute((id, section, subId) => {\n\t\t\trequire(['./components/manager'], function () {\n\t\t\t\trouter.setCurrentView('pathways-manager', {\n\t\t\t\t\tanalysisId: id,\n\t\t\t\t\tsection: section,\n\t\t\t\t\texecutionId: section === 'results' ? subId : null,\n\t\t\t\t\tsourceId: section === 'executions' ? subId : null,\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\tconst pathwaysManagerVersion = new AuthorizedRoute((id, version) => {\n\t\t\trequire(['./components/manager'], function () {\n\t\t\t\trouter.setCurrentView('pathways-manager', {\n\t\t\t\t\tanalysisId: id,\n\t\t\t\t\tsection: 'design',\n\t\t\t\t\tversion: version\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\tconst pathwaysBrowser = new AuthorizedRoute(() => {\n\t\t\trequire(['./components/browser'], function () {\n\t\t\t\trouter.setCurrentView('pathways-browser');\n\t\t\t});\n\t\t})\n\n\t\treturn {\n\t\t\t'pathways': pathwaysBrowser,\n\t\t\t'pathways/:id:': pathwaysManager,\n\t\t\t'pathways/:id:/version/:version:': pathwaysManagerVersion,\n\t\t\t'pathways/:id:/:section:': pathwaysManager,\n\t\t\t'pathways/:id:/:section:/:subId:': pathwaysManager // for executions\n\t\t};\n\t}", "function navRouter(i) {\n if (i.text() === \"About\") {\n navAnimation('#0');\n showAbout();\n } else if (i.text() === \"Projects\") {\n navAnimation('#1');\n showProjects();\n } else {\n navAnimation('#2');\n showContactInfo();\n }\n toggleMenu();\n }", "onNavigate(payload) {\n // router navigation\n if (payload.handler === 'router') {\n const { path, queryParams } = payload;\n // path control\n if (!path)\n throw Error('onNavigate: no path for router navigate');\n if (queryParams) {\n this.router.navigate(path, {\n relativeTo: this.route,\n queryParams,\n queryParamsHandling: 'merge',\n });\n }\n else {\n this.router.navigate(path);\n }\n // on change\n this._onRouterNavigate();\n }\n }", "render(){ \n return ( \n <div>\n <NavBar/>\n <Switch>\n <Route path='/navigation' component={NavBar}/>\n <Route path=\"/movie/:id\" component={movieId}/> \n <Route path=\"/tv/:id\" component={seriesId}/> \n <Route path=\"/trending\" component={trending}/>\n <Route path=\"/movies\" component={movies}/> \n <Route path=\"/series\" component={series}/>\n <Route path=\"/search\" component={search}/>\n <Redirect from=\"/\" exact to=\"/trending\"/>\n <Route path=\"/not-found\" component={NotFound}/>\n <Redirect to=\"/not-found\"/>\n </Switch>\n </div>\n );\n }", "render() {\n\n return (\n\n <div>\n <Router>\n\n <>\n \n \n <NavigationComponent/>\n\n {/* Adding the URL paths for each component */}\n\n <Switch>\n <Route path=\"/\" exact component={RegistrationSelection}/>\n <Route path=\"/signup\" exact component={RegistrationSelection}/>\n <Route path=\"/nr\" exact component={NurseryRegistration}/>\n <Route path=\"/pr\" exact component={ParentRegistration}/>\n <Route path=\"/ns\" exact component={NurserySearch}/>\n <Route path=\"/nsr\" exact component={SearchNurseryResults}/>\n <Route path=\"/single\" exact component={SingleNursery}/>\n <Route path=\"/login\" exact component={Login}/>\n <Route path=\"/ps\" exact component={PaymentSetup}/>\n <Route path=\"/p\" exact component={Prices}/>\n <Route path=\"/sn\" exact component={SendNotification}/>\n <Route path=\"/ans\" exact component={RegistrationRequestsSearch}/>\n <Route path=\"/ansr\" exact component={RegistrationRequests}/>\n <Route path=\"/ana\" exact component={NurseryApplication}/>\n <Route path=\"/add-child\" exact component={AddChild}/>\n <Route path=\"/my-children\" exact component={ViewChild}/>\n <Route path=\"/nursery-send\" exact component={NurseryNotification}/>\n <Route path=\"/view-requests\" exact component={ChildrenRequests}/>\n <Route path=\"/set-meeting\" exact component={Meeting}/>\n <Route path=\"/apply\" exact component={ApplyNursery}/>\n <Route path=\"/confirmation\" exact component={ApplyConfirmation}/>\n\n {/* <Route component={Error}/> WILL BE USED FOR ERROR PATHS*/}\n\n </Switch>\n\n </>\n\n </Router>\n\n </div>\n\n )\n\n }", "_renderScene(sceneProps) {\n\t if (sceneProps.scene.index === 0) {\n\n\t\t return (\n\t\t <Home\n\t\t route={sceneProps.scene.route}\n\t\t onPushRoute={(val) => this._onPushRoute(val)}\n\t\t onPopRoute={() => this._onPushRoute(0)}\n\t\t onExit={this.props.onExit}\n\t\t {...this.props}\n\t\t />\n\t\t\t);\n\t\t}\n\t\tif (sceneProps.scene.index === 1) {\n\t\t\treturn (\n\t\t <SettingsPage\n\t\t \troute={sceneProps.scene.route}\n\t\t onPushRoute={(val) => this._onPushRoute(val)}\n\t\t onPopRoute={() => this._onPushRoute(0)}\n\t\t onExit={this.props.onExit}\n\t\t {...this.props}\n\t\t\t\t/>\n\t\t\t);\t\n\t\t}\n\t\tif (sceneProps.scene.index === 2) {\n\t\t\treturn (\n\t\t <ArchivePage\n\t\t \troute={sceneProps.scene.route}\n\t\t onPushRoute={(val) => this._onPushRoute(val)}\n\t\t onPopRoute={() => this._onPushRoute(0)}\n\t\t onExit={this.props.onExit}\n\t\t {...this.props}\n\t\t />\n\t\t\t);\t\n\t\t}\n\t\tif (sceneProps.scene.index === 3) {\n\t\t\treturn (\n\t\t <UnitsPage\n\t\t \troute={sceneProps.scene.route}\n\t\t onPushRoute={(val) => this._onPushRoute(val)}\n\t\t onPopRoute={() => this._onPushRoute(0)}\n\t\t onExit={this.props.onExit}\n\t\t {...this.props}\n\t\t />\n\t\t\t);\t\n\t\t}\t\t\t\t\t\n }", "function initPageManagement () {\n\n\t\tPAGE('*', function load(ctx) {\n\t\t\ttry {\n\n\t\t\t\tvar pathname = ctx.pathname;\n\t//debugger;\n\t//console.log(\"ON PAGE CHANGE ctx\", ctx);\n\n\t\t\t\t// IE Fix\n\t\t\t\tif (\n\t\t\t\t\tpathname !== PATHNAME &&\n\t\t\t\t\tpathname.indexOf(\"#\") === -1\n\t\t\t\t) {\n\t\t\t\t\tpathname = PATHNAME + \"#\" + pathname.substring(1);\n\t\t\t\t}\n\n//console.log(\"pathname1: \" + pathname);\n\n\t\t\t\tvar view = pathname.replace(PATHNAME, \"\").replace(/^#/, \"\");\n\n//console.log(\"view: \" + view);\n//console.log(\"pathname2: \" + pathname);\n\t\t\t\tif (\n\t\t\t\t\t/^\\//.test(view) &&\n\t\t\t\t\tappContext.get('lockedView') &&\n\t\t\t\t\tview !== appContext.get('lockedView') &&\n\t\t\t\t\tappContext.get('lockedView').split(\",\").indexOf(view) === -1\n\t\t\t\t) {\n\t//console.log(\"REDIRECT TO\", window.location.origin + view);\n\t\t\t\t\t// We are selecting a new view and updating the URL using a REDIRECT which\n\t\t\t\t\t// loads the new page from the server.\n\n\t\t\t\t\t// NOTE: This will not work if only the Hash changes.\n\t\t\t\t\t// In those cases you need to redirect to a new URL.\n\t\t\t\t\twindow.location.href = appContext.get(\"windowOrigin\") + view;\n\t\t\t\t} else {\n//console.log(\"SET VIEW\", view);\n\n\t\t\t\t\t// We are selecting a new view and updating the URL using PUSH-STATE\n\t\t\t\t\t// without reloading the page.\n\n\t\t\t\t\tappContext.set('selectedView', view);\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tconsole.error(\"page changed error:\", err.stack);\n\t\t\t}\n\t\t});\n\t\tPAGE({\n\t\t\tpopstate: false,\n\t\t\tclick: false\n\t\t});\n\n/*\nappContext.get(\"data\").collection(\"page\").add({\n\t\"id\": \"loaded\",\n\t\"selectedDay\": MOMENT().format(\"YYYY-MM-DD\"),\n\t\"selectedEvent\": context.dbfilter.event_id\n});\n*/\n\n\t\tappContext.on(\"change:selectedDayId\", function () {\n\nconsole.info(\"CHANEGD SELECETD DAY!\", appContext.get(\"selectedDayId\"));\n\n\t\t\tappContext.get(\"data\").collection(\"page\").get(\"loaded\").set(\n\t\t\t\t\"selectedDay\",\n\t\t\t\tappContext.get(\"selectedDayId\")\n\t\t\t);\n\t\t});\n\n\n\t\tappContext.on(\"change:selectedView\", function () {\n\n\t\t\ttry {\n\n\t//console.log(\"ON VIEW CHANGE appContext.selectedView\", appContext.selectedView);\n\t//console.log(\"ON VIEW CHANGE appContext.lockedView\", appContext.lockedView);\n\n\t\t\t\tif (\n\t\t\t\t\tappContext.get('lockedView') &&\n\t\t\t\t\tappContext.get('selectedView') !== appContext.get('lockedView') &&\n\t\t\t\t\tappContext.get('lockedView').split(\",\").indexOf(appContext.get('selectedView')) === -1\n\t\t\t\t) {\n\t//console.log(\"REDIRECT TO\", window.location.origin + PATHNAME + \"#\" + appContext.selectedView);\n\t\t\t\t\t// We are selecting a new view and updating the URL using a REDIRECT which\n\t\t\t\t\t// loads the new page from the server.\n\n\t\t\t\t\t// NOTE: This will not work if only the Hash changes.\n\t\t\t\t\t// In those cases you need to redirect to a new URL.\n\t\t\t\t\twindow.location.href = appContext.get(\"windowOrigin\") + PATHNAME + \"#\" + appContext.get('selectedView');\n\t\t\t\t} else {\n\n\t//console.log(\"SET PAGE1\", PATHNAME + \"#\" + appContext.selectedView);\n\n\t\t\t\t\t// We are selecting a new view and updating the URL using PUSH-STATE\n\t\t\t\t\t// without reloading the page.\n\n\t\t\t\t\tif (handleSelectedViewInit()) return;\n\t//console.log(\"SET PAGE2\", PATHNAME + \"#\" + appContext.selectedView);\n\n\t\t\t\t\tPAGE.redirect(PATHNAME + \"#\" + appContext.get('selectedView'));\n\n\t//\t\t\t\tPAGE(PATHNAME + \"#\" + appContext.selectedView);\n\t//console.log(\"SET PAGE DONE\", PATHNAME + \"#\" + appContext.selectedView);\n\n\t\t\t\t\twindow.scrollTo(0, 0);\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tconsole.error(\"selectedView change error:\", err.stack);\n\t\t\t}\n\t\t});\n/*\n\t\tappContext.on(\"change:selectedDay\", function () {\n\t\t\tif (appContext.get('selectedView') != \"Landing\") {\n\t\t\t\tappContext.set('selectedView', \"Landing\");\n\t\t\t}\n\t\t});\n*/\n\t}", "viewMeta() { FlowRouter.go('invoiceMeta', { invoiceId: this.props.invoice._id } ) }", "viewMeta() { FlowRouter.go('invoiceMeta', { invoiceId: this.props.invoice._id } ) }", "goToMapPage(){\r\n\r\n this.props.history.push(\r\n {\r\n pathname: MAP,\r\n data: []\r\n }\r\n );\r\n \r\n }", "function Router() {\n return (\n\n <BrowserRouter>\n\t\t<Switch>\n\t\t\t<LayoutNav>\t\n\t\t\t{/* https://jekaport.com/auth/verify/5d7919c0857aba0007fcd988 */}\n\t\t\t\t<Route exact path=\"/auth/verify/:token\" component={Authenticator} />\n\t\t\t\t<Route exact path=\"/registervehicle\" component={RegVehicle} />\n\t\t\t\t<Route exact path=\"/result\" component={SearchResults} />\n\t\t\t\t<Route exact path=\"/selectseat\" component={PickSeat} />\n\t\t\t\t<Route exact path=\"/forgotpassword\" component={ForgotPassword} />\n\t\t\t\t<Route exact path=\"/resetpassword\" component={ResetPassword} />\n\t\t\t\t<Route exact path=\"/register\" component={Registration} />\n\t\t\t\t<Route exact path=\"/login\" component={LoginAuth} />\n\t\t\t\t<Route exact path=\"/\" component={Home} />\n\t\t\t\t<Route exact path=\"/companydashboard\" component={CompanyDashboard} />\n\t\t\t\t<Route exact path=\"/businessdetaildashboard\" component={BusinessDetailDashboard} />\n\t\t\t</LayoutNav>\n\t\t\t<Route component={NotFound} />\n\t\t</Switch>\n\t\t<Footer />\n </BrowserRouter>\n );\n}", "function Temp() {\n const { zhPageList } = usePages();\n const { user_id, adim } = usePages().userInfo;\n const { RecordTeam, UserEditor, RecordPlayer, Profile } = pagesMenu();\n return (\n <Router>\n <Layout className=\"layout\">\n <Header>\n {/* <div className=\"logo\" /> */}\n <NavBar />\n </Header>\n <Switch>\n <Route exact path=\"/\">\n <Redirect to={\"/\" + zhPageList[0][0]} />\n </Route>\n <Route\n path=\"/確認隊伍資訊\"\n render={(props) => <Checkteam user_id={user_id} adim={adim} />}\n />\n {zhPageList.map((page, index) => (\n <Route key={index} path={\"/\" + page[0]} component={page[1]} />\n ))}\n <Route exact path=\"/profile\" component={UserEditor} />\n <Route exact path=\"/profile/:user_id\" component={Profile} />\n <Route path=\"/recordTeam/:aMatch\" component={RecordTeam} />\n <Route path=\"/recordPlayer/:data\" component={RecordPlayer} />\n </Switch>\n <Footer style={{ textAlign: \"center\" }}>\n Online Basketball Web design by{\" \"}\n </Footer>\n </Layout>\n </Router>\n );\n}", "function navigatingTo(args) {\n page = args.object;\n}", "GoToSelectPage() { \n \n this.props.history.push(\"/ChoicePage\");\n }", "render() {\n return(\n <div>\n {/* {this is the router for changing pages on the site} */}\n <BrowserRouter history={history}>\n {/* The Main Context Providers */}\n <UserProvider>\n <OrganizationProvider>\n <VerifyStatusProvider>\n <PrimaryNavSelectedProvider>\n <OpenTicketContextProvider>\n <StatusListProvider>\n <PriorityListProvider>\n <TicketColumnsContextProvider>\n <TicketProvider>\n {/* {Navbar component to navigate} */}\n {/* <Navbar/> */}\n \n \n {/* TicketTabContext to hold the ticket tabs*/}\n <TicketTabContextProvider>\n <SelectedOrgProvider>\n \n\n \n {/* {creating a switch to swap out the component to show when on different pages} */}\n \n {/* {pages and the component assgined to them} */}\n \n <Route component={AllRoutes}/>\n\n </SelectedOrgProvider>\n \n </TicketTabContextProvider>\n \n </TicketProvider>\n </TicketColumnsContextProvider>\n </PriorityListProvider>\n </StatusListProvider>\n </OpenTicketContextProvider>\n </PrimaryNavSelectedProvider>\n </VerifyStatusProvider>\n </OrganizationProvider>\n </UserProvider>\n </BrowserRouter>\n </div>\n );\n }", "render() {\n let appContainer = document.querySelector('#tabsBoxApp');\n let template = require('./views/TabsBoxComponent.hbs');\n let navigationLinks = this.navigation.getNavigationLinks();\n\n appContainer.innerHTML = template({'links': navigationLinks});\n\n this.navigation.addNavigationClickActions();\n\n }", "constructor(props) {\n super(props);\n this.changePageToOverview = this.changePageToOverview.bind(this);\n this.changePageToRegistration = this.changePageToRegistration.bind(this);\n }", "index() {\n new IndexView({ el: '.pages-wrapper' });\n }", "onNavigate (routeData) {\n this.channel.trigger('before:navigate', routeData.linked)\n\n routeData.linked.show(routeData.params)\n .then(() => {\n this.channel.trigger('navigate', routeData.linked)\n })\n .catch((error) => {\n console.error(error)\n this.channel.trigger('error')\n })\n }", "function App() {\n \n \n return (\n <Router>\n <div className= \"pages\">\n <nav className=\"nav-bar\">\n <h1 className= \"title\">CRYSTALS & PENDULUMS</h1>\n {/* <img src=\"%PUBLIC_URL%/favicon.ico\" width=\"25\" height=\"25\" alt=\"brand\"/> */}\n <ul className=\"across\">\n \n \n <li><Link to=\"/Welcome\">WELCOME</Link></li>\n <li><Link to=\"/Crystals\">CRYSTALS</Link></li>\n <li><Link to=\"/Jewelry\">JEWELRY</Link></li> \n <li><Link to=\"/Pendulums\">PENDULUMS</Link></li> \n <li><Link to=\"/ItemUpload\">ITEM UPLOAD</Link></li>\n </ul> \n \n </nav>\n \n <Switch>\n <Route path='/Welcome'><br/><br/>\n <Welcome />\n </Route>\n <Route path='/Crystals'><br/><br/>\n <Crystals />\n </Route>\n <Route path='/Jewelry'><br/><br/>\n <Jewelry />\n </Route>\n <Route path='/Pendulums'><br/><br/>\n <Pendulums />\n </Route>\n <Route path='/ItemUpload'><br/><br/>\n <ItemUpload />\n \n </Route>\n </Switch>\n\n \n\n\n\n\n </div>\n\n </Router>\n\n \n );\n}", "render(){\n return(\n <div>\n <Router>\n <React.Fragment>\n <NavBar />\n <Route exact path = \"/\" render = {()=> <Redirect to=\"/news\" />}/>\n <Route exact path = \"/news\" render = {()=> <NewsPage/>}/>\n <Route exact path = \"/login\" render = {()=> <Landing/>}/>\n <Route exact path = \"/charts\" render = {()=> <ChartPage/>}/>\n <Route exact path = \"/trade\" render = {()=> <TradePage/>}/>\n <Route exact path = \"/portfolio\" render = {()=> <PortfolioPage/>}/>\n <Route exact path = \"/leaderboard\" render = {()=> <LeaderboardPage/>}/>\n </React.Fragment>\n </Router>\n </div>\n )\n }", "render() {\n console.log('sef a', this.props)\n return (\n <div className=\"intro_container\">\n <div className=\"text_intro\">\n <p>More...</p>\n </div>\n <div className=\"intro_tabs\">\n <div className=\"news_bubble\">\n <img className=\"news_img\" src={feed} alt=\"\"/>\n <button onClick={() => this.props.router.history.push('/feed')} className=\"main_button_tab\">Feed</button>\n </div>\n <div className=\"friends_bubble\">\n <img className=\"friends_img\" src={chat} alt=\"\"/>\n <button onClick={() => this.props.router.history.push('/chat')} className=\"main_button_tab\">Chat</button>\n </div>\n <div className=\"space_station_bubble\">\n <img className=\"ss_img\" src={apod} alt=\"\"/>\n <button onClick={() => this.props.router.history.push('/apod')} className=\"main_button_tab\">APOD</button>\n </div>\n </div>\n <div className=\"bottom_footer\">\n \n </div>\n </div>\n )\n }", "buscarPokemon(termino) {\n console.log('capturo info de text - navbar.component.ts ', termino);\n this.router.navigate(['/buscar', termino]);\n }", "render() {\n return (\n <Container>\n <RouterView router={router}>\n <HomePage path=\"/\" />\n <SecondPage path=\"/secondPage\" />\n </RouterView>\n </Container>\n );\n }", "goToRoute(event) {\n this.props.history.push(\"/blogs\");\n }", "changeToMainPage(num) {\n this.props.history.push(\"/\");\n }", "navigateToLabPage() {\n return this._navigate(this.buttons.lab, 'labPage.js');\n }", "get routes(){\n\t\treturn {\n\t\t\t'get /': [actionFilter, 'index'],\n\t\t\t'get /home/about': 'about'\n\t\t}\n\t}", "constructor(shareable, user, router) {\n this.user = user;\n this.router = router;\n this.shareable = shareable;\n this.linksList = [{\n subRoute: '',\n text: 'Overview',\n icon: 'tachometer-alt',\n order: 1,\n }, {\n text: 'Resources',\n subRoute: 'resources',\n icon: 'bezier-curve',\n order: 2,\n featureName: 'resources',\n }, {\n text: 'Members',\n subRoute: 'members',\n icon: 'users',\n order: 3,\n }, {\n text: 'User Stories',\n subRoute: 'user-stories',\n icon: 'book-reader',\n order: 4,\n featureName: 'userStories',\n }, {\n text: 'Tasks Board',\n subRoute: 'tasks-board',\n icon: 'sticky-note',\n className: 'pink-text bold',\n featureName: 'taskBoard',\n order: 5,\n }, {\n text: 'Test Suits',\n subRoute: 'test-suits',\n icon: 'toolbox',\n order: 6,\n featureName: 'testSuits',\n }, {\n text: 'Test Environments',\n subRoute: 'test-environments',\n icon: 'tags',\n order: 6,\n featureName: 'testEnvironment',\n }, {\n tooltip: 'Bugs',\n subRoute: 'bugs',\n order: 7,\n featureName: 'bugs',\n }, {\n text: 'Layouts & Components',\n subRoute: 'components',\n icon: 'puzzle-piece',\n order: 8,\n featureName: 'components',\n }, {\n text: 'Modules',\n subRoute: 'modules',\n icon: 'cogs',\n order: 8,\n featureName: 'modules',\n }, {\n text: 'Sprints',\n subRoute: 'sprints',\n icon: 'running',\n order: 8,\n featureName: 'sprints',\n }, {\n text: 'Features',\n subRoute: 'features',\n icon: 'book',\n order: 8,\n featureName: 'features',\n }, {\n text: 'Meetings',\n subRoute: 'meetings',\n icon: 'handshake',\n order: 9,\n featureName: 'meetings',\n }, {\n text: 'Teams',\n subRoute: 'teams',\n icon: 'people-carry',\n order: 10,\n featureName: 'teams',\n }, {\n text: 'Change Requests (CR)',\n subRoute: 'change-requests',\n icon: 'exchange-alt',\n order: 11,\n featureName: 'changeRequests',\n }, {\n text: 'SRS',\n subRoute: 'srs',\n icon: 'book',\n tooltip: 'Software Requirements Specifications',\n order: 12,\n featureName: 'srs',\n }, {\n text: 'Documentation',\n subRoute: 'documentations',\n icon: 'book-dead',\n order: 13,\n featureName: 'documentation',\n }, {\n text: 'Discussions',\n subRoute: 'discussions',\n fab: 'rocketchat',\n order: 14,\n featureName: 'discussions',\n }, {\n text: 'Settings',\n subRoute: 'settings',\n icon: 'cogs',\n order: 15,\n isAuthorized: () => this.projectDetails.isHigherAuthority || (this.projectDetails.is || {}).higherAuthority,\n }, {\n // text: 'Supervisors',\n // subRoute: 'supervisors',\n // icon: 'user-secret',\n // order: 16, \n // isAuthorized: () => this.projectDetails.isHigherAuthority, \n // }, {\n text: 'Client',\n subRoute: 'client',\n icon: 'user-secret',\n order: 17,\n featureName: 'client',\n }];\n\n // Todo Links later\n // Calendar\n // Reminders\n // Milestones\n // Todo List\n // Top Participants\n // Teams Dashboard\n // Activities\n // Project Backlog\n // Poll\n }", "next() {\n const that = this;\n\n that.navigateTo(that.pageIndex + 1);\n }", "goToCustomerListPage(){\n this.getListOfCustomers();//calling function that will retrieve list of customers with server\n }", "function App() {\n return (\n <div className=\"container\">\n <h1>Madlibs</h1>\n {/* <Link className = \"btn btn-info mr-3\" to=\"/\">Home</Link> */}\n\n \n {/* <h4 className = \"my-3\">We have quotes by:</h4> */}\n <Router className = \"my-3\">\n <Home path=\"/\"/>\n <Camp path=\"/camp\"/>\n\n\n\n </Router>\n\n\n \n\n\n\n </div>\n );\n}", "get events() { return this.routerEvents; }", "function App(){\n return(\n <div>\n <S>\n <R path=\"/info\">\n <Detail/>\n </R>\n <R path='/login'>\n <Login/>\n </R>\n <R path=\"/\">\n <Home/> \n </R>\n </S>\n </div>\n );\n}", "'click .btn-go-to-course'(event, template){\n FlowRouter.go('course', { slug: Courses.findOne({ _id: template.courseId.get() }).slug });\n }", "function render(url) {\n\n /**\n * Get request keyword from url\n * @type {string}\n */\n const request = url.split('/')[0];\n\n get(\"loading-status\").update(\"Organizando as informações...\");\n\n const routes = {\n\n /**\n * Home\n */\n '': function () {\n /**\n * App Page element\n * @type {Element}\n */\n let page = new Element({\n properties: {\n id: \"app\",\n className: \"\"\n }\n });\n\n /**\n * Page Header\n */\n new Element({\n type: \"header\",\n properties: {\n className: \"app-header\"\n },\n content: [\n new Element({\n type: \"h1\",\n content: \"Busca Marvel\",\n properties: {\n className: \"app-title\"\n }\n }),\n new Element({\n type: \"h2\",\n content: \"Teste front-end\",\n properties: {\n className: \"app-subtitle\"\n }\n }),\n new Element({\n type: \"h3\",\n content: \"Paulo Cézar Francisco Júnior\",\n properties: {\n className: \"app-developer hide-on-mobile\"\n }\n })\n ]\n }, page);\n\n /**\n * Detail\n */\n new Element({\n properties: {\n className: \"app-line\"\n },\n content: new Element\n }, page);\n\n /**\n * Search box\n */\n new Element({\n type: \"section\",\n properties: {\n id: \"search-container\",\n placeholder: \"Pesquisar\"\n },\n content: [\n new Element({\n type: \"label\",\n content: \"Nome do Personagem\",\n properties: {\n htmlFor: \"search-box\",\n className: \"app-search-label\"\n }\n }),\n new Element({\n type: \"input\",\n properties: {\n id: \"search-box\",\n className: \"app-search-box\",\n title: \"Digite o nome de um herói da Marvel\",\n placeholder: \"ex. Iron Man\",\n oninput: function(){\n filterList();\n }\n }\n }),\n ]\n }, page);\n\n /**\n * Heroes List\n */\n new Element({\n type: \"section\",\n properties: {\n className: \"app-hero-list\",\n },\n content: [\n new Element({\n properties: {\n className: \"app-hero-list-header\",\n },\n content: [\n new Element({\n content: \"Nome\"\n }),\n new Element({\n content: \"Séries\",\n properties: {\n className: \"hide-on-mobile\"\n }\n }),\n new Element({\n content: \"Eventos\",\n properties: {\n className: \"hide-on-mobile\"\n }\n })\n ]\n }),\n new Element({\n properties: {\n id: \"hero-list\",\n className: \"app-hero-list-rows\",\n },\n content: goPage(1, HERO_LIST, true)\n }),\n ]\n }, page);\n\n new Element({\n properties: {\n id: \"pagination-container\",\n className: \"app-pagination-container row-4\",\n },\n type: \"section\",\n content: [\n new Element({\n properties: {\n className: \"app-pagination\"\n },\n content: [\n new Element({\n type: \"span\",\n content: \"&#9664;\",\n properties: {\n className: \"disabled\",\n id: \"app-pagination-prev\",\n onclick: function () {\n goPage(prevPage());\n }\n }\n }),\n new Element({\n type: \"ul\",\n properties: {\n id: \"pagination-list\"\n },\n content: [\n new Element({\n type: \"li\",\n content: \"1\",\n properties: {\n className: \"app-pagination-page active\",\n onclick: function () {\n goPage(1);\n }\n }\n })\n ]\n }),\n new Element({\n type: \"span\",\n content: \"&#9654;\",\n properties: {\n className: \"disabled\",\n id: \"app-pagination-next\",\n onclick: function () {\n goPage(nextPage());\n }\n }\n })\n ]\n })\n ]\n }, page);\n\n new Element({\n properties: {\n id: \"footer\",\n },\n type: \"footer\",\n content: [\n new Element({\n type: \"span\",\n properties: {\n id: \"copyright\"\n },\n content: HERO_DATA.copyright\n })\n ]\n }, page);\n\n ROOT.update(page, function(){\n trigger(\"list-updated\");\n });\n },\n\n /**\n * Detail page\n */\n '#hero': function () {\n\n /**\n * App Page element\n * @type {Element}\n */\n let page = new Element({\n properties: {\n id: \"app\",\n className: \"detail\"\n }\n });\n\n /**\n * Get the hero name\n * @type {string}\n */\n let idHero = url.split('#hero/')[1].trim();\n\n let hero = HERO_LIST.find(function (h) {\n if(parseInt(h.id) === parseInt(idHero)){\n return h;\n }\n });\n\n let series = [\n new Element({\n properties: {\n className: \"detail-block\"\n },\n content: [\n new Element({\n type: \"header\",\n properties: {\n className: \"detail-block-header\"\n },\n content: \"Não há dados para exibir nesta categoria.\"\n })\n ]\n })\n ];\n\n let events = [\n new Element({\n properties: {\n className: \"detail-block\"\n },\n content: [\n new Element({\n type: \"header\",\n properties: {\n className: \"detail-block-header\"\n },\n content: \"Não há dados para exibir nesta categoria.\"\n })\n ]\n })\n ];\n\n if(hero.series.returned > 0){\n\n /**\n * Fetch (more) information about series\n */\n series = hero.series.items.map(function(s){\n idSerie = \"detail-serie-\" + s.resourceURI.toString().split(\"/\").slice(-1).toString().trim();\n\n setTimeout(function(){\n fetch(s.resourceURI.toString().replace(\"http://\", \"https://\") + \"?apikey=5e8ca1959f7f23db54436ae4b3661243\").then(r => r.json()).then(function(json){\n let data = json.data.results[0];\n get(\"detail-serie-\" + data.id).update(new Element({\n properties: {\n className: \"detail-card\"\n },\n content: [\n new Element({\n properties: {\n className: \"detail-card-description\"\n },\n content: data.description || \"Sem descrição.\"\n }),\n new Element({\n type: \"a\",\n properties: {\n className: \"detail-card-link\",\n href: data.urls[0].url,\n target: \"_blank\",\n title: \"Veja mais no site da MARVEL\"\n },\n content: \"&#9654; Veja mais em MARVEL.com\"\n }),\n new Element({\n properties: {\n className: \"detail-card-properties\"\n },\n content: [\n new Element({\n content: [\n \"Creators:\",\n data.creators.items.map(function(c){\n return c.name;\n }).join(\", \")\n ].join(\" \").trim()\n })\n ]\n }),\n ]\n }));\n }).catch(function(err){\n get(idSerie).update(\"Desculpe, não foi possível obter dados da MARVEL.\");\n console.error(err);\n });\n }, 300);\n\n return new Element({\n properties: {\n className: \"detail-block\"\n },\n content: [\n new Element({\n type: \"header\",\n properties: {\n className: \"detail-block-header\"\n },\n content: s.name\n }),\n new Element({\n type: \"section\",\n properties: {\n className: \"detail-block-content\",\n id: idSerie,\n style: {\n textAlign: \"center\"\n }\n },\n content: [\n new Element({\n className: \"detail-loading\",\n type: \"img\",\n properties: {\n src: \"img/loading.gif\",\n alt: \"Obtendo dados...\",\n height: \"40\",\n width: \"40\"\n }\n }),\n ]\n })\n ]\n });\n });\n }\n\n if(hero.events.returned > 0){\n\n /**\n * Fetch (more) information about events\n */\n events = hero.events.items.map(function(s){\n idEvent = \"detail-event-\" + s.resourceURI.toString().split(\"/\").slice(-1).toString().trim();\n\n setTimeout(function(){\n fetch(s.resourceURI.toString().replace(\"http://\", \"https://\") + \"?apikey=5e8ca1959f7f23db54436ae4b3661243\").then(r => r.json()).then(function(json){\n let data = json.data.results[0];\n console.log(data);\n get(\"detail-event-\" + data.id).update(new Element({\n properties: {\n className: \"detail-card\"\n },\n content: [\n new Element({\n properties: {\n className: \"detail-card-description\"\n },\n content: data.description || \"Sem descrição.\"\n }),\n new Element({\n properties: {\n className: \"detail-card-properties\"\n },\n content: [\n new Element({\n content: [\n \"Criadores:\",\n data.creators.items.map(function(c){\n return c.name;\n }).join(\", \")\n ].join(\" \").trim()\n })\n ]\n }),\n ]\n }));\n }).catch(function(err){\n get(idSerie).update(\"Desculpe, não foi possível obter dados da MARVEL.\");\n console.error(err);\n });\n }, 300);\n\n return new Element({\n properties: {\n className: \"detail-block\"\n },\n content: [\n new Element({\n type: \"header\",\n properties: {\n className: \"detail-block-header\"\n },\n content: s.name\n }),\n new Element({\n type: \"section\",\n properties: {\n className: \"detail-block-content\",\n id: idEvent\n },\n content: [\n new Element({\n className: \"detail-loading\",\n type: \"img\",\n properties: {\n src: \"img/loading.gif\",\n alt: \"Obtendo dados...\",\n height: \"40\",\n width: \"40\",\n style: {\n display: \"block\",\n margin: \"10px auto\",\n }\n }\n }),\n ]\n })\n ]\n });\n });\n }\n\n /**\n * Back home link\n */\n new Element({\n type: \"a\",\n properties: {\n onclick: function(){\n window.location.hash = \"\";\n },\n id: \"back-home\",\n title: \"Voltar à busca\"\n },\n content: \"&#9664;\"\n }, page);\n\n /**\n * Page Header\n */\n new Element({\n type: \"header\",\n properties: {\n id: \"detail-header\",\n className: \"app-header\"\n },\n content: [\n new Element({\n content: [\n new Element({\n id: \"detail-img\",\n type: \"img\",\n properties: {\n src: (['path', 'extension'].map(p => hero.thumbnail[p])).join(\".\").replace(\"http://\", \"https://\"),\n alt: hero.name,\n height: \"180\",\n width: \"180\"\n }\n }),\n new Element({\n type: \"h1\",\n content: hero.name,\n properties: {\n className: \"app-title\"\n }\n }),\n ]\n }),\n new Element({\n type: \"h3\",\n content: HERO_DATA.copyright,\n properties: {\n className: \"detail-logo hide-on-mobile\"\n }\n })\n ]\n }, page);\n\n new Element({\n properties: {\n id: \"detail-content\",\n },\n type: \"section\",\n content: [\n new Element({\n type: \"section\",\n properties: {\n className: \"detail-content-section\"\n },\n content: [\n new Element({\n type: \"header\",\n content: \"Séries\"\n }),\n new Element({\n type: \"section\",\n content: series\n })\n ]\n }),\n new Element({\n type: \"section\",\n properties: {\n className: \"detail-content-section\"\n },\n content: [\n new Element({\n type: \"header\",\n content: \"Eventos\"\n }),\n new Element({\n type: \"section\",\n content: events\n })\n ]\n })\n ]\n }, page);\n\n /**\n * Footer\n */\n new Element({\n properties:{\n id: \"detail-footer\"\n },\n content: [\n new Element({\n content: HERO_DATA.attributionText\n }),\n new Element({\n content: \"PAULO CÉZAR FRANCISCO JÚNIOR\"\n })\n ]\n }, page);\n\n ROOT.update(page);\n }\n };\n\n /**\n * Load the page requested\n */\n if (routes[request]) {\n get(\"loading-status\").addClass(\"hidden\");\n routes[request]();\n }\n /**\n * If the request is not registered, load main page\n */\n else {\n window.location.hash = \"\";\n }\n}", "viewRoute() {\n\n this.router.use(auth.isLoggedIn());\n \n this.router.get('/signup', signup);\n this.router.get('/login', login);\n this.router.get('/forgot-password', forgotPassword);\n this.router.get('/reset-password', resetPassword);\n this.router.get('/forgot-password/success', forgotPasswordSuccess);\n this.router.get('/team', team);\n this.router.get('/volunteer', volunteer);\n this.router.get('/', home);\n this.router.get('/about-us', about);\n this.router.post('/', (req, res, next) => (req.page='home', next()), home);\n\n \n this.router.get(\n '/donor',\n auth.authenticateApp(),\n auth.authorizeApp('donor'),\n (req, res, next) => res.redirect('/donor/dashboard')\n );\n \n this.router\n .get(\n '/donor/dashboard',\n auth.authenticateApp(),\n auth.authorizeApp('donor'),\n (req, res, next) => ((req.page = 'dashboard'), next()),\n donorDashboard\n );\n \n this.router\n .get(\n '/donor/donations',\n auth.authenticateApp(),\n auth.authorizeApp('donor'),\n (req, res, next) => ((req.page = 'donations'), next()),\n donorDashboard\n );\n \n this.router\n .get(\n '/donor/donations/verify',\n auth.authenticateApp(),\n auth.authorizeApp('donor'),\n verifyMonetaryDonation\n )\n \n return this.router;\n}", "render() {\n return (\n <Router>\n <div>\n <Route exact path=\"/\" component={ProjectPage}/>\n <Route path=\"/adminpage\" component={AdminPage}/>\n </div>\n </Router>\n );\n }", "render() {\n return (\n <Router>\n <Switch>\n <Route exact path='/service' component={ServiceAvailable}/>\n <Route exact path='/admin' component={Admin}/>\n <Route exact path='/adminlog' component={AdminFront}/>\n <Route exact path='/previousbooking' component={Previous}/>\n <Route exact path='/' component={Homei}/>\n <Route exact path='/404' component={ErrorPage}/>\n <Redirect to=\"/404\"/>\n </Switch>\n </Router>\n \n \n );\n }", "render() {\n\t\t// preserve context\n\t\tconst _this = this;\n\t\t\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<AppHeader links={_this.state.links} />\n\n\t\t\t\t<Switch>\n\t\t\t\t\t<Route exact path=\"/\" component={Home} />\n\t\t\t\t\t<Route path=\"/datagrid\" component={DataGrid} />\n\t\t\t\t\t<Route path=\"/form\" component={Form} />\n\t\t\t\t\t<Route component={NoRoute} />\n\t\t\t\t</Switch>\n\t\t\t</div>\n\t\t);\n\t}", "function bindRouter() {\n menu.map(function (item) {\n router[item.type || 'get'](item.url, Site.plain);\n });\n}", "function App() {\n\n const showMenuHome = (routers) => {\n if (routers && routers.length > 0) {\n return routers.map((item, index) => {\n return (\n <HomeTemplate\n key={index}\n exact={item.exact}\n path={item.path}\n Component={item.component}\n\n />\n\n )\n\n })\n }\n }\n var Snow = require(\"react-snow-effect\")\n return (\n <BrowserRouter history={history}>\n <Snow />\n <Switch>\n <Suspense fallback={Loading}>\n {showMenuHome(routerHome)}\n <Route exact path=\"/detail/:id\" Component={DetailMovie} />\n <Route path=\"/admin\" exact component={AdminTemplate}></Route>\n <Route path=\"/user\" exact component={UserTemplate}></Route>\n\n </Suspense>\n\n\n </Switch>\n </BrowserRouter>\n );\n}", "configureRouter(config, router){\n let self = this;\n config.title = 'Aurelia';\n config.addPipelineStep('authorize', AuthorizeStep);\n config.map([\n { route: '', moduleId: 'login', title: 'Home'},\n { route: 'admindashboard', moduleId: './users/admin/admindashboard', name:'admindashboard',auth: true },\n { route: 'userdashboard', moduleId: './users/normalUser/userdashboard', name:'userdashboard', auth: true }, \n { route: 'admindashboard/uploadaccountbalance', moduleId: './users/admin/accountbalances/uploadaccountbalance', name:'admindashboard/uploadaccountbalance', nav:true, auth: true },\n { route: 'admindashboard/viewaccountbalance', moduleId: './users/admin/accountbalances/viewaccountbalance', name:'admindashboard/viewaccountbalance', nav:true, auth: true },\n { route: 'admindashboard/viewaccountbalancesummary', moduleId: './users/admin/accountbalances/viewaccountbalancesummary', name:'admindashboard/viewaccountbalancesummary', nav:true, auth: true }, \n { route: 'admindashboard/adduser', moduleId: './users/admin/users/adduser', name:'admindashboard/adduser', nav:true, auth: true }, \n { route: 'admindashboard/deleteuser', moduleId: './users/admin/users/deleteuser', name:'admindashboard/deleteuser', nav:true, auth: true } \n \n ]);\n\n this.router = router;\n }", "_onViewMyBookingsClick() {\n this.props.push('/bookings')\n }", "verPokemon(idx) {\n this.router.navigate(['/pokemon', idx]);\n }", "navigate(appRouter) {\r\n let navigatingRouter = this.options.useAppRouter ? appRouter : (this.router || appRouter);\r\n navigatingRouter.navigateToRoute(this.route, this.params, this.options);\r\n }", "openPageSearch() {\n this.currentPage = \"search\";\n }", "routeChange() {\n\n // Validating the routes object\n if (!router.routes) return;\n if (router.routes.constructor !== Object) throw err(9);\n\n const route = router.getRoute(window.location.pathname);\n const entries = Object.entries(router.routes);\n\n // Looping through all routes in the routes-object\n for (let i = 0; i < entries.length; i++) {\n const entryRoute = router.getRoute(entries[i][0]);\n let match = true;\n\n // Checking if the current URL matches the route\n for (let a = 0; a < entryRoute.length; a++) {\n if (route[a] === undefined || (entryRoute[a] !== \"**\" && entryRoute[i] !== route[i])) {\n match = false;\n break;\n }\n }\n\n // Change content if match was found\n if (match) {\n router.page = entries[i][1];\n window.dispatchEvent(router.newRouteEvent);\n return;\n }\n }\n\n }", "function _appLinkRouter(){\n $( document ).on('click', 'a[href^=\"/\"]', function(event) {\n\n var href, passThrough, url;\n href = $(event.currentTarget).attr('href');\n // passThrough = href.indexOf('sign_out') >= 0;\n if (!event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey) {\n event.preventDefault();\n url = href.replace('/', '');\n\n url = lang + '/' + url;\n\n if(P.FullscreenHandler.getIsFullscreen() === false){\n P.AppRouter.navigate(url, {\n trigger: true\n });\n }else{\n P.Presenter.prototype.call( url );\n }\n \n return false;\n }\n });\n }", "init() {\n this.router.get(this.path, this.process);\n }", "registerRoutes() {\n this.router.get(`/`, this.getAllAccounts.bind(this));\n }", "onNavigate({ linked: RouteCtr, params, query, uriFragment }) {\n // Create a new route each time we navigate\n const newRoute = new RouteCtr({ router: this });\n\n // Remove unnecessary pieces from the routeData\n const routeData = { params, query, uriFragment };\n\n // Store the route we're trying to transition to. This lets us know if\n // the user transitions away at a later time.\n this._transitioningTo = newRoute;\n\n // Give the route a way to bail out of transitioning even if it isn't\n // navigating to a new route (which the above would catch)\n newRoute._bail = false;\n newRoute.bail = () => { newRoute._bail = true; };\n\n // Convenience method for pulling relevant filters\n function getFilters(obj, type) {\n return _.result(obj, 'filters').reduce((arr, filter) => {\n const fn = filter[type];\n return fn ? [...arr, fn.bind(obj)] : arr;\n }, []);\n }\n\n // Gather filter chains\n const promiseChain = [\n // Router \"before\" filters\n ...getFilters(this, 'before'),\n\n // Route \"before\" filters\n ...getFilters(newRoute, 'before'),\n\n // Route fetch method\n newRoute.fetch.bind(newRoute),\n\n // Exit previous route\n () => (this.currentRoute ? this.currentRoute.exit() : undefined),\n\n // Store reference to this new route\n () => { this.currentRoute = newRoute; },\n\n // Route show method\n newRoute.show.bind(newRoute),\n\n // Route \"after\" filters\n ...getFilters(newRoute, 'after'),\n\n // Router \"after\" filters\n ...getFilters(this, 'after'),\n\n // Finally trigger a navigate event on the router & remove reference\n // to the route-in-progress\n () => {\n this.trigger('navigate', routeData);\n delete this._transitioningTo;\n return this;\n },\n ];\n\n // Start the crazy promise chain\n return promiseChain.reduce((p, fn) => p.then(() => {\n // Anytime the developer has an opportunity to navigate again,\n // we need to check if they have. If they have, then we stop.\n // We need to do this check after every step.\n if (this._transitioningTo !== newRoute || newRoute._bail) {\n return this;\n }\n return fn(routeData); // eslint-disable-line consistent-return\n }), Promise.resolve())\n\n // If there are errors at any time, then we look for an `error`\n // method of the Route. If it exists, we execute it; otherwise, we\n // use the Router's `error` callback.\n .catch((e) => {\n const handler = newRoute.error || this.error;\n return handler(e, routeData);\n });\n }", "change(){\n\t\tthis.props.router.push('/proyectos')\n\t}", "render() {\n return (\n <div className=\"App\">\n <h1>Movies!</h1>\n {/* <HomeListPage/> */}\n <Router>\n <Route exact path=\"/\" component={HomeListPage}/>\n <Route path=\"/details\" component={DetailsPage}/>\n <Route path=\"/addmovie\" component={AddMoviePage}/>\n </Router>\n </div>\n );\n }", "nav_helper_view(data) {\n\t\tp11.nav_helper_view(data);\n\t\tutil.elementClickable(p11.nextBtn)\n\t}", "handleNextPage() {\n this.props.getNextPage(this.props.page + 1);\n }" ]
[ "0.6770864", "0.6618932", "0.659033", "0.6385987", "0.6341484", "0.6339623", "0.63270634", "0.6312558", "0.6305172", "0.61244", "0.60829824", "0.6074965", "0.60729057", "0.6071625", "0.60647833", "0.606295", "0.6051352", "0.6049778", "0.6042353", "0.603454", "0.60088986", "0.60079473", "0.60031825", "0.6002068", "0.59847534", "0.5980895", "0.5971079", "0.5966802", "0.59652174", "0.5902495", "0.58953", "0.5892278", "0.58844274", "0.58527803", "0.58499324", "0.58407825", "0.5836966", "0.5835235", "0.5827746", "0.5825107", "0.57886195", "0.57874095", "0.57850194", "0.57797915", "0.5773245", "0.5770407", "0.57676023", "0.5767342", "0.57649404", "0.57603496", "0.57599354", "0.57593554", "0.57579523", "0.57579523", "0.5753411", "0.57524824", "0.57486457", "0.5741209", "0.5736414", "0.57358074", "0.5728522", "0.5716927", "0.5714692", "0.5709705", "0.57094944", "0.5700899", "0.56987774", "0.56865126", "0.5685853", "0.567338", "0.56722254", "0.56669617", "0.5665863", "0.56654745", "0.5663205", "0.5661056", "0.56607974", "0.5653078", "0.5651287", "0.56457114", "0.5639482", "0.562982", "0.5628443", "0.56281173", "0.5627689", "0.5619467", "0.56188935", "0.5614438", "0.56119514", "0.56106055", "0.5610041", "0.5609354", "0.5606549", "0.5605089", "0.55974746", "0.55931544", "0.5589953", "0.55860937", "0.5582321", "0.5581506", "0.557319" ]
0.0
-1
the main init js file that will be used to start game
function start() { init(); game.start(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n\t\t// reset will display start game screen when screen is designed\n\t\treset();\n\n\t\t// lastTime required for game loop\n\t\tlastTime = Date.now();\n\n\t\tmain();\n\t}", "function init() {\n gameStart();\n}", "function init() {\n if (game.init())\n game.start();\n}", "function startGame() {\n init();\n}", "function init() {\n //go through menus\n menus = true;\n //choosing play style\n choosingStyle = true;\n //Display text and buttons\n AI.DecidePlayStyle();\n //load the board and interactable cubes\n LoadBoard();\n LoadInteractables();\n}", "function init() {\n lobby.init();\n game.init();\n}", "function init()\r\n{\r\n\tconsole.log('init');\r\n\tinitView(); \t\r\n OSnext(); \r\n \t \t\t\r\n// \tdeleteGame();\r\n// \tloadGame();\r\n// \t\r\n// \tif (game==null) {\r\n// \t\tstartNewGame();\r\n// \t} else {\r\n// \t UI_clear(); \r\n// \t UI_closeOverlay(); \r\n// \t UI_hideActions();\r\n// \t \tUI_hideCard();\r\n// \t UI_updateFront('Sinai');\r\n// \t UI_updateFront('Mesopotamia');\r\n// \t UI_updateFront('Caucasus');\r\n// \t UI_updateFront('Arab');\r\n// \t UI_updateFront('Gallipoli');\r\n// \t UI_updateFront('Salonika');\r\n// \t UI_updateNarrows();\r\n// \t UI_updateCounters();\t\t\t\r\n// \t\tconsole.log('loaded previous game');\r\n// \t}\r\n\t\t \r\n}", "function initMain(){\n\tbuildGameButton();\n\tbuildGameStyle();\n\tbuildScoreboard();\n\t\n\tgoPage('main');\n\tloadXML('questions.xml');\n}", "function init(){\n\tconsole.log('Running');\n\trenderer = new RenderManager(\"game_canvas\");\n\tgl = renderer.gl;\n\tkeyboard = new KeyBoard();\n\n\tshaderName = 'triangle';\n\tvar triangleShader = new CreateShader(gl);\n\ttextureName = 'blue_sky';\n\ttextureObj = new Texture('bluecloud_bk.jpg', gl.CLAMP_TO_EDGE, gl.CLAMP_TO_EDGE, gl.LINEAR, gl.LINEAR);\n\ttextureObj.loadTexture();\n\ttriangleShader.makeProgram(\"vertShader.txt\", \"fragShader.txt\");\n\tvar delay = 150;\n\tif(navigator.userAgent.indexOf(\"Firefox\") != -1){\n\t\tdelay = 450;\n\t}\n\tsetTimeout(start, delay);\n}", "function init () {\r\n initAllVars();\r\n gameLoop();\r\n}", "function init()\n\t{\n\t\t\n\t\t\n\t//////////\n\t///STATE VARIABLES\n\tloadMainMenu();\n\t\n\t//////////////////////\n\t///GAME ENGINE START\n\t//\tThis starts your game/program\n\t//\t\"paint is the piece of code that runs over and over again, so put all the stuff you want to draw in here\n\t//\t\"60\" sets how fast things should go\n\t//\tOnce you choose a good speed for your program, you will never need to update this file ever again.\n\n\t//if(typeof game_loop != \"undefined\") clearInterval(game_loop);\n\t//\tgame_loop = setInterval(paint, 60); //old value 130\n\t}", "function init() {\n\t// Page elements that we need to change\n\tG.currTitleEl = document.getElementById('current-title');\n\tG.currImageEl = document.getElementById('current-image');\n\tG.currTextEl = document.getElementById('current-text');\n\tG.currChoicesEl = document.getElementById('current-choices-ul');\n\tG.audioEl = document.getElementById('audio-player');\n\t\n\t// Start a new game\n\tnewGame(G);\n}", "function init() {\n cookies = new Cookies();\n ui = new UI();\n game = new Game();\n}", "function init() {\n //UH HUH, THIS MY SHIT!\n }", "function init() {\n setupModeButtons();\n setupSquares();\n resetGame();\n}", "function init() {\r\n\t/* Globals initialisation */\r\n\tset_globals();\r\n\t\r\n\t/* Retrieving top scores from database */\r\n\tretrieves_top_scores();\r\n\t\r\n\t/* Loading musics */\r\n\tload_musics()\r\n\t\r\n\t/* Drawing menu */\r\n\tdraw_menu_background();\r\n\t\r\n\t/* Images loading */\r\n\tset_images();\r\n\t\r\n\t/* A boom is heard when the mainSquare dies */\r\n\tset_boom_sound();\r\n\t\r\n\t/* Buttons creation */\r\n\tset_buttons();\r\n}", "function casinotv_initialize() {\r\n context.include(\"game.js\");\r\n}", "function init() {\n // Initialize all base variables and preload assets. Once assets are loaded it will call init. \n\n // Canvas info\n canvas = document.getElementById(\"canvas\"); \n fullScreenCanvas(canvas); // Sets width and height to fill screen\n // Stage info\n stage = new createjs.Stage(canvas); // Creates a EaselJS Stage for drawing\n stage.addChild(backgroundLayer, midLayer, foregroundLayer, overlayLayer); // Add layers\n // Detection\n createjs.Touch.enable(stage); \n\n // Initialize global variables for layout and sizing\n initializeVariables(canvas.width, canvas.height);\n\n // Preload all assets (crucial for first rendering)\n preload.loadManifest(manifest);\n}", "function init() {\n\t\t//console.log(\"app.init()\");\n\t\tif(initDone) {\n\t\t\t//console.log(\"init already done.\");\n\t\t\treturn;\n\t\t} else {\n\t\t\tinitDone = true;\n\t\t}\n\n\t\t// Init HTML layout and from there the GUI/UI with interaction.\n\t\tlayout.init();\n\t\tscene.init();\n\t\t//ui.init();\n\t\t// Proceed directly to startup of the loop.\n\t\t//start();\n\t}", "function init() {\n stage = new createjs.Stage(document.getElementById(\"gameCanvas\"));\n game = new createjs.Container();\n stage.enableMouseOver(20);\n createjs.Ticker.setFPS(60);\n createjs.Ticker.addEventListener(\"tick\", gameLoop);\n optimizeForMobile();\n\n // When game begins, current state will be opening menu (MENU_STATE)\n //scoreboard = new objects.scoreBoard(stage, game);\n currentState = constants.MENU_STATE;\n changeState(currentState);\n}", "function initGame() {\r\n initPelota();\r\n initNavecilla();\r\n initLadrillos();\r\n}", "function init() {\n\t\t// Loads a script\n\t\tvar loadScript = function(path) {\n\t\t var headID = document.getElementsByTagName('head')[0];\n\t\t var newScript = document.createElement('script');\n\t\t newScript.type = 'text/javascript';\n\t\t newScript.src = path;\n\t\t headID.appendChild(newScript);\n\t\t};\n\n\n\t\tMessenger.storeData('originalLocation', location.hash);\n\t Messenger.storeData('server', server);\n\t Messenger.storeData('extVersion', extVersion);\n\t Messenger.storeData('combinedPath', combinedPath);\n\t if (typeof devRealtimeServer !== 'undefined') {\n\t \tMessenger.storeData('devRealtimeServer', devRealtimeServer);\n\t }\n\n\n\t // Load the initialization script\n\t loadScript(server + combinedPath + 'combined-' + extVersion + '.js');\n\t }", "function init() {\n enablePlayAgain(reset);\n reset();\n lastTime = Date.now();\n main();\n }", "function init() {\n stage = new createjs.Stage(document.getElementById(\"canvas\"));\n stage.enableMouseOver(30);\n createjs.Ticker.setFPS(60);\n createjs.Ticker.addEventListener(\"tick\", gameLoop);\n optimizeForMobile();\n //set the current game staate to MENU_STATE\n currentState = constants.MENU_STATE;\n changeState(currentState);\n}", "function startGame() {\n\tsetup();\n\tmainLoop();\n}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function start(){\n\t\t //Initialize this Game. \n newGame(); \n //Add mouse click event listeners. \n addListeners();\n\t\t}", "function init() {\n reset();\n menu = new GameMenu();\n /* Initialize the level */\n initLevel();\n\n lastTime = Date.now();\n main();\n }", "function init() {\n stage = new createjs.Stage(canvas); // reference to the stage\n stage.enableMouseOver(20);\n createjs.Ticker.setFPS(60); // framerate 60 fps for the game\n // event listener triggers 60 times every second\n createjs.Ticker.on(\"tick\", gameLoop);\n optimizeForMobile();\n // calling main game function\n main();\n}", "start() {// Your initialization goes here.\n }", "function init() {\n createWelcomeGraphic();\n console.log('WELCOME TO ASSOCIATE MANAGER!');\n console.log('FOLLOW THE PROMPTS TO COMPLETE YOUR TASKS.');\n}", "function init(){\r\n \t\tinitPhysijs();\r\n\t\tscene = initScene();\r\n\t\tcreateEndScene();\r\n\t\tcreateEndLoseScene();\r\n\t\tinitRenderer();\r\n\t\tcreateMainScene();\r\n\t}", "function init() {\n // get a referene to the target <canvas> element.\n if (!(canvas = document.getElementById(\"game-canvas\"))) {\n throw Error(\"Unable to find the required canvas element.\");\n }\n\n // resize the canvas based on the available browser available draw size.\n // this ensures that a full screen window can contain the whole game view.\n canvas.height = (window.screen.availHeight - 100);\n canvas.width = (canvas.height * 0.8);\n\n // get a reference to the 2D drawing context.\n if (!(ctx = canvas.getContext(\"2d\"))) {\n throw Error(\"Unable to get 2D draw context from the canvas.\");\n }\n\n // specify global draw definitions.\n ctx.fillStyle = \"white\";\n ctx.textAlign = \"center\";\n\n // set the welcome scene as the initial scene.\n setScene(welcomeScene);\n }", "function initApp() {\n\tinitSounds();\n\tinitSensors();\n\tshowWelcome();\n}", "function init() {\n\n\n\n\t}", "function init() {\n // quadTree = new QuadTree();\n showCanvas();\n debug.init();\n keyboard.init();\n menuWindow.init();\n // fillboxes(100);\n Game.init();\n}", "function init() {\n\tif (logFull) console.log(\"%s(%j)\", arguments.callee.name, Array.prototype.slice.call(arguments).sort());\n\tcanvas = document.getElementById(\"game-canvas\");\n\tctx = canvas.getContext(\"2d\");\n\n\tdocument.body.style.backgroundColor = BACKGROUND_COLOR;\n\n\thandleResize();\n}", "function main() {\r\n\t// Init the myGM functions.\r\n\tmyGM.init();\r\n\r\n\t// If the script was already executed, do nothing.\r\n\tif(myGM.$('#' + myGM.prefix + 'alreadyExecutedScript'))\treturn;\r\n\r\n\t// Add the hint, that the script was already executed.\r\n\tvar alreadyExecuted\t\t= myGM.addElement('input', myGM.$('#container'), 'alreadyExecutedScript');\r\n\talreadyExecuted.type\t= 'hidden';\r\n\r\n\t// Init the language.\r\n\tLanguage.init();\r\n\r\n\t// Init the script.\r\n\tGeneral.init();\r\n\r\n\t// Call the function to check for updates.\r\n\tUpdater.init();\r\n\r\n\t// Call the function to enhance the view.\r\n\tEnhancedView.init();\r\n}", "function startgame() {\t\r\n\tloadImages();\r\nsetupKeyboardListeners();\r\nmain();\r\n}", "function init() {\n STAGE_WIDTH = parseInt(document.getElementById(\"gameCanvas\").getAttribute(\"width\"));\n STAGE_HEIGHT = parseInt(document.getElementById(\"gameCanvas\").getAttribute(\"height\"));\n\n // init state object\n stage = new createjs.Stage(\"gameCanvas\"); // canvas id is gameCanvas\n stage.mouseEventsEnabled = true;\n stage.enableMouseOver(); // Default, checks the mouse 20 times/second for hovering cursor changes\n\n setupManifest(); // preloadJS\n startPreload();\n\n stage.update();\n}", "init() {\n // Called on scene initialization.\n console.log(\"the-game system init\");\n this.lastCreepReleaseTime = -60000;\n this.creepReleaseFrequency = 20000;\n this.paused = true;\n\n this.startSlots = [0,30,60,90,120,150,180,210,240,270,300,330];\n this._creepCount = 0;\n }", "function startGame() { }", "function init() {\n stage = new createjs.Stage(document.getElementById(\"canvas\"));\n stage.enableMouseOver(30);\n createjs.Ticker.setFPS(60);\n createjs.Ticker.addEventListener(\"tick\", gameLoop);\n optimizeForMobile();\n\n currentState = constants.MENU_STATE;\n changeState(currentState);\n}", "function init() {\n spielstart();\n}", "function init() {\n stage = new createjs.Stage(canvas); // reference to the stage\n stage.enableMouseOver(20);\n createjs.Ticker.setFPS(60); // framerate 60 fps for the game\n // event listener triggers 60 times every second\n createjs.Ticker.on(\"tick\", gameLoop);\n // calling main game function\n main();\n}", "function init() {\n stage = new createjs.Stage(canvas); // reference to the stage\n stage.enableMouseOver(20);\n createjs.Ticker.setFPS(60); // framerate 60 fps for the game\n // event listener triggers 60 times every second\n createjs.Ticker.on(\"tick\", gameLoop);\n // calling main game function\n main();\n}", "function init()\n{\n game = new Phaser.Game(768, 432, Phaser.CANVAS, '', null, false, false);\n\n\tgame.state.add(\"MainGame\", MainGame);\n\tgame.state.start(\"MainGame\");\n}", "function on_load()\n{\n\tgame.start();\n}", "function init(){\n \n load_seasons();\n load_char();\n \n}", "function init() {\r\n\t// CUSTOMIZE YOUR APP\r\n\tsetTitle(\"Meteor Masher\"); // set title\r\n\tsetByLine(\"by M.T., Stephen Lewis Secondary, 2016\"); // set name\r\n\t\r\n\tsetCanvasSize(canvasX,canvasY); // canvas height and width in pixels\r\n\t\r\n\tsetButton1(\"\"); // (\"\" if not using)\r\n\tsetButton2(\"\"); // (\"\" if not using)\r\n\t\r\n\tsetTimer(10); \t\t\t// set interval (in ms) for clock ticks. 0 = no clock.\r\n\t// END OF CUSTOMIZATIONS\r\n\t//*** Your Code Here\r\n}", "function init() { }", "function init() { }", "function startGame(){\n\tvar game = new Game();\n\tgame.init();\n}", "function init(){}", "function mainComplete() {\n console.log('it is all loaded up');\n MyGame.game.initialize();\n\n }", "function init() {\n // Create game stage & initialize stuff\n superSimple.start();\n // Show tutorial\n tutorial.start();\n // when tutorial ends do...\n tutorial.onEnd = function() {\n var a = new After();\n a.after(0, function() {\n superSimple.controller.showMessage(\"Enjoy!\", 40, 2);\n })\n .after(1, function() {\n superSimple.controller.spawnPlayer();\n })\n .after(0.5, function() {\n superSimple.controller.spawnEnemy();\n superSimple.controller.spawnEnemy();\n })\n .after(0.5, function() {\n superSimple.controller.spawnEnemy();\n superSimple.controller.spawnEnemy();\n })\n .after(0.5, function() {\n superSimple.controller.spawnEnemy();\n superSimple.controller.spawnEnemy();\n })\n .after(0.5, function() {\n superSimple.controller.spawnEnemy();\n superSimple.controller.spawnEnemy();\n });\n };\n }", "function init() {\n\tdocument.getElementById(\"play\").blur();\n\t//call function inside the object to start the game\n\tmyGame.start();\n}", "function init() {\n console.log('Welcome to your company employee manager.')\n menu()\n}", "function init() {\n STAGE_WIDTH = parseInt(document.getElementById(\"gameCanvas\").getAttribute(\"width\"));\n STAGE_HEIGHT = parseInt(document.getElementById(\"gameCanvas\").getAttribute(\"height\"));\n\n // init state object\n stage.mouseEventsEnabled = true;\n stage.enableMouseOver(); // Default, checks the mouse 20 times/second for hovering cursor changes\n\n setupManifest(); // preloadJS\n startPreload();\n\n score = 0; // reset game score\n gameStarted = false;\n\n stage.update();\n\n muted = false;\n}", "function init() {\n \n document.getElementById('play-again').addEventListener('click', function() {\n reset();\n });//Add click to play-again button --HTML\n\n reset(); // reset the game state\n lastTime = Date.now();\n main(); // start game // Why do we need a main function and then an init function?\n}", "function init() {\n canvas = document.getElementById(\"canvas\"); // reference to canvas element\n stage = new createjs.Stage(canvas); // passing canvas to stage\n stage.enableMouseOver(20); // listening every 20fps for any mouse over events to enable them in the Stage (our main canvas - our scene per se)\n createjs.Ticker.setFPS(60); // set frame rate to 60 fps\n createjs.Ticker.on(\"tick\", gameLoop); // update gameLoop every frame\n setupStats(); //sets up our stat counting before calling Main function - to start counting in Main function\n state = config.MENU_STATE; // on first frame - we have the state number equal to the menu state first - \n changeState(); // - which calls this function on first frame to have menu state show up first\n}", "function startGame(){\n initialiseGame();\n}", "function init() {\n\n// reset();\n lastTime = Date.now();\n main();\n }", "function init () {\n}", "function initMain()\r\n{\r\n\t// Initialize a new instance\r\n\tinitInstance();\r\n\r\n\t// Initialize AJAX components\r\n\tinitAjaxComponents();\r\n\r\n\t// Initialize AJAX navigation\r\n\tinitAjaxNavigation();\r\n\r\n\t// Initialize addons\r\n\tinitAddons();\r\n}", "init(game) {\n\n }", "function init() {\n initValues();\n initEngine();\n initLevel();\n initTouchHandlers();\n startTurn();\n initEffects();\n setInterval(tick, 10);\n\t}", "function init()\n{\n}", "function init()\n{\n}", "function init()\n{\n}", "function init() {\n let query1 = URL_POKE + \"?pokedex=all\";\n fetch(query1)\n .then(checkStatus)\n .then((resp) => resp.text())\n .then(makeSprites)\n .catch(console.error);\n id(\"start-btn\").addEventListener(\"click\", startGame);\n id(\"flee-btn\").addEventListener(\"click\", resultMove);\n id(\"endgame\").addEventListener(\"click\", goBack);\n }", "function init() {\n\t\t\t// Mount all riot tags\n\t\t\triot.mount('loadingscreen');\n\t\t\triot.mount('applauncher');\n\n\t\t\t//window.wm.mode = 'exposeHack';\n //window.wm.mode = 'default';\n\t\t}", "function init() {\n stage = new createjs.Stage(document.getElementById(\"canvas\"));\n stage.enableMouseOver(30);\n createjs.Ticker.setFPS(60);\n createjs.Ticker.addEventListener(\"tick\", gameLoop);\n this.soundtrack = createjs.Sound.play('soundtrack', createjs.Sound.INTERRUPT_NONE, 0, 0, -1, 1, 0);\n optimizeForMobile();\n\n currentState = constants.MENU_STATE;\n changeState(currentState);\n}", "function init() {\n}", "function init() {\n}", "function init()\n{\n\t// get a reference to the game canvas\n\tgame = document.getElementById(\"gameCanvas\");\n\t\n\t// load and build the spritesheet\n\tbuildSpriteSheet();\n}", "function init() {\n id(\"roll\").addEventListener(\"click\", startGame);\n id(\"stop\").addEventListener(\"click\", endGame);\n }", "function init() {\n console.log('init!');\n setup();\n startTimer();\n }", "function Init() {\n \n playGame = false;\n\n statusTab.hide();\n board.hide();\n gameEnd.hide();\n \n startButton.click(function(event) {\n event.preventDefault();\n StartPlaying();\n });\n\n resetButton.click(function(event) {\n event.preventDefault();\n RestartGame();\n });\n}", "function init() {\n setCircleVisibility(false);\n isPlayingGame = false;\n id(\"start-button\").addEventListener(\"click\", () => {\n isPlayingGame = !isPlayingGame;\n if (isPlayingGame) {\n startGame();\n } else {\n endGame();\n }\n });\n id(\"game-frame\").style.borderWidth = FRAME_BORDER_PIXELS + \"px\";\n }", "function init()\n{\n\t// Load entire map data for Map 1 and display it on the screen\n\t\n\tgame.loadMap(\"map1.json\");\n\t\n\t// Place the player at the map entrance\n\t\n\tplayer.place(24, 4);\n\t\n\t// Load a troll character and place it near the player\n\t\n\tvar troll = new Character(\"troll.json\");\n\ttroll.place(24, 10);\n\t\n\t// Add a talk action to the troll\n\t\n\ttroll.action(talk_to_troll);\n\t\n\t// Once this function is finished, the player is free to run around\n\t// and trigger script actions!\n}", "function init() {\n \n\n}", "function gameInit() {\r\n // disable menu when right click with the mouse.\r\n dissRightClickMenu();\r\n resetValues();\r\n // switch emoji face to normal.\r\n switchEmoji();\r\n gBoard = createBoard(gLevel.SIZE);\r\n renderBoard(gBoard);\r\n}", "function init() {\n /*Add click event to refresh / restart button*/\n document.querySelector('.restart').addEventListener(\"click\", function(event) {\n refreshGame();\n });\n createDeck();\n }", "function initGame() {\r\n\tinitFE();\r\n\tinitGP();\r\n\tsetTimeout(startLoader, 250);\r\n}", "function initialiseGame() {\n // Hides start panel and GitHub icon, shows direction buttons, plays audio\n document.getElementById(\"start-panel\").classList.toggle(\"hidden\");\n document.getElementById(\"bottom-banner\").classList.toggle(\"hidden\");\n document.getElementById(\"github\").classList.toggle(\"hidden\");\n document.getElementById(\"start\").play();\n document.getElementById(\"music\").play();\n\n // Generates new Sprite object per array iteration and maintains Sprite numbers to numberOfSprites\n for (var i = 0; i < numberOfSprites; i++) {\n spritesArray[i] = new Sprite(\n centreOfX,\n centreOfY,\n Math.random() * cnvsWidth\n );\n }\n\n // Triggers main loop animations\n update();\n}", "function NewGame() {\n\t// Your code goes here for starting a game\n\tprint(\"Complete this method in Singleplayer.js\");\n}", "function initApp() {\r\n var startUpInfo;\r\n MemoryMatch.setPlatform();\r\n startUpInfo = \"Loading \" + MemoryMatch.getAppInfo();\r\n if (MemoryMatch.debugMode) {\r\n MemoryMatch.debugLog(startUpInfo);\r\n } else {\r\n console.log(startUpInfo);\r\n }\r\n\r\n // Listeners for all possible cache events\r\n\r\n var cache = window.applicationCache;\r\n if (cache != null) {\r\n cache.addEventListener('cached', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('checking', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('downloading', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('error', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('noupdate', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('obsolete', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('progress', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('updateready', MemoryMatch.logCacheEvent, false);\r\n }\r\n if (document.getElementById(MemoryMatch.loaderElement) != null) {\r\n // show canvas under loader so we can implement a loadbar until we get everything setup for EaselJS to take over\r\n document.getElementById(MemoryMatch.loaderElement).style.display = \"block\";\r\n document.getElementById(MemoryMatch.stageCanvasElement).style.display = \"block\";\r\n }\r\n\r\n // Determine canvas size, it will determine which assets need to be loaded\r\n MemoryMatch.isDesiredOrientationWhenLoadStarted = MemoryMatch.isDesiredOrientation();\r\n MemoryMatch.setCanvasSize(null);\r\n MemoryMatch.loadAllAssets(false);\r\n\r\n //runTests(); // run unit tests\r\n}", "function init() {\n // THIS IS THE CODE THAT WILL BE EXECUTED ONCE THE WEBPAGE LOADS\n }", "function init() {\n\n\taGithub.href = source;\n\n\tspnVersion.innerHTML = version;\n\n\tdivDescription.innerHTML = description;\n\n\n\tTHR.init();\n\t\n\tTHR.animate();\n\n\tTHR.addLights();\n\n\tTHR.addGround();\n\n\tTHR.group = THR.setSceneNew();\n\n\tTHRU.addMeshes(100);\n\n\tTHR.updateScene();\n\n\tFOO.init();\n\n\tHRT.init()\n\n}", "function main() {\n // Initialize some event listeners on the word info display choice.\n setup_word_info();\n\n // Initialize the first page of cues.\n previous_page();\n\n // Initialize the top scores leaderboard.\n load_leaderboard();\n\n // Initialize the Sammy.js app.\n app.run();\n}" ]
[ "0.7901488", "0.78569734", "0.76020956", "0.75799984", "0.7481812", "0.7478938", "0.7353873", "0.73514795", "0.7348657", "0.7345728", "0.73349124", "0.73041147", "0.72803766", "0.72484493", "0.72395545", "0.7238584", "0.7231932", "0.72291064", "0.72236586", "0.72208583", "0.7162326", "0.7154866", "0.7150553", "0.714839", "0.7133905", "0.7131426", "0.7131426", "0.7131426", "0.7131426", "0.7131426", "0.7131426", "0.7131426", "0.7131426", "0.7131426", "0.7131426", "0.71301347", "0.7128614", "0.71277946", "0.71087575", "0.71048695", "0.7100263", "0.70989865", "0.7081093", "0.708032", "0.7071503", "0.7066115", "0.7051936", "0.7044972", "0.7044268", "0.70320046", "0.7028833", "0.70261997", "0.70220506", "0.70009595", "0.70009595", "0.6985608", "0.69798285", "0.69772005", "0.6976149", "0.6969556", "0.6969556", "0.696339", "0.69588387", "0.6957255", "0.69554514", "0.6947123", "0.69324064", "0.6932038", "0.69305867", "0.69232327", "0.6922127", "0.6908439", "0.69075155", "0.6906755", "0.6901421", "0.6900478", "0.6898397", "0.6898397", "0.6898397", "0.68980145", "0.68977976", "0.6894067", "0.68918484", "0.68918484", "0.68874204", "0.68867934", "0.6882588", "0.6878415", "0.68766224", "0.68742025", "0.687361", "0.6864387", "0.6850758", "0.68473345", "0.6847178", "0.6841759", "0.6840225", "0.6838929", "0.6835905", "0.6834637" ]
0.7455334
6
Constructor adds all the elements
constructor(index){ // Set the id for later access this.index = index $('#minigame-modal').attr('data-minigame-for',index) // Select the modal body for content (and empty both of them) var canvas = $('#minigame-modal').find('.modal-body').empty() var title = $('#minigame-modal').find('.modal-title').empty() // Add the the background and the title canvas.append('<img class="img-fluid" id="minigame-background" src='+locations[index].minigame_img+' alt="Minigame">') title.text("The stones of the well are marked...") // Create the table as a separate method this.createGrid() // If the puzzle has been completed, show the opened hiding place if (locations[index].complete == 1) { this.openHidingPlace() } // Show the modal $('#minigame-modal').modal('show') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n this.elements = new Object();\n this.____length = 0;\n }", "constructor(ele) {\n super(ele);\n }", "constructor(elemento) {\n super(elemento);\n }", "constructor (element) {\n super(element);\n }", "constructor() {\n super([\n new Add1A0(0),\n new Add1A0(0),\n new Add1A0(0),\n new Add1A0(0),\n new Add1A0(0),\n new Add1A0(0),\n new Add1A0(0),\n new Add1A0(0), //s0 = 0\n ])\n }", "constructor() {\n // when we start adding elements to a list, they will be pushed to the items array\n this.items = []\n }", "constructor(elements, root, options) {\n this.length = 0;\n this.options = options;\n this._root = root;\n if (elements) {\n for (let idx = 0; idx < elements.length; idx++) {\n this[idx] = elements[idx];\n }\n this.length = elements.length;\n }\n }", "constructor() {\n this.#elements = []\n this.top = 0;\n }", "constructur() {}", "initElements() {\n this.ringCore = new MyQuad(this, -0.5,-0.5,0.5,0.5);\n this.ringPost = new MyCylinderCovered(this, 20, 20);\n this.ringRope = new MyCylinderCovered(this, 20, 20);\n this.stairs = new MyStairs(this);\n this.ramp = new MyRamp(this, 20, 100, 40);\n this.barrier = new MyBarrier(this, 10, 40, 5);\n this.number_chairs = 20;\n this.chairs = new MyChairs(this, 5, this.number_chairs);\n this.stage = new MyStage(this);\n\n this.torus = new MyTorus(this,20,20,1,2);\n this.cylinder = new MyCylinder(this, 10.0, 2.0, 2.0, 4, 2);\n this.circle = new MyPoligon(this,20);\n\n this.sphere = new MySphere(this,5,20,10);\n\n this.floor = new MyQuad(this, -0.5,-0.5,0.5,0.5);\n this.triangle = new MyTriangle(this, 0,0,0,4,0,0,2,0,2.5);\n }", "constructor(element) {\n super();\n this._element = element;\n }", "constructor(theElement) {\n this(theElement, null, null);\n }", "function Dome(elements) {\n for (var i = 0;i < elements.length; i++) {\n this[i] = elements[i]\n }\n this.length = elements.length\n }", "constructor() {\n this.id = undefined;\n this.headerTitle = undefined;\n \n // Structure for a button element\n this.buttonElement = function() {\n return {\n tagName: \"button\",\n onClick: null,\n text: null\n };\n };\n \n // Structure for a select element\n this.selectElement = function() {\n return {\n desc: null,\n tagName: \"select\",\n id: null,\n onChange: null,\n value: null,\n text: null\n };\n };\n \n // Structure for a text element\n this.textElement = function() {\n return {\n tagName: \"p\",\n text: null\n };\n }\n \n // List of element(s) to generate\n this.elementList = [];\n }", "function Elements() {\n this._elements = [];\n this._currentIndex = 0;\n }", "constructor(options, element) {\n super(options, element);\n }", "constructor(options, element) {\n super(options, element);\n }", "constructor(el) {\n this.el = el || {};\n }", "constructor() {\n this.cant = 0;\n this.element = [];\n }", "construct(element) {\n this._currentElement = element;\n }", "constructor() {\n this.sections = new Array();\n this.elArray = new Array();\n this.charts = new Array();\n this.tables = new Object();\n }", "constructor(element) {\n this.element = element;\n }", "constructor(element) {\r\n super(element); \r\n this.element = element;\r\n this.attributeManager = new AttributeManager(this.element);\r\n }", "constructor(element) {\r\n super(element); \r\n this.element = element;\r\n this.attributeManager = new AttributeManager(this.element);\r\n }", "constructor(element) {\r\n super(element); \r\n this.element = element;\r\n this.attributeManager = new AttributeManager(this.element);\r\n }", "constructor() {\n super(null, null, 0, 0, 0, 0, 0);\n }", "constructor(el) {\n this.el = el;\n }", "constructor() {\n super();\n this[0] = [0, 0, 0, 0];\n this[1] = [0, 0, 0, 0];\n this[2] = [0, 0, 0, 0];\n this[3] = [0, 0, 0, 0];\n }", "function _construct()\n\t\t{;\n\t\t}", "constructor() {\n this._elements = [\n [1, 0, 0],\n [0, 1, 0],\n [0, 0, 1],\n ];\n\n this._stack = [];\n }", "constructor() {\r\n // ohne Inhalt\r\n }", "_construct() {\n this._nodesById = {}\n }", "constructor(...args) {\n this.length = 0;\n args.forEach(arg => {\n this.push(arg);\n })\n }", "constructor() {\n super();\n this._init();\n }", "addElem(elem){\r\n\t\tthis.elem.push(elem);\r\n\t\tthis.setClass();\r\n\t}", "constructor() {\n\t\tthis.elements = [];\n\t\tthis.fastElements = new Set();\n\t\tthis.regexp = null;\n\t}", "constructor(height, width, ...elements) {\n this._height = height;\n this._width = width;\n const size = height * width;\n const padding = _.fill(Array(size), 0);\n this._elements = _.slice(_.concat(elements, padding), 0, size);\n }", "constructor () {\n this.compOptionsList = new OptionsList();\n this.compArticle = new Article();\n this.compTechnologiesList = new TechnologiesList();\n }", "constructor({id, info, subject_id}){\n this.id = id\n this.info = info\n this.subject_id = subject_id\n this.element = document.createElement('div')\n this.element.id = `comment-${this.id}`\n Comment1Class.all.push(this)\n }", "static Element() {\n return new Element([...arguments]);\n }", "appendElements() {\n this.appendChild(this.container)\n }", "consructor() {\n }", "constructor (){}", "constructor () {\r\n\t\t\r\n\t}", "constructor(element) \n\t{ \n\t\tthis.element = element; \n\t\tthis.next = null\n\t}", "constructor() {\n super();\n this.items = [];\n }", "Initialize() \n {\n this.UpdateElementDeclaration();\n }", "constructor(el) {\n this.el = el;\n this.emptyCheckbox = this.el.parentElement.querySelector('.checkbox-empty');\n this.tickCheckbox = this.el.parentElement.querySelector('.checkbox-tick');\n\n this.init();\n }", "constructor () {\n super() // always call super() first in the ctor. This also calls the extended class' ctor.\n\n this.width = this.width || DEFAULT_WIDTH\n this.height = this.height || DEFAULT_HEIGHT\n this.visible = this.visible || 'true'\n\n // Inkább meglévő elemet módosítgassunk, inline HTML írása helyett.\n this.div = document.createElement('div')\n\n this.div.style.margin = '0 auto'\n this.div.style.transition = 'all 1s'\n\n this.appendChild(this.div)\n\n console.log('constructor')\n\n // Itt NE hívd meg a rendert, azt csak a connectedCallback-ben!\n }", "constructor(){\r\n\t}", "constructor() {\n super() // required after extends\n this.data = []\n }", "constructor () {\n\t\tthis.nodes = {};\n\t}", "function BaseElement() {\n }", "function addElement () {\n setElements(elements.concat([\"\"]))\n props.setCount(props.count + 1)\n }", "constructor() {\n super([\n [1, 0, 0, 0],\n [0, 1, 0, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1]\n ]);\n }", "constructor() {\n\t\tsuper();\n\t\tthis.message = 'Hello world! From my-element';\n\t\tthis.myArray = [ 'an', 'array', 'of', 'test', 'data' ];\n\t\tthis.myBool = true;\n\t}", "constructor(name, el, list) {\n super(name, el, \"\"); //no need to pass template you will remove and change. Use \"\"\n this._list = list;\n this.ordered = false; // another API for setting orderd or unordered\n this._refresh(\"ul\");\n }", "constructor(name, type, evolutions){\n //This hace referencia al elemento que está por dentro.\n this.#name = name;\n this.#type = type;\n this.#evolutions = evolutions;\n }", "static initialize(obj, type, name, operator, elements) { \n obj['type'] = type;\n obj['name'] = name;\n obj['operator'] = operator;\n obj['elements'] = elements;\n }", "function constructor(domRoot) {\n\t\t// this._event = null\n\t\t_findElements(domRoot);\n\t}", "constructor(racine, equipe, manche, point) {\n this.racine = new Element(racine, equipe, manche, point);\n }", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "elem(bldr) {\n\t\tthis.elements.push(bldr);\n\t\treturn this;\n\t}", "appendList(elements) {\n this.elements.push(elements)\n }", "constructor() { \n \n UidListChildren.initialize(this);\n }", "constructor() {\n this.array = []; //Creamos un arreglo de los obstaculos que se van a crear \n }", "constructor(elementClass) {\n this.descriptions = document.getElementsByClassName(elementClass);\n }", "constructor(element) {\n this.element = element;\n this.next = null;\n }", "constructor() {\n this.items = [1, 2, 3, 4, 5];\n this.size = 0;\n }", "constructor(id, template, elements) {\n super();\n this.id = id;\n this.template = template;\n this.elements = elements;\n this.math = undefined;\n this.values = {};\n for(let i in this.elements) {\n const name = this.elements[i][0];\n const cls = this.elements[i][1];\n const opts = this.elements[i][2];\n const callbackBase = this.id + '.callback('+i;\n this.elements[i] = [name, new cls(this, callbackBase, this.id+'_'+name, opts), callbackBase];\n }\n\n MathJax.Hub.Queue(this.setup.bind(this));\n this.updateValues();\n }", "constructor(width, el) {\n this.width = width;\n\n this.el = el;\n }", "constructor() { \n \n ExpenseSimpleDocumentAllOf.initialize(this);\n }", "constructor() {\n\t this.properties = [];\n\t }", "init(inputElement, outputElement, answerElement) {\n super.init(inputElement, outputElement, answerElement);\n this.foods = new Array();\n this.ingredientsWithAllergins = new Map();\n this.allerginsDetermined = new Array();\n }", "constructor() {\n\n _length.set( this, 0 );\n _count.set( this, 0 );\n _index.set( this, null );\n _childObjects.set( this, [] );\n _childCollections.set( this, [] );\n }", "constructor() //Surprisingly, constructor name is not the same as that of the class.\n {\n this.items = [];\n }", "constructor(elem) {\n\n // the element is saved\n this.element = elem;\n // list of elements inside the carousel\n this.content = [...elem.children];\n\n // each one should have an event to select it\n for (let el of this.content) {\n el.addEventListener(\"click\", this.select);\n }\n\n // the first one should be selected, so here the event is triggered on the first\n // element of the current carousel\n this.select({\n target: this.content[0]\n });\n }", "constructor() {\n super();\n }", "function CVBaseElement() {\n }", "constructor(nodes) {\n this.nodes = nodes;\n }", "constructor() {\n super()\n self = this\n self.init()\n }", "constructor() {\n this.el = this.createBoxWrapper();\n // this.closeButton = this.createCloseButton();\n this.contentWrapper = this.createContentWrapper();\n this.el.appendChild(this.contentWrapper);\n }", "function ElementData(){}", "constructor(props) {\n super(props);\n\n if (props.nodes != null) {\n djedi.addNodes(props.nodes);\n }\n }", "function ElementCollection(){\n\tthis.inState = 0;\n\tthis.placeHolder = document.createComment('ElementCollection');\n\tthis.children = [];\n\tthis.firstChild = null;\n\tthis.lastChild = null;\n\tthis.parentElement = null;\n\tthis.placeHolder.ElementCollection = this;\n\treturn this;\n}", "constructElements() {\n const htmlElements = this.getFormElements();\n const formElements = [];\n\n htmlElements.forEach(htmlElement => {\n formElements.push(new __WEBPACK_IMPORTED_MODULE_0__FormElement__[\"a\" /* default */](htmlElement));\n });\n\n return formElements;\n }", "constructor() {\n\t\tthis.vikingArmy = [];\n\t\tthis.saxonArmy = [];\n\t}", "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 }", "constructor() {\n this.container = [];\n }", "constructor() {\n }", "appendCeleb(element) {\n element.append(this.createElement())\n }", "constructor() { \n \n ProductFieldAllOf.initialize(this);\n }", "function Ja(){this.ce=[]}", "constructor() {\n super();\n\n // load templates\n const templates = window.document;\n this.tpls = {\n component: templates.getElementsByClassName('tpl-component')[0].innerHTML,\n styles: templates.getElementsByClassName('tpl-styles')[0].innerHTML,\n table: templates.getElementsByClassName('tpl-table')[0].innerHTML,\n headCell: templates.getElementsByClassName('tpl-header-cell')[0].innerHTML,\n dataRow: templates.getElementsByClassName('tpl-data-row')[0].innerHTML,\n dataCell: templates.getElementsByClassName('tpl-data-cell')[0].innerHTML,\n handledSelector: templates.getElementsByClassName('tpl-selector')[0].innerHTML,\n }\n\n // initialize state\n this.data = [];\n this.shadow = this.attachShadow({mode: 'open'});\n\n this.resetSorting();\n this.parseEmbedSource();\n }", "loadElements()\n {\n\n this.el = {};\n\n document.querySelectorAll('[id]').forEach(element => \n {\n this.el[Format.getCamelCase(element.id)] = element\n });\n }" ]
[ "0.7436643", "0.71054757", "0.7023472", "0.6943673", "0.6933639", "0.686425", "0.6848717", "0.6708078", "0.66804093", "0.6673728", "0.6597897", "0.65545785", "0.64835674", "0.6453539", "0.6448183", "0.636233", "0.636233", "0.63551915", "0.635302", "0.6349339", "0.6343509", "0.6307799", "0.63074744", "0.63074744", "0.63074744", "0.62992936", "0.62788856", "0.6253908", "0.62285876", "0.6186279", "0.6172582", "0.6167365", "0.6105039", "0.6097344", "0.6094093", "0.6086513", "0.6081161", "0.60651267", "0.60436296", "0.60075426", "0.5998397", "0.5992707", "0.59885514", "0.596379", "0.5961136", "0.5957892", "0.59481245", "0.5933951", "0.59252673", "0.59224916", "0.59198034", "0.5917608", "0.5914424", "0.5913816", "0.5906479", "0.5899939", "0.5896273", "0.58936334", "0.58852893", "0.5885287", "0.58668506", "0.58648026", "0.58648026", "0.58648026", "0.58648026", "0.58648026", "0.58648026", "0.58648026", "0.58599055", "0.58588654", "0.58549184", "0.58545125", "0.58508694", "0.5850518", "0.5846977", "0.5844966", "0.58389914", "0.5835938", "0.5821232", "0.581271", "0.58098334", "0.5803869", "0.5797121", "0.57965624", "0.579655", "0.5788046", "0.5786521", "0.5785737", "0.57819366", "0.5766469", "0.57657725", "0.57617074", "0.5758378", "0.5757365", "0.5754412", "0.57542974", "0.5749125", "0.57469845", "0.57386166", "0.5733934", "0.5732748" ]
0.0
-1
Function for creating a grid of stones
createGrid(){ var self = this // Get the canvas to work on var canvas = $('#minigame-modal').find('.modal-body') // Append a table canvas.append('<div class="well-grid-wrapper"></div>') $('.well-grid-wrapper').append('<table class="table-fixed" id="well-grid"></table') var tbody = $('#well-grid') tbody.append('<tbody id="well-grid-body"></tbody>') // Append 22 rows for (var i=0; i<80; i++) { var trow = $('<tr class="well-grid-col" id="well-grid-col-'+i+'"></tr>') for (var j=0; j<5; j++) { var tcell = $('<td class="well-grid-cell well-grid-col-'+i+' well-grid-row-'+j+'"></td>') var cell = $('<div class="well-grid-cell-wrapper"></div>') .attr('data-grid-row',i) .attr('data-grid-col',j) .attr('data-stone-clicked',0) var stone = $('<img class="img-fluid well-stone" src=assets/images/minigames/puzzles/well/well-stone-in0.jpg alt="Stone">') cell.append(stone) tcell.append(cell) trow.append(tcell) } tbody.append(trow) } // Add an on-click method for each cell, to move the stone in on click $('.well-grid-cell-wrapper').on("click",function(){self.moveStoneIn(this)}) // Add icons to the stones this.addIcons() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createGrid(n) {\n for (var i = 0; i < n; i++) {\n for (var j = 0; j < n; j++) {\n $('.container').append('<div class=\"square\"></div>');\n }\n }\n //set dimensions\n $('.square').css('height', 960 / n + 'px');\n $('.square').css('width', 960 / n + 'px');\n //change colors of squares on hover\n $('.square').mouseenter(function() {\n $(this).css('background-color', randColor);\n });\n }", "function makeGrid(){\n\t\tvar startX = 149;\n\t\tvar startY = 119;\n\t\tvar interval = 6;\n\t\tvar nodeArray = [];\n\t\tfor (var i=0; i<660; i+=interval){\n\t\t\tfor (var j=0; j<660; j+=interval){\n\t\t\t\tnodeArray.push({x:startX+i,y:startY+j,city:null});\n\t\t\t}\n\t\t}\n\t\treturn nodeArray;\n\t}", "function makeGrid() {\nfor (let x = 0; x < rowsNum.value ; x ++) {\n const insertRow = pixelCanvas.insertRow(0) ;\n for (let y = 0 ; y < cellsNum.value ; y ++) {\n insertRow.insertCell(0) ;\n }\n}\n\n}", "function _makeGrid () {\n let board = [];\n for (let i = 0; i < 8; i++) {\n let row = [];\n for (let j = 0; j < 8; j++) {\n row.push(null);\n }\n board.push(row);\n }\n let whites = [[3, 3], [4, 4]];\n let blacks = [[4, 3], [3, 4]];\n whites.forEach(coordinates => {\n let piece = new Piece(\"white\");\n board[coordinates[0]][coordinates[1]] = piece;\n });\n blacks.forEach(coordinates => {\n let piece = new Piece(\"black\");\n board[coordinates[0]][coordinates[1]] = piece;\n });\n return board;\n}", "function createGrid(squaresPerSide) {\r\n for (i = 0; i < squaresPerSide * squaresPerSide; i++) {\r\n const square = document.createElement('div');\r\n square.classList.add('square');\r\n square.style.width = (750 / squaresPerSide - 2).toString() + 'px';\r\n square.style.height = (750 / squaresPerSide - 2).toString() + 'px';\r\n container.appendChild(square);\r\n }\r\n}", "function generateGrid(squares) {\n\n container.style.setProperty(\"grid-template-columns\", \"repeat(\" + squares + \", 1fr)\");\n container.style.setProperty(\"grid-template-rows\", \"repeat(\" + squares + \", 1fr)\");\n \n //creates the ammount of divs necessary to fill the entire grid\n for (let i = 1; i <= squares * squares; i++) {\n const div = document.createElement(\"div\");\n div.classList.add(\"pixels\");\n div.style.border = \"1px solid rgba(0,0,0,0.5)\";\n \n container.appendChild(div);\n }\n \n //creates a nodelist as a global variable, of all the squares in the grid\n window.pixels = document.querySelectorAll(\".pixels\");\n\n //currentPen points to the function that determine the behavior of the pen\n pixels.forEach(currentPen);\n}", "function createGrid(width, height) {\n\n}", "function createGrid(n = 16) {\n // Ensure reasonable range input\n if (n > 101) {\n n = 100;\n } else if (n < 1) {\n n = 1;\n }\n for (let i = 0; i < n * n; i++) {\n container.style.setProperty('--grid-n', n);\n const square = document.createElement('div');\n container.appendChild(square).className = 'grid__square';\n square.addEventListener('mouseover', etchTheSketch);\n }\n}", "function createGrid(){\n for (var i = 0; i < 200; i++) {\n var div = document.createElement(\"div\");\n div.id = i;\n div.style.visibility = \"hidden\";\n document.getElementById(\"board\").appendChild(div);\n }\n if (!start) {\n for (var i = 0; i < 16; i++) {\n \t var div = document.createElement(\"div\");\n div.id = i.toString() + \"side\";\n div.style.visibility = \"hidden\";\n document.getElementById(\"upcoming\").appendChild(div);\n }\n }\n}", "function makeGrid() {\n\n\n}", "function _makeGrid () {\n\n let grid=[];\n\n for (let i = 0; i<8;i++){\n let rows = [];\n for( let j=0; j<8; j++){\n rows.push(undefined);\n }\n grid.push(rows);\n }\n\n grid[3][4] = new Piece(\"black\");\n grid[4][3] = new Piece(\"black\");\n grid[3][3] = new Piece(\"white\"); \n grid[4][4] = new Piece(\"white\"); \n\n return grid;\n}", "function makeGrid(newNum){\n userInptNum = newNum;\n container.style.gridTemplateRows = userInptNum;\n container.style.gridTemplateColumns = userInptNum;\n\n for (let i = 1; i <= userInptNum; i++){\n for(let j = 1; j <= userInptNum; j++){\n let square = document.createElement('div');\n square.classList.add('square');\n square.style.backgroundColor = \"rgb(250,250,250\";\n square.style.gridRow = i;\n square.style.gridColumn = j;\n container.appendChild(square);\n\n }\n \n }\n getColor();\n \n}", "function generateGrid() {\n const tileWidth = PHASER_CONFIG.width / SNAKE_GAME_CONFIG.gridSize.width;\n const tileHeight = PHASER_CONFIG.height / SNAKE_GAME_CONFIG.gridSize.height;\n\n this.spriteGrid = [];\n for (let x = 0; x < SNAKE_GAME_CONFIG.gridSize.width; x++) {\n for (let y = 0; y < SNAKE_GAME_CONFIG.gridSize.height; y++) {\n const sprite = this.physics.add.sprite((x + 0.5) * tileWidth, (y + 0.5) * tileHeight, 'whiteSquare64');\n sprite.displayWidth = tileWidth * 0.9;\n sprite.displayHeight = tileHeight * 0.9;\n sprite.tint = SNAKE_GAME_CONFIG.emptyTileColour;\n this.spriteGrid.push({gridPos: {x, y}, sprite});\n }\n }\n}", "function grid() {\n\tvar spaceX = 64;\n\tvar spaceY = spaceX;\n\n\tstroke(200);\n\tfor (var i = 64; i < width; i += 64) {\n\t\tline(i, 0, i, height);\n\t}\n\tfor (var i = 64; i < height; i += 64) {\n\t\tline(0, i, width, i);\n\t}\n}", "function makeGrid(){\n\tfor(let row = 0; row < inputHeight.value; row++){\n\t\tconst tableRow = pixelCanvas.insertRow(row);\n\t\tfor(let cell = 0; cell < inputWidth.value; cell++){\n\t\t\tconst cellBlock = tableRow.insertCell(cell);\n\t\t}\n\t}\n}", "function _makeGrid () {\n\tgrid = new Array(8)\n\tfor(let i = 0; i <= grid.length - 1; i++){\n\t\tgrid[i] = new Array(8);\n\t}\n\tgrid[3][4] = new Piece('black');\n\tgrid[4][3] = new Piece('black');\n\tgrid[3][3] = new Piece('white');\n\tgrid[4][4] = new Piece('white');\n\treturn grid;\n}", "function createBoard() {\r\n for(let i=0;i<width*width;i++)\r\n {\r\n square = document.createElement('div')\r\n square.innerHTML = 0\r\n gridDisplay.appendChild(square)\r\n squares.push(square)\r\n }\r\n generate()\r\n generate()\r\n\r\n\r\n }", "function createBoard() {\n for (let i=0; i < width*width; i++) {\n square = document.createElement('div')\n square.innerHTML = 0\n gridDisplay.appendChild(square)\n squares.push(square)\n }\n generate()\n generate()\n }", "function makeGrid(number) {\nfor (i = 0; i < (number * number); i++) {\n container.style.gridTemplateColumns = `repeat(${number}, auto)`;\n const square1 = document.createElement('div');\n square1.classList.add('square1');\n let size = 700/number\n square1.style.width = size;\n square1.style.height = size;\n container.appendChild(square1);\n }\n}", "function defineGrid(n){\n\t\tvar boardDiv = document.getElementsByClassName(\"boardCls\")[0] ;\n\t\t$(\"#board\").html(\"\")\n\t\tlet cnt=0 ;\n\t\tfor(let i=0;i<n;i++)\n\t\t{\n\t\t\tvar rowDiv = document.createElement(\"div\") ;\n\t\t\trowDiv.classList.add(\"row\") ;\n\t\t\trowDiv.style.height=(580/n)+\"px\";\n\n\t\t\tfor(let j=0;j<n;j++)\n\t\t\t{\n\t\t\t\tvar singleDiv = document.createElement(\"div\") ;\n\t\t\t\tsingleDiv.classList.add(\"block\") ;\n\t\t\t\tsingleDiv.style.width=(580/n)+\"px\" ;\n\t\t\t\tvar para = document.createElement(\"p\") ;\n\t\t\t\tpara.classList.add(\"number\") ;\n\t\t\t\t\n\t\t\t\tsingleDiv.id=\"block-\"+cnt ;\n\t\t\t\tpara.id=\"blk-\"+cnt;\n\t\t\t\tcnt++ ;\n\t\t\t\tsingleDiv.appendChild(para) ;\n\t\t\t\trowDiv.appendChild(singleDiv) ;\n\t\t\t}\n\t\t\tboardDiv.appendChild(rowDiv) ;\n\t\t}\n\t}", "function _makeGrid () {\n let grid = new Array(8);\n for (let i = 0; i < grid.length; i++) {\n grid[i] = new Array(8)\n }\n grid[3][4] = new Piece(\"black\");\n grid[4][3] = new Piece(\"black\");\n grid[3][3] = new Piece(\"white\");\n grid[4][4] = new Piece(\"white\");\n return grid;\n}", "function setupGridSpots() {\r\n /*Direction spots*/\r\n right = [32, 24, 17];\r\n up = [39, 30];\r\n left = [7, 14];\r\n down = [0, 9];\r\n \r\n /*End spot*/\r\n end = [21];\r\n \r\n /*Card spots*/\r\n card = [2, 6, 22, 23, 28, 34, 38];\r\n \r\n /*Trap Spots*/\r\n trap = [1, 3, 8, 10, 13, 15, 26, 27, 36];\r\n \r\n /*Fill grid*/\r\n fillGrid(\"right\", right);\r\n fillGrid(\"up\", up);\r\n fillGrid(\"left\", left);\r\n fillGrid(\"down\", down);\r\n \r\n fillGrid(\"end\", end);\r\n \r\n fillGrid(\"card\", card);\r\n \r\n fillGrid(\"trap\", trap);\r\n}", "function createGrid(){\n var color = '#BDBDBD';\n \n //Creates vertical grid\n for(var i = origin.x; i < canvasWidth; i += step){ //Populates right of the origin\n var line = two.makeLine(i, 0, i, canvasHeight);\n line.linewidth = 1;\n line.stroke = color;\n }\n for(var i = origin.x; i > 0; i -= step){ //Populates left of the origin\n var line = two.makeLine(i, 0, i, canvasHeight);\n line.linewidth = 1;\n line.stroke = color;\n }\n \n \n //Creates horizontal grid\n for(var i = origin.y; i < canvasHeight; i += step){ //Populates above the origin\n var line = two.makeLine(0, i, canvasWidth, i);\n line.linewidth = 1;\n line.stroke = color;\n }\n for(var i = origin.y; i > 0; i -= step){ //Populates below the origin\n var line = two.makeLine(0, i, canvasWidth, i);\n line.linewidth = 1;\n line.stroke = color;\n }\n}", "function Layout(){\r\n for(let i=0;i<squares.length;i++)\r\n {\r\n let divs = document.createElement(\"div\")\r\n grid.appendChild(divs)\r\n square.push(divs)\r\n if(squares[i]===1) square[i].classList.add(\"wall\")\r\n else if(squares[i]===0) square[i].classList.add(\"pac-dots\")\r\n else if(squares[i]===3) square[i].classList.add(\"power-pellet\")\r\n else if(squares[i]===2) square[i].classList.add(\"ghost-liar\")\r\n }\r\n}", "function createGrid(size) {\n var wrapper = $('#wrapper'),\n squareSide = 600 / size;\n $(wrapper).empty();\n for (var i = 0; i < size; i++) {\n for (var j = 0; j < size; j++) {\n $(wrapper).append('<div class=square id=xy_' + i + '_' + j + '></div>');\n\n }\n }\n\n //Single square size setting\n $('.square').css({\n \"height\": squareSide + \"px\",\n \"width\": squareSide + \"px\"\n\n });\n }", "createGridPoints() {\n\n\t\tconst gridPoints = this.gridPoints;\n\n\t\tconst s = this.cellSize;\n\t\tconst n = HermiteData.resolution;\n\n\t\tconst base = this.cellPosition;\n\t\tconst offset = new Vector3();\n\t\tconst gridPointGeometry = new SphereBufferGeometry(0.05, 8, 8);\n\t\tconst gridPointMaterial = this.gridPointMaterials[0];\n\n\t\tfor(let z = 0; z <= n; ++z) {\n\n\t\t\toffset.z = z * s / n;\n\n\t\t\tfor(let y = 0; y <= n; ++y) {\n\n\t\t\t\toffset.y = y * s / n;\n\n\t\t\t\tfor(let x = 0; x <= n; ++x) {\n\n\t\t\t\t\toffset.x = x * s / n;\n\n\t\t\t\t\tconst gridPoint = new Mesh(gridPointGeometry, gridPointMaterial);\n\t\t\t\t\tgridPoint.position.copy(base).add(offset);\n\t\t\t\t\tgridPoints.add(gridPoint);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}", "function createGrid(squaresPerSide) {\n // Create n columns and rows to hold our squares\n container.style.gridTemplateColumns = `repeat(${squaresPerSide}, 40px)`;\n container.style.gridTemplateRows = `repeat(${squaresPerSide}, 40px)`;\n\n // Create n*n squares\n for (let i=0; i < (squaresPerSide * squaresPerSide); i++){\n const square = document.createElement('div');\n square.classList.add('square');\n // Every square has a lightness value\n square.setAttribute(\"lightness\", 50);\n\n square.addEventListener('mouseover', function(e){\n // Get the lightness value of the square we are hovering over\n currentLightness = e.target.getAttribute(\"lightness\");\n // Set a random color and its lightness\n e.target.style.backgroundColor = `hsl(${Math.floor(Math.random()*361)}, 100%, ${currentLightness}%)`;\n e.target.setAttribute(\"lightness\", currentLightness-5);\n });\n container.appendChild(square);\n }\n}", "function createBoard() {\n for (let i = 0; i < width * width; i++) {\n const square = document.createElement(\"div\");\n //put this child into the gird\n grid.appendChild(square);\n squares.push(square);\n\n // Assigning a random colour to each div\n let randomColor = Math.floor(Math.random() * coloursOfCancy.length);\n square.style.backgroundImage = coloursOfCancy[randomColor];\n\n //To drag each square and give unique ID to each cell so we can see which square is actually moved.\n square.setAttribute(\"draggable\", \"true\");\n square.setAttribute(\"id\", i);\n }\n }", "function renderGrids(x){\n\t\tfor (var i = 0; i < x; i++){\n\t\t\tvar pixels = document.createElement('div');\n\t\t\tpixels.className = 'miniDiv';\n\t\t\tcontainer.appendChild(pixels);\n\t\t}\n\t}", "function createBoard(){\n for(let i=0; i<width*width; i++){\n const square = document.createElement('div');\n square.setAttribute('id', i);\n grid.appendChild(square);\n squares.push(square);\n }\n}", "function createGrid(num) {\n for(let i = 0; i < num **2; i++) {\n container.appendChild(cellNode.cloneNode(true));\n }\n gridFormat(container, num);\n startColor(color);\n \n \n}", "function createBoard() {\n let grid = document.querySelector('.container');\n\n grid.innerHTML = '';\n\n for (let row = 0; row < 10; row++) {\n for (let col = 0; col < 10; col++) {\n let weight = Math.round(Math.random() * (100 - 1) + 1);\n let node = createNode(row, col, weight);\n let shadow = weight / 10;\n\n node.style.boxShadow = `${shadow}px ${shadow}px ${shadow}px rgba(0,0,0,0.8)`;\n\n grid.appendChild(node);\n }\n }\n\n // Declares the start and end nodes\n let startNode = document.querySelector(\"div[row='0'][col='0']\");\n let endNode = document.querySelector(\"div[row='9'][col='9']\");\n\n startNode.setAttribute('cost', 0);\n startNode.innerHTML = 'Start';\n endNode.innerHTML = 'End';\n startNode.style.boxShadow = `${0}px ${0}px ${0}px rgba(0,0,0,0.6)`;\n}", "function buildGrid() {\n return new Array(COLS).fill(null)\n .map(()=> new Array(ROWS).fill(null)\n .map(()=> Math.floor(Math.random()*2)));\n}", "function createGrid(num){\n\tvar blockNum = num * num;\n\tvar blockSize = 600/num;\n\tfor(var j=0; j < num; j++){\n\t\tfor(var i=0; i < num; i++){\n\t\t\t$('<div />', {class: 'block',\n\t\t\t\twidth: blockSize + 'px',\n\t\t\t\theight: blockSize + 'px'\n\t\t\t}).appendTo('#screen');\n\t\t}\n\t}\n}", "function buildGrid(size){\n \n let squareSize = document.getElementById('grid').clientWidth / size;\n //Creating the square and defining his size\n for(let i=1 ; i<=size*size;i++){ \n let square = document.createElement('div')\n grid.appendChild(square);\n square.classList.add('square-grid');\n square.style.width = squareSize + \"px\";\n square.style.height = squareSize + \"px\";\n //Rounding square grid corners\n if(i==1){\n square.style.borderTopLeftRadius = \"10px\";\n }else if(i==size){\n square.style.borderTopRightRadius = \"10px\";\n }else if(i==size*size-size+1){\n square.style.borderBottomLeftRadius = \"10px\";\n }else if(i==size*size){\n square.style.borderBottomRightRadius = \"10px\";\n }\n }\n \n}", "function buildSweeperGrid() {\n\n var gameArea = document.getElementById('game');\n gameArea.innerHTML = \"\";\n\n console.log('---------------[ GENERATING GRID ]---------------');\n\n for (var i = 0; i < Math.sqrt(game.gridSize); i++) {\n var row = document.createElement('div');\n row.classList.add('row');\n row.classList.add('flex');\n console.log('ROW ' + i + \":\");\n for (var j = 0; j < Math.sqrt(game.gridSize); j++) {\n var cell = document.createElement('div');\n cell.id = `cell-${j}-${i}`;\n cell.setAttribute('row', i);\n cell.setAttribute('cell', j);\n cell.classList.add('w-16');\n cell.classList.add('h-16');\n\n\n cell.classList.add('cell');\n cell.classList.add('border');\n cell.classList.add('border-black');\n cell.classList.add('m-0');\n row.appendChild(cell);\n\n console.log(' - Cell ' + j);\n }\n gameArea.appendChild(row);\n }\n console.log('---------------[ GENERATED GRID ]---------------');\n\n}", "function makeGrid(nCells) {\n sizeOfCells = getSizeOfCells(maxSize, nCells);\n\n container.style['grid-template'] = \n `repeat(${nCells}, ${sizeOfCells}) / repeat(${nCells}, ${sizeOfCells})`;\n\n for (let i = 0; i < nCells; i++) {\n for (let j = 0; j < nCells; j++) {\n div = document.createElement('div');\n div.classList.add('cell');\n div.setAttribute('data-counter', 10);\n container.appendChild(div);\n }\n }\n}", "function 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}", "function setGrid(xn, yn) {\n\n tGrid = [];\n\n\n for (i = 0; xn > i; i++) {\n\n yGrid = [];\n\n for (j = 0; yn > j; j++) {\n\n yGrid.push(new Land(i, j));\n\n }\n\n tGrid.push(yGrid);\n\n }\n\n return tGrid;\n}", "function createGrid(x0,x1,y0,y1,xbasis,ybasis,strokeWidth){\n createLines(\"vertical\",x0,x1,y0,y1,xbasis,strokeWidth);\n createLines(\"horizontal\",x0,x1,y0,y1,ybasis,strokeWidth);\n }", "function createBoard() {\n for (let i = 0; i < width * width; i++) {\n //every time it loops we want to create a div\n //using .createElement\n const square = document.createElement('div');\n //we want to make the divs draggable. so we just use the\n //setAttribute function and set draggable to true\n square.setAttribute('draggable', true);\n //we also want to use setAttribute to give each square a unique ID\n square.setAttribute('id', i);\n //set a random number based on the candy colors length and a whole number\n let randomColor = Math.floor(Math.random() * candyColors.length);\n //set that color background for the square at this index\n square.style.backgroundImage = candyColors[randomColor];\n //next we add that div to the grid with appendChild\n grid.appendChild(square);\n //we also want to store these squares into an array\n squares.push(square);\n }\n }", "createGrids () {\n }", "function createGrid(startX, startY){\n let x = startX;\n let y;\n let finalArr = [];\n let tempArr = [];\n\n for(let i=0; i<3; i++){\n y = startY;\n tempArr = [];\n for(let j=0; j<3; j++){\n let coor = [x, y]; \n tempArr.push(coor); \n y++;\n }\n x++;\n finalArr.push(tempArr); \n } \n return finalArr;\n}", "function createGrid( rows, cols ) {\n\n let html = '';\n const con = document.querySelector('.con');\n\n // Create and Store the Grid\n for( let i = 0; i < rows; i++ ) {\n\n grid[i] = [];\n let rowHtml = '';\n let rowConHtml = `<div class='row' id='${i}'></div>`;\n con.innerHTML += rowConHtml;\n let rowCon = document.getElementById(i.toString());\n\n for( let j=0; j < cols; j++ ) {\n\n let block = new Block(i, j);\n grid[i].push(block);\n rowHtml = `<div class='block' id=${block.id}>&nbsp</div>`\n rowCon.innerHTML += rowHtml;\n\n }\n\n }\n\n // Add each block's neighbors\n for( let i = 0; i < rows; i++ ) {\n\n for( let j = 0; j < cols; j++ ) {\n\n grid[i][j].addNeighbors();\n\n }\n\n }\n\n}", "createGrid(starti, startj, endi, endj, level, mapped) {\n for (let i = 0; i < this.rows; i++) {\n\n let rowgrid = [];\n for (let j = 0; j < this.columns; j++) {\n let cell = new Cell(\n i, \n j, \n (i==starti && j==startj), \n (i==endi && j==endj), \n level, \n mapped\n );\n paintCell(cell);\n rowgrid.push(cell);\n }\n this.grid.push(rowgrid);\n }\n }", "function createGrid(num, colour){\n $('.wrapper > div').remove();\n for(var i = 0; i < num * num; i++){\n $newdiv = $('<div class=\"square\" />');\n $squareSize = 480 / num\n $('.wrapper').append($newdiv);\n $('.square').css(\"width\", $squareSize);\n $('.square').css(\"height\", $squareSize);\n $('.square').css(\"background-color\", \"#CFCFCF\");\n }\n}", "function createBoard(numSquares = 4) {\n const container = document.getElementById('container');\n\n if (container.children.length) removeChildren(container);\n\n for (let i = 0; i < numSquares * numSquares; i++) {\n square = document.createElement('div');\n square.setAttribute('class','square')\n squareContent = document.createElement('div');\n squareContent.setAttribute('class', 'content');\n square.appendChild(squareContent);\n container.appendChild(square);\n }\n\n container.style['grid-template-rows'] = `repeat(${numSquares}, [row-start] 1fr [row-end])`;\n container.style['grid-template-columns'] = `repeat(${numSquares}, [col-start] 1fr [col-end])`;\n\n addSquareEventListeners()\n}", "function generateGrid(blocks){\n //subtracting by 10 due to the px values associated with the padding and margin properties\n var gridSquareHeightAndWidth = Math.floor(960/blocks)-10;\n var toAdd = document.createDocumentFragment();\n for(let x=1; x<=blocks; x++){\n for(let y=1; y<=blocks; y++){\n var gridSquare = document.createElement(\"div\");\n gridSquare.id = \"grid-square\";\n gridSquare.style.width = gridSquareHeightAndWidth + \"px\";\n gridSquare.style.height = gridSquareHeightAndWidth + \"px\";\n gridSquare.style.backgroundColor = \"white\";\n gridSquare.addEventListener(\"mouseover\", e => {\n e.target.style.backgroundColor = \"black\";\n })\n toAdd.appendChild(gridSquare);\n }\n }\n document.getElementById(\"container\").appendChild(toAdd); \n}", "function generateStartingGrid() {\n Mobile();\n let Gaps = emptyGrid();\n let n = 1;\n let m = 0;\n for (let i = 0; i < x; i++) {\n for (let j = 0; j < y; j++) {\n // People point generater\n if (Gaps.includes(n)) {\n } else {\n var dotOffWid = getRandomArbitrary(0.2, 0.8) * refWid;\n var dotOffHei = getRandomArbitrary(0.2, 0.8) * refHei;\n let xData = refWid * i + dotOffWid;\n let yData = refHei * j + dotOffHei;\n dotData[m] = [xData, yData, 0, 0, 0, 0, 0,\"blue\"];\n resetData[m] = [xData, yData];\n m++;\n }\n n++;\n }\n }\n //console.log(\"generateStartingGrid: \" + dotData)\n}", "function generateGrid(x) {\n \tfor (var rows = 0; rows < x; rows++) {\n \tfor (var columns = 0; columns < x; columns++) {\n \t$('#container').append(\"<div class='cell'></div>\");\n };\n };\n $('.cell').width(720/x);\n $('.cell').height(720/x);\n\t\tpaint();\n}", "function createGrid(numBox){\n var box = '<div class=\"box\"></div>';\n for(var i = 1; i <= numBox; i++){\n for(var j = 1; j <= numBox; j++){\n $('#container').append('<div class=\"box\"></div>');\n }\n }\n var size = (400 - (numBox * 2)) / numBox;\n $('.box').css({'height': size, 'width': size});\n }", "function createBoard(grid, squares) {\n for (let i = 0; i < nbSquares * nbSquares; i++) {\n const square = document.createElement('div');\n square.dataset.id = i; // we give each square an id\n grid.appendChild(square);\n squares.push(square);\n }\n }", "createGrid() {\n // loop to create the 8 rows\n for (let row = 0; row < 8; row++) {\n this.grid[row] = [];\n // push in 8 columns of nulls\n for (let column = 0; column < 8; column++) {\n this.grid[row].push(null);\n }\n }\n }", "createGrid() {\n // loop to create the 8 rows\n for (let row = 0; row < 8; row++) {\n this.grid[row] = [];\n // push in 8 columns of nulls\n for (let column = 0; column < 8; column++) {\n this.grid[row].push(null);\n }\n }\n }", "createGrid() {\n // loop to create the 8 rows\n for (let row = 0; row < 8; row++) {\n this.grid[row] = [];\n // push in 8 columns of nulls\n for (let column = 0; column < 8; column++) {\n this.grid[row].push(null);\n }\n }\n }", "createGrid() {\n // loop to create the 8 rows\n for (let row = 0; row < 8; row++) {\n this.grid[row] = [];\n // push in 8 columns of nulls\n for (let column = 0; column < 8; column++) {\n this.grid[row].push(null);\n }\n }\n }", "function createBoard() {\n\tfor (let i = 0; i < layout.length; i++) {\n\t\tconst square = document.createElement('div')\n\t\tgrid.appendChild(square)\n\t\tsquares.push(square)\n\n\t\t//add layout to the board\n\t\t//we want to check what is on the board on every position :\n\t\tif (layout[i] === 0) {\n\t\t\tsquares[i].classList.add('pac-dot')\n\t\t} else if (layout[i] === 1) {\n\t\t\tsquares[i].classList.add('wall')\n\t\t} else if (layout[i] === 2) {\n\t\t\tsquares[i].classList.add('ghost-lair')\n\t\t} else if (layout[i] === 3) {\n\t\t\tsquares[i].classList.add('power-pellet')\n\t\t}\n\t}\n}", "function drawGrid(x,y,s){\r\n for(j = 0; j<7 ; j++){\r\n for(var i = 0 ; i<7 ; i++){\r\n drawRectangle(x+i*s/7,y+j*s/7, s/7,s/7,colArray[3], colArray[4],1, false, true);\r\n }\r\n }\r\n}", "function createGrid(n) {\n for (var i = 0; i < n * n; ++i) {\n const square = document.createElement(\"div\");\n square.classList.add(\"square\");\n\n // modify square size\n let squareWidth = 480 / n;\n square.style.width = squareWidth + \"px\";\n square.style.height = squareWidth + \"px\";\n\n console.log(square.style.width);\n\n square.addEventListener(\"mouseover\", (e) => {\n square.style.backgroundColor = \"black\";\n });\n container.style.gridTemplateColumns = \"repeat(\" + n + \", \" + square.style.width + \")\";\n container.appendChild(square);\n }\n}", "function makeGrid() {\n pixelCanvas.innerHTML = \"\";\n for (let i = 0; i < gridHeight;i++) {\n const tr = document.createElement(\"tr\");\n for(let j = 0; j < gridWidth; j++){\n const td = document.createElement(\"td\");\n tr.appendChild(td);\n }\n fragment.appendChild(tr);\n }", "function createGrid() {\n for (let i = 0; i < DIMENSION; ++i) {\n const container = document.querySelector('#gridContainer');\n const row = document.createElement('div');\n\n row.classList.add('row');\n container.appendChild(row);\n\n for (let j = 0; j < DIMENSION; ++j) {\n const cell = document.createElement('div');\n cell.classList.add('cell');\n\n row.appendChild(cell);\n paint(cell);\n }\n }\n}", "createGrid() {\n\t\t// loop to create the 8 rows\n\t\tfor (let row = 0; row < 8; row++) {\n\t\t\tthis.grid[row] = [];\n\t\t\t// push in 8 columns of nulls\n\t\t\tfor (let column = 0; column < 8; column++) {\n\t\t\t\tthis.grid[row].push(null);\n\t\t\t}\n\t\t}\n\t}", "function createGrid(){\n for (let i=0; i<gridSize; i++) {\n const div = document.createElement('div');\n grid.appendChild(div);\n // Push elements to previously empty cells array\n cells.push(div);\n }\n createLife();\n generateTrees();\n }", "createBdryGrid() {\n this.p.push()\n let rows = this.rows / this.scale\n let cols = this.cols / this.scale\n let cellSize = this.cellSize * this.scale\n\n this.p.stroke(200,200,200)\n\n for (let i=0; i<=cols; i++) {\n let x = this.x + cellSize*i\n this.p.line(x,this.y, x, this.y +this.h)\n \n }\n\n for (let i=0; i<=rows; i++) {\n let y = this.y + cellSize*i\n this.p.line(this.x, y, this.x+this.w, y)\n }\n this.p.pop()\n }", "function generateStones(){\n if (frameCount%50===0){\n // creating sprites of Stones\n var stone= createSprite(1200,120,40,10);\n // craeting the stones in random locations based on the values randomly\n stone.x=random(50,450);\n stone.addImage(stoneImg);\n stone.scale=0.5;\n stone.velocityY= 5;\n stone.lifetime=250;\n stonesGroup.add(stone);\n }}", "function createGrid() {\n\t// create 2 rows\n // for (var rows = 0; rows < 2; rows++) {\n // $(document.body).append(\"<div class='cards'>khjhjh</div>\");\n // }\n\t// create 2 tiles inside each row\n\tfor (var columns = 0; columns < 4; columns++) {\n\t $('.cards').append(\"<div class='tile'></div>\");\n\t}\n}", "function makeGrid() {\n\tfor (y = 0; y < sizeY; y++ ){\n\t\t$('#pixelCanvas').append('<tr>');\n\t\t\tfor(x = 0; x< sizeX; x++ ){\n\t\t\t\t$('#pixelCanvas tr:last-child').append('<td></td>');\n\t\t\t}\n\t\t$('#pixelCanvas').append('</tr>');\n\t}\n}", "function createGrid() {\r\n removeSquares(); // remove the previous squars\r\n let squares = [];\r\n let grid = prompt('How many squares you need in each direction?', 16);\r\n if(grid < 0 || grid > 64 || isNaN(grid)){ //Check if the input is a valid numbers\r\n\r\n alert(\"Please enter a valid number of grid more than 0 and less than or equal 64 grids.\")\r\n\r\n }else{\r\n let squareSize = (100 / grid) + '%';\r\n for (let i = 1; i <= grid ** 2; i++) {\r\n squares[i] = document.createElement('div');\r\n squares[i].id = 'square' + i;\r\n squares[i].className = 'squares';\r\n container.appendChild(squares[i]);\r\n }\r\n\r\n const squareStyle = document.querySelectorAll('.squares');\r\n squareStyle.forEach((e) => {\r\n e.setAttribute('style', `width:${squareSize};height:${squareSize};`);\r\n });\r\n keepColor();\r\n}\r\n}", "function squareGen(num,cells){\n const node = document.createElement(\"div\");\n //aggiungo classe square e stili per dimensioni\n node.classList.add(\"square\");\n node.style.width = ` calc(100% /${cells}` ;\n node.style.height = ` calc(100% /${cells}` ;\n\n //span per numero generato\n const span = document.createElement(\"div\");\n span.append(num);\n \n\n //Inserisco lo span nello square\n node.append(span);\n\n return node;\n}", "function squareGen(num,cells){\n const node = document.createElement(\"div\");\n //aggiungo classe square e stili per dimensioni\n node.classList.add(\"square\");\n node.style.width = ` calc(100% /${cells}` ;\n node.style.height = ` calc(100% /${cells}` ;\n\n //span per numero generato\n const span = document.createElement(\"div\");\n span.append(num);\n \n\n //Inserisco lo span nello square\n node.append(span);\n\n return node;\n}", "place_pins(start_x, start_y, end_x, end_y, normx, normy, pin_nb){\n\n var i;\n\n var increment_x = (start_x == end_x ? 0 : 1);\n var increment_y = (start_y == end_y ? 0 : 1);\n\n for(i = 0; i < pin_nb; i++){\n if(Math.random() > 0.4){ //prob to have a pin here\n this.pins.push(new Pin(start_x+increment_x*i, start_y+increment_y*i, normx, normy, 0));\n occupation[start_x+increment_x*i][start_y+increment_y*i] = 1;\n }\n }\n }", "function createBoard() \n{\n\tvar grid = $('#grid');\n\t\n\tfor(var row = 0; row < boardSize; row++) \n\t{\n\t\tvar rowDiv = $('<div class=\"row\"></div>');\n\n\t\tfor(var col = 0; col < boardSize; col++)\n\t\t{\n\t\t\trowDiv.append('<div id=\"s' + row + col + '\" class=\"col square\" row=\"' + row + '\" col=\"' + col + '\"><div class=\"square-interior\"><p></p></div></div>');\n\t\t}\n\n\t\tgrid.append(rowDiv);\n\t}\n\n\t//Spawn a square somewhere to start off the game\n\tspawnTile();\n}", "function createGrid(size){\n gridSquare.style.gridTemplateColumns = `repeat(${size}, 1fr)`;\n gridSquare.style.gridTemplateRows = `repeat(${size}, 1fr)`;\n for(i=0; i<size*size; i++){\n const div = document.createElement('div');\n div.addEventListener('mouseover', fillBlack);\n div.classList.add('square');\n gridSquare.appendChild(div);\n colorCnt = 0;\n }\n}", "makeGrid() {\n let grid = []\n for (let row = 0; row < 18; row ++) {\n grid.push([])\n for (let col = 0; col < 10; col ++) {\n grid[row].push(<Square key={`${col}${row}`} color=\"1\" />)\n }\n }\n return grid\n }", "function displayGrid(n) {\n var viewportSize = $(window).height();\n var heightLimit = viewportSize*.75;\n $('.wrapper').width(heightLimit);\n // Hacky element here to remove the 2 pixels of border\n var boxSize = (heightLimit/n) - 2;\n var wrapper = $('.wrapper').html(\"\");\n for (var i=0;i<n;i++){\n for (var j=0;j<n;j++){\n wrapper.append($('<div></div>').addClass('tile').width(boxSize).css('padding-bottom', boxSize));\n }\n //wrapper.append($('<div></div>').css('clear', 'both'));\n }\n wrapper.append($('<div></div>').css('clear', 'both'));\n}", "function _createGrid() {\n\t_grid = [$game.VIEWPORT_WIDTH];\n\tvar i = $game.VIEWPORT_WIDTH;\n\twhile(--i >= 0) {\n\t\t_grid[i] = [$game.VIEWPORT_HEIGHT];\n\t\tvar j = $game.VIEWPORT_HEIGHT;\n\t\twhile(--j >= 0) {\n\t\t\t//place random object\n\t\t\tvar item = _makeRandomItem();\n\t\t\t_grid[i][j] = {\n\t\t\t\titem: item,\n\t\t\t\titemRevealed: false\n\t\t\t};\n\t\t}\n\t}\n}", "function gridSystem(size){\n\tvar pattern = \"\";\n\tfor(var i = 0; i < size; i++){\n if( i % 2 === 0 ){\n for (var k = 0; k < size; k++){\n if( k % 2 === 0 ) pattern += \" \"; \n else pattern += \"#\";\n } pattern += \"\\n\";\n } else {\n for (var k = 0; k < size; k++){\n if( k % 2 === 0 ) pattern += \"#\"; \n else pattern += \" \";\n } pattern += \"\\n\";\n }\n } \n console.log(pattern);\n}", "function generateGrid() {\n gameBoard.childNodes[1].innerText = `It's ${game.turn.token}'s turn`;\n var grid = gameBoard.childNodes[3];\n grid.innerHTML = '';\n for (var i = 0; i < 9; i++) {\n gridIndex = i;\n grid.innerHTML += `\n <article class=\"${gridIndex}\">\n </article>\n `\n }\n game.resetGame();\n persistWins();\n}", "function createBoard() {\r\n // We'll use a for loop to iterate through all the elemtents of the layout array:\r\n for (let i = 0; i < layout.length; i++) {\r\n // For each element we create a square:\r\n const square = document.createElement('div')\r\n // Append the square to our grid:\r\n grid.appendChild(square)\r\n // And push the square to our squares array:\r\n squares.push(square)\r\n\r\n // Now we color each square depending on its number, by adding the corresponding class:\r\n if (layout[i] === 0) {\r\n squares[i].classList.add('pac-dot')\r\n } else if (layout[i] === 1) {\r\n squares[i].classList.add('wall')\r\n } else if (layout[i] === 2) {\r\n squares[i].classList.add('ghost-lair')\r\n } else if (layout[i] === 3) {\r\n squares[i].classList.add('power-pellet')\r\n }\r\n }\r\n}", "function createGrid(size = 4) {\n \n if ( size > 64 || isNaN(size)) return alert('the number has to be less than 64');\n \n for (let i = 0 ; i<size*size; i++){\n const createDivs = document.createElement('div');\n createDivs.style.width = `${(100/size)-0.4}%`;\n createDivs.classList.add('grid');\n main.appendChild(createDivs);\n}\n mouseOver();\n}", "function generateGrids() {\n for (let indexX = 0; indexX < constants.GRID_X_COUNT; indexX++) {\n xJump = gap;\n for (let indexY = 0; indexY < constants.GRID_Y_COUNT; indexY++) {\n // Create a PIXI container and set image properties to it. Shall review it later.\n mainContainer[indexX][indexY] = new PIXI.Container();\n mainContainer[indexX][indexY].interactive = true;\n mainContainer[indexX][indexY].height = boxWidth;\n mainContainer[indexX][indexY].width = boxWidth;\n mainContainer[indexX][indexY].interactive = true;\n mainContainer[indexX][indexY].x = xPos + xJump;\n mainContainer[indexX][indexY].y = yPos + yJump;\n mainContainer[indexX][indexY].indexX = indexX;\n mainContainer[indexX][indexY].indexY = indexY;\n\n // Background Image with choice of loser / winner.\n grids[indexX][indexY] = PIXI.Sprite.fromImage(uniqueImageGenerator(indexX, indexY));\n grids[indexX][indexY].cacheAsBitmapboolean = true;\n grids[indexX][indexY].interactive = true;\n grids[indexX][indexY].indexX = indexX;\n grids[indexX][indexY].indexY = indexY;\n grids[indexX][indexY].height = boxWidth;\n grids[indexX][indexY].width = boxWidth;\n grids[indexX][indexY].position.set(0, 0);\n\n // Scratching area.\n gridScratches[indexX][indexY] = PIXI.Sprite.fromImage(constants.scratchImg);\n gridScratches[indexX][indexY].cacheAsBitmapboolean = true;\n gridScratches[indexX][indexY].interactive = true;\n gridScratches[indexX][indexY].indexX = indexX;\n gridScratches[indexX][indexY].indexY = indexY;\n gridScratches[indexX][indexY].height = boxWidth;\n gridScratches[indexX][indexY].width = boxWidth;\n gridScratches[indexX][indexY].position.set(0, 0);\n\n mainContainer[indexX][indexY].addChild(gridScratches[indexX][indexY]);\n mainContainer[indexX][indexY].addChild(grids[indexX][indexY]);\n stage.addChild(mainContainer[indexX][indexY]);\n\n // Srpite overlay for the scratching area.\n drawingMask[indexX][indexY] = new InverseDrawingMask(mainContainer[indexX][indexY]);\n alphaSprite[indexX][indexY] = new PIXI.ParticleContainer();\n particleViews[indexX][indexY] = new PIXI.particles.Emitter(alphaSprite[indexX][indexY],\n constants.particleImg, configParticle);\n grids[indexX][indexY].mask = drawingMask[indexX][indexY].getMaskSprite();\n particleViews[indexX][indexY].emit = false;\n mainContainer[indexX][indexY].addChild(alphaSprite[indexX][indexY]);\n\n // Comment the below lines to see only the Pixi graphic eraser.\n // alpha[indexX][indexY] = new PIXI.Graphics();\n // grids[indexX][indexY].mask = alpha[indexX][indexY];\n\n // let texture = new PIXI.Texture.fromCanvas(renderer.view);\n // let alpha = new PIXI.Sprite(texture);\n // gridScratches[indexX][indexY].mask = alpha;\n // alphaSprite[indexX][indexY] = new PIXI.ParticleContainer();\n // particleViews[indexX][indexY] = new PIXI.particles.Emitter(alphaSprite[indexX][indexY],\n // constants.particleImg, configParticle);\n\n // mainContainer[indexX][indexY].addChild(alphaSprite[indexX][indexY]);\n\n\n // Add mouse and touch events to the grid boxes\n mainContainer[indexX][indexY].on('mouseover', mouseover);\n mainContainer[indexX][indexY].on('mouseout', mouseout);\n mainContainer[indexX][indexY].on('touchstart', mouseover);\n mainContainer[indexX][indexY].on('touchend', mouseout);\n\n xJump += boxWidth + gap;\n }\n\n yJump += boxWidth + gap;\n }\n\n return grids;\n}", "function createAllGrids(){\n let allGrids = [];\n let startCoordinates = [];\n let tempGrid = [];\n for(let i=1; i<=9; i++){\n startCoordinates = setInitialCoordinates(i);\n tempGrid = createGrid(startCoordinates[0], startCoordinates[1]);\n allGrids.push(tempGrid);\n } \n return allGrids;\n}", "function buildGrid() {\n gameArea.innerHTML = \"\";\n\n console.log('---------------[ GENERATING GRID ]---------------');\n\n for (var i = 0; i < Math.sqrt(config.gridSize); i++) {\n var row = document.createElement('div');\n row.classList.add('row');\n // console.log('ROW ' + i + \":\");\n for (var j = 0; j < Math.sqrt(config.gridSize); j++) {\n var cell = document.createElement('div');\n cell.id = `cell-${j}-${i}`;\n cell.setAttribute('row', i);\n cell.setAttribute('cell', j);\n cell.classList.add('cell');\n row.appendChild(cell);\n\n // console.log(' - Cell ' + j);\n }\n gameArea.appendChild(row);\n }\n console.log('---------------[ GENERATED GRID ]---------------');\n\n}", "function createGrid() {\n let grid = [];\n for (let x = 0; x < urBoard.width; x++) {\n grid[x] = Array(urBoard.height).fill(' ');\n }\n\n let enemy = 0;\n for (let snake of urBoard.snakes) {\n let ch = enemyS[enemy];\n for (let p of snake.body)\n grid[p.x][p.y] = ch;\n\n enemy++;\n }\n\n for (let p of you.body) // will overwrite one snake\n grid[p.x][p.y] = 'M';\n\n for (let p of urBoard.food)\n grid[p.x][p.y] = 'F';\n\n // console.dir(grid);\n return grid;\n }", "function createGrid(numberElements) {\n if (numberElements === undefined) {\n numberElements = 5;\n } else {\n numberElements = verifyElementsNumbers(numberBoardSize.value);\n }\n for (let index = 0; index < (numberElements ** 2); index += 1) {\n const pixel = document.createElement('div');\n boardGrid.appendChild(pixel);\n boardGrid.style.display = 'grid';\n boardGrid.style.gridTemplateColumns = `repeat(${numberElements}, 40px)`;\n pixel.className = 'pixel';\n }\n}", "function makeGrid(squaresPerSide) {\n\n //Add div rows(basically tr), to act as rows\n for (var i = 0; i < squaresPerSide; i++) {\n $('#pad').append('<div class=\"row\"></div>');\n }\n\n //Add div squares(basically td), to ever row\n for (var i = 0; i < squaresPerSide; i++) {\n $('.row').append('<div class=\"square\"></div>');\n }\n\n //Set square size= giant grid div divided by sqperside\n var squareDimension = $('#pad').width() / squaresPerSide;\n $('.square').css({\n 'height': squareDimension,\n 'width': squareDimension\n });\n}", "function create_snake() {\n\t\tlet length = 1;\n\t\tsnake_length = [];\n\t\tfor (let i = length - 1; i >= 0; i--) {\n\t\t\tsnake_length.push({ x: i, y: height / cellWidth / 2 });\n\t\t}\n\t}", "function makeGrid(cols, rows) {\n for (let i = 0; i < (cols * rows); i++) {\n const div = document.createElement('div');\n div.style.border = '1px solid black';\n container.style.gridTemplateColumns = `repeat(${cols}, 1fr)`;\n container.style.gridTemplateRows = `repeat(${rows}, 1fr)`;\n container.appendChild(div).classList.add('box');\n }\n}", "function putWalls() {\n console.log(\"Walls\");\n for (let i = 0; i < n; i++) {\n for (let j = 0; j < m; j++) {\n if (grid[i][j] != source && grid[i][j] != end) {\n if (random(1) < 0.1) {\n grid[i][j].wall = true;\n }\n }\n }\n }\n\n source.wall = false;\n end.wall = false;\n\n background(\"#FFFFFF\");\n for (let i = 0; i < n; i++) {\n for (let j = 0; j < m; j++) {\n grid[i][j].showCell(color(\"#FFFFFF\"));\n }\n }\n\n source.showCell(color(\"#1a3da6\"));\n end.showCell(color(\"#fd1036\"));\n}", "function createGrid(width, height) {\n for (let i = 0; i < height; i++) {\n let row = document.createElement('div');\n row.classList.add('row');\n\n for (let x = 0; x < width; x++) {\n let pixel = document.createElement('div');\n pixel.classList.add('pixel');\n row.appendChild(pixel);\n }\n grid.appendChild(row);\n }\n}", "function buildBoard(){\n container = document.createElement(\"div\");\n container.classList.add(\"grid-container\");\n\n for(i=0; i < dims; i++){\n for(j = 0; j < dims; j++){\n let temp = makeGridEle(boardSize);\n container.appendChild(temp);\n }\n let br = document.createElement(\"br\");\n container.appendChild(br);\n }\n\n document.body.appendChild(container);\n}", "function grid(w, h){ //create grid of tiles with dimensions wxh\r\n var arr = [];\r\n for(var i = 0; i < h; i++){ //for each row\r\n arr.push([]); //create new row\r\n for(var j = 0; j < w; j++){ //for each column\r\n arr[i].push(parseInt(Math.random() * (Global.Colors.length))); //create new tile with random color\r\n }\r\n }\r\n return arr;\r\n}", "function makeGrid(n) {\r\n const fabric = [];\r\n for (let i = 0; i <= n; i++) {\r\n fabric[i] = [];\r\n fabric[i][n] = '.';\r\n fabric[i].fill('.', 0, n);\r\n }\r\n return fabric;\r\n }", "createGrid() {\n let grid = new Array(parseInt(this.width)).fill(0)\n\n for(let col = 0; col < this.width; col++) {\n grid[col] = new Array(parseInt(this.height)).fill(0)\n }\n return grid\n }", "function buildBoard(){\n\t \t\tvar mineCount = 0;\n\t \t\tfor (var i = 0; i < ROWS; i+=1) {\n\t\t\t\tfor (var j = 0; j < COLS; j+=1) {\n\t\t\t\t\tvar x_shift = Math.floor(0.5*start) + i*stepW;\n\t\t\t\t\tvar y_shift = Math.floor(0.5*start) + j*stepH;\n\t\t\t\t\tvar circleCol = randomColorGenerator(x_shift,y_shift);\n\t\t\t\t\tvar invertedCol = getInvertedColors(circleCol);\n\t\t\t\t\tvar myCircle = new Path.Circle(new Point(x_shift+circleSize,y_shift+circleSize),circleSize).fillColor = circleCol;\n\t\t\t\t\t//initialise space object\n\n\n\t\t\t\t\tvar spaceObj = {\n\t\t\t\t\t\t\t\t\tindex: n, \n\t\t\t\t\t\t\t\t\tcolor: circleCol,\n\t\t\t\t\t\t\t\t\toutline: invertedCol,\n\t\t\t\t\t\t\t\t\tcircleRef: myCircle,\n\t\t\t\t\t\t\t\t\tpos_x: 0, pos_y: 0, \n\t\t\t\t\t\t\t\t\tholdsMine: 0, \n\t\t\t\t\t\t\t\t\tadjacentNeighbours: 0, \n\t\t\t\t\t\t\t\t\tclicked: false,\n\t\t\t\t\t\t\t\t\tflagged: false,\n\t\t\t\t\t\t\t\t\tneighbourIndexList: []\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\tspaceObj.pos_x = x_shift+circleSize;\n\t\t\t\t\tspaceObj.pos_y = y_shift+circleSize;\n\t\t\t\t\tspaceObj.holdsMine = assignMine();\n\n\t\t\t\t\tif(spaceObj.holdsMine){\n\t\t\t\t\t\tmineCount++;\n\t\t\t\t\t}\n\n\t\t\t\t\tspaces.push(spaceObj);\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tplayerStats.totalMines = mineCount;\n\t\t\tplayerStats.flags = mineCount;\n\t \t}", "function createGrid(playerStartPosition) {\n // Using for loop to create grid, because we can specify how long we want it to run for\n for (let i = 0; i < cellCount; i++) {\n const cell = document.createElement('div')\n // Set cell number based on i (Turn on for development reasons to see cell index)\n //cell.innerHTML = i\n // Add each div to parent grid as children\n grid.appendChild(cell)\n // adds's each cell to an array\n cells.push(cell)\n }\n\n addPlayer(playerStartPosition)\n }", "function setupTavern() {\n\n//draw a grid\n//make objects of each area\n\n\n}", "createGameGrid (x, y) {\n while (y < 1080){\n while (x < 1920){\n const cell = this.add.rectangle(x, y, 192, 180).setInteractive()\n cell.setStrokeStyle(2, 0x000000)\n cell.alpha = 0.01\n this.gameGridCellGroup.add(cell)\n x += 192\n }\n if (x > 1920) {\n x = 96\n y += 180\n }\n }\n }", "function createGrid() {\n\n const frame = null; // get a reference to the frame\n\n // Add Code to create the game grid\n for (let i = 0; i < 10 ; i++) {\n buildRow(frame); \n }\n resetGame();\n}", "function createGrid() {\n\t$('.header').append('<div class=\"container\"></div>'); //create container\n var $row = $(\"<div />\", {\n \tclass: 'row'\n\t});\n\tvar $square = $(\"<div />\", {\n \tclass: 'sq'\n\t});\n\n for (var i = 0; i < columns; i++) {\n $row.append($square.clone());\n }\n for (var i = 0; i < rows; i++) {\n $(\".container\").append($row.clone());\n }\n}", "function createGrid() {\n for (let i = 0; i < cellCount; i++) {\n const cell = document.createElement('div')\n // cell.innerText = i\n grid.appendChild(cell)\n cells.push(cell)\n\n // generate borders and map\n if (level === 'beginner') {\n if (i < width || (i % width === 0 && i !== 55) || (i % width === width - 1 && i !== 65) || i + width > width * width - 1 || borderArray.includes(i)) {\n cell.classList.add(borderClass)\n } else if (i === 27) {\n cell.classList.add(fossilClass)\n } else if (i === 20 || i === 100) {\n cell.classList.add(netClass)\n } else if (i === 48 || i === 50) {\n cell.classList.add(fenceClass)\n } else if (!cell.classList.contains(borderClass) && !cell.classList.contains(fossilClass) && !cell.classList.contains(netClass) & !cell.classList.contains(fenceClass) && i !== 59 & i !== 60 & i !== 61) {\n cell.classList.add(foodClass)\n }\n\n grabLives[2].classList.add(hiddenClass)\n\n if (i === 58) {\n centerText = document.createElement('div')\n cell.appendChild(centerText)\n center = document.createElement('p')\n centerText.appendChild(center)\n centerText.classList.add('center-text')\n centerText.classList.add(hiddenClass)\n }\n }\n }\n\n center.innerText = 'Welcome to Animal Crossing, PacMan Edition. \\n Press Start to begin!'\n centerText.classList.remove(hiddenClass)\n center.classList.add('welcome')\n\n addPlayer(playerStartPosition)\n console.log('player added at start')\n addGhost(scorpianStartPosition, scorpianClass)\n addGhost(tarantulaStartPosition, tarantulaClass)\n addGhost(waspStartPosition, waspClass)\n }" ]
[ "0.69495034", "0.69487864", "0.6933928", "0.68922925", "0.6849623", "0.6837589", "0.68185705", "0.67937374", "0.6757577", "0.6692012", "0.666156", "0.6659617", "0.66583604", "0.6655502", "0.6650055", "0.6649327", "0.6645979", "0.664104", "0.6626312", "0.66250443", "0.6606446", "0.6599128", "0.65977645", "0.6587459", "0.65823716", "0.6581236", "0.65734893", "0.65685046", "0.65610015", "0.6548976", "0.65483195", "0.65433735", "0.65414494", "0.65330505", "0.6529821", "0.65226984", "0.6521749", "0.65172994", "0.6513702", "0.65116805", "0.6510854", "0.6504855", "0.65014386", "0.6500761", "0.6495964", "0.64951736", "0.6493425", "0.6492739", "0.64877915", "0.64866626", "0.6485469", "0.64728576", "0.64675146", "0.64675146", "0.64675146", "0.64675146", "0.64669937", "0.64590645", "0.6454537", "0.6448654", "0.64463633", "0.64450955", "0.64359075", "0.643573", "0.64344794", "0.6423005", "0.641621", "0.64112324", "0.6404465", "0.6404465", "0.6401608", "0.6400822", "0.6398823", "0.63946056", "0.63906246", "0.6387837", "0.63874537", "0.63829166", "0.6380369", "0.63694507", "0.6346967", "0.63424677", "0.6341432", "0.63404334", "0.6337501", "0.6332407", "0.6323705", "0.6320646", "0.6313977", "0.6312585", "0.6301842", "0.62991613", "0.6295369", "0.62849957", "0.6283649", "0.6276936", "0.6276741", "0.6270712", "0.6268324", "0.6258478", "0.62528336" ]
0.0
-1
Method for applying icons to the labels
addIcons(){ // Icon sizes make the icon smaller as the stone moves in this.iconSizes = ['32px','30px','28px','26px','24px','22px'] // Add elements for all the icons var iconConifer = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-tree" id="icon-conifer"></span></div>') var iconScissors = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-cut" id="icon-scissors"></span></div>') var iconBell = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-bell" id="icon-bell"></span></div>') var iconCamera = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-camera" id="icon-camera"></span></div>') var iconFlag = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-flag" id="icon-flag"></span></div>') var iconHeadphones = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-headphones" id="icon-headphones"></span></div>') var iconSuitcase = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-lock" id="icon-suitcase"></span></div>') var iconClock = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-clock" id="icon-clock"></span></div>') var iconMusic = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-music" id="icon-music"></span></div>') var iconPencil = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-pen" id="icon-pencil"></span></div>') var iconEnvelope = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-envelope" id="icon-envelope"></span></div>') var iconHeart = $('<div class="well-icon-wrapper"><span class="well-icon fas fa-heart" id="icon-heart"></span></div>') // Create a list of all their icons and positions this.iconsList = [{icon:iconConifer,id:"icon-conifer", col:1,row:51}, {icon:iconScissors,id:"icon-scissors", col:3,row:7}, {icon:iconBell,id:"icon-bell", col:1,row:49}, {icon:iconCamera,id:"icon-camera", col:4,row:36}, {icon:iconFlag,id:"icon-flag", col:0,row:30}, {icon:iconHeadphones,id:"icon-headphones", col:3,row:59}, {icon:iconSuitcase,id:"icon-suitcase", col:2,row:26}, {icon:iconClock,id:"icon-clock", col:0,row:13}, {icon:iconMusic,id:"icon-music", col:1,row:73}, {icon:iconPencil,id:"icon-pencil", col:1,row:74}, {icon:iconEnvelope,id:"icon-envelope", col:4,row:55}, {icon:iconHeart,id:"icon-heart", col:0,row:67} ] // Loop through all icons and add them for (var icon of this.iconsList) { // Get the row and column to add it to from the list of icons var iconRow = icon.row var iconCol = icon.col // Select the right stone var stone = $('.well-grid-cell-wrapper[data-grid-row="'+icon.row+'"][data-grid-col="'+icon.col+'"]') // Append the icon to the stone stone.append(icon.icon) // Set the font size of the icons $('.well-icon').css({"font-size":"32px"}) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function icons() {\r\n var arr = [], style = 'style=\"width:18px\"';\r\n if (iconMapper.map(link)) add(iconMapper.map(link));\r\n if (iconMapper.map(obj.Type)) add(iconMapper.map(obj.Type));\r\n if (reg !== 'Message' && iconMapper.map(reg)) add(iconMapper.map(reg));\r\n if (detail.contains('email')) add(iconMapper.map('email'));\r\n if (detail.contains('SMS')) add(iconMapper.map('sms'));\r\n\r\n //make sure there is exactly 2 icons\r\n arr.first(2);\r\n while (arr.length < 2) {\r\n arr.push('icon-blank');\r\n }\r\n\r\n if (arr.length) {\r\n return '<i ' + style + ' class=\"' + arr.join(' icon-large muted disp-ib\"></i> <i ' + style + ' class=\"') + ' icon-large muted disp-ib\"></i> ';\r\n } else {\r\n return '';\r\n }\r\n function add(i) {\r\n if (!arr.contains(i)) arr.push(i);\r\n }\r\n }", "function updateIcons() {\n if (vm.buttons) {\n for (var i = 0 , length = vm.buttons.length; i < length ; i++) {\n constructIconObject(vm.buttons[i]);\n }\n }\n }", "function IconLabelButton() {\n this._init.apply(this, arguments);\n}", "createLabels() {\n if (this.settings.labelsConfig.areSpritesUsed) {\n this.createLabelsAsSprites();\n } else {\n this.createLabelsAsPoints();\n }\n this.render();\n }", "function getLabel(iconName) {\n return '<i class=\"md-sm-text icon-' + iconName + '></i>';\n}", "generateIcons() {\n const terminalBase = Core.atlas.find(this.name);\n const terminalDisplay = Core.atlas.find(this.name + \"-display-icon\");\n return [terminalBase, terminalDisplay];\n }", "renderIcon(data) {\n const e = document.createElement('div');\n e.className = this.createIconClass(data);\n e.appendChild(document.createTextNode(data.iconLabel));\n return e;\n }", "newIcon() {\n return `${this.iconPrefix}${this.getEquivalentIconOf(this.icon)}`;\n }", "function renderIcons() {\r\n\t\te.renderIcon('#logo', 'logo');\r\n\t\t//e.renderIcon('#loading_msglogo','logo');\r\n\t\te.renderIcon('.menu_icon', 'user_management');\r\n\t\te.renderIcon('.menu_click', 'user_management');\r\n\t\te.renderIcon('.notification', 'notification');\r\n\t\te.renderIcon('header .analysis_status .analysis_icon', 'analysis');\r\n\t\te.renderFontIcon('.input_clear_icon', 'ic-close-sm');\r\n\t\te.renderFontIcon('.search_icon', 'ic-search');\r\n\t\te.renderIcon('#add_bookmark', 'bookmarks');\r\n\t\te.renderIcon('#add_bookmark1', 'bookmarks');\r\n\t\te.renderFontIcon('.tag_icon', 'ic-tags');\r\n\t\t$(document).foundation();\r\n\t\tg.init();\r\n\t}", "defineCustomIcons() {\n this.icons = {\n default: leaflet.divIcon({\n iconSize: this.mapSettings.iconSize.default,\n }),\n\n center: leaflet.divIcon({\n className: \"leaflet-div-icon-center\",\n iconSize: this.mapSettings.iconSize.center,\n }),\n\n eat: leaflet.divIcon({\n className: \"leaflet-div-icon-eat\",\n iconSize: this.props.markerSize,\n html: svgIcons.eat,\n }),\n\n drink: leaflet.divIcon({\n className: \"leaflet-div-icon-drink\",\n iconSize: this.props.markerSize,\n html: svgIcons.drink,\n }),\n\n play: leaflet.divIcon({\n className: \"leaflet-div-icon-play\",\n iconSize: this.props.markerSize,\n html: svgIcons.play,\n }),\n\n see: leaflet.divIcon({\n className: \"leaflet-div-icon-see\",\n iconSize: this.props.markerSize,\n html: svgIcons.see,\n }),\n\n shop: leaflet.divIcon({\n className: \"leaflet-div-icon-shop\",\n iconSize: this.props.markerSize,\n html: svgIcons.shop,\n }),\n\n sleep: leaflet.divIcon({\n className: \"leaflet-div-icon-sleep\",\n iconSize: this.props.markerSize,\n html: svgIcons.sleep,\n }),\n };\n }", "function getLabelIconImagePath(labelType) {\n return {\n 'Walk' : {\n 'id' : 'Walk',\n 'iconImagePath' : undefined\n },\n 'StopSign' : {\n 'id' : 'StopSign',\n 'iconImagePath' : 'public/img/icons/Icon_BusStop.png'\n },\n 'StopSign_OneLeg' : {\n 'id' : 'StopSign_OneLeg',\n 'iconImagePath' : 'public/img/icons/Icon_BusStopSign_SingleLeg.png'\n },\n 'StopSign_TwoLegs' : {\n 'id' : 'StopSign_TwoLegs',\n 'iconImagePath' : 'public/img/icons/Icon_BusStopSign_TwoLegged.png'\n },\n 'StopSign_Column' : {\n 'id' : 'StopSign_Column',\n 'iconImagePath' : 'public/img/icons/Icon_BusStopSign_Column.png'\n },\n 'StopSign_None' : {\n 'id' : 'StopSign_None',\n 'iconImagePath' : 'public/img/icons/Icon_BusStop.png'\n },\n 'Landmark_Shelter' : {\n 'id' : 'Landmark_Shelter',\n 'iconImagePath' : 'public/img/icons/Icon_BusStopShelter.png'\n },\n 'Landmark_Bench' : {\n 'id' : 'Landmark_Bench',\n 'iconImagePath' : 'public/img/icons/Icon_Bench.png'\n },\n 'Landmark_TrashCan' : {\n 'id' : 'Landmark_TrashCan',\n 'iconImagePath' : 'public/img/icons/Icon_TrashCan2.png'\n },\n 'Landmark_MailboxAndNewsPaperBox' : {\n 'id' : 'Landmark_MailboxAndNewsPaperBox',\n 'iconImagePath' : 'public/img/icons/Icon_Mailbox2.png'\n },\n 'Landmark_OtherPole' : {\n 'id' : 'Landmark_OtherPole',\n 'iconImagePath' : 'public/img/icons/Icon_OtherPoles.png'\n }\n }\n}", "function getLabelIconImagePath(labelType) {\n return {\n 'Walk' : {\n 'id' : 'Walk',\n 'iconImagePath' : undefined\n },\n CurbRamp: {\n id: 'CurbRamp',\n iconImagePath : svl.rootDirectory + 'img/Icon_CurbRamp.svg'\n },\n NoCurbRamp: {\n id: 'NoCurbRamp',\n iconImagePath : svl.rootDirectory + '/img/icons/Sidewalk/Icon_NoCurbRamp.svg'\n },\n Obstacle: {\n id: 'Obstacle',\n iconImagePath: null\n },\n SurfaceProblem: {\n id: 'SurfaceProblem',\n iconImagePath: null\n },\n Other: {\n id: 'Other',\n iconImagePath: null\n },\n Void: {\n id: 'Void',\n iconImagePath : null\n },\n Unclear: {\n id: 'Unclear',\n iconImagePath : null\n },\n 'StopSign' : {\n 'id' : 'StopSign',\n 'iconImagePath' : svl.rootDirectory + '/img/icons/Icon_BusStop.png'\n },\n 'StopSign_OneLeg' : {\n 'id' : 'StopSign_OneLeg',\n 'iconImagePath' : svl.rootDirectory + '/img/icons/Icon_BusStopSign_SingleLeg.png'\n },\n 'StopSign_TwoLegs' : {\n 'id' : 'StopSign_TwoLegs',\n 'iconImagePath' : svl.rootDirectory + '/img/icons/Icon_BusStopSign_TwoLegged.png'\n },\n 'StopSign_Column' : {\n 'id' : 'StopSign_Column',\n 'iconImagePath' : svl.rootDirectory + '/img/icons/Icon_BusStopSign_Column.png'\n },\n 'StopSign_None' : {\n 'id' : 'StopSign_None',\n 'iconImagePath' : svl.rootDirectory + '/img/icons/Icon_BusStop.png'\n },\n 'Landmark_Shelter' : {\n 'id' : 'Landmark_Shelter',\n 'iconImagePath' : svl.rootDirectory + '/img/icons/Icon_BusStopShelter.png'\n },\n 'Landmark_Bench' : {\n 'id' : 'Landmark_Bench',\n 'iconImagePath' : svl.rootDirectory + '/img/icons/Icon_Bench.png'\n },\n 'Landmark_TrashCan' : {\n 'id' : 'Landmark_TrashCan',\n 'iconImagePath' : svl.rootDirectory + '/img/icons/Icon_TrashCan2.png'\n },\n 'Landmark_MailboxAndNewsPaperBox' : {\n 'id' : 'Landmark_MailboxAndNewsPaperBox',\n 'iconImagePath' : svl.rootDirectory + '/img/icons/Icon_Mailbox2.png'\n },\n 'Landmark_OtherPole' : {\n 'id' : 'Landmark_OtherPole',\n 'iconImagePath' : svl.rootDirectory + '/img/icons/Icon_OtherPoles.png'\n }\n }\n}", "function modifyIcons() {\n document.getElementById(\"panel\").removeEventListener('DOMSubtreeModified', modifyIcons, false);\n\n var icons = document.getElementsByClassName(\"adp-marker\");\n var iconLabelsExist = document.getElementsByClassName(\"icon-label\").length;\n for (var i = 0; i < icons.length; i++) {\n icons[i].src = namespace.markers[i].icon.url;\n if (!iconLabelsExist) {\n $(icons[i]).wrap('<div class=\"icon-container\"></div>');\n $( '<p class=\"icon-label\">' + (i + 1) + '</p>' ).insertAfter(icons[i]);\n }\n }\n}", "getIcon() {\n switch (this.props.checkr) {\n case \"waitlist\":\n return {\n checkrText: \"Pending waitlist\",\n color: Colors.white,\n name: \"hourglass-empty\"\n };\n case \"clear\":\n return {\n checkrText: \"All Set!\",\n color: Colors.white,\n name: \"check\"\n };\n case \"consider\":\n return {\n checkrText: \"In Review\",\n color: Colors.error,\n name: \"hourglass-empty\"\n };\n case \"pending\":\n return {\n checkrText: \"Pending\",\n color: Colors.secondary,\n name: \"hourglass-full\"\n };\n case \"sent\":\n return {\n checkrText: \"Sent\",\n color: Colors.secondary,\n name: \"hourglass-empty\"\n };\n default:\n return {\n checkrText: \"Error\",\n color: Colors.error,\n name: \"error-outline\"\n };\n }\n }", "function mapper_page_paint_icons() {\n\n if( glyph_url != null ) return;\n\n if(true) { \n glyph_post = \"/dynamapper/icons/weather-clear.png\";\n var feature = {};\n feature[\"kind\"] = \"icon\";\n feature[\"image\"] = glyph_post;\n feature[\"iconSize\"] = [ 32, 32 ];\n feature[\"iconAnchor\"] = [ 9, 34 ];\n feature[\"iconWindowAnchor\"] = [ 9, 2 ];\n mapper_inject_feature(feature);\n }\n\n if(true) {\n glyph_person = \"/dynamapper/icons/emblem-favorite.png\";\n var feature = {};\n feature[\"kind\"] = \"icon\";\n feature[\"image\"] = glyph_person;\n feature[\"iconSize\"] = [ 32, 32 ];\n feature[\"iconAnchor\"] = [ 9, 34 ];\n feature[\"iconWindowAnchor\"] = [ 9, 2 ];\n mapper_inject_feature(feature);\n }\n\n if(true) {\n glyph_url = \"/dynamapper/icons/emblem-important.png\";\n var feature = {};\n feature[\"kind\"] = \"icon\";\n feature[\"image\"] = glyph_url;\n feature[\"iconSize\"] = [ 32, 32 ];\n feature[\"iconAnchor\"] = [ 9, 34 ];\n feature[\"iconWindowAnchor\"] = [ 9, 2 ];\n mapper_inject_feature(feature);\n }\n}", "function IconOptions() {}", "function updateIcons(title) {\n // Reset all the icons\n for (var x = locations.length - 1; x >= 0; x--) {\n var marker_title = locations[x].title;\n\n if (title != marker_title) {\n marker[marker_title].setIcon({\n url: './img/icons/map-'+marker_title+'.png',\n scaledSize: new google.maps.Size(50,50)\n });\n }\n }\n\n // Set the active icon\n marker[title].setIcon({\n url: './img/icons/map-'+title+'-active.png',\n scaledSize: new google.maps.Size(50,50)\n });\n}", "setIcon(i) {\n this.icon = i;\n }", "function renderLabels() {\n renderLabelsHorizontal.call(this);\n renderLabelsVertical.call(this);\n}", "function _setAllIcons() {\n\n // Style all markers.\n var markers = _spiderfier.getMarkers();\n var index = markers.length - 1;\n while(index >= 0) {\n _setIcon(markers[index--], false);\n }\n\n // Style spiderfier markers.\n markers = _spiderfier.markersNearAnyOtherMarker();\n index = markers.length - 1;\n while(index >= 0) {\n _setIcon(markers[index--], true);\n }\n}", "lIcon(properties) {\n properties.tag = \"i\";\n properties.class = this.removeLeadingWhitespace(\n `${this.processContent(properties.class)} fal fa-${properties.icon}`\n );\n\n return this.getElement(properties);\n }", "function tooltipIcons(id) {\n hoverTooltip(id, 'smileys');\n hoverTooltip(id, 'save');\n}", "buildIcons(){\n for(var i=0; i<this.popUpFltImgs.length; i++){\n this.buildIcon(i, false);\n }\n }", "function MatIconLocation() {}", "createIconClass(data) {\n const name = 'jp-Dialog-buttonIcon';\n const extra = data.iconClass;\n return extra ? `${name} ${extra}` : name;\n }", "function cargarIconos(){\n // iconos para mostrar puntos\n estilosMarcadores[\"carga\"] = styles.marcadorCarga();\n estilosMarcadores[\"traslado\"] = styles.marcadorTraslado();\n }", "function getIcons(text) {\n switch (text) {\n case 'Frigate':\n case 'Galleon':\n case 'Skiff':\n case 'Pinnace':\n case 'Flute':\n return 'fas fa-ship';\n case 'Tax increase':\n return 'fas fa-balance-scale';\n case 'Expedition':\n return 'fas fa-map-signs';\n case 'Trader':\n return 'fas fa-exchange-alt';\n case 'Governor':\n return 'fas fa-landmark';\n case 'Jester':\n return 'far fa-smile-wink';\n case 'Admiral':\n return 'fas fa-binoculars';\n case 'Sailor':\n case 'Pirate':\n return 'fas fa-skull-crossbones';\n case 'Priest':\n return 'fas fa-cross';\n case 'Captain':\n return 'fas fa-anchor';\n case 'Settler':\n return 'fas fa-home';\n case 'Madamoiselle':\n return 'fas fa-percent';\n case 'Jack of all Trades':\n return 'fas fa-asterisk';\n }\n}", "configureLabels() {\n this.label\n .attr(\"class\", \"lgv-label\")\n .attr(\"data-node-label\", d => this.extractLabel(d))\n .attr(\"data-node-depth\", d => d.depth)\n .attr(\"data-node-children\", d => d.children ? true : false)\n .attr(\"x\", d => d.x)\n .attr(\"y\", d => d.children ? (d.y - (d.r * 0.9)) : d.y)\n .text(d => this.extractLabel(d));\n }", "function setIcons(options) {\n let icon = `<i class='fas fa-${options.icon_name} fa-fw'></i>`;\n if (options.quantity) {\n icon = icon.repeat(options.quantity);\n }\n return icon;\n}", "getIcon() {\n return \"document-cook\";\n }", "oIcon(properties) {\n properties.tag = \"i\";\n properties.class = this.removeLeadingWhitespace(\n `${this.processContent(properties.class)} far fa-${properties.icon}`\n );\n return this.getElement(properties);\n }", "updateDriveSpecificIcons() {}", "updateDriveSpecificIcons() {}", "get labelStyle() {\n return !!this.icon && this.icon !== \"\" && this.showTextLabel === false ? \"offscreen\" : null;\n }", "function cargarIconos(){\n // iconos para mostrar puntos\n estilosActuales[\"carga\"] = styles.marcadorCarga();\n //corregir esto\n estilosActuales[\"Taxi/Remis\"] = styles.marcadorTraslado();\n // default\n estilosActuales[\"default\"] = styles.marcadorDefault();\n }", "function renderLabel(rowid) {\n var lbldata = JSON.parse(document.getElementById(rowid).dataset.label_rw).label;\n// RENDER LABEL\n // create the label's text from its name and add emojis if present in \n // the label name\n var imgtag = undefined;\n if((imgtag = emojitag(lbldata.name)) === undefined) {\n $('#'+rowid+'-color').text(lbldata.name);\n } else {\n // remove emoji text from the name\n var lblname = lbldata.name.replace(/\\:(.*?)\\:/g, '');\n $('#'+rowid+'-color').text(lblname);\n // append each <img> tag with an emoji to the label\n while((img = imgtag.shift()) !== undefined) {\n $('#'+rowid+'-color').append(img);\n }\n }\n // set the label's background color\n $('#'+rowid+'-color').attr('style', 'background-color:#'+lbldata.color+';color:#'+adaptColor(lbldata.color)+';');\n// ^RENDER LABEL\n\n $('#'+rowid+'-desc').text((lbldata.description === null ? '' : lbldata.description));\n}", "function _positionCurrentLabelIcon() {\n const currLabelProps = currLabel.getProperties();\n const labelCanvasXY = currLabelProps.currCanvasXY;\n const scaledX = (labelCanvasXY.x * $gsvLayer.width()) / panoWidth;\n const scaledY = (labelCanvasXY.y * $gsvLayer.height()) / panoHeight;\n\n $('.common-mistakes-current-label-icon', $commonMistakesCurrentLabelImage).css({\n 'left': scaledX,\n 'top': scaledY,\n });\n }", "_setIcons() {\n if (this.options.list) {\n var item = this.$container.find('.select2-selection__choice__remove');\n item.text('').addClass(this.options.removeIcon);\n }\n }", "updateIcon() {\n const zoom = this.map_.getZoom();\n const mz = this.markerClusterer_.getMaxZoom();\n\n if (mz && zoom > mz) {\n // The zoom is greater than our max zoom so show all the markers in cluster.\n for (let i = 0, marker; marker = this.markers_[i]; i++) {\n marker.setMap(this.map_);\n }\n return;\n }\n\n if (this.markers_.length < this.minClusterSize_) {\n // Min cluster size not yet reached.\n this.clusterIcon_.hide();\n return;\n }\n\n const numStyles = this.markerClusterer_.getStyles().length;\n const sums = this.markerClusterer_.getCalculator()(this.markers_, numStyles);\n this.clusterIcon_.setCenter(this.center_);\n this.clusterIcon_.setSums(sums);\n this.clusterIcon_.setCover(this.getFrontCover())\n this.clusterIcon_.show();\n\n\n }", "setIcon (Icon) {\n _Icon = Icon\n }", "mark(...labels) { labels.forEach(label => this.classList.add(label)); }", "function createIcon(bg_color, opacity, textAlign, text_margin_top, font_color, font_size, data, data_suffix, old_data) {\r\n\r\n //if a sensor is determined to have old data, we color it gray and make it semitransparent\r\n if(old_data) {\r\n font_color = '#2a2a2a';\r\n bg_color = '#808080';\r\n opacity = '0.85';\r\n }\r\n\r\n icon = L.divIcon({ \r\n className: \"my-custom-pin\",\r\n iconAnchor: [15, 15],\r\n labelAnchor: [0, 0],\r\n popupAnchor: [0, -15],\r\n html: `<svg width=\"30px\" viewBox=\"0 0 60 60\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\r\n <circle cx=\"30\" cy=\"30\" r=\"28\" opacity=\"${opacity}\" stroke-width=\"1\" stroke=\"black\" fill=\"${bg_color}\" shape-rendering=\"geometricPrecision\"/>\r\n <text x=\"50%\" y=\"50%\" text-anchor=\"middle\" fill=\"${font_color}\" font-size=\"1.9em\" dy=\".4em\">${data}${data_suffix}</text>\r\n </svg>`\r\n });\r\n\r\n return icon;\r\n}", "function addIcons(computed_route) {\n\n var numRouteLegs = computed_route.routeLegs.length;\n\n for (var i = 0; i < computed_route.routeLegs.length; i++) {\n startMarkerLatLong = computed_route.routeLegs[i][\"startLatLong\"].reverse();\n var htmlStartIcon = new L.divIcon({html:\"<div class='icon-circular'>\"+computed_route.routeLegs[i].startIconHtml+\"</div>\"});\n var startMarker = new L.marker(startMarkerLatLong, {icon:htmlStartIcon});//.addTo(map);\n allMarkers.addLayer(startMarker);\n\n if (i == computed_route.routeLegs.length-1) {\n endMarkerLatLong = computed_route.routeLegs[i][\"endLatLong\"].reverse();\n var htmlEndIcon = new L.divIcon({html:\"<div class='icon-circular'>\"+computed_route.routeLegs[i].endIconHtml+\"</div>\"});\n var endMarker = new L.marker(endMarkerLatLong, {icon:htmlEndIcon});//.addTo(map);\n allMarkers.addLayer(endMarker);\n } \n }\n\n}", "setLoadingIcon() {\n this.setImage(config.loadingIconPath);\n this.setText('Ladataan ja lasketaan säätietoja ja kelivaroituksia.');\n }", "createLabels() {\n return this.props.pie(this.props.data).map((data, idx) => {\n // Don't label the really small wedges.\n if (data.endAngle - data.startAngle < 0.1) return null;\n let labelKey = data.data[this.props.labelKey]\n\n // Note the ref being placed on each label element for easy reference\n // and subsequently easy access to the height/width for repositioning.\n return (\n <text transform={this.labelTransform(data, labelKey)}\n ref={ (node) => this.labelNodes[labelKey] = node }\n key={labelKey}>\n { this.props.formatLabel(data.value) }\n </text>\n );\n });\n }", "function iconize() {\n var lists = $(\"#show-data > li\");\n $(lists).has(\"span:contains('ARTICLE')\").prepend('<i style=\"font-size:15px;color:rgba(80, 80, 80, 0.97);padding-right:5px;cursor:pointer;margin-left:-18px;\" class=\"fa fa-plus\" ></i>').wrap('<div class=\"icon\"></div>');\n $(lists).has(\"span:contains('TOPIC')\").wrap('<div class=\"maintopic\"></div>');\n if ($(\"div.icon + div.icon\").length) {\n $(\"div.icon + div.icon\").prev().find('i').css('display', 'none');\n }\n if ($(\"div.icon + div.maintopic\").length) {\n $(\"div.icon + div.maintopic\").prev().find('i').css('display', 'none');\n }\n\n if ($('#show-data div.icon:last-child + div').length > -1) {\n $('#show-data div.icon:last-child').find('i').css('display', 'none');\n }\n\n $(\"#show-data li\").find(\"i\").click(function() {\n if ($(this).hasClass('fa-minus')) {\n $(this).attr('class', 'fa fa-plus');\n var next = $(this).parent(\"li.treeline\").closest(\"div.icon\").nextUntil(\"div\");\n next.slideUp();\n } else {\n $(this).attr('class', 'fa fa-minus');\n var next = $(this).parent(\"li.treeline\").closest(\"div.icon\").nextUntil(\"div\");\n next.slideDown();\n }\n });\n }", "function setLabels(index){\n\tvar label = '';\n\tif (!defaultSettings.showlabels){\n\t\treturn label;\n\t}\n\t\n\tif (index % 8 === 0){\n\t\tlabel += '<span class=\"label type-num number-' + labelPosition.num + '\">' + labelPosition.num + '</span>';\n\t\tlabelPosition.num--;\n\t}\n\tif (index >=56){\n\t\tlabel += '<span class=\"label type-alpha alphabet-' + String.fromCharCode(labelPosition.alpha) + '\">' + String.fromCharCode(labelPosition.alpha) + '</span>';\n\t\tlabelPosition.alpha++;\n\t}\n\treturn label; \n}", "function iconsRedraw() {\n setTimeout(function(){\n if(instance.network)\n instance.network.redraw();\n if(instance.legend)\n instance.legend.redraw();\n }, 250);\n }", "set cxIcon(type) {\n this.setIcon(type);\n }", "function createMarkerIcons() {\n\t\t\tvar markerIconDot = {\n\t\t\t\turl: '/assets/images/1x1-pixel.png',\n\t\t\t\tsize: new google.maps.Size(1, 1),\n\t\t\t\torigin: new google.maps.Point(0, 0),\n\t\t\t\tanchor: new google.maps.Point(4, 4),\n\t\t\t\tscaledSize: null\n\t\t\t};\n\n\t\t\tvar markerIconSmallRed = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(16, 16),\n\t\t\t\torigin: new google.maps.Point(8, 85),\n\t\t\t\tanchor: new google.maps.Point(8, 12),\n\t\t\t\tscaledSize: null\n\t\t\t};\n\n\t\t\tvar markerIconLargeRed = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(20, 28),\n\t\t\t\torigin: new google.maps.Point(0, 0),\n\t\t\t\tanchor: new google.maps.Point(10, 24),\n\t\t\t\tscaledSize: new google.maps.Size(100, 66)\n\t\t\t};\n\n\t\t\tvar markerIconInvisRed = {\n\t\t\t\turl: '/assets/images/picture1.png',\n\t\t\t\tsize: new google.maps.Size(220, 230),\n\t\t\t\torigin: new google.maps.Point(0, 0),\n\t\t\t\tanchor: new google.maps.Point(3, 158)\n\t\t\t};\n\n\t\t\tvar markerIconLargeRedMain = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(20, 28),\n\t\t\t\torigin: new google.maps.Point(0, 0),\n\t\t\t\tanchor: new google.maps.Point(10, 24),\n\t\t\t\tscaledSize: new google.maps.Size(100, 66)\n\t\t\t};\n\n\t\t\tvar markerIconSmallBlue = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(16, 16),\n\t\t\t\torigin: new google.maps.Point(47, 85),\n\t\t\t\tanchor: new google.maps.Point(8, 12),\n\t\t\t\tscaledSize: null\n\t\t\t};\n\n\t\t\tvar markerIconLargeBlue = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(20, 28),\n\t\t\t\torigin: new google.maps.Point(27, 0),\n\t\t\t\tanchor: new google.maps.Point(9, 24),\n\t\t\t\tscaledSize: new google.maps.Size(100, 66)\n\t\t\t};\n\n\t\t\tvar markerIconSmallGreen = {};\n\n\t\t\tvar markerIconLargeGreen = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(20, 28),\n\t\t\t\torigin: new google.maps.Point(54, 0),\n\t\t\t\tanchor: new google.maps.Point(8, 24),\n\t\t\t\tscaledSize: new google.maps.Size(100, 66)\n\t\t\t};\n\n\t\t\tvar markerIconSmallOrange = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(16, 16),\n\t\t\t\torigin: new google.maps.Point(126, 85),\n\t\t\t\tanchor: new google.maps.Point(8, 12),\n\t\t\t\tscaledSize: null\n\t\t\t};\n\n\t\t\tvar markerIconLargeOrange = {\n\t\t\t\turl: '/assets/images/markers4.png',\n\t\t\t\tsize: new google.maps.Size(20, 28),\n\t\t\t\torigin: new google.maps.Point(81, 0),\n\t\t\t\tanchor: new google.maps.Point(8, 24),\n\t\t\t\tscaledSize: new google.maps.Size(100, 66)\n\t\t\t};\n\n\t\t\treturn {\n\t\t\t\tdot: markerIconDot,\n\t\t\t\tsmallRed: markerIconSmallRed,\n\t\t\t\tinvisRed: markerIconInvisRed,\n\t\t\t\tsmallBlue: markerIconSmallBlue,\n\t\t\t\tsmallGreen: markerIconSmallGreen,\n\t\t\t\tsmallOrange: markerIconSmallOrange,\n\t\t\t\tlargeRed: markerIconLargeRed,\n\t\t\t\tlargeRedMain: markerIconLargeRedMain,\n\t\t\t\tlargeBlue: markerIconLargeBlue,\n\t\t\t\tlargeGreen: markerIconLargeGreen,\n\t\t\t\tlargeOrange: markerIconLargeOrange\n\t\t\t};\n\t\t}", "function estado_icon(value) {\n var icon = \"TBL TBL-\" + value;\n return (\n '<samp class=\"' +\n icon +\n '\" title=\"' +\n value +\n '\"><p class=\"hidden \">' +\n value +\n \"</p></samp>\"\n );\n}", "icon(properties) {\n properties.tag = \"i\";\n properties.class = this.removeLeadingWhitespace(\n `${this.processContent(properties.class)} fas fa-${properties.icon}`\n );\n return this.getElement(properties);\n }", "function setIcon() {\n for (var i = 0; i < tabCollection.length; i++) {\n // for each element in collection\n if (tabObjects[i].icon === \"plus\") {\n // if current tab object is collapsed\n tabCollection[i].setAttribute(\"class\", \"fa-solid icon-plus\"); // set class to show collapsed icon\n } else if (tabObjects[i].icon === \"minus\") {\n // if current tab object is expanded\n tabCollection[i].setAttribute(\"class\", \"fa-solid icon-minus\"); // set class to show expanded icon\n }\n }\n }", "addIcon(...icons) {\n icons.forEach(icon => {\n this._svgDefinitions.set(withSuffix(icon.name, icon.theme), icon);\n });\n }", "function addIcon(name, data) {\n storage[name] = icon.fullIcon(data);\n}", "function displayPokemonIcons(names) {\n\t\tlet pokemonNamesPairs = names.split(\"\\n\");\n\t\tlet view = $(\"pokedex-view\");\n\t\tfor (let i = 0; i < pokemonNamesPairs.length; i++) {\n\t\t\tlet singlePokemonPair = pokemonNamesPairs[i].split(\":\");\n\t\t\tlet pokemonName = singlePokemonPair[0];\n\t\t\tlet pokemonImg = singlePokemonPair[1];\n\t\t\tlet newImg = document.createElement(\"img\");\n\t\t\tnewImg.setAttribute(\"src\", endPoint + \"sprites/\" + pokemonImg);\n\t\t\tnewImg.setAttribute(\"alt\", pokemonName);\n\t\t\tnewImg.setAttribute(\"id\", pokemonName);\n\t\t\tnewImg.classList.add(\"sprite\");\n\t\t\tif (starterPokemon.includes(pokemonName)){\n\t\t\t\tnewImg.classList.add(\"found\");\n\t\t\t\tnewImg.addEventListener(\"click\", helperToGetPokemonData);\n\t\t\t}\n\t\t\tview.appendChild(newImg);\n\n\t\t} \n\t}", "label() {\n if(this.props.columnType === Constants.getIn(['columnTypes', 'SIDEBAR'])) {\n return null\n }\n\n let labelLines = this.labelLines()\n\n // Clip long names, and append an ellipsis\n if (labelLines.length > 3) {\n labelLines = [labelLines[0], labelLines[1], labelLines[2]]\n labelLines[2] += '…'\n }\n\n const labelLengthExceed = labelLines.length * Constants.get('singleLineCategoryLabelHeight') > this.props.height\n\n let labelClassName = 'inactiveCategoryLabels'\n\n if(labelLengthExceed === true && this.checkHoverState() === false && this.filterboxActive() === false) {\n return null\n }\n\n if(this.checkHoverState() === true) {\n labelClassName = 'activeCategoryLabels'\n }\n\n let currentY = (this.props.height/2)\n let lineCount = 0\n currentY += (1 - (labelLines.length/2)) * \n Constants.get('singleLineCategoryLabelHeight')\n\n // Decrement just before it's increcemented inside the map.\n currentY -= Constants.get('singleLineCategoryLabelHeight')\n\n return <g>\n <text\n >\n {labelLines.map((line) => {\n currentY += Constants.get('singleLineCategoryLabelHeight')\n lineCount += 1\n return <tspan fill={this.fill} className={labelClassName} \n key={this.props.categoryName + 'CategoryLabelLine' + lineCount}\n y={currentY}\n x={this.props.width + Constants.get('categoryLabelOffset')}>\n {line}\n </tspan>\n })}\n </text>\n { this.filterbox(currentY) }\n </g>\n }", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-2\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-2-63c99abf.woff') format('woff')\"\n },\n icons: {\n 'Picture': '\\uE8B9',\n 'ChromeClose': '\\uE8BB',\n 'ShowResults': '\\uE8BC',\n 'Message': '\\uE8BD',\n 'CalendarDay': '\\uE8BF',\n 'CalendarWeek': '\\uE8C0',\n 'MailReplyAll': '\\uE8C2',\n 'Read': '\\uE8C3',\n 'Cut': '\\uE8C6',\n 'PaymentCard': '\\uE8C7',\n 'Copy': '\\uE8C8',\n 'Important': '\\uE8C9',\n 'MailReply': '\\uE8CA',\n 'GotoToday': '\\uE8D1',\n 'Font': '\\uE8D2',\n 'FontColor': '\\uE8D3',\n 'FolderFill': '\\uE8D5',\n 'Permissions': '\\uE8D7',\n 'DisableUpdates': '\\uE8D8',\n 'Unfavorite': '\\uE8D9',\n 'Italic': '\\uE8DB',\n 'Underline': '\\uE8DC',\n 'Bold': '\\uE8DD',\n 'MoveToFolder': '\\uE8DE',\n 'Dislike': '\\uE8E0',\n 'Like': '\\uE8E1',\n 'AlignCenter': '\\uE8E3',\n 'OpenFile': '\\uE8E5',\n 'ClearSelection': '\\uE8E6',\n 'FontDecrease': '\\uE8E7',\n 'FontIncrease': '\\uE8E8',\n 'FontSize': '\\uE8E9',\n 'CellPhone': '\\uE8EA',\n 'RepeatOne': '\\uE8ED',\n 'RepeatAll': '\\uE8EE',\n 'Calculator': '\\uE8EF',\n 'Library': '\\uE8F1',\n 'PostUpdate': '\\uE8F3',\n 'NewFolder': '\\uE8F4',\n 'CalendarReply': '\\uE8F5',\n 'UnsyncFolder': '\\uE8F6',\n 'SyncFolder': '\\uE8F7',\n 'BlockContact': '\\uE8F8',\n 'Accept': '\\uE8FB',\n 'BulletedList': '\\uE8FD',\n 'Preview': '\\uE8FF',\n 'News': '\\uE900',\n 'Chat': '\\uE901',\n 'Group': '\\uE902',\n 'World': '\\uE909',\n 'Comment': '\\uE90A',\n 'DockLeft': '\\uE90C',\n 'DockRight': '\\uE90D',\n 'Repair': '\\uE90F',\n 'Accounts': '\\uE910',\n 'Street': '\\uE913',\n 'RadioBullet': '\\uE915',\n 'Stopwatch': '\\uE916',\n 'Clock': '\\uE917',\n 'WorldClock': '\\uE918',\n 'AlarmClock': '\\uE919',\n 'Photo': '\\uE91B',\n 'ActionCenter': '\\uE91C',\n 'Hospital': '\\uE91D',\n 'Timer': '\\uE91E',\n 'FullCircleMask': '\\uE91F',\n 'LocationFill': '\\uE920',\n 'ChromeMinimize': '\\uE921',\n 'ChromeRestore': '\\uE923',\n 'Annotation': '\\uE924',\n 'Fingerprint': '\\uE928',\n 'Handwriting': '\\uE929',\n 'ChromeFullScreen': '\\uE92D',\n 'Completed': '\\uE930',\n 'Label': '\\uE932',\n 'FlickDown': '\\uE935',\n 'FlickUp': '\\uE936',\n 'FlickLeft': '\\uE937',\n 'FlickRight': '\\uE938',\n 'MiniExpand': '\\uE93A',\n 'MiniContract': '\\uE93B',\n 'Streaming': '\\uE93E',\n 'MusicInCollection': '\\uE940',\n 'OneDriveLogo': '\\uE941',\n 'CompassNW': '\\uE942',\n 'Code': '\\uE943',\n 'LightningBolt': '\\uE945',\n 'CalculatorMultiply': '\\uE947',\n 'CalculatorAddition': '\\uE948',\n 'CalculatorSubtract': '\\uE949',\n 'CalculatorPercentage': '\\uE94C',\n 'CalculatorEqualTo': '\\uE94E',\n 'PrintfaxPrinterFile': '\\uE956',\n 'StorageOptical': '\\uE958',\n 'Communications': '\\uE95A',\n 'Headset': '\\uE95B',\n 'Health': '\\uE95E',\n 'Webcam2': '\\uE960',\n 'FrontCamera': '\\uE96B',\n 'ChevronUpSmall': '\\uE96D'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-2\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-2-63c99abf.woff') format('woff')\"\n },\n icons: {\n 'Picture': '\\uE8B9',\n 'ChromeClose': '\\uE8BB',\n 'ShowResults': '\\uE8BC',\n 'Message': '\\uE8BD',\n 'CalendarDay': '\\uE8BF',\n 'CalendarWeek': '\\uE8C0',\n 'MailReplyAll': '\\uE8C2',\n 'Read': '\\uE8C3',\n 'Cut': '\\uE8C6',\n 'PaymentCard': '\\uE8C7',\n 'Copy': '\\uE8C8',\n 'Important': '\\uE8C9',\n 'MailReply': '\\uE8CA',\n 'GotoToday': '\\uE8D1',\n 'Font': '\\uE8D2',\n 'FontColor': '\\uE8D3',\n 'FolderFill': '\\uE8D5',\n 'Permissions': '\\uE8D7',\n 'DisableUpdates': '\\uE8D8',\n 'Unfavorite': '\\uE8D9',\n 'Italic': '\\uE8DB',\n 'Underline': '\\uE8DC',\n 'Bold': '\\uE8DD',\n 'MoveToFolder': '\\uE8DE',\n 'Dislike': '\\uE8E0',\n 'Like': '\\uE8E1',\n 'AlignCenter': '\\uE8E3',\n 'OpenFile': '\\uE8E5',\n 'ClearSelection': '\\uE8E6',\n 'FontDecrease': '\\uE8E7',\n 'FontIncrease': '\\uE8E8',\n 'FontSize': '\\uE8E9',\n 'CellPhone': '\\uE8EA',\n 'RepeatOne': '\\uE8ED',\n 'RepeatAll': '\\uE8EE',\n 'Calculator': '\\uE8EF',\n 'Library': '\\uE8F1',\n 'PostUpdate': '\\uE8F3',\n 'NewFolder': '\\uE8F4',\n 'CalendarReply': '\\uE8F5',\n 'UnsyncFolder': '\\uE8F6',\n 'SyncFolder': '\\uE8F7',\n 'BlockContact': '\\uE8F8',\n 'Accept': '\\uE8FB',\n 'BulletedList': '\\uE8FD',\n 'Preview': '\\uE8FF',\n 'News': '\\uE900',\n 'Chat': '\\uE901',\n 'Group': '\\uE902',\n 'World': '\\uE909',\n 'Comment': '\\uE90A',\n 'DockLeft': '\\uE90C',\n 'DockRight': '\\uE90D',\n 'Repair': '\\uE90F',\n 'Accounts': '\\uE910',\n 'Street': '\\uE913',\n 'RadioBullet': '\\uE915',\n 'Stopwatch': '\\uE916',\n 'Clock': '\\uE917',\n 'WorldClock': '\\uE918',\n 'AlarmClock': '\\uE919',\n 'Photo': '\\uE91B',\n 'ActionCenter': '\\uE91C',\n 'Hospital': '\\uE91D',\n 'Timer': '\\uE91E',\n 'FullCircleMask': '\\uE91F',\n 'LocationFill': '\\uE920',\n 'ChromeMinimize': '\\uE921',\n 'ChromeRestore': '\\uE923',\n 'Annotation': '\\uE924',\n 'Fingerprint': '\\uE928',\n 'Handwriting': '\\uE929',\n 'ChromeFullScreen': '\\uE92D',\n 'Completed': '\\uE930',\n 'Label': '\\uE932',\n 'FlickDown': '\\uE935',\n 'FlickUp': '\\uE936',\n 'FlickLeft': '\\uE937',\n 'FlickRight': '\\uE938',\n 'MiniExpand': '\\uE93A',\n 'MiniContract': '\\uE93B',\n 'Streaming': '\\uE93E',\n 'MusicInCollection': '\\uE940',\n 'OneDriveLogo': '\\uE941',\n 'CompassNW': '\\uE942',\n 'Code': '\\uE943',\n 'LightningBolt': '\\uE945',\n 'CalculatorMultiply': '\\uE947',\n 'CalculatorAddition': '\\uE948',\n 'CalculatorSubtract': '\\uE949',\n 'CalculatorPercentage': '\\uE94C',\n 'CalculatorEqualTo': '\\uE94E',\n 'PrintfaxPrinterFile': '\\uE956',\n 'StorageOptical': '\\uE958',\n 'Communications': '\\uE95A',\n 'Headset': '\\uE95B',\n 'Health': '\\uE95E',\n 'Webcam2': '\\uE960',\n 'FrontCamera': '\\uE96B',\n 'ChevronUpSmall': '\\uE96D'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function handleIcons(iconId, newClassName) {\n var span = document.getElementById(iconId);\n\n if(span==null) {\n return; //skip iconId target is null. This occurs when customIcon is set\n }\n if(isLeaf(span)) {\n return; //we do not handle leaf nodes\n }\n var currentClassName = span.className;\n removeClass(span, currentClassName);\n addClass(span, newClassName + \"Icon\");\n}", "function addResourcesLabel(widget) {\n try {\n widget.removeAll();\n widget.add(lootLabel, {row: 0, column: 0, colSpan: 4});\n widget.add(imgResearch, {row: 1, column: 0});\n widget.add(new qx.ui.basic.Label(ClientLib.Base.Util.formatNumbersCompact$0(cncloot.getResearch())), {row: 1, column: 1});\n widget.add(imgTiberium, {row: 1, column: 2});\n widget.add(new qx.ui.basic.Label(ClientLib.Base.Util.formatNumbersCompact$0(cncloot.getTiberium())), {row: 1, column: 3});\n widget.add(imgCrystal, {row: 1, column: 4});\n widget.add(new qx.ui.basic.Label(ClientLib.Base.Util.formatNumbersCompact$0(cncloot.getCrystal())) , {row: 1, column: 5});\n widget.add(imgCredits, {row: 1, column: 6});\n widget.add(new qx.ui.basic.Label(ClientLib.Base.Util.formatNumbersCompact$0(cncloot.getCredits())) , {row: 1, column: 7});\n\n } catch (e) {\n console.log(\"cncloot.addResourcesLabel(): \", e);\n }\n }", "function SentimentToIcon(sentiment) {\n // neutral\n if (Math.abs(sentiment) < 0.2) {\n return (\n <SvgIcon fontSize=\"large\">\n <path d=\"M9 14h6v1.5H9z\" />\n <circle cx=\"15.5\" cy=\"9.5\" r=\"1.5\" />\n <circle cx=\"8.5\" cy=\"9.5\" r=\"1.5\" />\n <path d=\"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z\" />\n </SvgIcon>\n );\n }\n if (sentiment < 0) {\n if (sentiment < -0.8) {\n return <SentimentVeryDissatisfiedOutlinedIcon fontSize=\"large\" />;\n }\n if (sentiment < -0.5) {\n return <SentimentVeryDissatisfiedIcon fontSize=\"large\" />;\n }\n return <SentimentDissatisfiedIcon fontSize=\"large\" />;\n } else {\n if (sentiment > 0.8) {\n return <SentimentVerySatisfiedOutlinedIcon fontSize=\"large\" />;\n }\n if (sentiment > 0.5) {\n return <SentimentVerySatisfiedIcon fontSize=\"large\" />;\n }\n return <SentimentSatisfiedAltIcon fontSize=\"large\" />;\n }\n}", "get labelStyle() {\n return !!this.icon && this.icon !== \"\" && this.showTextLabel === false\n ? \"offscreen\"\n : null;\n }", "function ThirdIcon() {\n this.setIcon(ThirdOne);\n}", "function printIcons(icons, contenitoreIcone) {\r\n icons.forEach((icon)=>{\r\n const {family, prefix, name, color} = icon;\r\n const html =//parte di html\r\n `<div class=\"icon\">\r\n <i class=\"${family} ${prefix}${name}\"\r\n style=\"color: ${color}\"></i>\r\n <div class=\"nomeIcona\">${name}</div>\r\n </div>\r\n `\r\n contenitoreIcone.append(html);\r\n return\r\n });\r\n\r\n\r\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-7\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-7-2b97bb99.woff') format('woff')\"\n },\n icons: {\n 'SingleBookmark': '\\uEDFF',\n 'SingleBookmarkSolid': '\\uEE00',\n 'DoubleChevronDown': '\\uEE04',\n 'FollowUser': '\\uEE05',\n 'ReplyAll': '\\uEE0A',\n 'WorkforceManagement': '\\uEE0F',\n 'RecruitmentManagement': '\\uEE12',\n 'Questionnaire': '\\uEE19',\n 'ManagerSelfService': '\\uEE23',\n 'ProductionFloorManagement': '\\uEE29',\n 'ProductRelease': '\\uEE2E',\n 'ProductVariant': '\\uEE30',\n 'ReplyMirrored': '\\uEE35',\n 'ReplyAllMirrored': '\\uEE36',\n 'Medal': '\\uEE38',\n 'AddGroup': '\\uEE3D',\n 'QuestionnaireMirrored': '\\uEE4B',\n 'CloudImportExport': '\\uEE55',\n 'TemporaryUser': '\\uEE58',\n 'CaretSolid16': '\\uEE62',\n 'GroupedDescending': '\\uEE66',\n 'GroupedAscending': '\\uEE67',\n 'AwayStatus': '\\uEE6A',\n 'MyMoviesTV': '\\uEE6C',\n 'GenericScan': '\\uEE6F',\n 'AustralianRules': '\\uEE70',\n 'WifiEthernet': '\\uEE77',\n 'TrackersMirrored': '\\uEE92',\n 'DateTimeMirrored': '\\uEE93',\n 'StopSolid': '\\uEE95',\n 'DoubleChevronUp12': '\\uEE96',\n 'DoubleChevronDown12': '\\uEE97',\n 'DoubleChevronLeft12': '\\uEE98',\n 'DoubleChevronRight12': '\\uEE99',\n 'CalendarAgenda': '\\uEE9A',\n 'ConnectVirtualMachine': '\\uEE9D',\n 'AddEvent': '\\uEEB5',\n 'AssetLibrary': '\\uEEB6',\n 'DataConnectionLibrary': '\\uEEB7',\n 'DocLibrary': '\\uEEB8',\n 'FormLibrary': '\\uEEB9',\n 'FormLibraryMirrored': '\\uEEBA',\n 'ReportLibrary': '\\uEEBB',\n 'ReportLibraryMirrored': '\\uEEBC',\n 'ContactCard': '\\uEEBD',\n 'CustomList': '\\uEEBE',\n 'CustomListMirrored': '\\uEEBF',\n 'IssueTracking': '\\uEEC0',\n 'IssueTrackingMirrored': '\\uEEC1',\n 'PictureLibrary': '\\uEEC2',\n 'OfficeAddinsLogo': '\\uEEC7',\n 'OfflineOneDriveParachute': '\\uEEC8',\n 'OfflineOneDriveParachuteDisabled': '\\uEEC9',\n 'TriangleSolidUp12': '\\uEECC',\n 'TriangleSolidDown12': '\\uEECD',\n 'TriangleSolidLeft12': '\\uEECE',\n 'TriangleSolidRight12': '\\uEECF',\n 'TriangleUp12': '\\uEED0',\n 'TriangleDown12': '\\uEED1',\n 'TriangleLeft12': '\\uEED2',\n 'TriangleRight12': '\\uEED3',\n 'ArrowUpRight8': '\\uEED4',\n 'ArrowDownRight8': '\\uEED5',\n 'DocumentSet': '\\uEED6',\n 'GoToDashboard': '\\uEEED',\n 'DelveAnalytics': '\\uEEEE',\n 'ArrowUpRightMirrored8': '\\uEEEF',\n 'ArrowDownRightMirrored8': '\\uEEF0',\n 'CompanyDirectory': '\\uEF0D',\n 'OpenEnrollment': '\\uEF1C',\n 'CompanyDirectoryMirrored': '\\uEF2B',\n 'OneDriveAdd': '\\uEF32',\n 'ProfileSearch': '\\uEF35',\n 'Header2': '\\uEF36',\n 'Header3': '\\uEF37',\n 'Header4': '\\uEF38',\n 'RingerSolid': '\\uEF3A',\n 'Eyedropper': '\\uEF3C',\n 'MarketDown': '\\uEF42',\n 'CalendarWorkWeek': '\\uEF51',\n 'SidePanel': '\\uEF52',\n 'GlobeFavorite': '\\uEF53',\n 'CaretTopLeftSolid8': '\\uEF54',\n 'CaretTopRightSolid8': '\\uEF55',\n 'ViewAll2': '\\uEF56',\n 'DocumentReply': '\\uEF57',\n 'PlayerSettings': '\\uEF58',\n 'ReceiptForward': '\\uEF59',\n 'ReceiptReply': '\\uEF5A',\n 'ReceiptCheck': '\\uEF5B',\n 'Fax': '\\uEF5C',\n 'RecurringEvent': '\\uEF5D',\n 'ReplyAlt': '\\uEF5E',\n 'ReplyAllAlt': '\\uEF5F',\n 'EditStyle': '\\uEF60',\n 'EditMail': '\\uEF61',\n 'Lifesaver': '\\uEF62',\n 'LifesaverLock': '\\uEF63',\n 'InboxCheck': '\\uEF64',\n 'FolderSearch': '\\uEF65'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-7\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-7-2b97bb99.woff') format('woff')\"\n },\n icons: {\n 'SingleBookmark': '\\uEDFF',\n 'SingleBookmarkSolid': '\\uEE00',\n 'DoubleChevronDown': '\\uEE04',\n 'FollowUser': '\\uEE05',\n 'ReplyAll': '\\uEE0A',\n 'WorkforceManagement': '\\uEE0F',\n 'RecruitmentManagement': '\\uEE12',\n 'Questionnaire': '\\uEE19',\n 'ManagerSelfService': '\\uEE23',\n 'ProductionFloorManagement': '\\uEE29',\n 'ProductRelease': '\\uEE2E',\n 'ProductVariant': '\\uEE30',\n 'ReplyMirrored': '\\uEE35',\n 'ReplyAllMirrored': '\\uEE36',\n 'Medal': '\\uEE38',\n 'AddGroup': '\\uEE3D',\n 'QuestionnaireMirrored': '\\uEE4B',\n 'CloudImportExport': '\\uEE55',\n 'TemporaryUser': '\\uEE58',\n 'CaretSolid16': '\\uEE62',\n 'GroupedDescending': '\\uEE66',\n 'GroupedAscending': '\\uEE67',\n 'AwayStatus': '\\uEE6A',\n 'MyMoviesTV': '\\uEE6C',\n 'GenericScan': '\\uEE6F',\n 'AustralianRules': '\\uEE70',\n 'WifiEthernet': '\\uEE77',\n 'TrackersMirrored': '\\uEE92',\n 'DateTimeMirrored': '\\uEE93',\n 'StopSolid': '\\uEE95',\n 'DoubleChevronUp12': '\\uEE96',\n 'DoubleChevronDown12': '\\uEE97',\n 'DoubleChevronLeft12': '\\uEE98',\n 'DoubleChevronRight12': '\\uEE99',\n 'CalendarAgenda': '\\uEE9A',\n 'ConnectVirtualMachine': '\\uEE9D',\n 'AddEvent': '\\uEEB5',\n 'AssetLibrary': '\\uEEB6',\n 'DataConnectionLibrary': '\\uEEB7',\n 'DocLibrary': '\\uEEB8',\n 'FormLibrary': '\\uEEB9',\n 'FormLibraryMirrored': '\\uEEBA',\n 'ReportLibrary': '\\uEEBB',\n 'ReportLibraryMirrored': '\\uEEBC',\n 'ContactCard': '\\uEEBD',\n 'CustomList': '\\uEEBE',\n 'CustomListMirrored': '\\uEEBF',\n 'IssueTracking': '\\uEEC0',\n 'IssueTrackingMirrored': '\\uEEC1',\n 'PictureLibrary': '\\uEEC2',\n 'OfficeAddinsLogo': '\\uEEC7',\n 'OfflineOneDriveParachute': '\\uEEC8',\n 'OfflineOneDriveParachuteDisabled': '\\uEEC9',\n 'TriangleSolidUp12': '\\uEECC',\n 'TriangleSolidDown12': '\\uEECD',\n 'TriangleSolidLeft12': '\\uEECE',\n 'TriangleSolidRight12': '\\uEECF',\n 'TriangleUp12': '\\uEED0',\n 'TriangleDown12': '\\uEED1',\n 'TriangleLeft12': '\\uEED2',\n 'TriangleRight12': '\\uEED3',\n 'ArrowUpRight8': '\\uEED4',\n 'ArrowDownRight8': '\\uEED5',\n 'DocumentSet': '\\uEED6',\n 'GoToDashboard': '\\uEEED',\n 'DelveAnalytics': '\\uEEEE',\n 'ArrowUpRightMirrored8': '\\uEEEF',\n 'ArrowDownRightMirrored8': '\\uEEF0',\n 'CompanyDirectory': '\\uEF0D',\n 'OpenEnrollment': '\\uEF1C',\n 'CompanyDirectoryMirrored': '\\uEF2B',\n 'OneDriveAdd': '\\uEF32',\n 'ProfileSearch': '\\uEF35',\n 'Header2': '\\uEF36',\n 'Header3': '\\uEF37',\n 'Header4': '\\uEF38',\n 'RingerSolid': '\\uEF3A',\n 'Eyedropper': '\\uEF3C',\n 'MarketDown': '\\uEF42',\n 'CalendarWorkWeek': '\\uEF51',\n 'SidePanel': '\\uEF52',\n 'GlobeFavorite': '\\uEF53',\n 'CaretTopLeftSolid8': '\\uEF54',\n 'CaretTopRightSolid8': '\\uEF55',\n 'ViewAll2': '\\uEF56',\n 'DocumentReply': '\\uEF57',\n 'PlayerSettings': '\\uEF58',\n 'ReceiptForward': '\\uEF59',\n 'ReceiptReply': '\\uEF5A',\n 'ReceiptCheck': '\\uEF5B',\n 'Fax': '\\uEF5C',\n 'RecurringEvent': '\\uEF5D',\n 'ReplyAlt': '\\uEF5E',\n 'ReplyAllAlt': '\\uEF5F',\n 'EditStyle': '\\uEF60',\n 'EditMail': '\\uEF61',\n 'Lifesaver': '\\uEF62',\n 'LifesaverLock': '\\uEF63',\n 'InboxCheck': '\\uEF64',\n 'FolderSearch': '\\uEF65'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function setupLabel() \n{\n\n if (jQuery('.label_check input').length) {\n jQuery('.label_check').each(function(){ \n jQuery(this).removeClass('c_on');\n });\n jQuery('.label_check input:checked').each(function(){ \n jQuery(this).parent('label').addClass('c_on');\n }); \n};\n\n\n\nif (jQuery('.label_radio input').length) {\n jQuery('.label_radio').each(function(){ \n jQuery(this).removeClass('r_on');\n });\n jQuery('.label_radio input:checked').each(function(){ \n jQuery(this).parent('label').addClass('r_on');\n });\n};\n\n\nif (jQuery('.label_thumb input').length) {\n jQuery('.label_thumb').each(function(){\n jQuery(this).removeClass('r_on');\n });\n jQuery('.label_thumb input:checked').each(function(){ \n jQuery(this).parent('label').addClass('r_on');\n });\n};\n\n\n\nif (jQuery('.label_tick input').length) {\n jQuery('.label_tick').each(function(){ \n jQuery(this).removeClass('r_on');\n });\n jQuery('.label_tick input:checked').each(function(){ \n jQuery(this).parent('label').addClass('r_on');\n });\n};\n\n\n\n\n}", "function icon(text, name) {\n let span = document.createElement(\"span\")\n span.className = \"menuicon \" + name\n span.title = name\n span.textContent = text\n return span\n}", "function updateLabels() {\n for (const label of [...document.getElementsByClassName('ehp-label')]) {\n label.parentElement.removeChild(label);\n }\n actions = {};\n for (const label of labels) {\n const element = label.element && (label.element instanceof Node ? label.element : label.element()) || document.createElement('div');\n actions[label.key] = label.action || (element => () => { element.click(); })(element.querySelector('a'));\n if (element) {\n element.style.position = 'relative';\n }\n const el = document.createElement('div');\n el.style.position = 'absolute';\n el.style.border = '1px solid var(--foreground)';\n el.style.borderRadius = '2px';\n el.style.top = '1px';\n el.style.left = '-10px';\n el.style.width = '1em';\n el.style.lineHeight = '1em';\n el.style.backgroundColor = 'var(--background)';\n el.style.color = 'var(--foreground)';\n el.style.textAlign = 'center';\n el.style.fontWeight = 'bold';\n el.style.display = 'none';\n el.classList.add('ehp-label');\n if (label.action) {\n el.style.top = 'calc(50% - 0.5em)';\n el.style.left = 'calc(50% - 0.5em)';\n }\n if (label.top) { el.style.top = label.top; }\n if (label.left) { el.style.left = label.left; }\n el.innerText = label.key;\n element.appendChild(el);\n }\n\n\n\n for (const label of [...document.getElementsByClassName('ehp-tag-label')]) {\n label.parentElement.removeChild(label);\n }\n tagActions = {};\n for (const label of tagLabels) {\n const element = label.element && (label.element instanceof Node ? label.element : label.element()) || document.createElement('div');\n tagActions[label.key] = label.action || (element => () => { element.click(); })(element.querySelector('a'));\n if (element) {\n element.style.position = 'relative';\n }\n const el = document.createElement('div');\n el.style.position = 'absolute';\n el.style.border = '1px solid var(--foreground)';\n el.style.borderRadius = '2px';\n el.style.top = '1px';\n el.style.left = '-10px';\n el.style.width = '1em';\n el.style.lineHeight = '1em';\n el.style.backgroundColor = 'var(--background)';\n el.style.color = 'var(--foreground)';\n el.style.textAlign = 'center';\n el.style.fontWeight = 'bold';\n el.style.display = 'none';\n el.classList.add('ehp-tag-label');\n if (label.action) {\n el.style.top = 'calc(50% - 0.5em)';\n el.style.left = 'calc(50% - 0.5em)';\n }\n if (label.top) { el.style.top = label.top; }\n if (label.left) { el.style.left = label.left; }\n el.innerText = label.key;\n element.appendChild(el);\n }\n }", "getIcons(content) {\n switch (content) {\n case \"Logout\":\n return (\n <>\n <FiLogOut size=\"0.9rem\" />\n </>\n );\n case \"Login\":\n return (\n <>\n <FiLogIn size=\"0.9rem\" />\n </>\n );\n case \"Profile\":\n return (\n <>\n <FiUserPlus size=\"0.9rem\" />\n </>\n );\n case \"Help\":\n return (\n <>\n <FiShoppingCart size=\"0.9rem\" />\n </>\n );\n case \"Home\":\n return (\n <>\n <FiUser size=\"0.9rem\" />\n </>\n );\n case \"About\":\n return (\n <>\n <FiClipboard size=\"0.9rem\" />\n </>\n );\n case \"Contact\":\n return (\n <>\n <BsGift size=\"0.9rem\" />\n </>\n );\n case \"Staff Manager\":\n return (\n <>\n <GrUserSettings size=\"0.9rem\" />\n </>\n );\n default:\n return <></>;\n }\n }", "_updateLabels() {\n if (this._reviewView.hasOpenIssues()) {\n this._$boxStatus.addClass('has-issues');\n this._$fixItLabel\n .show()\n .css({\n opacity: 1,\n left: 0,\n });\n } else {\n this._$fixItLabel.css({\n opacity: 0,\n left: '-100px',\n });\n this._$boxStatus.removeClass('has-issues');\n }\n }", "_createIconHtml(iconName) {\n return `<i class=\"material-icons\">${iconName}</i>`;\n }", "getIcon_() {\n return this.isCloudGamingDevice_ ? 'oobe-32:game-controller' :\n 'oobe-32:checkmark';\n }", "_updateLabels() {\n this._updateLabel(this._$fixItLabel,\n this._reviewView.hasOpenIssues(),\n 'has-issues');\n this._updateLabel(this._$shipItLabel,\n this.model.get('review').get('shipIt'),\n 'ship-it');\n }", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-1\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-1-4d521695.woff') format('woff')\"\n },\n icons: {\n 'Paste': '\\uE77F',\n 'WindowsLogo': '\\uE782',\n 'Error': '\\uE783',\n 'GripperBarVertical': '\\uE784',\n 'Unlock': '\\uE785',\n 'Slideshow': '\\uE786',\n 'Trim': '\\uE78A',\n 'AutoEnhanceOn': '\\uE78D',\n 'AutoEnhanceOff': '\\uE78E',\n 'Color': '\\uE790',\n 'SaveAs': '\\uE792',\n 'Light': '\\uE793',\n 'Filters': '\\uE795',\n 'AspectRatio': '\\uE799',\n 'Contrast': '\\uE7A1',\n 'Redo': '\\uE7A6',\n 'Crop': '\\uE7A8',\n 'PhotoCollection': '\\uE7AA',\n 'Album': '\\uE7AB',\n 'Rotate': '\\uE7AD',\n 'PanoIndicator': '\\uE7B0',\n 'Translate': '\\uE7B2',\n 'RedEye': '\\uE7B3',\n 'ViewOriginal': '\\uE7B4',\n 'ThumbnailView': '\\uE7B6',\n 'Package': '\\uE7B8',\n 'Telemarketer': '\\uE7B9',\n 'Warning': '\\uE7BA',\n 'Financial': '\\uE7BB',\n 'Education': '\\uE7BE',\n 'ShoppingCart': '\\uE7BF',\n 'Train': '\\uE7C0',\n 'Move': '\\uE7C2',\n 'TouchPointer': '\\uE7C9',\n 'Merge': '\\uE7D5',\n 'TurnRight': '\\uE7DB',\n 'Ferry': '\\uE7E3',\n 'Highlight': '\\uE7E6',\n 'PowerButton': '\\uE7E8',\n 'Tab': '\\uE7E9',\n 'Admin': '\\uE7EF',\n 'TVMonitor': '\\uE7F4',\n 'Speakers': '\\uE7F5',\n 'Game': '\\uE7FC',\n 'HorizontalTabKey': '\\uE7FD',\n 'UnstackSelected': '\\uE7FE',\n 'StackIndicator': '\\uE7FF',\n 'Nav2DMapView': '\\uE800',\n 'StreetsideSplitMinimize': '\\uE802',\n 'Car': '\\uE804',\n 'Bus': '\\uE806',\n 'EatDrink': '\\uE807',\n 'SeeDo': '\\uE808',\n 'LocationCircle': '\\uE80E',\n 'Home': '\\uE80F',\n 'SwitcherStartEnd': '\\uE810',\n 'ParkingLocation': '\\uE811',\n 'IncidentTriangle': '\\uE814',\n 'Touch': '\\uE815',\n 'MapDirections': '\\uE816',\n 'CaretHollow': '\\uE817',\n 'CaretSolid': '\\uE818',\n 'History': '\\uE81C',\n 'Location': '\\uE81D',\n 'MapLayers': '\\uE81E',\n 'SearchNearby': '\\uE820',\n 'Work': '\\uE821',\n 'Recent': '\\uE823',\n 'Hotel': '\\uE824',\n 'Bank': '\\uE825',\n 'LocationDot': '\\uE827',\n 'Dictionary': '\\uE82D',\n 'ChromeBack': '\\uE830',\n 'FolderOpen': '\\uE838',\n 'PinnedFill': '\\uE842',\n 'RevToggleKey': '\\uE845',\n 'USB': '\\uE88E',\n 'Previous': '\\uE892',\n 'Next': '\\uE893',\n 'Sync': '\\uE895',\n 'Help': '\\uE897',\n 'Emoji': '\\uE899',\n 'MailForward': '\\uE89C',\n 'ClosePane': '\\uE89F',\n 'OpenPane': '\\uE8A0',\n 'PreviewLink': '\\uE8A1',\n 'ZoomIn': '\\uE8A3',\n 'Bookmarks': '\\uE8A4',\n 'Document': '\\uE8A5',\n 'ProtectedDocument': '\\uE8A6',\n 'OpenInNewWindow': '\\uE8A7',\n 'MailFill': '\\uE8A8',\n 'ViewAll': '\\uE8A9',\n 'Switch': '\\uE8AB',\n 'Rename': '\\uE8AC',\n 'Go': '\\uE8AD',\n 'Remote': '\\uE8AF',\n 'SelectAll': '\\uE8B3',\n 'Orientation': '\\uE8B4',\n 'Import': '\\uE8B5'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-1\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-1-4d521695.woff') format('woff')\"\n },\n icons: {\n 'Paste': '\\uE77F',\n 'WindowsLogo': '\\uE782',\n 'Error': '\\uE783',\n 'GripperBarVertical': '\\uE784',\n 'Unlock': '\\uE785',\n 'Slideshow': '\\uE786',\n 'Trim': '\\uE78A',\n 'AutoEnhanceOn': '\\uE78D',\n 'AutoEnhanceOff': '\\uE78E',\n 'Color': '\\uE790',\n 'SaveAs': '\\uE792',\n 'Light': '\\uE793',\n 'Filters': '\\uE795',\n 'AspectRatio': '\\uE799',\n 'Contrast': '\\uE7A1',\n 'Redo': '\\uE7A6',\n 'Crop': '\\uE7A8',\n 'PhotoCollection': '\\uE7AA',\n 'Album': '\\uE7AB',\n 'Rotate': '\\uE7AD',\n 'PanoIndicator': '\\uE7B0',\n 'Translate': '\\uE7B2',\n 'RedEye': '\\uE7B3',\n 'ViewOriginal': '\\uE7B4',\n 'ThumbnailView': '\\uE7B6',\n 'Package': '\\uE7B8',\n 'Telemarketer': '\\uE7B9',\n 'Warning': '\\uE7BA',\n 'Financial': '\\uE7BB',\n 'Education': '\\uE7BE',\n 'ShoppingCart': '\\uE7BF',\n 'Train': '\\uE7C0',\n 'Move': '\\uE7C2',\n 'TouchPointer': '\\uE7C9',\n 'Merge': '\\uE7D5',\n 'TurnRight': '\\uE7DB',\n 'Ferry': '\\uE7E3',\n 'Highlight': '\\uE7E6',\n 'PowerButton': '\\uE7E8',\n 'Tab': '\\uE7E9',\n 'Admin': '\\uE7EF',\n 'TVMonitor': '\\uE7F4',\n 'Speakers': '\\uE7F5',\n 'Game': '\\uE7FC',\n 'HorizontalTabKey': '\\uE7FD',\n 'UnstackSelected': '\\uE7FE',\n 'StackIndicator': '\\uE7FF',\n 'Nav2DMapView': '\\uE800',\n 'StreetsideSplitMinimize': '\\uE802',\n 'Car': '\\uE804',\n 'Bus': '\\uE806',\n 'EatDrink': '\\uE807',\n 'SeeDo': '\\uE808',\n 'LocationCircle': '\\uE80E',\n 'Home': '\\uE80F',\n 'SwitcherStartEnd': '\\uE810',\n 'ParkingLocation': '\\uE811',\n 'IncidentTriangle': '\\uE814',\n 'Touch': '\\uE815',\n 'MapDirections': '\\uE816',\n 'CaretHollow': '\\uE817',\n 'CaretSolid': '\\uE818',\n 'History': '\\uE81C',\n 'Location': '\\uE81D',\n 'MapLayers': '\\uE81E',\n 'SearchNearby': '\\uE820',\n 'Work': '\\uE821',\n 'Recent': '\\uE823',\n 'Hotel': '\\uE824',\n 'Bank': '\\uE825',\n 'LocationDot': '\\uE827',\n 'Dictionary': '\\uE82D',\n 'ChromeBack': '\\uE830',\n 'FolderOpen': '\\uE838',\n 'PinnedFill': '\\uE842',\n 'RevToggleKey': '\\uE845',\n 'USB': '\\uE88E',\n 'Previous': '\\uE892',\n 'Next': '\\uE893',\n 'Sync': '\\uE895',\n 'Help': '\\uE897',\n 'Emoji': '\\uE899',\n 'MailForward': '\\uE89C',\n 'ClosePane': '\\uE89F',\n 'OpenPane': '\\uE8A0',\n 'PreviewLink': '\\uE8A1',\n 'ZoomIn': '\\uE8A3',\n 'Bookmarks': '\\uE8A4',\n 'Document': '\\uE8A5',\n 'ProtectedDocument': '\\uE8A6',\n 'OpenInNewWindow': '\\uE8A7',\n 'MailFill': '\\uE8A8',\n 'ViewAll': '\\uE8A9',\n 'Switch': '\\uE8AB',\n 'Rename': '\\uE8AC',\n 'Go': '\\uE8AD',\n 'Remote': '\\uE8AF',\n 'SelectAll': '\\uE8B3',\n 'Orientation': '\\uE8B4',\n 'Import': '\\uE8B5'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function clusterIconCreate() {\n\treturn ( \n\t\t\tfunction (cluster) {\n\t\t\t\tvar childCount = cluster.getChildCount();\n\n\t\t\t\tvar c = ' marker-cluster-';\n\t\t\t\tif (childCount < 10) {\n\t\t\t\t\tc += 'small';\n\t\t\t\t} else if (childCount < 100) {\n\t\t\t\t\tc += 'medium';\n\t\t\t\t} else {\n\t\t\t\t\tc += 'large';\n\t\t\t\t}\n\t\t\t\tif(childCount>1){\n\t\t\t\t\treturn new L.DivIcon({html: '<div><span>' + childCount + '</span></div>', \n\t\t\t\t\t\t\t\t\t\t className: 'marker-cluster' + c,\n\t\t\t\t\t\t\t\t\t\t iconSize: new L.Point(40, 40) });\n\t\t\t\t}else{\n\t\t\t\t\treturn iconPulsingSmall;\n\t\t\t\t}\n\t\t\t}\n\t)\n}", "function setupLabel() \r\n{\r\n\r\n if (jQuery('.label_check input').length) {\r\n jQuery('.label_check').each(function(){ \r\n jQuery(this).removeClass('c_on');\r\n });\r\n jQuery('.label_check input:checked').each(function(){ \r\n jQuery(this).parent('label').addClass('c_on');\r\n }); \r\n};\r\n\r\n\r\n\r\nif (jQuery('.label_radio input').length) {\r\n jQuery('.label_radio').each(function(){ \r\n jQuery(this).removeClass('r_on');\r\n });\r\n jQuery('.label_radio input:checked').each(function(){ \r\n jQuery(this).parent('label').addClass('r_on');\r\n\r\n });\r\n};\r\n\r\nif (jQuery('.label_thumb input').length) {\r\n jQuery('.label_thumb').each(function(){ \r\n jQuery(this).removeClass('r_on');\r\n });\r\n jQuery('.label_thumb input:checked').each(function(){ \r\n jQuery(this).parent('label').addClass('r_on');\r\n });\r\n};\r\n\r\n\r\n\r\nif (jQuery('.label_tick input').length) {\r\n jQuery('.label_tick').each(function(){ \r\n jQuery(this).removeClass('r_on');\r\n });\r\n jQuery('.label_tick input:checked').each(function(){ \r\n jQuery(this).parent('label').addClass('r_on');\r\n });\r\n};\r\n\r\n\r\n\r\n\r\n}", "displayIcon() {\n switch(this.determineCurator()) {\n case \"Recommended\":\n return(\n <div className=\"percent\">{this.state.boardDetails.relevance}%</div>\n );\n case \"Discovered\":\n return(\n <div className=\"icon\">\n <img className=\"tanjo-icon\" src=\"//tanjo.s3.amazonaws.com/assets/tanjo-icons/icon-discovered-by-tanjo-black.svg\" />\n </div>\n );\n case \"Board Header\":\n return(\n <div className=\"icon\">\n <img className=\"tanjo-icon\" src=\"//tanjo.s3.amazonaws.com/assets/tanjo-icons/icon-save-outline-white.svg\" />\n </div>\n );\n case \"Board Owner Header\":\n return(\n <div className=\"icon\">\n <img className=\"tanjo-icon\" src=\"//tanjo.s3.amazonaws.com/assets/icons/saved-by-you.svg\" />\n </div>\n );\n case \"Persona Header\":\n return(\n <div className=\"icon\">\n <img className=\"tanjo-icon\" src=\"//tanjo.s3.amazonaws.com/assets/tanjo-icons/icon-save-outline-white.svg\" />\n </div>\n );\n default:\n return(\n <div className=\"icon\">\n <img className=\"tanjo-icon\" src=\"//tanjo.s3.amazonaws.com/assets/tanjo-icons/icon-saved-by-username-black.svg\" />\n </div>\n );\n }\n }", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-6\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-6-ef6fd590.woff') format('woff')\"\n },\n icons: {\n 'SwayLogoInverse': '\\uED29',\n 'OutOfOffice': '\\uED34',\n 'Trophy': '\\uED3F',\n 'ReopenPages': '\\uED50',\n 'EmojiTabSymbols': '\\uED58',\n 'AADLogo': '\\uED68',\n 'AccessLogo': '\\uED69',\n 'AdminALogoInverse32': '\\uED6A',\n 'AdminCLogoInverse32': '\\uED6B',\n 'AdminDLogoInverse32': '\\uED6C',\n 'AdminELogoInverse32': '\\uED6D',\n 'AdminLLogoInverse32': '\\uED6E',\n 'AdminMLogoInverse32': '\\uED6F',\n 'AdminOLogoInverse32': '\\uED70',\n 'AdminPLogoInverse32': '\\uED71',\n 'AdminSLogoInverse32': '\\uED72',\n 'AdminYLogoInverse32': '\\uED73',\n 'DelveLogoInverse': '\\uED76',\n 'ExchangeLogoInverse': '\\uED78',\n 'LyncLogo': '\\uED79',\n 'OfficeVideoLogoInverse': '\\uED7A',\n 'SocialListeningLogo': '\\uED7C',\n 'VisioLogoInverse': '\\uED7D',\n 'Balloons': '\\uED7E',\n 'Cat': '\\uED7F',\n 'MailAlert': '\\uED80',\n 'MailCheck': '\\uED81',\n 'MailLowImportance': '\\uED82',\n 'MailPause': '\\uED83',\n 'MailRepeat': '\\uED84',\n 'SecurityGroup': '\\uED85',\n 'Table': '\\uED86',\n 'VoicemailForward': '\\uED87',\n 'VoicemailReply': '\\uED88',\n 'Waffle': '\\uED89',\n 'RemoveEvent': '\\uED8A',\n 'EventInfo': '\\uED8B',\n 'ForwardEvent': '\\uED8C',\n 'WipePhone': '\\uED8D',\n 'AddOnlineMeeting': '\\uED8E',\n 'JoinOnlineMeeting': '\\uED8F',\n 'RemoveLink': '\\uED90',\n 'PeopleBlock': '\\uED91',\n 'PeopleRepeat': '\\uED92',\n 'PeopleAlert': '\\uED93',\n 'PeoplePause': '\\uED94',\n 'TransferCall': '\\uED95',\n 'AddPhone': '\\uED96',\n 'UnknownCall': '\\uED97',\n 'NoteReply': '\\uED98',\n 'NoteForward': '\\uED99',\n 'NotePinned': '\\uED9A',\n 'RemoveOccurrence': '\\uED9B',\n 'Timeline': '\\uED9C',\n 'EditNote': '\\uED9D',\n 'CircleHalfFull': '\\uED9E',\n 'Room': '\\uED9F',\n 'Unsubscribe': '\\uEDA0',\n 'Subscribe': '\\uEDA1',\n 'HardDrive': '\\uEDA2',\n 'RecurringTask': '\\uEDB2',\n 'TaskManager': '\\uEDB7',\n 'TaskManagerMirrored': '\\uEDB8',\n 'Combine': '\\uEDBB',\n 'Split': '\\uEDBC',\n 'DoubleChevronUp': '\\uEDBD',\n 'DoubleChevronLeft': '\\uEDBE',\n 'DoubleChevronRight': '\\uEDBF',\n 'TextBox': '\\uEDC2',\n 'TextField': '\\uEDC3',\n 'NumberField': '\\uEDC4',\n 'Dropdown': '\\uEDC5',\n 'PenWorkspace': '\\uEDC6',\n 'BookingsLogo': '\\uEDC7',\n 'ClassNotebookLogoInverse': '\\uEDC8',\n 'DelveAnalyticsLogo': '\\uEDCA',\n 'DocsLogoInverse': '\\uEDCB',\n 'Dynamics365Logo': '\\uEDCC',\n 'DynamicSMBLogo': '\\uEDCD',\n 'OfficeAssistantLogo': '\\uEDCE',\n 'OfficeStoreLogo': '\\uEDCF',\n 'OneNoteEduLogoInverse': '\\uEDD0',\n 'PlannerLogo': '\\uEDD1',\n 'PowerApps': '\\uEDD2',\n 'Suitcase': '\\uEDD3',\n 'ProjectLogoInverse': '\\uEDD4',\n 'CaretLeft8': '\\uEDD5',\n 'CaretRight8': '\\uEDD6',\n 'CaretUp8': '\\uEDD7',\n 'CaretDown8': '\\uEDD8',\n 'CaretLeftSolid8': '\\uEDD9',\n 'CaretRightSolid8': '\\uEDDA',\n 'CaretUpSolid8': '\\uEDDB',\n 'CaretDownSolid8': '\\uEDDC',\n 'ClearFormatting': '\\uEDDD',\n 'Superscript': '\\uEDDE',\n 'Subscript': '\\uEDDF',\n 'Strikethrough': '\\uEDE0',\n 'Export': '\\uEDE1',\n 'ExportMirrored': '\\uEDE2'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-6\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-6-ef6fd590.woff') format('woff')\"\n },\n icons: {\n 'SwayLogoInverse': '\\uED29',\n 'OutOfOffice': '\\uED34',\n 'Trophy': '\\uED3F',\n 'ReopenPages': '\\uED50',\n 'EmojiTabSymbols': '\\uED58',\n 'AADLogo': '\\uED68',\n 'AccessLogo': '\\uED69',\n 'AdminALogoInverse32': '\\uED6A',\n 'AdminCLogoInverse32': '\\uED6B',\n 'AdminDLogoInverse32': '\\uED6C',\n 'AdminELogoInverse32': '\\uED6D',\n 'AdminLLogoInverse32': '\\uED6E',\n 'AdminMLogoInverse32': '\\uED6F',\n 'AdminOLogoInverse32': '\\uED70',\n 'AdminPLogoInverse32': '\\uED71',\n 'AdminSLogoInverse32': '\\uED72',\n 'AdminYLogoInverse32': '\\uED73',\n 'DelveLogoInverse': '\\uED76',\n 'ExchangeLogoInverse': '\\uED78',\n 'LyncLogo': '\\uED79',\n 'OfficeVideoLogoInverse': '\\uED7A',\n 'SocialListeningLogo': '\\uED7C',\n 'VisioLogoInverse': '\\uED7D',\n 'Balloons': '\\uED7E',\n 'Cat': '\\uED7F',\n 'MailAlert': '\\uED80',\n 'MailCheck': '\\uED81',\n 'MailLowImportance': '\\uED82',\n 'MailPause': '\\uED83',\n 'MailRepeat': '\\uED84',\n 'SecurityGroup': '\\uED85',\n 'Table': '\\uED86',\n 'VoicemailForward': '\\uED87',\n 'VoicemailReply': '\\uED88',\n 'Waffle': '\\uED89',\n 'RemoveEvent': '\\uED8A',\n 'EventInfo': '\\uED8B',\n 'ForwardEvent': '\\uED8C',\n 'WipePhone': '\\uED8D',\n 'AddOnlineMeeting': '\\uED8E',\n 'JoinOnlineMeeting': '\\uED8F',\n 'RemoveLink': '\\uED90',\n 'PeopleBlock': '\\uED91',\n 'PeopleRepeat': '\\uED92',\n 'PeopleAlert': '\\uED93',\n 'PeoplePause': '\\uED94',\n 'TransferCall': '\\uED95',\n 'AddPhone': '\\uED96',\n 'UnknownCall': '\\uED97',\n 'NoteReply': '\\uED98',\n 'NoteForward': '\\uED99',\n 'NotePinned': '\\uED9A',\n 'RemoveOccurrence': '\\uED9B',\n 'Timeline': '\\uED9C',\n 'EditNote': '\\uED9D',\n 'CircleHalfFull': '\\uED9E',\n 'Room': '\\uED9F',\n 'Unsubscribe': '\\uEDA0',\n 'Subscribe': '\\uEDA1',\n 'HardDrive': '\\uEDA2',\n 'RecurringTask': '\\uEDB2',\n 'TaskManager': '\\uEDB7',\n 'TaskManagerMirrored': '\\uEDB8',\n 'Combine': '\\uEDBB',\n 'Split': '\\uEDBC',\n 'DoubleChevronUp': '\\uEDBD',\n 'DoubleChevronLeft': '\\uEDBE',\n 'DoubleChevronRight': '\\uEDBF',\n 'TextBox': '\\uEDC2',\n 'TextField': '\\uEDC3',\n 'NumberField': '\\uEDC4',\n 'Dropdown': '\\uEDC5',\n 'PenWorkspace': '\\uEDC6',\n 'BookingsLogo': '\\uEDC7',\n 'ClassNotebookLogoInverse': '\\uEDC8',\n 'DelveAnalyticsLogo': '\\uEDCA',\n 'DocsLogoInverse': '\\uEDCB',\n 'Dynamics365Logo': '\\uEDCC',\n 'DynamicSMBLogo': '\\uEDCD',\n 'OfficeAssistantLogo': '\\uEDCE',\n 'OfficeStoreLogo': '\\uEDCF',\n 'OneNoteEduLogoInverse': '\\uEDD0',\n 'PlannerLogo': '\\uEDD1',\n 'PowerApps': '\\uEDD2',\n 'Suitcase': '\\uEDD3',\n 'ProjectLogoInverse': '\\uEDD4',\n 'CaretLeft8': '\\uEDD5',\n 'CaretRight8': '\\uEDD6',\n 'CaretUp8': '\\uEDD7',\n 'CaretDown8': '\\uEDD8',\n 'CaretLeftSolid8': '\\uEDD9',\n 'CaretRightSolid8': '\\uEDDA',\n 'CaretUpSolid8': '\\uEDDB',\n 'CaretDownSolid8': '\\uEDDC',\n 'ClearFormatting': '\\uEDDD',\n 'Superscript': '\\uEDDE',\n 'Subscript': '\\uEDDF',\n 'Strikethrough': '\\uEDE0',\n 'Export': '\\uEDE1',\n 'ExportMirrored': '\\uEDE2'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function iconFormat(state) {\n var originalOption = state.element;\n return \"<i class='icon-\" + $(originalOption).data('icon') + \"'></i>\" + state.text;\n }", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none',\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-a13498cf.woff') format('woff')\",\n },\n icons: {\n GlobalNavButton: '\\uE700',\n ChevronDown: '\\uE70D',\n ChevronUp: '\\uE70E',\n Edit: '\\uE70F',\n Add: '\\uE710',\n Cancel: '\\uE711',\n More: '\\uE712',\n Settings: '\\uE713',\n Mail: '\\uE715',\n Filter: '\\uE71C',\n Search: '\\uE721',\n Share: '\\uE72D',\n BlockedSite: '\\uE72F',\n FavoriteStar: '\\uE734',\n FavoriteStarFill: '\\uE735',\n CheckMark: '\\uE73E',\n Delete: '\\uE74D',\n ChevronLeft: '\\uE76B',\n ChevronRight: '\\uE76C',\n Calendar: '\\uE787',\n Megaphone: '\\uE789',\n Undo: '\\uE7A7',\n Flag: '\\uE7C1',\n Page: '\\uE7C3',\n Pinned: '\\uE840',\n View: '\\uE890',\n Clear: '\\uE894',\n Download: '\\uE896',\n Upload: '\\uE898',\n Folder: '\\uE8B7',\n Sort: '\\uE8CB',\n AlignRight: '\\uE8E2',\n AlignLeft: '\\uE8E4',\n Tag: '\\uE8EC',\n AddFriend: '\\uE8FA',\n Info: '\\uE946',\n SortLines: '\\uE9D0',\n List: '\\uEA37',\n CircleRing: '\\uEA3A',\n Heart: '\\uEB51',\n HeartFill: '\\uEB52',\n Tiles: '\\uECA5',\n Embed: '\\uECCE',\n Glimmer: '\\uECF4',\n Ascending: '\\uEDC0',\n Descending: '\\uEDC1',\n SortUp: '\\uEE68',\n SortDown: '\\uEE69',\n SyncToPC: '\\uEE6E',\n LargeGrid: '\\uEECB',\n SkypeCheck: '\\uEF80',\n SkypeClock: '\\uEF81',\n SkypeMinus: '\\uEF82',\n ClearFilter: '\\uEF8F',\n Flow: '\\uEF90',\n StatusCircleCheckmark: '\\uF13E',\n MoreVertical: '\\uF2BC',\n },\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none',\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-a13498cf.woff') format('woff')\",\n },\n icons: {\n GlobalNavButton: '\\uE700',\n ChevronDown: '\\uE70D',\n ChevronUp: '\\uE70E',\n Edit: '\\uE70F',\n Add: '\\uE710',\n Cancel: '\\uE711',\n More: '\\uE712',\n Settings: '\\uE713',\n Mail: '\\uE715',\n Filter: '\\uE71C',\n Search: '\\uE721',\n Share: '\\uE72D',\n BlockedSite: '\\uE72F',\n FavoriteStar: '\\uE734',\n FavoriteStarFill: '\\uE735',\n CheckMark: '\\uE73E',\n Delete: '\\uE74D',\n ChevronLeft: '\\uE76B',\n ChevronRight: '\\uE76C',\n Calendar: '\\uE787',\n Megaphone: '\\uE789',\n Undo: '\\uE7A7',\n Flag: '\\uE7C1',\n Page: '\\uE7C3',\n Pinned: '\\uE840',\n View: '\\uE890',\n Clear: '\\uE894',\n Download: '\\uE896',\n Upload: '\\uE898',\n Folder: '\\uE8B7',\n Sort: '\\uE8CB',\n AlignRight: '\\uE8E2',\n AlignLeft: '\\uE8E4',\n Tag: '\\uE8EC',\n AddFriend: '\\uE8FA',\n Info: '\\uE946',\n SortLines: '\\uE9D0',\n List: '\\uEA37',\n CircleRing: '\\uEA3A',\n Heart: '\\uEB51',\n HeartFill: '\\uEB52',\n Tiles: '\\uECA5',\n Embed: '\\uECCE',\n Glimmer: '\\uECF4',\n Ascending: '\\uEDC0',\n Descending: '\\uEDC1',\n SortUp: '\\uEE68',\n SortDown: '\\uEE69',\n SyncToPC: '\\uEE6E',\n LargeGrid: '\\uEECB',\n SkypeCheck: '\\uEF80',\n SkypeClock: '\\uEF81',\n SkypeMinus: '\\uEF82',\n ClearFilter: '\\uEF8F',\n Flow: '\\uEF90',\n StatusCircleCheckmark: '\\uF13E',\n MoreVertical: '\\uF2BC',\n },\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function icon(str, click) {\n return '<span class=\"glyphicon glyphicon-'+str+'\"'\n + (typeof click != \"undefined\" ? ' onclick=\"'+click+'\" style=\"cursor:pointer\"':'')\n +'></span>';\n}", "bIcon(properties) {\n properties.tag = \"i\";\n properties.class = this.removeLeadingWhitespace(\n `${this.processContent(properties.class)} fab fa-${properties.icon}`\n );\n\n return this.getElement(properties);\n }", "function addicon() {\n var lists = $(\"ul.sub-group-list > li\");\n\n $(lists).has(\"span:contains('ARTICLE')\").prepend('<i style=\"font-size:15px;color:rgba(80, 80, 80, 0.97);padding-right:5px;cursor:pointer;height:14px;width:13px;\" class=\"fa fa-plus\" ></i>').wrap('<div class=\"icon\"></div>');\n $(lists).has(\"span:contains('TOPIC')\").wrap('<div class=\"maintopic\"></div>');\n $(lists).find(\".article-title\").text('A');\n $(lists).find(\".topic-title\").text('T');\n $(lists).find(\".issue-title\").text('I');\n\n $(lists).find(\"i\").addClass(\"fa fa-caret-down\");\n\n if ($(\"div.icon + div.icon\").length) {\n //$(\"div.icon + div.icon\").prev().find('i').css('display', 'none');\n $(\"div.icon + div.icon\").prev().find('i').remove();\n\n }\n if ($(\"div.icon + div.maintopic\").length) {\n //$(\"div.icon + div.maintopic\").prev().find('i').css('display', 'none');\n $(\"div.icon + div.maintopic\").prev().find('i').remove();\n\n }\n\n if ($('ul.sub-group-list div.icon:last-child + div').length > -1) {\n //$('ul.sub-group-list div.icon:last-child').find('i').css('display', 'none');\n $('ul.sub-group-list div.icon:last-child').find('i').remove();\n\n }\n\n $(\"div.icon li > a\").removeClass();\n if ($(\"li.treelist + div.icon\").length) {\n $(\"li.treelist + div.icon\").prev().find('a').removeClass();\n }\n if ($(\".sub-group-list li.treelist:last\").length) {\n $(\".sub-group-list li.treelist:last\").find('a').removeClass();\n }\n\n\n $(\"ul.sub-group-list > li\").find(\"i\").click(function() {\n if ($(this).hasClass('fa-caret-down')) {\n $(this).attr('class', 'fa fa-caret-right');\n var next = $(this).parent(\"li\").closest(\"div.icon\").nextUntil(\"div\");\n next.slideUp();\n } else {\n $(this).attr('class', 'fa fa-caret-down');\n var next = $(this).parent(\"li\").closest(\"div.icon\").nextUntil(\"div\");\n next.slideDown();\n }\n });\n\n if ($(\"#nav-list\").find('ul.sub-group-list li').prev(\"div.icon\").nextUntil(\"div\").length) {\n $(selectSecId).find('li').prev(\"div.icon\").nextUntil(\"div\").css('display', 'none');\n $(\"#nav-list li:contains('ISSUE') + div.maintopic\").prev().find('i').css('display', 'none');\n $(selectSecId).css('display', 'block');\n $(selectSecId).find(\"i\").attr('class', 'fa fa-caret-right');\n }\n\n }", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-8\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-8-6fdf1528.woff') format('woff')\"\n },\n icons: {\n 'CollapseMenu': '\\uEF66',\n 'ExpandMenu': '\\uEF67',\n 'Boards': '\\uEF68',\n 'SunAdd': '\\uEF69',\n 'SunQuestionMark': '\\uEF6A',\n 'LandscapeOrientation': '\\uEF6B',\n 'DocumentSearch': '\\uEF6C',\n 'PublicCalendar': '\\uEF6D',\n 'PublicContactCard': '\\uEF6E',\n 'PublicEmail': '\\uEF6F',\n 'PublicFolder': '\\uEF70',\n 'WordDocument': '\\uEF71',\n 'PowerPointDocument': '\\uEF72',\n 'ExcelDocument': '\\uEF73',\n 'GroupedList': '\\uEF74',\n 'ClassroomLogo': '\\uEF75',\n 'Sections': '\\uEF76',\n 'EditPhoto': '\\uEF77',\n 'Starburst': '\\uEF78',\n 'ShareiOS': '\\uEF79',\n 'AirTickets': '\\uEF7A',\n 'PencilReply': '\\uEF7B',\n 'Tiles2': '\\uEF7C',\n 'SkypeCircleCheck': '\\uEF7D',\n 'SkypeCircleClock': '\\uEF7E',\n 'SkypeCircleMinus': '\\uEF7F',\n 'SkypeMessage': '\\uEF83',\n 'ClosedCaption': '\\uEF84',\n 'ATPLogo': '\\uEF85',\n 'OfficeFormsLogoInverse': '\\uEF86',\n 'RecycleBin': '\\uEF87',\n 'EmptyRecycleBin': '\\uEF88',\n 'Hide2': '\\uEF89',\n 'Breadcrumb': '\\uEF8C',\n 'BirthdayCake': '\\uEF8D',\n 'TimeEntry': '\\uEF95',\n 'CRMProcesses': '\\uEFB1',\n 'PageEdit': '\\uEFB6',\n 'PageArrowRight': '\\uEFB8',\n 'PageRemove': '\\uEFBA',\n 'Database': '\\uEFC7',\n 'DataManagementSettings': '\\uEFC8',\n 'CRMServices': '\\uEFD2',\n 'EditContact': '\\uEFD3',\n 'ConnectContacts': '\\uEFD4',\n 'AppIconDefaultAdd': '\\uEFDA',\n 'AppIconDefaultList': '\\uEFDE',\n 'ActivateOrders': '\\uEFE0',\n 'DeactivateOrders': '\\uEFE1',\n 'ProductCatalog': '\\uEFE8',\n 'ScatterChart': '\\uEFEB',\n 'AccountActivity': '\\uEFF4',\n 'DocumentManagement': '\\uEFFC',\n 'CRMReport': '\\uEFFE',\n 'KnowledgeArticle': '\\uF000',\n 'Relationship': '\\uF003',\n 'HomeVerify': '\\uF00E',\n 'ZipFolder': '\\uF012',\n 'SurveyQuestions': '\\uF01B',\n 'TextDocument': '\\uF029',\n 'TextDocumentShared': '\\uF02B',\n 'PageCheckedOut': '\\uF02C',\n 'PageShared': '\\uF02D',\n 'SaveAndClose': '\\uF038',\n 'Script': '\\uF03A',\n 'Archive': '\\uF03F',\n 'ActivityFeed': '\\uF056',\n 'Compare': '\\uF057',\n 'EventDate': '\\uF059',\n 'ArrowUpRight': '\\uF069',\n 'CaretRight': '\\uF06B',\n 'SetAction': '\\uF071',\n 'ChatBot': '\\uF08B',\n 'CaretSolidLeft': '\\uF08D',\n 'CaretSolidDown': '\\uF08E',\n 'CaretSolidRight': '\\uF08F',\n 'CaretSolidUp': '\\uF090',\n 'PowerAppsLogo': '\\uF091',\n 'PowerApps2Logo': '\\uF092',\n 'SearchIssue': '\\uF09A',\n 'SearchIssueMirrored': '\\uF09B',\n 'FabricAssetLibrary': '\\uF09C',\n 'FabricDataConnectionLibrary': '\\uF09D',\n 'FabricDocLibrary': '\\uF09E',\n 'FabricFormLibrary': '\\uF09F',\n 'FabricFormLibraryMirrored': '\\uF0A0',\n 'FabricReportLibrary': '\\uF0A1',\n 'FabricReportLibraryMirrored': '\\uF0A2',\n 'FabricPublicFolder': '\\uF0A3',\n 'FabricFolderSearch': '\\uF0A4',\n 'FabricMovetoFolder': '\\uF0A5',\n 'FabricUnsyncFolder': '\\uF0A6',\n 'FabricSyncFolder': '\\uF0A7',\n 'FabricOpenFolderHorizontal': '\\uF0A8',\n 'FabricFolder': '\\uF0A9',\n 'FabricFolderFill': '\\uF0AA',\n 'FabricNewFolder': '\\uF0AB',\n 'FabricPictureLibrary': '\\uF0AC',\n 'PhotoVideoMedia': '\\uF0B1',\n 'AddFavorite': '\\uF0C8'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-8\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-8-6fdf1528.woff') format('woff')\"\n },\n icons: {\n 'CollapseMenu': '\\uEF66',\n 'ExpandMenu': '\\uEF67',\n 'Boards': '\\uEF68',\n 'SunAdd': '\\uEF69',\n 'SunQuestionMark': '\\uEF6A',\n 'LandscapeOrientation': '\\uEF6B',\n 'DocumentSearch': '\\uEF6C',\n 'PublicCalendar': '\\uEF6D',\n 'PublicContactCard': '\\uEF6E',\n 'PublicEmail': '\\uEF6F',\n 'PublicFolder': '\\uEF70',\n 'WordDocument': '\\uEF71',\n 'PowerPointDocument': '\\uEF72',\n 'ExcelDocument': '\\uEF73',\n 'GroupedList': '\\uEF74',\n 'ClassroomLogo': '\\uEF75',\n 'Sections': '\\uEF76',\n 'EditPhoto': '\\uEF77',\n 'Starburst': '\\uEF78',\n 'ShareiOS': '\\uEF79',\n 'AirTickets': '\\uEF7A',\n 'PencilReply': '\\uEF7B',\n 'Tiles2': '\\uEF7C',\n 'SkypeCircleCheck': '\\uEF7D',\n 'SkypeCircleClock': '\\uEF7E',\n 'SkypeCircleMinus': '\\uEF7F',\n 'SkypeMessage': '\\uEF83',\n 'ClosedCaption': '\\uEF84',\n 'ATPLogo': '\\uEF85',\n 'OfficeFormsLogoInverse': '\\uEF86',\n 'RecycleBin': '\\uEF87',\n 'EmptyRecycleBin': '\\uEF88',\n 'Hide2': '\\uEF89',\n 'Breadcrumb': '\\uEF8C',\n 'BirthdayCake': '\\uEF8D',\n 'TimeEntry': '\\uEF95',\n 'CRMProcesses': '\\uEFB1',\n 'PageEdit': '\\uEFB6',\n 'PageArrowRight': '\\uEFB8',\n 'PageRemove': '\\uEFBA',\n 'Database': '\\uEFC7',\n 'DataManagementSettings': '\\uEFC8',\n 'CRMServices': '\\uEFD2',\n 'EditContact': '\\uEFD3',\n 'ConnectContacts': '\\uEFD4',\n 'AppIconDefaultAdd': '\\uEFDA',\n 'AppIconDefaultList': '\\uEFDE',\n 'ActivateOrders': '\\uEFE0',\n 'DeactivateOrders': '\\uEFE1',\n 'ProductCatalog': '\\uEFE8',\n 'ScatterChart': '\\uEFEB',\n 'AccountActivity': '\\uEFF4',\n 'DocumentManagement': '\\uEFFC',\n 'CRMReport': '\\uEFFE',\n 'KnowledgeArticle': '\\uF000',\n 'Relationship': '\\uF003',\n 'HomeVerify': '\\uF00E',\n 'ZipFolder': '\\uF012',\n 'SurveyQuestions': '\\uF01B',\n 'TextDocument': '\\uF029',\n 'TextDocumentShared': '\\uF02B',\n 'PageCheckedOut': '\\uF02C',\n 'PageShared': '\\uF02D',\n 'SaveAndClose': '\\uF038',\n 'Script': '\\uF03A',\n 'Archive': '\\uF03F',\n 'ActivityFeed': '\\uF056',\n 'Compare': '\\uF057',\n 'EventDate': '\\uF059',\n 'ArrowUpRight': '\\uF069',\n 'CaretRight': '\\uF06B',\n 'SetAction': '\\uF071',\n 'ChatBot': '\\uF08B',\n 'CaretSolidLeft': '\\uF08D',\n 'CaretSolidDown': '\\uF08E',\n 'CaretSolidRight': '\\uF08F',\n 'CaretSolidUp': '\\uF090',\n 'PowerAppsLogo': '\\uF091',\n 'PowerApps2Logo': '\\uF092',\n 'SearchIssue': '\\uF09A',\n 'SearchIssueMirrored': '\\uF09B',\n 'FabricAssetLibrary': '\\uF09C',\n 'FabricDataConnectionLibrary': '\\uF09D',\n 'FabricDocLibrary': '\\uF09E',\n 'FabricFormLibrary': '\\uF09F',\n 'FabricFormLibraryMirrored': '\\uF0A0',\n 'FabricReportLibrary': '\\uF0A1',\n 'FabricReportLibraryMirrored': '\\uF0A2',\n 'FabricPublicFolder': '\\uF0A3',\n 'FabricFolderSearch': '\\uF0A4',\n 'FabricMovetoFolder': '\\uF0A5',\n 'FabricUnsyncFolder': '\\uF0A6',\n 'FabricSyncFolder': '\\uF0A7',\n 'FabricOpenFolderHorizontal': '\\uF0A8',\n 'FabricFolder': '\\uF0A9',\n 'FabricFolderFill': '\\uF0AA',\n 'FabricNewFolder': '\\uF0AB',\n 'FabricPictureLibrary': '\\uF0AC',\n 'PhotoVideoMedia': '\\uF0B1',\n 'AddFavorite': '\\uF0C8'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "createLabelsAsSprites() {\n this.labelsGroup.clear();\n const verticesHashMap = this.createVerticesHashMap();\n Object.entries(verticesHashMap).forEach(([key, vertices]) => {\n for (let i = 0; i < vertices.length; i += 3) {\n const atomPosition = new THREE.Vector3().fromArray(vertices, i);\n const labelSprite = this.createLabelSprite(key, `label-for-${key}`);\n const offsetVector = this.getLabelOffsetVector(atomPosition, key);\n labelSprite.userData = { atomPosition, atomName: key };\n labelSprite.position.addVectors(atomPosition, offsetVector);\n this.labelsGroup.add(labelSprite);\n }\n });\n this.structureGroup.add(this.labelsGroup);\n }", "function LabelOptions() { }", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-5\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-5-f95ba260.woff') format('woff')\"\n },\n icons: {\n 'Certificate': '\\uEB95',\n 'FastForward': '\\uEB9D',\n 'Rewind': '\\uEB9E',\n 'Photo2': '\\uEB9F',\n 'OpenSource': '\\uEBC2',\n 'Movers': '\\uEBCD',\n 'CloudDownload': '\\uEBD3',\n 'Family': '\\uEBDA',\n 'WindDirection': '\\uEBE6',\n 'Bug': '\\uEBE8',\n 'SiteScan': '\\uEBEC',\n 'BrowserScreenShot': '\\uEBED',\n 'F12DevTools': '\\uEBEE',\n 'CSS': '\\uEBEF',\n 'JS': '\\uEBF0',\n 'DeliveryTruck': '\\uEBF4',\n 'ReminderPerson': '\\uEBF7',\n 'ReminderGroup': '\\uEBF8',\n 'ReminderTime': '\\uEBF9',\n 'TabletMode': '\\uEBFC',\n 'Umbrella': '\\uEC04',\n 'NetworkTower': '\\uEC05',\n 'CityNext': '\\uEC06',\n 'CityNext2': '\\uEC07',\n 'Section': '\\uEC0C',\n 'OneNoteLogoInverse': '\\uEC0D',\n 'ToggleFilled': '\\uEC11',\n 'ToggleBorder': '\\uEC12',\n 'SliderThumb': '\\uEC13',\n 'ToggleThumb': '\\uEC14',\n 'Documentation': '\\uEC17',\n 'Badge': '\\uEC1B',\n 'Giftbox': '\\uEC1F',\n 'VisualStudioLogo': '\\uEC22',\n 'HomeGroup': '\\uEC26',\n 'ExcelLogoInverse': '\\uEC28',\n 'WordLogoInverse': '\\uEC29',\n 'PowerPointLogoInverse': '\\uEC2A',\n 'Cafe': '\\uEC32',\n 'SpeedHigh': '\\uEC4A',\n 'Commitments': '\\uEC4D',\n 'ThisPC': '\\uEC4E',\n 'MusicNote': '\\uEC4F',\n 'MicOff': '\\uEC54',\n 'PlaybackRate1x': '\\uEC57',\n 'EdgeLogo': '\\uEC60',\n 'CompletedSolid': '\\uEC61',\n 'AlbumRemove': '\\uEC62',\n 'MessageFill': '\\uEC70',\n 'TabletSelected': '\\uEC74',\n 'MobileSelected': '\\uEC75',\n 'LaptopSelected': '\\uEC76',\n 'TVMonitorSelected': '\\uEC77',\n 'DeveloperTools': '\\uEC7A',\n 'Shapes': '\\uEC7C',\n 'InsertTextBox': '\\uEC7D',\n 'LowerBrightness': '\\uEC8A',\n 'WebComponents': '\\uEC8B',\n 'OfflineStorage': '\\uEC8C',\n 'DOM': '\\uEC8D',\n 'CloudUpload': '\\uEC8E',\n 'ScrollUpDown': '\\uEC8F',\n 'DateTime': '\\uEC92',\n 'Event': '\\uECA3',\n 'Cake': '\\uECA4',\n 'Org': '\\uECA6',\n 'PartyLeader': '\\uECA7',\n 'DRM': '\\uECA8',\n 'CloudAdd': '\\uECA9',\n 'AppIconDefault': '\\uECAA',\n 'Photo2Add': '\\uECAB',\n 'Photo2Remove': '\\uECAC',\n 'Calories': '\\uECAD',\n 'POI': '\\uECAF',\n 'AddTo': '\\uECC8',\n 'RadioBtnOff': '\\uECCA',\n 'RadioBtnOn': '\\uECCB',\n 'ExploreContent': '\\uECCD',\n 'Product': '\\uECDC',\n 'ProgressLoopInner': '\\uECDE',\n 'ProgressLoopOuter': '\\uECDF',\n 'Blocked2': '\\uECE4',\n 'FangBody': '\\uECEB',\n 'Toolbox': '\\uECED',\n 'PageHeader': '\\uECEE',\n 'ChatInviteFriend': '\\uECFE',\n 'Brush': '\\uECFF',\n 'Shirt': '\\uED00',\n 'Crown': '\\uED01',\n 'Diamond': '\\uED02',\n 'ScaleUp': '\\uED09',\n 'QRCode': '\\uED14',\n 'Feedback': '\\uED15',\n 'SharepointLogoInverse': '\\uED18',\n 'YammerLogo': '\\uED19',\n 'Hide': '\\uED1A',\n 'Uneditable': '\\uED1D',\n 'ReturnToSession': '\\uED24',\n 'OpenFolderHorizontal': '\\uED25',\n 'CalendarMirrored': '\\uED28'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-5\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-5-f95ba260.woff') format('woff')\"\n },\n icons: {\n 'Certificate': '\\uEB95',\n 'FastForward': '\\uEB9D',\n 'Rewind': '\\uEB9E',\n 'Photo2': '\\uEB9F',\n 'OpenSource': '\\uEBC2',\n 'Movers': '\\uEBCD',\n 'CloudDownload': '\\uEBD3',\n 'Family': '\\uEBDA',\n 'WindDirection': '\\uEBE6',\n 'Bug': '\\uEBE8',\n 'SiteScan': '\\uEBEC',\n 'BrowserScreenShot': '\\uEBED',\n 'F12DevTools': '\\uEBEE',\n 'CSS': '\\uEBEF',\n 'JS': '\\uEBF0',\n 'DeliveryTruck': '\\uEBF4',\n 'ReminderPerson': '\\uEBF7',\n 'ReminderGroup': '\\uEBF8',\n 'ReminderTime': '\\uEBF9',\n 'TabletMode': '\\uEBFC',\n 'Umbrella': '\\uEC04',\n 'NetworkTower': '\\uEC05',\n 'CityNext': '\\uEC06',\n 'CityNext2': '\\uEC07',\n 'Section': '\\uEC0C',\n 'OneNoteLogoInverse': '\\uEC0D',\n 'ToggleFilled': '\\uEC11',\n 'ToggleBorder': '\\uEC12',\n 'SliderThumb': '\\uEC13',\n 'ToggleThumb': '\\uEC14',\n 'Documentation': '\\uEC17',\n 'Badge': '\\uEC1B',\n 'Giftbox': '\\uEC1F',\n 'VisualStudioLogo': '\\uEC22',\n 'HomeGroup': '\\uEC26',\n 'ExcelLogoInverse': '\\uEC28',\n 'WordLogoInverse': '\\uEC29',\n 'PowerPointLogoInverse': '\\uEC2A',\n 'Cafe': '\\uEC32',\n 'SpeedHigh': '\\uEC4A',\n 'Commitments': '\\uEC4D',\n 'ThisPC': '\\uEC4E',\n 'MusicNote': '\\uEC4F',\n 'MicOff': '\\uEC54',\n 'PlaybackRate1x': '\\uEC57',\n 'EdgeLogo': '\\uEC60',\n 'CompletedSolid': '\\uEC61',\n 'AlbumRemove': '\\uEC62',\n 'MessageFill': '\\uEC70',\n 'TabletSelected': '\\uEC74',\n 'MobileSelected': '\\uEC75',\n 'LaptopSelected': '\\uEC76',\n 'TVMonitorSelected': '\\uEC77',\n 'DeveloperTools': '\\uEC7A',\n 'Shapes': '\\uEC7C',\n 'InsertTextBox': '\\uEC7D',\n 'LowerBrightness': '\\uEC8A',\n 'WebComponents': '\\uEC8B',\n 'OfflineStorage': '\\uEC8C',\n 'DOM': '\\uEC8D',\n 'CloudUpload': '\\uEC8E',\n 'ScrollUpDown': '\\uEC8F',\n 'DateTime': '\\uEC92',\n 'Event': '\\uECA3',\n 'Cake': '\\uECA4',\n 'Org': '\\uECA6',\n 'PartyLeader': '\\uECA7',\n 'DRM': '\\uECA8',\n 'CloudAdd': '\\uECA9',\n 'AppIconDefault': '\\uECAA',\n 'Photo2Add': '\\uECAB',\n 'Photo2Remove': '\\uECAC',\n 'Calories': '\\uECAD',\n 'POI': '\\uECAF',\n 'AddTo': '\\uECC8',\n 'RadioBtnOff': '\\uECCA',\n 'RadioBtnOn': '\\uECCB',\n 'ExploreContent': '\\uECCD',\n 'Product': '\\uECDC',\n 'ProgressLoopInner': '\\uECDE',\n 'ProgressLoopOuter': '\\uECDF',\n 'Blocked2': '\\uECE4',\n 'FangBody': '\\uECEB',\n 'Toolbox': '\\uECED',\n 'PageHeader': '\\uECEE',\n 'ChatInviteFriend': '\\uECFE',\n 'Brush': '\\uECFF',\n 'Shirt': '\\uED00',\n 'Crown': '\\uED01',\n 'Diamond': '\\uED02',\n 'ScaleUp': '\\uED09',\n 'QRCode': '\\uED14',\n 'Feedback': '\\uED15',\n 'SharepointLogoInverse': '\\uED18',\n 'YammerLogo': '\\uED19',\n 'Hide': '\\uED1A',\n 'Uneditable': '\\uED1D',\n 'ReturnToSession': '\\uED24',\n 'OpenFolderHorizontal': '\\uED25',\n 'CalendarMirrored': '\\uED28'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-9\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-9-c6162b42.woff') format('woff')\"\n },\n icons: {\n 'AddFavoriteFill': '\\uF0C9',\n 'BufferTimeBefore': '\\uF0CF',\n 'BufferTimeAfter': '\\uF0D0',\n 'BufferTimeBoth': '\\uF0D1',\n 'PublishContent': '\\uF0D4',\n 'ClipboardList': '\\uF0E3',\n 'ClipboardListMirrored': '\\uF0E4',\n 'CannedChat': '\\uF0F2',\n 'SkypeForBusinessLogo': '\\uF0FC',\n 'TabCenter': '\\uF100',\n 'PageCheckedin': '\\uF104',\n 'PageList': '\\uF106',\n 'ReadOutLoud': '\\uF112',\n 'CaretBottomLeftSolid8': '\\uF121',\n 'CaretBottomRightSolid8': '\\uF122',\n 'FolderHorizontal': '\\uF12B',\n 'MicrosoftStaffhubLogo': '\\uF130',\n 'GiftboxOpen': '\\uF133',\n 'StatusCircleOuter': '\\uF136',\n 'StatusCircleInner': '\\uF137',\n 'StatusCircleRing': '\\uF138',\n 'StatusTriangleOuter': '\\uF139',\n 'StatusTriangleInner': '\\uF13A',\n 'StatusTriangleExclamation': '\\uF13B',\n 'StatusCircleExclamation': '\\uF13C',\n 'StatusCircleErrorX': '\\uF13D',\n 'StatusCircleInfo': '\\uF13F',\n 'StatusCircleBlock': '\\uF140',\n 'StatusCircleBlock2': '\\uF141',\n 'StatusCircleQuestionMark': '\\uF142',\n 'StatusCircleSync': '\\uF143',\n 'Toll': '\\uF160',\n 'ExploreContentSingle': '\\uF164',\n 'CollapseContent': '\\uF165',\n 'CollapseContentSingle': '\\uF166',\n 'InfoSolid': '\\uF167',\n 'GroupList': '\\uF168',\n 'ProgressRingDots': '\\uF16A',\n 'CaloriesAdd': '\\uF172',\n 'BranchFork': '\\uF173',\n 'MuteChat': '\\uF17A',\n 'AddHome': '\\uF17B',\n 'AddWork': '\\uF17C',\n 'MobileReport': '\\uF18A',\n 'ScaleVolume': '\\uF18C',\n 'HardDriveGroup': '\\uF18F',\n 'FastMode': '\\uF19A',\n 'ToggleLeft': '\\uF19E',\n 'ToggleRight': '\\uF19F',\n 'TriangleShape': '\\uF1A7',\n 'RectangleShape': '\\uF1A9',\n 'CubeShape': '\\uF1AA',\n 'Trophy2': '\\uF1AE',\n 'BucketColor': '\\uF1B6',\n 'BucketColorFill': '\\uF1B7',\n 'Taskboard': '\\uF1C2',\n 'SingleColumn': '\\uF1D3',\n 'DoubleColumn': '\\uF1D4',\n 'TripleColumn': '\\uF1D5',\n 'ColumnLeftTwoThirds': '\\uF1D6',\n 'ColumnRightTwoThirds': '\\uF1D7',\n 'AccessLogoFill': '\\uF1DB',\n 'AnalyticsLogo': '\\uF1DE',\n 'AnalyticsQuery': '\\uF1DF',\n 'NewAnalyticsQuery': '\\uF1E0',\n 'AnalyticsReport': '\\uF1E1',\n 'WordLogo': '\\uF1E3',\n 'WordLogoFill': '\\uF1E4',\n 'ExcelLogo': '\\uF1E5',\n 'ExcelLogoFill': '\\uF1E6',\n 'OneNoteLogo': '\\uF1E7',\n 'OneNoteLogoFill': '\\uF1E8',\n 'OutlookLogo': '\\uF1E9',\n 'OutlookLogoFill': '\\uF1EA',\n 'PowerPointLogo': '\\uF1EB',\n 'PowerPointLogoFill': '\\uF1EC',\n 'PublisherLogo': '\\uF1ED',\n 'PublisherLogoFill': '\\uF1EE',\n 'ScheduleEventAction': '\\uF1EF',\n 'FlameSolid': '\\uF1F3',\n 'ServerProcesses': '\\uF1FE',\n 'Server': '\\uF201',\n 'SaveAll': '\\uF203',\n 'LinkedInLogo': '\\uF20A',\n 'Decimals': '\\uF218',\n 'SidePanelMirrored': '\\uF221',\n 'ProtectRestrict': '\\uF22A',\n 'Blog': '\\uF22B',\n 'UnknownMirrored': '\\uF22E',\n 'PublicContactCardMirrored': '\\uF230',\n 'GridViewSmall': '\\uF232',\n 'GridViewMedium': '\\uF233',\n 'GridViewLarge': '\\uF234',\n 'Step': '\\uF241',\n 'StepInsert': '\\uF242',\n 'StepShared': '\\uF243',\n 'StepSharedAdd': '\\uF244',\n 'StepSharedInsert': '\\uF245',\n 'ViewDashboard': '\\uF246',\n 'ViewList': '\\uF247'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-9\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-9-c6162b42.woff') format('woff')\"\n },\n icons: {\n 'AddFavoriteFill': '\\uF0C9',\n 'BufferTimeBefore': '\\uF0CF',\n 'BufferTimeAfter': '\\uF0D0',\n 'BufferTimeBoth': '\\uF0D1',\n 'PublishContent': '\\uF0D4',\n 'ClipboardList': '\\uF0E3',\n 'ClipboardListMirrored': '\\uF0E4',\n 'CannedChat': '\\uF0F2',\n 'SkypeForBusinessLogo': '\\uF0FC',\n 'TabCenter': '\\uF100',\n 'PageCheckedin': '\\uF104',\n 'PageList': '\\uF106',\n 'ReadOutLoud': '\\uF112',\n 'CaretBottomLeftSolid8': '\\uF121',\n 'CaretBottomRightSolid8': '\\uF122',\n 'FolderHorizontal': '\\uF12B',\n 'MicrosoftStaffhubLogo': '\\uF130',\n 'GiftboxOpen': '\\uF133',\n 'StatusCircleOuter': '\\uF136',\n 'StatusCircleInner': '\\uF137',\n 'StatusCircleRing': '\\uF138',\n 'StatusTriangleOuter': '\\uF139',\n 'StatusTriangleInner': '\\uF13A',\n 'StatusTriangleExclamation': '\\uF13B',\n 'StatusCircleExclamation': '\\uF13C',\n 'StatusCircleErrorX': '\\uF13D',\n 'StatusCircleInfo': '\\uF13F',\n 'StatusCircleBlock': '\\uF140',\n 'StatusCircleBlock2': '\\uF141',\n 'StatusCircleQuestionMark': '\\uF142',\n 'StatusCircleSync': '\\uF143',\n 'Toll': '\\uF160',\n 'ExploreContentSingle': '\\uF164',\n 'CollapseContent': '\\uF165',\n 'CollapseContentSingle': '\\uF166',\n 'InfoSolid': '\\uF167',\n 'GroupList': '\\uF168',\n 'ProgressRingDots': '\\uF16A',\n 'CaloriesAdd': '\\uF172',\n 'BranchFork': '\\uF173',\n 'MuteChat': '\\uF17A',\n 'AddHome': '\\uF17B',\n 'AddWork': '\\uF17C',\n 'MobileReport': '\\uF18A',\n 'ScaleVolume': '\\uF18C',\n 'HardDriveGroup': '\\uF18F',\n 'FastMode': '\\uF19A',\n 'ToggleLeft': '\\uF19E',\n 'ToggleRight': '\\uF19F',\n 'TriangleShape': '\\uF1A7',\n 'RectangleShape': '\\uF1A9',\n 'CubeShape': '\\uF1AA',\n 'Trophy2': '\\uF1AE',\n 'BucketColor': '\\uF1B6',\n 'BucketColorFill': '\\uF1B7',\n 'Taskboard': '\\uF1C2',\n 'SingleColumn': '\\uF1D3',\n 'DoubleColumn': '\\uF1D4',\n 'TripleColumn': '\\uF1D5',\n 'ColumnLeftTwoThirds': '\\uF1D6',\n 'ColumnRightTwoThirds': '\\uF1D7',\n 'AccessLogoFill': '\\uF1DB',\n 'AnalyticsLogo': '\\uF1DE',\n 'AnalyticsQuery': '\\uF1DF',\n 'NewAnalyticsQuery': '\\uF1E0',\n 'AnalyticsReport': '\\uF1E1',\n 'WordLogo': '\\uF1E3',\n 'WordLogoFill': '\\uF1E4',\n 'ExcelLogo': '\\uF1E5',\n 'ExcelLogoFill': '\\uF1E6',\n 'OneNoteLogo': '\\uF1E7',\n 'OneNoteLogoFill': '\\uF1E8',\n 'OutlookLogo': '\\uF1E9',\n 'OutlookLogoFill': '\\uF1EA',\n 'PowerPointLogo': '\\uF1EB',\n 'PowerPointLogoFill': '\\uF1EC',\n 'PublisherLogo': '\\uF1ED',\n 'PublisherLogoFill': '\\uF1EE',\n 'ScheduleEventAction': '\\uF1EF',\n 'FlameSolid': '\\uF1F3',\n 'ServerProcesses': '\\uF1FE',\n 'Server': '\\uF201',\n 'SaveAll': '\\uF203',\n 'LinkedInLogo': '\\uF20A',\n 'Decimals': '\\uF218',\n 'SidePanelMirrored': '\\uF221',\n 'ProtectRestrict': '\\uF22A',\n 'Blog': '\\uF22B',\n 'UnknownMirrored': '\\uF22E',\n 'PublicContactCardMirrored': '\\uF230',\n 'GridViewSmall': '\\uF232',\n 'GridViewMedium': '\\uF233',\n 'GridViewLarge': '\\uF234',\n 'Step': '\\uF241',\n 'StepInsert': '\\uF242',\n 'StepShared': '\\uF243',\n 'StepSharedAdd': '\\uF244',\n 'StepSharedInsert': '\\uF245',\n 'ViewDashboard': '\\uF246',\n 'ViewList': '\\uF247'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "setErrorIcon() {\n this.setImage(config.loadingErrorIconPath);\n this.setText('Virhe! Yritä uudestaan.');\n }", "function setLabel(props){\n //label content\n var labelAttribute = \"<h1>\" + props[expressed] +\n \"</h1>\" + expressed + \"</b>\";\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.adm1_code + \"_label\")\n .html(labelAttribute)\n\n var regionName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html((props.NAME_1 + \" Region\").bold());\n }", "function updateMarker(m){\n m.setIcon('images/selectedlogo.png');\n }", "function writeCellIcons(strings, support, legendItems) {\n let output = '<div class=\"bc-icons\">';\n\n if (Array.isArray(support)) {\n // the first entry should be the most relevant/recent and will be used for the main cell\n support = support[0];\n }\n if (support.prefix) {\n output += writeIcon(strings, 'prefix', support.prefix) + ' ';\n legendItems.add('prefix');\n }\n\n if (support.notes) {\n output += writeIcon(strings, 'footnote') + ' ';\n legendItems.add('footnote');\n }\n\n if (support.alternative_name) {\n output += writeIcon(strings, 'altname', support.alternative_name) + ' ';\n legendItems.add('altname');\n }\n\n if (support.flags) {\n output += writeIcon(strings, 'disabled') + ' ';\n legendItems.add('disabled');\n }\n\n output += '</div>';\n\n return output;\n}", "function drawIcons() {\n map.data.addGeoJson(geoJSON);\n }" ]
[ "0.6663002", "0.66136485", "0.6596557", "0.65442085", "0.64753056", "0.63725626", "0.6364859", "0.63052565", "0.63020056", "0.6298434", "0.62905854", "0.62519604", "0.6229002", "0.62243503", "0.6195375", "0.6185135", "0.6177914", "0.6159013", "0.612364", "0.6089255", "0.6067196", "0.6027997", "0.5973228", "0.5968736", "0.59535426", "0.5929598", "0.5919627", "0.5904979", "0.5884587", "0.5883971", "0.587944", "0.58753866", "0.58753866", "0.58625", "0.5860289", "0.5854998", "0.5851165", "0.584791", "0.5841566", "0.58299255", "0.5829659", "0.5818756", "0.581109", "0.58109677", "0.5791794", "0.5782964", "0.57825434", "0.5764444", "0.5758924", "0.5757635", "0.57575583", "0.5755145", "0.5749336", "0.57416713", "0.57382274", "0.5734055", "0.57302356", "0.572787", "0.572787", "0.57273203", "0.572701", "0.57260203", "0.572549", "0.5721035", "0.5718238", "0.5716864", "0.5716864", "0.57168555", "0.5714625", "0.5713333", "0.5709202", "0.5708858", "0.5702853", "0.56955045", "0.5692306", "0.5690394", "0.5690394", "0.56864", "0.5683504", "0.56732243", "0.56729656", "0.56729656", "0.5671994", "0.56659985", "0.56659985", "0.56659293", "0.5664273", "0.5663145", "0.5662724", "0.5662724", "0.56551087", "0.5650661", "0.56467557", "0.56467557", "0.5636549", "0.5636549", "0.56307006", "0.56304574", "0.56220835", "0.5619211", "0.56169915" ]
0.0
-1
Method for moving a stone's image 'in'
moveStoneIn(stone){ // Get the stone's depth, row and column var stoneDepth = $(stone).attr('data-stone-clicked') var stoneRow = $(stone).attr('data-grid-row') var stoneCol = $(stone).attr('data-grid-col') // Get the icon by searching the list var stoneIcon = puzzle.iconsList.find(function(entry){ return entry.row == stoneRow && entry.col == stoneCol }) // Update the depth var newStoneDepth = parseInt(stoneDepth) + 1 if (newStoneDepth == 6) {newStoneDepth = 0} // Update the stone, add the new icon $(stone).empty() var newStone = $('<img class="img-fluid well-stone" src=assets/images/minigames/puzzles/well/well-stone-in'+newStoneDepth+'.jpg alt="Stone">') $(stone).append(newStone) $(stone).attr('data-stone-clicked',newStoneDepth) // If the stone has an icon, add it if (stoneIcon) { var newIcon = stoneIcon.icon $(stone).append(newIcon) // Update the font size of the icon $('#'+stoneIcon.id).css({"font-size":puzzle.iconSizes[parseInt(newStoneDepth)]}) } // Whenever you move a stone in, check for completion this.checkComplete() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "makeMoveable($image){\n\n }", "move() {\n this.x += this.xdir * .5;\n this.y += this.ydir * .5;\n }", "move() {\n this.geometricMidpoint = this.setGeometricMidpoint();\n this.in.X = this.position.X - this.geometricMidpoint.X;\n this.in.Y = this.position.Y - this.geometricMidpoint.Y;\n }", "function santaMoving(e) {\n if (e.code===\"ArrowLeft\") {state.santa.x-=5;\n } else if(e.code===\"ArrowRight\") {state.santa.x+=5;\n }\n\n drawSanta(ctx,image);\n }", "move(direction) {\n\n direction = spiel.moveDirection;\n\n if (direction == \"R\" && !this.isExploding) {\n\n this.posX++;\n let newBild = this.images[Math.floor(Math.random() * this.images.length)];\n if (newBild != null)\n this.img.src = newBild;\n }\n\n else if (direction == \"L\" && !this.isExploding) {\n this.posX--;\n let newBild = this.images[Math.floor(Math.random() * this.images.length)];\n if (newBild != null)\n this.img.src = newBild;\n }\n }", "function imageMove() {\n\t\t//Sets state to be the data in state for the images\n\t\tvar state = $(this).attr('data-state');\n\n\t\t//Switches the source to the animate/still state depending on what it is currently at\n\t if(state == 'still') {\n $(this).attr('src', $(this).data('animate'));\n $(this).attr('data-state', 'animate');\n }\n else {\n $(this).attr('src', $(this).data('still'));\n $(this).attr('data-state', 'still');\n }\n\t}", "keepMovingStones(stone) {\n setInterval(function() { stone.y += 4; }, 20);\n }", "move(){\n this.x = this.x + this.s;\n if (this.x > width){\n this.x = 0;\n }\n }", "animate () {\n this.x -= this.speed * 5;\n if (this.x < -this.groundImage.width) \n this.x = 0;\n }", "move() {\n\n }", "function oneMove() {\n for (var i = snake.length - 1; i >= 0; i--) {\n if (i === 0) {\n snake[0].position = createVector(offsetX, offsetY);\n } else {\n snake[i].position = createVector(snake[i - 1].position.x, snake[i - 1].position.y)\n }\n }\n}", "updateSwatter(){\n\n this.left = mouseX-50;\n this.right = mouseX+50;\n this.top = mouseY-50;\n this.bottom = mouseY+50;\n\n image(this.swatterPic, mouseX-150, mouseY-50, 300, 300);\n }", "move() {\r\n this.x += this.vX;\r\n this.y += this.vY;\r\n }", "move() {\n let xDiff = this.xTarget - this.x + 5; // Blumenmitte\n let yDiff = this.yTarget - this.y;\n if (Math.abs(xDiff) < 1 && Math.abs(yDiff) < 1)\n this.setRandomFlowerPosition();\n else {\n this.x += xDiff * this.speed;\n this.y += yDiff * this.speed;\n }\n }", "move(){\r\n this.x += this.dx;\r\n this.y += this.dy;\r\n\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 moveSprite() {\n\tconst position = getPosition();\n\tposition.appendChild(spriteImg);\n}", "function animateSth(img, sizeX, posX, sizeY, posY, x, y, width, height, sizeRow, sizeColumn){\n\tcontext.drawImage(img, sizeX*Math.floor(posX), sizeY*posY, sizeX, sizeY, x, y, width, height)\n\n\tposX += 0.1;\n\tconsole.log(posX);\n\tif(posX > sizeRow ){\n\t\t\n\t\tposX = 0;\n\t\tposY += 1;\n\t\tif(posY > sizeColumn){\n\t\t\tposY = 0;\n\t\t}\n\t\t\n\t\t\n\t}\n}", "move () {\n }", "move() {\n switch (this.f) {\n case NORTH:\n if(this.y + 1 < this.sizeY) this.y++;\n break;\n case SOUTH:\n if(this.y > 0) this.y--;\n break;\n case EAST:\n if(this.x + 1 < this.sizeX) this.x++;\n break;\n case WEST:\n default:\n if(this.x > 0) this.x--;\n }\n }", "move() {\n this.posX += this.deltaX;\n this.posY += this.deltaY;\n }", "function moveHoover(dir) {\n let [x, y] = [0, 0],\n newPosition;\n\n switch (dir) {\n case \"N\":\n y++;\n break;\n case \"S\":\n y--;\n break;\n case \"W\":\n x--;\n break;\n case \"E\":\n x++;\n break;\n }\n\n newPosition = { x: position.x + x, y: position.y + y };\n\n if (\n newPosition.x >= 0 &&\n newPosition.x < 5 &&\n newPosition.y >= 0 &&\n newPosition.y < 5\n ) {\n position = newPosition;\n slurpDirt();\n }\n }", "move() {\n }", "move() { }", "move() { }", "update() {\n this.moveNinja();\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 }", "move(){\n this.x1 -= this.velocidade;\n this.x2 -= this.velocidade;\n \n \n // Preparando para a volta do background para o início.\n if (this.x1 < -width)\n {\n this.x1 = width;\n }\n \n if (this.x2 < -width)\n {\n this.x2 = width;\n }\n \n \n }", "move(dir = 1){\n this.x += this.xspeed * dir;\n this.y += this.yspeed * dir;\n }", "move(x,y){\n this.position.x += x;\n this.position.y += y;\n }", "move_nubs() {\n //left nub\n this.left_nub.x = this.player.x - 17;\n this.left_nub.y = this.player.y;\n //right nub\n this.right_nub.x = this.player.x + 17;\n this.right_nub.y = this.player.y;\n //up nub\n this.up_nub.x = this.player.x;\n this.up_nub.y = this.player.y - 17;\n //down nub\n this.down_nub.x = this.player.x;\n this.down_nub.y = this.player.y + 17;\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 mkMover(val) {\n redraw();\n ctx.drawImage(moverDirection[val], mover[0] * boxSize, mover[1] * boxSize, boxSize, boxSize)\n}", "function moveImgFwd(){\n\tif (currentImg == (imgList.length -1 )){\n\t\t currentImg = 0;\n\t}else{\n\t\t currentImg++;\n\t};\n\n\tpaneSlide();\n\n}", "moveNorth(){\n this.move ( 'N' );\n }", "move() {\n // Set velocity via noise()\n this.vx = map(noise(this.tx), 0, 1, -this.speed, this.speed);\n this.vy = map(noise(this.ty), 0, 1, -this.speed, this.speed);\n // Update position\n this.x += this.vx;\n this.y += this.vy;\n // Update time properties\n this.tx += 0.01;\n this.ty += 0.01;\n // Handle wrapping\n this.handleWrapping();\n }", "move() {\n this.x += this.vx;\n this.y += this.vy;\n }", "move() {\n // Set velocity via noise()\n this.vx = map(noise(this.tx), 0, 1, -this.speed, this.speed);\n this.vy = map(noise(this.ty), 0, 1, -this.speed, this.speed);\n\n if (this.x + this.vx < 0 + this.size / 2 || this.x + this.vx > width - this.size / 2) {\n this.vx = -this.vx;\n }\n\n if (this.y + this.vy < 0 + this.size || this.y + this.vy > cockpitVerticalMask - this.size) {\n //this.speed = -this.speed;\n this.vy = -this.vy;\n }\n\n // Update position\n this.x += this.vx;\n this.y += this.vy;\n // Update time properties\n this.tx += 0.01;\n this.ty += 0.01;\n //increases enemy's size every frame,\n this.size += this.speed / 10;\n //constrain enemies on screen\n this.x = constrain(this.x, 0, width);\n this.y = constrain(this.y, 0, height * 75 / 100);\n }", "function move_active_piece( event ){\n\tvar vector = new THREE.Vector3( (event.clientX / window.innerWidth) * 2 - 1 , (event.clientY / window.innerHeight) * (-2) + 1 , 1);\n\tvar ray = projector.pickingRay( vector, camera );\n\tvar intersection = ray.intersectObjects( nav_mesh );\n\n\t//do we target a board square?\n\tif( intersection.length > 0 ){\n\n\t\tcalculate_snapping( intersection );\n\n\t\t//set the not snapped position for free movement( in only snapping was enabled, the piece would move strictly from square to square )\n\t\tmoved_piece.father_chess_info.lerp_fast_to.x = intersection[ 0 ].point.x;\n\t\tmoved_piece.father_chess_info.lerp_fast_to.z = intersection[ 0 ].point.z;\n\t}\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}", "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 }", "move() {\n // Update position\n this.x += this.vx;\n this.y += this.vy;\n }", "function changeSnakePosition(){\n headX = headX + xVelocity;\n headY = headY + yVelocity;\n}", "function myMove() {\n console.log(\"click happened! here's the click event:\");\n var elem = document.getElementById(\"lizard-photo\");\n var pos = 0;\n var id = setInterval(frame, 5);\n function frame() {\n if (pos == 350) {\n clearInterval(id);\n } else {\n pos++;\n elem.style.top = pos + 'px';\n elem.style.left = pos + 'px';\n }\n }\n}", "function forward() {\n topPos = img.offsetTop;\n img.style.top = topPos - 12 + 'px';\n}", "function moveImage() {\n\t//Keep on moving the image till the target is achieved\n\tif(y1<dest_y) y1 = y1 + interval;\n\t\n\t//Move the image to the new location\n\tdocument.getElementById(\"s1\").style.top = y1+'px';\n\tif (y1+interval < dest_y) {\n\t\t//Keep on calling this function every 100 microsecond \n\t\t//\ttill the target location is reached\n\t\twindow.setTimeout('moveImage()',100);\n\t}\n}", "move() {\n\n // Horizontal movement\n this.x_location += this.delta_x;\n\n // Vertical movement\n this.y_location += this.delta_y;\n\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 }", "moveTo() {\r\n this.move();\r\n if(this.position.x+this.width/2 > this.movingTo.x) {\r\n this.movement.x = -this.speed;\r\n this.side = false;\r\n } if(this.position.x+this.width/2 < this.movingTo.x) {\r\n this.movement.x = this.speed;\r\n this.side = true;\r\n }\r\n if(this.position.y+this.height/2 > this.movingTo.y) {\r\n this.movement.y = -this.speed;\r\n } if(this.position.y+this.height/2 < this.movingTo.y) {\r\n this.movement.y = this.speed;\r\n }\r\n }", "function moveIn() {\n return core_1.trigger('moveIn', [\n core_1.state('void', core_1.style({ position: 'fixed', width: '100%' })),\n core_1.state('*', core_1.style({ position: 'fixed', width: '100%' })),\n core_1.transition(':enter', [\n core_1.style({ opacity: '0', transform: 'translateX(100px)' }),\n core_1.animate('.6s ease-in-out', core_1.style({ opacity: '1', transform: 'translateX(0)' }))\n ]),\n core_1.transition(':leave', [\n core_1.style({ opacity: '1', transform: 'translateX(0)' }),\n core_1.animate('.3s ease-in-out', core_1.style({ opacity: '0', transform: 'translateX(-200px)' }))\n ])\n ]);\n}", "function move()\n{\n\n}", "move(x, y) {\n\n this.tr.x += x;\n this.tr.y += y;\n }", "moveToggle() {\r\n if (this.atOriginalPosition) this.moveToCamera();\r\n else this.moveToOriginal();\r\n }", "function moveSnake() {\n $.each(snake, function (index, value) {\n snake[index].oldX = value.x;\n snake[index].oldY = value.y;\n\n // head\n if (index == 0) {\n if (keyPressed === down) {\n snake[index].y = value.y + blockSize;\n } else if (keyPressed === up) {\n snake[index].y = value.y - blockSize;\n } else if (keyPressed === right) {\n snake[index].x = value.x + blockSize;\n } else if (keyPressed === left) {\n snake[index].x = value.x - blockSize;\n }\n } \n // body\n else {\n snake[index].x = snake[index - 1].oldX;\n snake[index].y = snake[index - 1].oldY;\n }\n });\n }", "function moveImage(elm, index, leftOrRight) {\n\t\tglow.anim.css(\n\t\t\t$(elm),\n\t\t\t0.25,\n\t\t\t{\n\t\t\t\t\"margin-left\": (pos[index][leftOrRight]+\"px\")\n\t\t\t},\n\t\t\t{\n\t\t\t\ttween: glow.tweens.easeOut()\n\t\t\t}\n\t\t).start();\n\t}", "function move() {\r\n\t\r\n}", "move(deltaTime){\n this.x += this.speed * this.direction * deltaTime;\n \n //Update Image Positions\n this.image.x = this.x;\n this.healthBar.x = this.x;\n }", "function move(from, to) {\n\n}", "function moveDisplayImg(e) {\n let mouseXposition = e.clientX - 100;\n let mouseYposition = e.clientY;\n gsap.to(containerWrapperImg, { x: mouseXposition, y: mouseYposition });\n}", "function move(){\n\t\t\tvar head={x:snakeArr[snakeArr.length-1].x+dx,y:snakeArr[snakeArr.length-1].y+dy};\n\t\t\tsnakeArr.push(head);\n\t\t\tsnakeArr.shift();\n\t\t\tsnakeArr.forEach(function(e,i){paint(e.x,e.y,'white','black',cellW);});\n\t\t}", "function move(snake) {\n\tvar h = snake.head,\n\t\td = snake.dir;\n\n\tif (snake.belly) {\n\t\tgrow(snake);\n\t} else if (snake.body.length) {\n\t\tvar back = snake.body.shift();\n\t\tsnake.body.push(back);\n\t\tplaceCell(back, h.x, h.y);\n\t}\n\tplaceCell(snake.head, h.x+d.x, h.y+d.y);\n\n}", "function updateAll()\n{\n // move the snake\n var sl = snake.length - 1; \n snake.push({x: snake[sl].x + dx, y: snake[sl].y + dy});\n snake.shift(); \n}", "moveRight() {\n this.shinobiPos.x += 30\n }", "move(){\n this.x = this.x+this.vx;\n this.y = this.y+this.vy;\n if(this.x > width || this.x < 0){\n this.vx *= -1;\n }\n if(this.y>height || this.y<0){\n this.vy *= -1;\n }\n var v = createVector(this.x, this.y);\n this.history.push(v);\n //Only trace 200 positions prior \n if(this.history.length > 200){\n this.history.splice(0,1);\n }\n }", "translate(newPosX, newPosY) {\n this.posX = newPosX\n this.imgProperties.posX = newPosX - (this.tileSize - this.width) / 2\n this.posY = newPosY\n this.imgProperties.posY = newPosY - this.tileSize * 0.65\n }", "skierMove() {\n const { xStart, yStart, xEnd, yEnd } = this.props.oneRunInfo;\n Animated.loop(\n Animated.sequence([\n Animated.timing(this.state.skierStart, {\n toValue: {x: xStart, y: yStart},\n duration: 1000,\n }, this.state.skierStart.setValue({x: parseInt(xStart), y: parseInt(yStart)})),\n Animated.timing(this.state.skierStart, {\n toValue: {x: xEnd, y: yEnd},\n duration: 2000,\n })\n ]), {\n iterations: 4\n }\n ).start()\n }", "move() {\n // Update position\n this.x += this.vx;\n this.y += this.vy;\n // Handle wrapping\n this.handleWrapping();\n }", "move() {\n if (!this.isOnTabletop()) return;\n let [dx, dy]=FacingOptions.getFacingMoment(this.facing);\n let nx=this.x+dx;\n let ny=this.y+dy;\n if (this.tabletop.isOutOfBoundary(nx, ny)) return;\n this.x=nx;\n this.y=ny;\n }", "function move(coordinatesCallback,centerCallback,dir,soundOnMove){\n for(var i = 0; i < tetromino.cells.length; i++){\n var old_x = tetromino.cells[i][0];\n var old_y = tetromino.cells[i][1];\n var new_coord = coordinatesCallback(i,dir);\n var new_x = new_coord[0];\n var new_y = new_coord[1];\n tetromino.cells[i][0] = new_x;\n tetromino.cells[i][1] = new_y;\n tetromino.sprites[i].x = new_x*blockSize;\n tetromino.sprites[i].y = new_y*blockSize;\n scene[old_x][old_y] = 0;\n scene[new_x][new_y] = blockValue;\n }\n if(centerCallback) {\n var center_coord = centerCallback(dir);\n tetromino.center = [center_coord[0],center_coord[1]];\n }\n if(soundOnMove) {\n Game.radio.playSound(Game.radio.moveSound);\n }\n}", "function movesmash() {\n horizontal += dhorizontal\n verticle += dverticle\n if (horizontal + smash.width > width || horizontal < 0) {\n dhorizontal = dhorizontal * -1\n }\n else if (verticle + smash.height > height || verticle < 0) {\n dverticle = dverticle * -1\n }\n}", "function move() {\n\t\tmovePiece(this);\n\t}", "move() {\n\n\t\tthis.x += random(-5, 5);\n\t\tthis.y += random(-5, 5);\n\n\t}", "function move(coordinatesCallback, centerCallback, dir, soundOnMove) {\n for (var i = 0; i < tetromino.cells.length; i++) {\n var old_x = tetromino.cells[i][0];\n var old_y = tetromino.cells[i][1];\n var new_coord = coordinatesCallback(i, dir);\n var new_x = new_coord[0];\n var new_y = new_coord[1];\n tetromino.cells[i][0] = new_x;\n tetromino.cells[i][1] = new_y;\n tetromino.sprites[i].x = new_x * blockSize;\n tetromino.sprites[i].y = new_y * blockSize;\n scene[old_x][old_y] = 0;\n scene[new_x][new_y] = blockValue;\n }\n if (centerCallback) {\n var center_coord = centerCallback(dir);\n tetromino.center = [center_coord[0], center_coord[1]];\n }\n if (soundOnMove) {\n Game.radio.playSound(Game.radio.moveSound);\n }\n}", "move() {\n //if I'm going east & I hit the edge...\n if(this.direction === 0) {\n this.x += this.speed;\n if (this.x > (WIDTH)){\n this.place()\n } //if I'm going west & I hit the edge...\n } else if(this.direction === 1) {\n this.x -= this.speed;\n if (this.x < 0) {\n this.place()\n }\n //if I'm going south & I hit the edge...\n } else if(this.direction === 2) {\n this.y += this.speed;\n if (this.y > (HEIGHT)) {\n this.place()\n }\n //if I'm going north & I hit the edge...\n }else if(this.direction === 3) {\n this.y -= this.speed;\n if (this.y < 0) {\n this.place()\n }\n }\n}", "function movementOfTheMonkeyUpDown(newPosition, rotate) {\n lionImage.style.top = `${newPosition}%`;\n lionImage.style.transform = rotate;\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(sp) {\n \n // change speeds: \n this.xv += randomGaussian() * sp;\n this.yv += randomGaussian() * sp;\n\n // if speed too high in one direction, or off screen, accelerate in other direction:\n let v_constraint = 15;\n if(this.xv > sp * v_constraint | this.x > width){\n this.xv -=sp;\n }\n if(this.xv < -sp * v_constraint | this.x < (-width)){\n this.xv += sp;\n }\n if(this.yv > sp * v_constraint | this.y > height){\n this.yv -= sp;\n }\n if(this.yv < -sp * v_constraint | this.y < (-height)){\n this.yv += sp;\n }\n\n // Change location based on the speed\n this.x += this.xv;\n this.y += this.yv;\n }", "move() {\n // To update the position\n this.x += this.vx;\n this.y += this.vy;\n // Handle wrapping\n this.handleWrapping();\n }", "function move_tile(tile)\n{\n var x = tile.ix * tile_width+2.5;\n var y = tile.iy * tile_height+2.5;\n tile.elem.css(\"left\",x);\n tile.elem.css(\"top\",y);\n}", "move(){\n for(let i = this.snake.length - 1; i > 0; i--){\n this.snake[i].style.left = `${this.snake[i - 1].offsetLeft}px`;\n this.snake[i].style.top = `${this.snake[i - 1].offsetTop}px`;\n }\n switch(this.direction){\n case LEFT:\n this.snakeHead.style.left = `${this.snakeHead.offsetLeft - this.cellWidth}px`;\n break;\n case UP:\n this.snakeHead.style.top = `${this.snakeHead.offsetTop - this.cellWidth}px`;\n break;\n case RIGHT:\n this.snakeHead.style.left = `${this.snakeHead.offsetLeft + this.cellWidth}px`;\n break;\n case DOWN:\n this.snakeHead.style.top = `${this.snakeHead.offsetTop + this.cellWidth}px`;\n break;\n }\n this.lastDirection = this.direction;\n }", "function move() {\n xPos += xSpeed; \n yPos += ySpeed;\n if (yPos >= height - 75 || yPos <= 0) { \n ySpeed = ySpeed * -1; \n }\n if (xPos >= width - 250 || xPos <= 0) { \n xSpeed = xSpeed * -1; \n }\n}", "function drawStickMan(sourceX, destinationX, destinationY){\n contexte.drawImage(spriteStickMan, sourceX, 64*2, tailleTuileX, tailleTuileY, destinationX, destinationY, tailleTuileX*agrandissementTuile, tailleTuileY*agrandissementTuile);\n}", "function myMove(e) {\n x = e.pageX - canvas.offsetLeft;\n y = e.pageY - canvas.offsetTop;\n\n for (c = 0; c < tileColumnCount; c++) {\n for (r = 0; r < tileRowCount; r++) {\n if (c * (tileW + 3) < x && x < c * (tileW + 3) + tileW && r * (tileH + 3) < y && y < r * (tileH + 3) + tileH) {\n if (tiles[c][r].state == \"e\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"w\";\n\n boundX = c;\n boundY = r;\n\n }\n else if (tiles[c][r].state == \"w\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"e\";\n\n boundX = c;\n boundY = r;\n\n }\n }\n }\n }\n}", "update() {\n\n this.nextMoveX = this.x + this.nextDirectionX;\n this.nextMoveY = this.y + this.nextDirectionY;\n\n\n }", "constructor(inx, iny, ins, intp) {\n this.x = inx; \n this.y = iny;\n this.s = ins;\n this.type = intp;\n this.moving = false;\n this.m = 2;\n this.pos = 0;\n this.speed = 1.5;\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}", "function moveStep(){\n megamanXPos += megamanXSpeed;\n megamanYPos += megamanYSpeed;\n }", "function moveShooter(e) {\n squares[currentShooterIndex].classList.remove(\"shooter\");\n switch(e.code) {\n case \"ArrowLeft\":\n if (currentShooterIndex % width !== 0) {\n currentShooterIndex--; \n } \n break;\n case \"ArrowRight\":\n if (currentShooterIndex % width < width - 1) {\n currentShooterIndex++; \n } \n break;\n default: break;\n }\n squares[currentShooterIndex].classList.add(\"shooter\");\n }", "animate() {\r\n if(this.count>6) {\r\n this.count = 0;\r\n if(this.side) { //True = right\r\n if(this.image===this.idleRight) { //Idle changed to a moving sprite\r\n this.image = this.goRight; //Moving - to idle\r\n } else {\r\n this.image = this.idleRight;\r\n }\r\n } else {\r\n if (this.image===this.idleLeft) {\r\n this.image = this.goLeft;\r\n } else {\r\n this.image = this.idleLeft;\r\n }\r\n }\r\n }\r\n }", "move() {\n\n // if it leaves the w, change direction\n if (this.x > width) {\n this.xspeed = -this.xspeed;\n }\n else if (this.x < 0) {\n this.xspeed = Math.abs(this.xspeed);\n }\n\n //if it leaves the height, change direction\n\n if (this.y > height + 50) {\n return true;\n }\n\n if (this.y < 0) {\n this.yspeed = Math.abs(this.yspeed)\n }\n\n\n\n this.x += this.xspeed;\n this.y += this.yspeed;\n \n }", "move() {\n this.center.x += this.speed.x;\n this.center.y += this.speed.y;\n \n wrapAround(this.center);\n }", "function getCharacterMove(dir){\n character_face[dir] = getCharacterImg(moveInd[dir])\n moveInd[dir] += 1\n \n}", "function backgroundMove(){\n imageMode(CORNER);\n bgImg.resize(7250,720);\n image(bgImg, bgLeft, 0);\n}", "movedown() {\n\n this.posY = this.posY + 10; //change\n if (spiel.cover != null) {\n if (this.posY >= 280 && spiel.cover.length > 0) {\n\n document.getElementById('playerExp').play();\n spiel.cover[0].explode();\n spiel.cover.splice(0, 1);\n }\n }\n }", "function draw() {\n //frameRate(1);\n //background (250);\n //xpos = xpos + 10;\n //ypos = ypos - 10;\n console.log(xpos);//check for errors\n \n image(sprite,xpos,ypos);\n}", "function moveBird(){\n if (mvL && storky.position.x >= -21) storky.position.x -= 0.2;\n if (mvR && storky.position.x <= 21) storky.position.x += 0.2;\n if (mvU && storky.position.y <= 6) pushStorkyUp();\n\n //update the box collider to follow the stork\n storkyBoxCollider.position.x = storky.position.x;\n storkyBoxCollider.position.y = storky.position.y + 0.2;\n}", "animate() {\n this._drawSprite(\n this.image, \n this.width * this.frameX, \n this.height * this.frameY,\n this.width, \n this.height, \n this.x,\n this.y, \n this.width, \n this.height\n )\n this.movePlayer()\n this.playerFrame() \n }", "walk(framesCounter) {\n this.ctx.drawImage(\n this.imageInstance,\n this.imageInstance.framesIndex * Math.floor(this.imageInstance.width / this.imageInstance.frames),\n 0,\n Math.floor(this.imageInstance.width / this.imageInstance.frames),\n this.imageInstance.height,\n this.shinobiPos.x,\n this.shinobiPos.y,\n this.shinobiSize.w,\n this.shinobiSize.h\n )\n this.animateSprite(framesCounter)\n }", "move(direction) {\r\n let container = document.querySelector(this.target + ' .images'),\r\n bcr = container.getBoundingClientRect(),\r\n prev = (this.active > 0) ? this.active - 1 : this.len - 1,\r\n next = (this.active < this.len - 1) ? this.active + 1 : 0,\r\n self = this,\r\n step = Math.round(bcr.height / 15)\r\n\r\n //animation\r\n function anim(dir) {\r\n let top = getComputedStyle(container).top.match(/[-]?[0-9]{1,}/)[0]\r\n self.animRun = true\r\n\r\n if(dir === '->' && (-top < bcr.height)) {\r\n\r\n if((bcr.height + +(top)) < step)\r\n step = bcr.height + +(top)\r\n\r\n container.style.top = (top - step) + 'px'\r\n window.requestAnimationFrame(() => {anim(direction)})\r\n\r\n } else if(dir === '<-' && (top < bcr.width)) {\r\n\r\n if((bcr.height - +(top)) < step)\r\n step = bcr.height - +(top)\r\n\r\n container.style.top = (+(top) + step) + 'px'\r\n window.requestAnimationFrame(() => {anim(direction)})\r\n\r\n } else {\r\n\r\n //switches the src of imgs -> active one in middle, prev on the left, next on the right\r\n self.img.prev.src = self.src[prev]\r\n self.img.prev.alt = prev\r\n\r\n self.img.active.src = self.src[self.active]\r\n self.img.active.alt = self.active\r\n\r\n self.img.next.src = self.src[next]\r\n self.img.next.alt = next\r\n\r\n container.style.top = 0\r\n self.animRun = false\r\n\r\n }\r\n }\r\n window.requestAnimationFrame(() => {anim(direction)})\r\n\r\n this.mark(this.active)\r\n }" ]
[ "0.6845299", "0.6717159", "0.6665342", "0.66635567", "0.6496797", "0.6470725", "0.6406895", "0.6402532", "0.63992864", "0.6322238", "0.6302872", "0.6297405", "0.6287569", "0.6286019", "0.6241229", "0.6234073", "0.620637", "0.61893684", "0.6175483", "0.6170292", "0.6156105", "0.6118511", "0.6110242", "0.6093473", "0.6093473", "0.6083292", "0.60797054", "0.6074036", "0.60680705", "0.60333735", "0.60298353", "0.6023481", "0.6015078", "0.5996464", "0.5987042", "0.5979754", "0.5978727", "0.59658015", "0.5944195", "0.59389967", "0.5921887", "0.5921887", "0.5919947", "0.59142554", "0.59097725", "0.5908625", "0.5907538", "0.59065384", "0.59022385", "0.5898003", "0.58960843", "0.58958066", "0.5894878", "0.58939123", "0.58920336", "0.5887205", "0.58847755", "0.5874295", "0.5871006", "0.5866909", "0.58640814", "0.5862613", "0.5861765", "0.5861478", "0.58510214", "0.58457446", "0.58429515", "0.58428216", "0.5836497", "0.5836485", "0.58333457", "0.5827822", "0.5819407", "0.581713", "0.5810583", "0.57985157", "0.57866746", "0.5785559", "0.57821923", "0.57810783", "0.57779706", "0.5777955", "0.5776711", "0.5775237", "0.57743406", "0.5772885", "0.57651025", "0.57601935", "0.57579106", "0.5757186", "0.5756684", "0.575351", "0.5753028", "0.57514375", "0.5750124", "0.57484883", "0.57309926", "0.5729837", "0.572749", "0.57187986" ]
0.6568766
4
Method for checking whether the puzzle is complete (needs to be called after dragging events)
checkComplete(){ console.log("Checking stones") // Get the depth of the five stones var stone1Depth = $('.well-grid-cell-wrapper[data-grid-row=6][data-grid-col=2]').attr('data-stone-clicked') var stone2Depth = $('.well-grid-cell-wrapper[data-grid-row=28][data-grid-col=1]').attr('data-stone-clicked') var stone3Depth = $('.well-grid-cell-wrapper[data-grid-row=46][data-grid-col=1]').attr('data-stone-clicked') var stone4Depth = $('.well-grid-cell-wrapper[data-grid-row=50][data-grid-col=0]').attr('data-stone-clicked') var stone5Depth = $('.well-grid-cell-wrapper[data-grid-row=67][data-grid-col=4]').attr('data-stone-clicked') // Use these if you want a quick test var tstone1Depth = $('.well-grid-cell-wrapper[data-grid-row="0"][data-grid-col="0"]').attr('data-stone-clicked') var tstone2Depth = $('.well-grid-cell-wrapper[data-grid-row="0"][data-grid-col="1"]').attr('data-stone-clicked') var tstone3Depth = $('.well-grid-cell-wrapper[data-grid-row="0"][data-grid-col="2"]').attr('data-stone-clicked') var tstone4Depth = $('.well-grid-cell-wrapper[data-grid-row="0"][data-grid-col="3"]').attr('data-stone-clicked') var tstone5Depth = $('.well-grid-cell-wrapper[data-grid-row="0"][data-grid-col="4"]').attr('data-stone-clicked') // Compare the depths to the targets // Real checks if ((parseInt(stone1Depth) == 1) && (parseInt(stone2Depth) == 2) && (parseInt(stone3Depth) == 3) && (parseInt(stone4Depth) == 4) && (parseInt(stone5Depth) == 5)) { // End of real checks // Testing checks //if ((parseInt(tstone1Depth) == 1) && // (parseInt(tstone2Depth) == 2)) { // End of testing checks nextHint = 'travel_well_volcano' // Set a timeout so that you can see the stone finish setTimeout(function(){ // Show a dialogue modal, describing the entry opening $('#dialogue-modal').find('.modal-title').text('The fifth stone slides back into the wall...') $('#dialogue-modal').modal('show') // Show the updated background and clues puzzle.openHidingPlace() },1000) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function completed() {\n var counter = 1;\n for(var row = 0; row < puzzle.length; row++) {\n for(var col = 0; col < puzzle[row].length; col++) {\n if(puzzle[row][col] == counter) counter++;\n else if (puzzle[row][col] == 0 && row == puzzleSize - 1 && col == puzzleSize - 1) return true;\n else return false;\n }\n }\n return false;\n}", "is_finished() {\n // if last piece\n let cpt = 0;\n\n for (let x = 0; x < 6; x++) {\n for (let y = 0; y < 6; y++) {\n if (this._board[x][y] !== -1) {\n cpt++;\n }\n }\n }\n if (cpt === 0) {\n return true;\n }\n // if one player have the set of color\n for (let i = 0; i < 6; i++) {\n if (this._player_1_pieces[i] === 6) {\n return true;\n }\n if (this._player_2_pieces[i] === 6) {\n return true;\n }\n }\n return false;\n }", "checkCompletedBoard(){\n let totalSquares = board.columnCount * board.rowCount;\n let dustedSquaresCount = 0;\n for(let checkColumn=0; checkColumn<board.columnCount; checkColumn++) {\n for(let checkRow=0; checkRow<board.rowCount; checkRow++) {\n let s = board.squares[checkColumn][checkRow];\n if (board.squares[checkColumn][checkRow].dusted===1) {\n dustedSquaresCount++;\n }\n }\n }\n if (dustedSquaresCount===totalSquares){\n level.boardFinished();\n }\n }", "_checkIfComplete() {\n\n\t\tif(this._matchedCards === this.rows*this.cols) {\n\n\t\t\t// Delay for the animations\n\t\t\tsetTimeout(() => {\n\n\t\t\t\talert(`You have scored ${this._score} points`);\n\n\t\t\t\tclearInterval(this._timer);\n\n\t\t\t\tthis.initGame();\n\t\t\t}, 400);\n\t\t}\n\t}", "function isEnd() {\n\t\tlet flag = true;\n\t\tfor (let i = 0; i < pieceCount.length; i++) {\n\t\t\t//for each puzzle piece\n\t\t\tlet top = parseInt(pieceCount[i].style.top);\n\t\t\tlet left = parseInt(pieceCount[i].style.left);\n\t\t\tif (left != (i % 4 * PIECESIZE) || top != parseInt(i / 4) * PIECESIZE) {\n\t\t\t\t//checks if each piece matches its left and top position\n\t\t\t\tflag = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn flag;\n\t}", "gameIsFinished() {\n return this.rows[0].some(\n cell => cell.filled \n );\n }", "function doneDigging() {\n return gotStart && gotFinish && cellsVisited == numCells;\n }", "function checkPuzzle(){\n var re =1;\n if(solv ==0){\n for(var id in tl_p){\n if(id !=tl_p[id].ord){ re =0; break;}\n }\n }\n if(re ==1){\n cnt.drawImage(img, 0, 0, width, height);\n \n //if solved manually (-1 is auto) calls solved()\n if(solv ==0){\n solv =1;\n me.solved();\n }\n }\n }", "checkComplete() {\n let result = true;\n for (let i = 0; i < this.solution.length; i++) {\n result = result && this.solution[i] === this.inputGates[i];\n }\n let oldComplete = this.complete;\n this.complete = result;\n if ((this.complete !== oldComplete) && this.complete) {\n bing.play();\n }\n }", "puzzleIsValid() {\r\n\t\ttry {\r\n\t\t\tthis.fullHouse(false, false);\r\n\t\t} catch {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function checkGameFinished() {\r\n if (getScore(PLAYER) == 0) return true;\r\n for (var i = 0; i < field_height; i++)\r\n for (var j = 0; j < field_width; j++)\r\n if (game_field[i][j] == EMPTY) return false;\r\n return true;\r\n}", "isDone() {\n return !this.loop && this.currentFrame >= this.sprites.length;\n }", "function gameFinished() {\n 'use strict';\n return othelloGrid.countDiscs(OTHELLO_CONST.empty) != 0 ? false : true;\n}", "isComplete() {\n for (let i = 0; i < this.rounds.length; i++) {\n for (let j = 0; j < this.rounds[i].length; j++) {\n if (this.rounds[i][j] == \"\") {\n return false;\n }\n }\n }\n return true;\n }", "function checkIfCompleted() {\n matchingCards++;\n\n if (matchingCards >= Math.floor(fieldSize / 2)) {\n gameCompleted = true;\n timerStop();\n gratulation();\n }\n }", "function finish()\r\n\r\n{\r\n\tvar flag = true;\r\n\r\n\tfor (var i = 0; i < gamePiece.length; i++) \r\n\t{\r\n\r\n\t\tvar top = parseInt(gamePiece[i].style.top);\r\n\t\tvar left = parseInt(gamePiece[i].style.left);\r\n\r\n\t\tif (left != (i%4*100) || top != parseInt(i/4)*100) \r\n\r\n\t\t{\r\n\t\t\tflag = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\treturn flag;\r\n}", "isSolved() {\n if (this.tiles[this.tiles.length - 1] !== 0) {\n return false;\n }\n for (let i = 0; i < this.tiles.length - 1; i++) {\n if (this.tiles[i] !== i + 1) {\n return false;\n }\n }\n return true;\n }", "isFinished() {\n if(this.noMoreTurns()||this.getWinner()!==null)\n return true;\n else\n return false;\n\n }", "function checkGridComplete() {\n // Make an array of all squares in the grid to look through\n let squares = qsa(\".square\");\n // Make an empty array to store empty squares in\n let emptySquares = [];\n for (let i = 0; i < squares.length; i++) {\n // Define a variable to show the content of the squares within the squares array\n let squareContent = squares[i].textContent;\n // If the sqaure's content is an empty string\n if (squareContent === \"\") {\n // All empty squares are pushed onto the emptySquares array\n emptySquares.push(squareContent);\n }\n }\n // If the array is empty, the game is won. Else the game continues\n if (emptySquares.length === 0) {\n return true;\n } else {\n return false;\n }\n}", "function isDone(self) {\n return Ex.fold_(self.exit, _ => O.isNone(C.flipCauseOption(_)), _ => false);\n}", "isFinished() {\n\n return this.pairsGuessed !== this.cards.length / 2 ? false : true\n\n }", "done() {\n for (let i = 0; i < this.players.length; i++) {\n if (!this.players[i].dead) {\n return false;\n }\n }\n return true;\n }", "function completed() {\n\t\t\t\t\tif (activeSortable) {\n\t\t\t\t\t\t// Set ghost class to new sortable's ghost class\n\t\t\t\t\t\t_toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n\t\t\t\t\t\t_toggleClass(dragEl, options.ghostClass, true);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (putSortable !== _this && _this !== Sortable.active) {\n\t\t\t\t\t\tputSortable = _this;\n\t\t\t\t\t} else if (_this === Sortable.active) {\n\t\t\t\t\t\tputSortable = null;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t// Null lastTarget if it is not inside a previously swapped element\n\t\t\t\t\tif ((target === dragEl && !dragEl.animated) || (target === el && !target.animated)) {\n\t\t\t\t\t\tlastTarget = null;\n\t\t\t\t\t}\n\t\t\t\t\t// no bubbling and not fallback\n\t\t\t\t\tif (!options.dragoverBubble && !evt.rootEl && target !== document) {\n\t\t\t\t\t\t_this._handleAutoScroll(evt);\n\t\t\t\t\t\tdragEl.parentNode[expando]._computeIsAligned(evt);\n\t\t\t\t\t}\n\n\t\t\t\t\t!options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n\n\t\t\t\t\treturn true;\n\t\t\t\t}", "isBoardSolved() {\n const diff = symmetricDifference(this.sudokuBoard.flat(), completedSet);\n return this.isValidBoard() && diff.size === 0;\n }", "function done_digging() {\n return got_start && got_finish && num_cells_visited == num_cells;\n }", "pageCompleted()\n {\n \tlet self = this;\n \tlet pag = self.getCurrentPage();\n \t\n \t// Are the page elements solved?\n \tlet solved = true;\n \t\n \t// Get all elements\n \tlet eles = self.canvasContent.getElementsByTagName( '*' );\n \t\n \tfor( let a = 0; a < eles.length; a++ )\n \t{\n \t\t// Checking element dummy\n \t\tif( eles[a].dummy )\n \t\t{\n \t\t\tif( !eles[a].dummy.resolved )\n \t\t\t{\n \t\t\t\tsolved = false;\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t}\n \treturn solved;\n }", "function checkIfDone() {\n var done = true;\n var hasResult = false;\n \n\n for ( i = 0; i < results.length; i++) {\n \tconsole.log('results[' + i + '].waiting: ' + results[i].waiting);\n \tconsole.log('results[' + i + '].geo_info.valid: ' + results[i].geo_info.valid);\n \tconsole.log('results[i]:');\n \tconsole.log(results[i]);\n if (results[i].waiting) {\n done = false;\n break;\n }\n if (results[i].geo_info.valid) {\n hasResult = true;\n }\n }\n\t\t\tconsole.log(done);\n if (done) {\n if (hasResult) {\n finish(true);\n } else {\n console.log('failed'); finish(false);\n }\n }//if (done)\n\n }", "function checkDone(){\n var done=true;\n\t\tvar currentCards=[];\n\t\tfor (var j=1;j<7;j++){\n\t\t\tfor (var i=1;i<4;i++){\n\t\t\t\tif (cardsOnBoard[j][i]!=null){\n\t\t\t\t\tcurrentCards.push(cardsOnBoard[j][i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tvar numCardsOnBoard=currentCards.length;\n\t\t//brute force all possible sets\n\t\tfor (var i=0; i<numCardsOnBoard; i++){\n\t\t\tfor (var j=i; j<numCardsOnBoard-1; j++){\n\t\t\t\tfor (var k=j; k<numCardsOnBoard-2; k++){\n\t\t\t\t\tif (i!=j && j!=k && i!=k && checkSet(currentCards[i],currentCards[j],currentCards[k])){\n\t\t\t\t\t\t//if there is a set, you aren't done\n\t\t\t\t\t\tdone=false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn done;\n }", "allQuestCompleted() {\n return !this.incompleteQuests().length;\n }", "function isDone() {\n return state === states.done;\n }", "isGameFinished() {\n // alert(this.questions.length);\n if (this.questionIndex === this.questions.length) {\n console.log('returning true');\n return true;\n }\n }", "get is_complete() {\n return !!(this.flags & PaintVolumeFlags.IS_COMPLETE);\n }", "function checkDoneAction(){\n db.game.findOne({\"game_id\": clientSocket.gameRoom},function(err,doc){\n var done = true;\n var playerArray = doc.player_list;\n playerArray.forEach(function(player){\n if(player.finishedAction === false){\n done = false;\n }\n });\n\n if(done){\n return true;\n }\n return false;\n });\n }", "finished() {\n return this.y > height || this.y < 0;\n }", "function sudokuSolved(puzzi){\n\n\n\tfor(var i = 0 ; i<puzzi.length ;i++){\n\n\t\tif(rowFinished(puzzi[i]) === false){\n\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}", "isFinished (){\n\t\treturn this.status !== null && this.finishDelay < 0;\n\t}", "function Complete(com){\r\n\t\tvar done = false;\r\n\t\ttop = 0;\r\n\t\tleft = 0;\r\n\r\n\t\tfor(var x = 0; x<pieces.length;x++){ \r\n\t\t\tif (com[x].style.left == left && com[x].style.top == top){\r\n\t\t\t\tdone = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdone = false;\r\n\t\t\t} \r\n\t\t\t\r\n\t\t}\r\n\r\n\t}//end of Complete() ", "function isAllCorrectTilesSelected() {\n if (correctTiles.length == 0) {\n toggleGridUnclickable();\n setTimeout(() => increaseDifficulty(), 1000);\n return true;\n }\n return false;\n}", "allPlayersDone() {\n var showHostOffset = 0;\n var doneCount = 0;\n\n this.playerMap.doAll((player) => {\n if (player.isShowHost) {\n showHostOffset++;\n } else if (!player.hasFastestFingerChoicesLeft()) {\n doneCount++;\n }\n });\n\n return doneCount >= this.playerMap.getPlayerCount() - showHostOffset;\n }", "static allQuestCompleted() {\n for (let questCompleted of player.completedQuestList) {\n if (!questCompleted()) {\n return false;\n }\n }\n return true;\n }", "isComplete() {\n return this.selection != null;\n }", "isComplete() {\n return this.selection != null;\n }", "function isSudokuComplete() {\n // Get all inputs of type number\n let results = Array.from(document.querySelectorAll('input[type=number]'));\n // Filter out any inputs that have no value\n results = results.filter(element => element.value.length > 0);\n\n // Debug Log\n if (results.length === 81) {\n console.log(\"Sudoku Completed!\")\n } else {\n console.log(\"Sudoku not completed: only \" + results.length + \"/81 inputs solved!\");\n }\n\n // If the results array has 81 members, the sudoku is complete\n return results.length === 81 ? true : false;\n}", "isFinished() {\n // after the first player third move, checks if anybody wan the game\n if(this.moves >= 5) {\n let i, j;\n\n // check rows\n for(i = 0; i < 6; i = i + 3) {\n if(this.board[i] !== 'E' && this.board[i] === this.board[i + 1] && this.board[i + 1] == this.board[i + 2]) {\n this.updatePlayerScore(this.result = {\n status: 'finished',\n winner: this.board[i]\n });\n return true;\n }\n }\n\n // check cols\n for(i = 0; i <= 2; i ++) {\n if(this.board[i] !== 'E' && this.board[i] === this.board[i + 3] && this.board[i + 3] == this.board[i + 6]) {\n this.updatePlayerScore(this.result = {\n status: 'finished',\n winner: this.board[i]\n });\n return true;\n }\n }\n\n // check diagonals\n for(i = 0, j = 4; i <= 2; i = i + 2, j = j - 2) {\n if(this.board[i] !== 'E' && this.board[i] === this.board[i + j] && this.board[i + j] == this.board[i + 2*j]) {\n this.updatePlayerScore(this.result = {\n status: 'finished',\n winner: this.board[i]\n });\n return true;\n }\n }\n\n if(this.moves === 9) {\n this.updatePlayerScore(this.result = {\n status: 'draw'\n });\n return true;\n }\n }\n\n // if there is not winner, the game is still running and the next player shoul move\n this.result = {status: 'running'};\n\n return false;\n }", "function checkFinish()\r\n {\r\n player = currentPlayer();\r\n\r\n if(completeRow = isRowComplete(player))\r\n {\r\n highlightWinningCells(_ROW, completeRow);\r\n }\r\n\r\n if(completeCol = isColumnComplete(player))\r\n {\r\n highlightWinningCells(_COL, completeCol);\r\n }\r\n\r\n if(completeDiagonal_1 = isDiagonalComplete(player, _FIRST_DIAGONAL))\r\n {\r\n highlightWinningCells(_DIAGONAL, completeDiagonal_1);\r\n }\r\n\r\n if(completeDiagonal_2 = isDiagonalComplete(player, _SECOND_DIAGONAL))\r\n {\r\n highlightWinningCells(_DIAGONAL, completeDiagonal_2);\r\n }\r\n\r\n if( completeRow || completeCol || completeDiagonal_1 || completeDiagonal_2 )\r\n {\r\n congratulate(player);\r\n finalize();\r\n\r\n // It returns the player number just in case in the next extensions of the program, we decide to store the players' scores.\r\n // Otherwise, simply return suffices.\r\n return player;\r\n }\r\n\r\n // The following will be executed only if there is no winner (based on the result of the code above).\r\n if(isTableFull())\r\n {\r\n congratulate(_BOTH);\r\n finalize();\r\n return _BOTH;\r\n }\r\n\r\n return 0;\r\n }", "function checkCompletion() {\n\tif (levelCompleted()) {\n\t\tincreasePoints();\n\t\tinitLevel(currentLevel + 1);\n\t\tinitValues();\n\t\tinitCells();\n\t}\n}", "function checkSuccessfullEnd(){\n successfullEnd = true;\n if(moves>0) successfullEnd = false;\n if (successfullEnd) alert(\"you won!\") \n}", "function gameOver() {\n puzzleEnd(false)\n }", "finished() {\n return (this.root.length >= this.totalLength * this.scale);\n }", "finished() {\n const target = Game.getObjectById(this.params.targetId);\n if (target.hits <= 0) {\n return true;\n }\n }", "function check_for_completion()\n{\n\tvar $btn_complete = $(\"#btn-complete\"),\n\t\t$tasks = $(\"#project .tasks li.task\"),\n\t\t$complete_tasks = $(\"#project .tasks li.task.complete\"),\n\t\ttask_len = $tasks.length,\n\t\tcomplete_task_len = $complete_tasks.length,\n\t\tis_complete = false;\n\t\t\n\tif(complete_task_len >= task_len)\n\t{\n\t\t$btn_complete.removeClass(\"disable\");\n\t\tis_complete = true;\n\t}\n\telse\n\t{\n\t\t$btn_complete.addClass(\"disable\");\n\t\tis_complete = false;\n\t}\n\t\n\treturn is_complete;\n}", "_complete() {\n this.wrapperEl.addClass(this.options.classes.completed);\n this.element.addClass(this.options.classes.completed);\n this.element.trigger(SnapPuzzleEvents.complete, this);\n }", "function hasWon(puzzle)\n{\n var i = 0;\n for (var r = 0; r < 4; r++) \n {\n for (var c = 0; c < 4; c++) \n {\n if (i < puzzle.length)\n {\n var currentRow = parseInt(puzzle[i].style.top, 10) / 100;\n var currentCol = parseInt(puzzle[i].style.left, 10) / 100;\n if (currentRow != r || currentCol != c)\n { \n return false;\n }\n i++;\n }\n }\n }\n $(\"text\").removeClassName(\"lose\");\n $(\"text\").addClassName(\"win\");\n $(\"text\").innerHTML = \"You've solved the puzzle in \" + moves + \" moves!\";\n moves = 0;\n return true;\n}", "function gameWin() {\n puzzleEnd(true)\n }", "function isComplete(){\n if(rootCheck.checked && relativeCheck.checked){\n return rootSelAnswer != -1 && modeSelAnswer != -1 && relativeSelAnswer != -1;\n }else if (rootCheck.checked) {\n return rootSelAnswer != -1 != -1 && modeSelAnswer != -1;\n }else if (relativeCheck.checked) {\n return modeSelAnswer != -1 && relativeSelAnswer != -1;\n }else {\n return modeSelAnswer != -1;\n }\n}", "isDone() {\n return this.single.length == 0 ? true : false\n }", "isLevelComplete() {\n let gridSpace;\n for (let x = 0; x < gameState.GRID_WIDTH; x++) {\n for (let y = 0; y < gameState.GRID_HEIGHT; y++) {\n gridSpace = gameState.grid[x][y];\n if (gridSpace.targetNumber && !gridSpace.absorbed) {\n console.log(\"Get the \" + gridSpace.number + \" at (\" + x + \", \" + y + \")\");\n return false;\n }\n }\n }\n return true;\n }", "finished() {\n let d = p5.Vector.dist(this.pos, target.getCenter());\n if (d < this.recordDist) {\n this.recordDist = d;\n }\n if (target.contains(this.pos)) {\n this.stopped = true;\n return true;\n }\n return false;\n }", "function isCompleted() {\n return cards.length === matchedCards.length;\n}", "function finishedAssignment(assignmentNr)\n{\n for(i = 0 ; i < exercisesFinished[assignmentNr].length ; i++)\n {\n // If at least one exercise is not finished, return false.\n if(!exercisesFinished[assignmentNr][i])\n {\n return false;\n }\n }\n return true;\n}", "function isSuccessGrid(){\n var success = true;\n var len = $scope.grid.length - 1;\n var i = 1;\n while(success && (i<len)){ // Go through the whole grid\n var j = 1;\n var leng = $scope.grid[i].length - 1;\n while(success && (j<leng)){\n var item = $scope.grid[i][j]\n success = success && ((item.state==-1 && !item.revealed) || (item.revealed)) // Check if the only non-revealed case are mines\n j++;\n }\n i++;\n }\n return success;\n }", "function checkMove() {\n var discToMove = startPeg[startPeg.length - 1];\n var topDisc = endPeg[endPeg.length - 1];\n var moveAvailable = false;\n if (discToMove < topDisc || endPeg.length === 0) {\n moveAvailable = true;\n }\n return moveAvailable;\n }", "function puzzle_solved() {\n\n\t/* jQuery returns -1 if the element is not found */\n\t/* So in our case if -1 is not in board then it returns -1 :) */\n\n\treturn (jQuery.inArray(-1, board) == -1);\n}", "isComplete() {\n if (!this.endTime) return false;\n if (this.now() > this.endTime) {\n return true;\n }\n else {\n return false;\n }\n \n }", "wait_AnimationEnd() {\n if (this.tmpPiece.parabolic.end == true) {\n this.unvalidateCells();\n this.check_GameOver();\n this.check_Reset();\n this.checkSelected();\n this.locked = true;\n }\n }", "is_done() {\n return this.box[0];\n }", "function checkSucess() {\n setTimeout(function() {\n if (answered && hungup) {\n done();\n } else {\n checkSucess();\n }\n }, asyncDelay);\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}", "isEndGame() {\r\n return this.solvedCards.length == this.arrayCards.length;\r\n }", "function checkStatus() {\n var allDone = true;\n\n for (var _i = 0; _i < layers.length; _i++) {\n if (layers[_i].loaded === false) {\n allDone = false;\n break;\n }\n }\n\n if (allDone) finish();else setTimeout(checkStatus, 500);\n }", "isComplete() {\n return this.selection.start != null && this.selection.end != null;\n }", "isComplete() {\n return this.selection.start != null && this.selection.end != null;\n }", "function checkGameOver() {\n let success = true;\n for (const [index, el] of puzzleData.entries()) {\n if (el.value == null) {\n continue;\n }\n if (el.value !== +index + 1) {\n success = false;\n break;\n }\n }\n if (success) console.log('Game Over!')\n }", "function checkStatus()\n\t\t{\n\t\t\tvar count = $('.tile').length;\n\t\t\tif(count == 16)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "function checkCompleted (){\n showUp = 0;\n $('div.nD p').each(function(index, el) {\n if ($(el).css('visibility') == 'visible') {\n showUp++;\n }\n });\n if (showUp == thisNub) {\n $('div.boardKey').css('visibility','hidden');\n $('div.theChar').css('visibility','hidden');\n alert('You are the winner!!!\\nClick reset to restart the game!');\n }\n}", "function gameIsDone(game) {\n return gameHasWinner(game) || gameIsDraw(game);\n}", "function test7() {\n currentPiece = new I();\n currentPiece.moveDown()\n updateGraphics();\n return !currentPiece.coords.some(x => board[x[0]][x[1]] !== currentPiece.color);\n}", "function isAttackPhaseComplete () {\n // logic to check if defender or players are dead.\n if (isCharacterDead(gameState.selectedCharacter)) {\n // you lose!\n alert('You were defeated by ' + gameState.selectedDefender.name + '. Click reset to play again.')\n // display lose message to user, and present reset button.\n $('#selected-character').empty()\n $('#reset-button').show()\n\n return true // returning true because attack phase has completed.\n } else if (isCharacterDead(gameState.selectedDefender)) {\n console.log('defender dead')\n\n // decrement enemiesLeft counter and empty defender div\n gameState.enemiesLeft--\n $('#defender').empty()\n\n // checks if you win the game, or if there are more characters to fight\n if (isGameWon()) {\n // show reset button and alert\n alert('You win! Click Reset to play again')\n $('#reset-button').show()\n } else {\n // Prompt user to select another enemy\n alert('You defeated ' + gameState.selectedDefender.name + '! Select another enemy to fight.')\n enableEnemySelection()\n }\n return true // returning true because attack phase has completed.\n }\n // returning false, because attack phase is not complete.\n return false\n}", "moveCompleted() {\n // Reset the from so we can\n this.from = null;\n\n if (this.gameOver) return;\n this.changeTurn();\n this.hideMessage();\n }", "function isSolved() {\n\t\tvar i, j;\n\t\tvar tobesolved = 0;\n\t\tvar solved = false;\n\n\t\tfor (i=0; i<9; i++) {\n\t\t\tfor (j=0; j<9; j++) {\n\t\t\t\tif ( puzzle[i][j] === 0) {\n\t\t\t\t\ttobesolved++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (tobesolved === 0) {\n\t\t\tsolved = true;\n\t\t}\n\t\treturn solved;\n\t}", "function solution()\n{\n\t// initialize correct-piece counter\n\tvar wincounter = piecenumber;\t\n\t\n\t// check each puzzle piece row by row\n\tfor (i = 0; i < piecerows; i++)\n\t{\n\t\tfor (j = 0; j < piececols; j++)\n\t\t{\n\t\t\t// get current position\n\t\t\tvar xcurr = $(\"#piece\" + i + j).position().left;\n\t\t\tvar ycurr = $(\"#piece\" + i + j).position().top;\n\t\t\t\n\t\t\t// get desired position\n\t\t\tvar ywin = i * piecesize;\n\t\t\tvar xwin = j * piecesize;\n\t\t\t\n\t\t\t// compare and score\n\t\t\tif ((Math.abs(xcurr - xwin) <= 10) && (Math.abs(ycurr - ywin) <= 10))\n\t\t\t\twincounter--;\n\t\t}\n\t}\n\t\n\t// debug\n\t// alert(\"Incorrect Pieces Remaining: \" + wincounter);\n\n\t// you win! maybe.\n\tif (wincounter == 0)\n\t{\n\t\t// freeze pieces\n\t\t$(\".piece\").draggable({disabled: true});\n\n\t\t// freeze solution checking\n\t\t$(\".piece\").unbind(\"mouseup\");\n\t\t\n\t\t// alert user\n\t\tyouwin();\n\t}\n\n}", "function checkSolution(){\n\t puzzleSolution;\n\t}", "function checkIfComplete(){\n\t\tif(isComplete == false){\n\t\t\tisComplete = true;\n\t\t} else {\n\t\t\tplace = ' SEGUNDO ';\n\t\t}\n\t}", "function isSolvedFn() {\n for (var i = 0; i < board.length - 1; i++) { // i < board.length because last index 15, will have 0 (empty space)\n if (board[i] != i + 1) {\n return false;\n }\n }\n return true;\n }", "function isFinished(board, row, col, c){\n for(var i = 0; i < 9; i++) {\n if (board[row][col] == \"\") return false;\n if(board[i][col] != \"\" && board[i][col] == c && i != row) return false; //check row\n if(board[row][i] != \"\" && board[row][i] == c && i != col) return false; //check column\n if(board[3 * Math.floor(row / 3) + Math.floor(i / 3)][ 3 * Math.floor(col / 3) + Math.floor(i % 3)] != \"\" && \nboard[3 * Math.floor(row / 3) + Math.floor(i / 3)][3 * Math.floor(col / 3) + Math.floor(i % 3)] == c && \n((3 * Math.floor(row / 3) + Math.floor(i / 3)) != row && (3 * Math.floor(col / 3) + Math.floor(i % 3)) != col)) return false; //check 3*3 block\n }\n return true;\n}", "static isTutorialCompleted() {\n var _a;\n return ((_a = App.game.quests.getQuestLine('Tutorial Quests')) === null || _a === void 0 ? void 0 : _a.state()) == QuestLineState.ended;\n }", "function checkDone() {\n if (queue.length() == 0 && listObjectsDone) {\n console.log('Tada! All objects have been copied :)');\n }\n}", "function handleIsSolvedButton() {\n // Update the global 2d array.\n updateInternalBoard();\n // Check answer.\n if (isSolved()) {\n alert('Puzzle is solved!');\n }\n else {\n alert('Wrong answer!');\n }\n}", "function tied() {\n var i = 0;\n while (i < 9) {\n if ($(cells[i++]).hasClass(empty_cell)) return false;\n }\n gameisfinished = true;\n return true;\n }", "function isuserFinishedEnteringAprobar(){\n return !isScannerInputAprobar() && userFinishedEnteringAprobar;\n }", "function checkDone() {\r\n\t\t\tif (todo===0) {\r\n\t\t\t\tresultCallback(unmarshalledTable);\r\n\t\t\t}\r\n\t\t}", "function setIsFinal() {\r\n var nPiecesFound = 0;\r\n for (var i in that.finalPieces) {\r\n var finalPiece = that.finalPieces[i];\r\n for (var j in that.pieces) {\r\n var piece = that.pieces[j];\r\n if (finalPiece.equals(piece)) {\r\n nPiecesFound++;\r\n break;\r\n }\r\n }\r\n }\r\n that.isFinal = nPiecesFound == that.finalPieces.length;\r\n }", "solutionCheck() {\n for (let row = 0; row < HEIGHT; row++) {\n for (let col = 0; col < WIDTH; col++) {\n let num = this._puzzle[row][col];\n this._puzzle[row][col] = 0;\n if (num === 0 || !this.isSafe(this._puzzle, row, col, num)) {\n this._puzzle[row][col] = num;\n return false;\n }\n this._puzzle[row][col] = num;\n }\n }\n return true;\n }", "newPieceCanDown(){\n\n\t\tlet isNoCollision = true;\n\t\tfor (let [index, element] of this.newPiece.entries()) {\n\t\t\n\t\t\tlet x = this.newPiecePosition[0] + index%this.newPieceLen;\n\t\t\tlet y = this.newPiecePosition[1]+1 + Math.trunc(index/this.newPieceLen);\n\n\t\t\tif(element > 0){\n\n\t\t\t\tif(this.board[x + y * this.boardLen] > 0 || y >= this.boardSize/this.boardLen){\n\t\t\t\t\tisNoCollision = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\n\t\t}\n\n\t\treturn isNoCollision;\n\n\t}", "function hasMoves () {\n for (var x = 0; x < cols; x++) {\n for (var y = 0; y < rows; y++) {\n if (canTileMove(x, y)) {\n return true;\n }\n }\n }\n return false;\n }", "function checkIfDone(){\n\tif(remainingSlides === 0 | remainingSlides < 0){\n\t\tconsole.log(\"DONE\");\n\t\t$(\"#quiz\").css(\"display\", \"none\");\n\t\t$(\"#results\").css(\"display\", \"block\");\n\t\tvar totalAgainstNN = liked/totalSlides*100;\n\t\tif (totalAgainstNN >= 50.0){\n\t\t\t$(\"#foragainst\").text(\"for\");\n\t\t\t$(\"#foragainst2\").text(\"for\");\n\t\t\t$(\"#magicNum\").text(Math.round(totalAgainstNN));\n\t\t\t$(\"#folksAgainstNN\").css(\"display\", \"block\");\n\t\t} else {\n\t\t\t$(\"#foragainst\").text(\"against\");\n\t\t\t$(\"#foragainst2\").text(\"against\");\n\t\t\t$(\"#magicNum\").text(Math.round(100-totalAgainstNN));\n\t\t\t$(\"#folksForNN\").css(\"display\", \"block\");\n\t\t}\n\t}\n}", "function gameComplete() {\r\n\r\n var linhas = [\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\"];\r\n var gameComplete = false;\r\n\r\n for (var i = 1; i <= 9; i++) {\r\n consoleDebug('Coluna: ', i);\r\n for (var j = 0; j < 9; j++) {\r\n\r\n if (hasValue(linhas[j] + i))\r\n gameComplete = true;\r\n else\r\n return gameComplete = false;\r\n }\r\n }\r\n\r\n return gameComplete;\r\n}", "function checkGoal() {\n var grid = Resources.getGrid();\n // Get the row index of water\n var ind = Helpers.blockIndices(grid.rows, 'W')[0];\n var i, x = ind * grid.nColumns;\n\n var rect1 = player.getBounds();\n var rect2;\n\n for (i = x; i < x + grid.nColumns; i++) {\n rect2 = blocks[i].getBounds();\n if (Helpers.verticallyClose(rect1, rect2, 5)) {\n player.y = ind;\n score++;\n player.setGoal(true);\n return;\n }\n }\n }", "function finish () {\n const isEmptyElement = /^empty/.test(getElem(size, size).className)\n if (!isEmptyElement) return\n\n let n = 1\n const numberOfItems = (size + 1) ** 2 - 1\n\n for (let i = 0; i <= size; i++) {\n for (let j = 0; j <= size; j++) {\n if (n <= numberOfItems &&\n getElem(i, j).innerHTML !== n.toString()\n ) return\n n++\n }\n }\n\n clearTimeout(setTimer)\n saveScore(moves)\n finishWindow()\n}", "function have_pending() {\n\t\tvar all_done = true;\n\t\tfor (name in progress_bars) {\n\t\t\tvar progress_bar = progress_bars[name];\n\t\t\tif (progress_bar.value < progress_bar.max) all_done = false;\n\t\t}\n\t\treturn !all_done;\n\t}", "isDone(wizardStep) {\n return wizardStep.completed;\n }" ]
[ "0.78191257", "0.7178827", "0.70605934", "0.6985316", "0.6974004", "0.69584805", "0.6897251", "0.68743306", "0.6860256", "0.6758799", "0.6750744", "0.6711293", "0.6700705", "0.6688978", "0.6653361", "0.664123", "0.6631974", "0.6624163", "0.6531838", "0.6531636", "0.651817", "0.64987826", "0.6476485", "0.64737916", "0.6472742", "0.6461636", "0.64462245", "0.6445223", "0.6429539", "0.64274514", "0.64181465", "0.64162433", "0.6414891", "0.6398579", "0.638552", "0.6371986", "0.63526356", "0.63408345", "0.63288015", "0.6327626", "0.6323702", "0.6323702", "0.6314929", "0.6300536", "0.62956446", "0.62918764", "0.6285924", "0.6268445", "0.6268443", "0.6242117", "0.624202", "0.6229452", "0.6227108", "0.6209415", "0.6208836", "0.62082523", "0.61761916", "0.6173302", "0.61691654", "0.616569", "0.61594784", "0.61328155", "0.61061114", "0.6088734", "0.6087871", "0.6080446", "0.6079758", "0.6065586", "0.60646296", "0.6047057", "0.6044705", "0.6044705", "0.60399944", "0.6037656", "0.6034603", "0.6029845", "0.60289115", "0.60204285", "0.6000985", "0.5998222", "0.5995159", "0.59943366", "0.59924376", "0.5986278", "0.5978045", "0.59590846", "0.5948728", "0.5948432", "0.59460366", "0.59381896", "0.593779", "0.5937622", "0.5934328", "0.59322786", "0.5929394", "0.59194", "0.59139866", "0.59100765", "0.59039116", "0.590375", "0.5902106" ]
0.0
-1
This method replaces the background with one with an open hiding space
openHidingPlace(){ // Turn off the stone on-click method $('.well-grid-cell-wrapper').off("click") // Append a black div to the fifth stone $('.well-grid-cell-wrapper[data-grid-row="67"][data-grid-col="4"]') .empty() .append('<div class="well-stone" id="black-well-stone"></div>') // Append the clues var clue1 = $('<img class="img-fluid" id="volcano-clue" src=assets/images/clues/volcano-clue.jpg alt="Clue1">') .on("click",function(){zoom = new Zoom('assets/images/clues/volcano-clue.jpg','volcano-clue','A clue!',1)}) var clue2 = $('<img class="img-fluid" id="key-line-well" src=assets/images/clues/key-line-well.bmp alt="Clue2">') .on("click",function(){zoom = new Zoom('assets/images/clues/key-line-well.bmp','key-line-well','Another of those gold bars',2)}) $('.well-grid-cell-wrapper[data-grid-row="67"][data-grid-col="4"]').append(clue1).append(clue2) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hiddenCave(){\n\tcurrentBG = cave;\n\tbackground(cave);\n}", "function background() {\n\tif (ydup != 600) {\n\t\tydup = ydup + 1;\n\t\tdocument.getElementById(\"road\").style.backgroundPosition = \"0px \"\n\t\t\t\t+ ydup + \"px\";\n\t} else {\n\t\tydup = 0;\n\t}\n}", "function clos() {\r\n background.style.display = \"none\"\r\n}", "function creepyHut(){\n\tcurrentBG = hut;\n\tbackground(hut);\n}", "function drawBackground(){\n ctx = myGameArea.context;\n //clear canvas\n ctx.clearRect(0, 0, 6656, 468);\n backgroundImg.draw();\n \n }", "function background(param)\n{\n novel_changeBackground(param, false);\n}", "backgroundDisplay() {\n push();\n rectMode(CORNER);\n noStroke();\n fill(this.color);\n rect(this.x, this.y, this.width, this.height);\n pop()\n }", "function clearBackground() {\r\n mainContainer.style.background = \"#FFFFFF\";\r\n}", "function grayOut() {\r\n that.surface.createRect({\r\n x: 0, y: 0, width: that.width, height: that.height\r\n }).setFill([255, 255, 255, 0.4]);\r\n }", "function removeBackground() {\n document.body.style.background = '#444444';\n localStorage.setItem('background', 'off');\n}", "function resetBackground() {\n if (window.innerWidth >= 768) {\n filterBG_md.style.display = 'none';\n filterBG_lg.style.display = 'block';\n } else {\n filterBG_lg.style.display = 'none';\n filterBG_md.style.display = 'block';\n }\n }", "function showBackground() {\n\n clearGameBoard();\n var background = new Image();\n background.src = 'images/background05.png';\n ctx.drawImage(background, 0, 0, game.width, game.height);\n\n var fontSize = game.width * 0.025;\n ctx.font = fontSize+'pt Calibri';\n\n if (game.width >= 768) {\n ctx.lineWidth = 3.3;\n } else {\n ctx.lineWidth = 1.5;\n }\n \n // stroke color\n ctx.strokeStyle = 'yellow';\n \n ctx.shadowColor = \"rgba(0,0,0,0.3)\";\n\n if (game.width >= 768) {\n ctx.strokeText('Space Invaders', game.width/2 - (fontSize*5), fontSize + 10);\n } else {\n ctx.strokeText('Space Invaders', 160, 15);\n }\n \n\n }", "function cleanBgColor() {\r\n\t\tfor(var j=0; j<board.length; j++) {\r\n\t\t\tboard[j].style.backgroundColor = 'transparent';\r\n\t\t}\r\n\t}", "function manageBackground() {\n let color = CurrColor.attr('bgcolor');\n // The canvas already has a background\n // Need to delete a background\n if (hasBackground) {\n Canvas.attr('bgcolor', '');\n BgrColor.attr('bgcolor', '');\n BgrBtn.html('Add background');\n hasBackground = false;\n }\n // The doesn't have a background\n // Need to add a background\n else {\n Canvas.attr('bgcolor', color);\n BgrColor.attr('bgcolor', color);\n BgrBtn.html('Remove background');\n hasBackground = true;\n };\n if (CanvasBgr.css('display') === 'block') {\n manageHistory('update');\n manageUndoRedoBtn();\n };\n }", "function removeMainMenuBg() {\n mainMenuBg.remove();\n mainMenuBg = '';\n }", "function unhighlight(x) {\r\n\tif (modeFlag == `standard`) {\r\n\t\tdocument.getElementById(`chest` + x).style.backgroundImage = \"url(images/poi.png)\";\r\n\t\tdocument.getElementById(\"caption\").innerHTML = \"&nbsp;\";\r\n\t} else if (modeFlag == `entrance`) {\r\n\t\tdocument.getElementById(`entrance` + x).style.backgroundImage = \"url(images/poi.png)\";\r\n\t\tdocument.getElementById(\"caption\").innerHTML = \"&nbsp;\";\r\n\t}\r\n}", "function changeBg(color) {\n block.style.backgroundColor = color;\n block.style.backgroundImage = null;\n}", "function removeBackground(x){\n\tx.style.background = \"white\";\n}", "function setWhite() {\r\n document.body.style.background = \"white\";\r\n}", "function blindBackgroundClicked() {\n\tblindBeingControlled = false;\n\thideBlindControl();\n}", "async _setTransparentBackgroundColor() {\n await this._client.send('Emulation.setDefaultBackgroundColorOverride', {\n color: { r: 0, g: 0, b: 0, a: 0 },\n });\n }", "onEnterBack() {\n state.glassBottle.alpha = 0;\n clear(state.ctx.glassBottle);\n }", "onEnterBack() {\n state.glassBottle.alpha = 0;\n clear(state.ctx.glassBottle);\n }", "function Background() {\n\tctx.beginPath();\n\tctx.rect(0, 0, 1140, 600);\n\tctx.fillStyle = \"black\";\n\tctx.fill();\n}", "function use_plyr_bg_color() {\n ctx.strokeStyle = BLACK;\n ctx.fillStyle = BLACK;\n if (sessionStorage.getItem(\"page\") === BLACK) {\n ctx.strokeStyle = WHITE;\n ctx.fillStyle = WHITE;\n }\n }", "function destroyBackground() {\n\tif (spriteBackground) {\n\t\tgroupBackground.remove(spriteBackground, true);\n\t}\n}", "function hideHome() {\n bgOne.style.display = \"none\";\n}", "function showStage(){\n clear();\n background(0);\n generateStyle(selectedStyle); \n}", "function GadgetUndocked() {\r\n with (document.body.style)\r\n width = 400,\r\n height = 300;\r\n\r\n with (backgroundImage.style)\r\n width = 400,\r\n height = 300;\r\n\r\n gadgetGUI.className = \"gadgetGUI_undocked\";\r\n}", "function stoptDragEffect(){\n $(globalOptions.full_page_content).css(\"background\",genPageBgColor);\n globalSubpageBuild.css({\n background: \"none\",\n borderRadius: \"0px\",\n border: \"none\"\n });\n}//stoptDragEffect", "function superSmashBrosOn() {\n switchScreen.style.backgroundImage =\n \"url('https://www.nintendo.com/content/dam/noa/en_US/games/switch/s/super-smash-bros-ultimate-switch/super-smash-bros-ultimate-switch-hero.jpg')\";\n switchScreen.style.backgroundSize = \"cover\";\n switchScreen.classList.remove(\"onHome\");\n switchScreen.classList.add(\"onGame\");\n}", "function movingBackground() {\n if (gameState == 0 || gameState == 2 || gameState == 3) return;\n xBg -= 1;\n if (xBg < -400) {\n xBg = 0\n }\n}", "function toggle() {\n if (shouldActivateBackgroundColor) {\n window.document.body.style.backgroundColor = '#333';\n shouldActivateBackgroundColor = false\n } else {\n window.document.body.style.backgroundColor = originalBackgroundColor;\n shouldActivateBackgroundColor = true\n }\n}", "function createBackground(){\n\t\tvar bg = createSquare(stageWidth, stageHeight, 0, 0, null, Graphics.getRGB(0,0,0,0));\n\t\tstage.addChild( bg );\n\t\tupdate = true;\n\t}", "function transitionToStarryBackground() {\n\t\t$('.container').removeClass('valign-wrapper');\n\t\tlet imageUrl = 'assets/img/stars.jpg';\n\t\t$('body').css('background', 'url(' + imageUrl + ')');\n\t\t$('body').css('background-size', 'cover');\n\t\t$('body').css('background-position', 'bottom');\n\t\t$('body').css('height', '100vh');\n\t\t$('#intro').remove();\n\t}", "redrawBg() {\n this.clearBg();\n this.drawBg();\n }", "function plainBackground(){\n document.body.style.backgroundColor = \"#ffffff\";\n}", "function toggleBackground() {\n const width = displayedImage.width();\n const height = displayedImage.height();\n overlay.width(width).height(height);\n if (btn.html().match(/Darken/)) {\n overlay.css({background: 'rgba(0,0,0,0.5)'});\n btn.html('Lighten');\n } else {\n overlay.css({background: 'rgba(0,0,0,0)'});\n btn.html('Darken');\n }\n }", "set background(value) {\n if (value === this.backgroundIn) {\n return;\n }\n this.backgroundIn = value;\n this.notifyPropertyChanged('background');\n }", "set background(value) {\n if (value === this.backgroundIn) {\n return;\n }\n this.backgroundIn = value;\n this.notifyPropertyChanged('background');\n }", "function changeBackground() {\n\treturn Math.floor(Math.random() * 256);\n}", "function colorBackground() {\r\n\t\r\n\t\t// INIT VEGAS SLIDESHOW PLUGIN\r\n\t\t$(\"body\").append('<div class=\"bg-color\" style=\"background-color:' + option_hero_background_color + '\"></div>');\r\n\t\r\n\t}", "function makeRed(kk){\r\n\tkk.style.backgroundImage= \"none\";\r\n\tkk.style.backgroundColor= AttentionColor;\r\n}", "function clearKeySpace() {\n g.setColor(g.theme.bg)\n .fillRect(offsetX, offsetY, 176, 176);\n }", "function setWOBgImg (){\n\t\t\t$(\"#colorbgrnd\").css({display: 'block'});\n\t\t\t//canvas.add(bgRect).sendToBack(bgRect);\t\n\t\t\tcanvas.setBackgroundImage(null);\n\t\t\t//console.log('clear bg image! bg fill = '+newRectBg.fill);\t\n\t\t\tcanvas.renderAll();\n\t\n\t\t}", "function createBackground(ctx){\n ctx.clearRect(0, 30, 400, 600);\n ctx.fillStyle = bgColour;\n ctx.fillRect(0, 30, 400, 600);\n}", "function makeBackground(){\n\timg = createImage(width, height);\n\n\timg.loadPixels();\n\tlet xoff = 0;\n\tfor (let i = 0; i < width; i++){\n\n\t\tlet yoff = 0;\n\n\t\tfor (let j = 0; j<height; j++){\n\n\t\t\tlet col = map(noise(xoff, yoff), 0,1,0,255);\n\t\t\timg.set(i, j, color(col, 0, col));\n\n\n\t\t\tyoff+=0.01;\n\n\t\t}\n\t\txoff+=0.01;\n\t}\n\timg.updatePixels();\n}", "function drawBackground() {\n //drawShadow(); //drawDog shadow beneath dog first\n context.fillStyle = BG_COLOR;\n context.fillRect(0, 0, WIDTH, 500); //wipe picture above shadow\n context.fillStyle = '#83B799';\n context.fillRect(0, 500, WIDTH, 2); //drawDog horizontal ground line\n}", "function toggleBackgroundSelect() {\n if (graphicsMode == '4') {\n document.getElementById('background-select-container').style.display = 'block';\n } else {\n document.getElementById('background-select-container').style.display = 'none';\n }\n }", "function toggle_blank(black) {\n\n\tvar other = ie ? document.all[\"other\"] : document.getElementById(\"other\");\n\tvar color = black ? \"black\" : \"white\";\n\tother.style.backgroundColor = (other.style.backgroundColor == color) ? \"transparent\" : color;\n}", "function colorUnselCurrent() {\r\n if(nOrU(document.getElementById(ICON_ID + currentDiv))) return;\r\n document.getElementById(ICON_ID + currentDiv).style.backgroundColor = BMDIV_BG_UNSEL;\r\n document.getElementById(TITLE_ID + currentDiv).style.backgroundColor = BMDIV_BG_UNSEL;\r\n document.getElementById(URL_ID + currentDiv).style.backgroundColor = BMDIV_BG_UNSEL;\r\n}", "background(lib){\n lib.moveTo(lib.width/2,lib.height/2);\n lib.penColor(\"black\");\n lib.dot(500);\n }", "function turnWhiteBgAndBlackFo() {\n\t$('*').css('background-color','');\n\t$('body').each(function(element){\n\t\t$(this).css('color','black');\n\t});\n\t$('*').css('color','');\n}", "create() {\n let background = this.add.image(0, 0, 'background');\n background.displayOriginX = 0;\n background.displayOriginY = 0;\n background.displayWidth = this.sys.canvas.width;\n background.displayHeight = this.sys.canvas.height;\n }", "function SarahLoadBackground() {\n\tSarahBackground = \"SarahBedroom0\";\n\tSarahBackground = \"SarahBedroom\" + (SarahCharacter.length - 2).toString();\n\tif (!SarahInside || (Sarah == null) || !Sarah.IsKneeling()) SarahBackground = \"SarahBedroom3\";\n}", "function drawBackground() {\n\tcanvasContext.fillStyle = 'black';\n\tcanvasContext.fillRect(0, 0, GAME_WIDTH, GAME_HEIGHT);\n}", "function schliessen() {\n $(\"#anzeige_background\").hide();\n $(\"#anzeige_bild\").css('min-height', '0');\n $(\"#anzeige\").css('margin-top', '0');\n}", "function whiteout()\n {\n $('.square').css({'opacity':'1','background-color':'#FFF'});\n }", "function changeBackgroundColor(){\n let background_hex = new THREE.Color(menu.background).getHexString();\n if ( isHex(background_hex) && scene.background != \"#\" + background_hex ){\n scene.background = new THREE.Color(\"#\"+background_hex); }\n // backgroundScene = menu.background;\n // scene.background.color.setHex(backgroundScene);\n }", "highlightBackground () {\n let bg = this.game.make.sprite(0, 0, 'area')\n bg.width = this.tileWidth\n bg.height = this.tileHeight\n bg.alpha = 0.2\n return bg\n }", "function backgroundGradient() {\n if (ball.x < width) {\n push();\n colorMode(HSB,255);\n background(map(ball.x,0,width,0,255),180,200);\n pop();\n }\n}", "function drawbg() {\n\tpalset = curbg;\n\tloadRomPal();\n\n\tvar bf = new bytebuffer(romFrameData);\n\tvar bf2 = new bytebuffer(romFrameData);\n\tvar bf3 = new bytebuffer(romFrameData);\n\tctxBack.clearRect(0, 0, canvasBack.width, canvasBack.height);\n\t\n\tlet bigindex = bf.getInt(0x1DE0A + curbg * 4);\n\t\n\tvar imageData = ctxBack.createImageData(gridWidth, gridHeight);\n\n\tvar height = 2;\n\tbf3.position(bigindex);\n\t\n\tlet startscr=0;\n\n\tlet w = mapdata[curbg][0];\n\tlet h = mapdata[curbg][1];\n\n\tbf3.skip(mapdata[curbg][3] * w * 2);\n\tbf3.skip(mapdata[curbg][2] * 2);\n\tbf3.skip(bgAddressSkip * 2);\n\tfor(let scr=0;scr<6;scr++) {\n\t\t\n\t\tif(scr == 2 || scr == 4) {\t// jump to next row\n\n\t\t\tif(h <= scr / 2) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbf3.skip((w - 2) * 2);\n\t\t}\n\t\tlet scrTile = bf3.getShort();\n\t\t\n\t\tlet scrx = (scr % 2) * 256;\n\t\tlet scry = (scr >> 1) * 256;\n\n\t\tbf.position(bgAddress + (scrTile << 10));\n\t\n\t\tfor(let i=0;i<16;i++) {\n\t\t\tfor(let j=0;j<16;j++) {\n\t\t\t\t\t\t\n\t\t\t\tlet tile = bf.getShort() + 0x6800;\n\t\t\t\tlet flag = bf.get();\n\t\t\t\tlet pal = bf.get();\n\t\t\t\tif(hideBackground) {\t// hide background based on flag and color, 0x10 maybe the switch\n\t\t\t\t\tlet hide = flag & 0xF;\n\t\t\t\t\tif((pal & 0x80) == 0)\n\t\t\t\t\t\thide = 16;\n\t\t\t\t\tdrawTilesBase(imageData, tile, 1, 1, (pal & 0x1F) + 0x40, 16, false, (pal & 0x40), (pal & 0x20), hide);\n\t\t\t\t} else \n\t\t\t\t\tdrawTilesBase(imageData, tile, 1, 1, (pal & 0x1F) + 0x40, 16, false, (pal & 0x40), (pal & 0x20));\n\t\t\t\tctxBack.putImageData(imageData, scrx + (i)%32 * gridHeight, scry + (j) * gridWidth);\n\t\t\t}\n\t\t}\n\t}\n\n}", "function popUp()\n{\n\tlet fg = document.getElementById(\"foreground\");\n\tlet bg = document.getElementById(\"background\");\n\tif(fg.style.visibility == \"hidden\" || fg.style.visibility == \"\")\n\t{\n\t\tfg.style.visibility = \"visible\";\n\t\tbg.style.visibility = \"visible\";\n\t}\n\n}", "drawBg() {\n let g = this,\n cxt = g.context,\n sunnum = window._main.sunnum,\n cards = window._main.cards,\n img = imageFromPath(allImg.bg);\n cxt.drawImage(img, 0, 0);\n sunnum.draw(cxt);\n }", "function getBgColorUponFlashingStopped() {\r\n\treturn \"transparent\";\r\n}", "function colorBg(colorBg) {\n noteDiv.style.background = colorBg;\n }", "_drawBackground() {\n const { x, y, width, height } = this.config;\n this._background = this.scene.add.rectangle( x, y, width, height,\n this.config.backgroundColor );\n this._background.setOrigin( 0, 0 );\n }", "function drawBackground() {\n\tcontext.save();\n\tcontext.fillStyle = \"#f0f0ff\";\n\tcontext.fillRect(0, 0, canvas.width, canvas.height);\n\tcontext.translate(0, canvas.height - 50);\n\tcontext.fillStyle = \"#007f00\";\n\tcontext.fillRect(0, 0, canvas.width, 50);\n\tcontext.restore();\n}", "function animateBackground() {\n\t\tbgStateOn = !bgStateOn;\n\t\tswitch (bgStateOn) {\n\t\tcase true:\n\t\t\t$.alertT10.backgroundImage = \"/images/blueiPadBg.png\";\n\t\t\tbreak;\n\n\t\tcase false:\n\t\t\t$.alertT10.backgroundImage = \"/images/rediPadBg.png\";\n\t\t\tbreak\n\t\t}\n\t}", "function checkBg(){\n if (changeBg){\n bgX =bgX - 150/36;\n bgY = bgY - 75/36;\n if(millis()>enterTime + 4000 && welcomeBgm.isPlaying()){\n menuBgm.loop();\n welcomeBgm.stop();\n }\n\n if(millis()>enterTime + 6000){\n \n changeBg =false;\n }\n }\n\n \n}", "function draw() {\n background(0);\n}", "function draw() {\n background(0);\n}", "function deactivate(){\n\n /* Mark the initiate_coloring_walls as false that no need to color the rects */\n initiate_coloring_walls = false;\n}", "function pickRandomBackground(){\n\n}", "function clearBackground() {\n var body = document.body;\n if (body.style) {\n body.style.backgroundColor = 'rgba(0,0,0,0.01)';\n body.style.backgroundImage = '';\n setTimeout(function() {\n body.style.backgroundColor = 'transparent';\n }, 1);\n if (body.parentNode && body.parentNode.style) {\n body.parentNode.style.backgroundColor = 'transparent';\n body.parentNode.style.backgroundImage = '';\n }\n }\n}", "function _generateBackground() {\n var t = new Trianglify();\n var pattern = t.generate(document.body.clientWidth, document.body.clientHeight);\n\n this.backSurface = new ImageSurface({\n size: [undefined, undefined],\n content: pattern.dataUri\n });\n\n var backModifier = new StateModifier({\n origin: [0.5, 0.5],\n align: [0.5, 0.5],\n opacity: 0\n });\n\n this.add(backModifier).add(this.backSurface);\n\n backModifier\n .setOpacity(0, { duration: this.options.animationDuration / 3 })\n // TODO: make showGUI after login\n .setOpacity(1, { duration: this.options.animationDuration / 3 });\n }", "function drawBackground() {\n\t// Draw the background\n\tcolorRect(0, 0, canvas.width, canvas.height, '#333');\n}", "function viewport_bg(e){\n\tsettings.colors.bg=e.srcElement.value;\n\tvp.bg=settings.colors.bg;\n\tvp.clear();\n}", "function FixNonVisible(context) {\n\t// 64x32 and 64x64 skin parts\n\tcontext.clearRect(0, 0, 8, 8);\n\tcontext.clearRect(24, 0, 16, 8);\n\tcontext.clearRect(56, 0, 8, 8);\n\tcontext.clearRect(0, 16, 4, 4);\n\tcontext.clearRect(12, 16, 8, 4);\n\tcontext.clearRect(36, 16, 8, 4);\n\tcontext.clearRect(52, 16, 4, 4);\n\tcontext.clearRect(56, 16, 8, 32);\n\t\n\t// 64x64 skin parts\n\tcontext.clearRect(0, 32, 4, 4);\n\tcontext.clearRect(12, 32, 8, 4);\n\tcontext.clearRect(36, 32, 8, 4);\n\tcontext.clearRect(52, 32, 4, 4);\n\tcontext.clearRect(0, 48, 4, 4);\n\tcontext.clearRect(12, 48, 8, 4);\n\tcontext.clearRect(28, 48, 8, 4);\n\tcontext.clearRect(44, 48, 8, 4);\n\tcontext.clearRect(60, 48, 8, 4);\n}", "function C012_AfterClass_Dorm_Run() {\n\tDrawImage(CurrentChapter + \"/\" + CurrentScreen + \"/Background.jpg\", 0, 0);\n\tDrawTransparentPlayerImage(390, 0, 0.6667);\t\t\n}", "function drawBackground(){\n\tcontext.fillStyle = \"#000000\";\n\tcontext.fillRect(0,0,canvas.width/2, canvas.height);\n\tcontext.fillStyle = \"#FFFFFF\";\n\tcontext.fillRect(canvas.width/2,0,canvas.width/2, canvas.height);\n\t//BASE IMGS\n\tif(!universityHidden[0])context.drawImage(universityImg, 0, canvas.height-canvas.height/3, canvas.width/3, canvas.height/3);\n\tif(!lifeHidden[0])context.drawImage(familyImg, canvas.width-canvas.width/4, canvas.height-canvas.height/3, canvas.width/4, canvas.height/3);\n\n\t//ADDITIONAL IMGS\n\n\t//University\n\tif(!universityHidden[1])context.drawImage(laptopImg, canvas.width/4, canvas.height/2, canvas.width/6, canvas.height/4);\n\tif(!universityHidden[2])context.drawImage(bookImg, canvas.width/12, canvas.height/4, canvas.width/6, canvas.height/2.5);\n\tif(!universityHidden[3])context.drawImage(timeImg, canvas.width/4, canvas.height/8, canvas.width/10, canvas.height/8);\n\n\t//Life\n\tif(!lifeHidden[1])context.drawImage(bacteriaImg, canvas.width-canvas.width/4, canvas.height/6, canvas.width/6, canvas.height/4);\n\tif(!lifeHidden[2])context.drawImage(loveImg, canvas.width-canvas.width/2.2, canvas.height/4, canvas.width/12, canvas.height/8);\n\tif(!lifeHidden[3])context.drawImage(moneyImg, canvas.width-canvas.width/2.5, canvas.height-canvas.height/4, canvas.width/12, canvas.height/8);\n\tif(!lifeHidden[4])context.drawImage(sandwichImg, canvas.width-canvas.width/2.5, canvas.height-canvas.height/2, canvas.width/6, canvas.height/6);\n\tif(!lifeHidden[5])context.drawImage(covidImg, canvas.width-canvas.width/2.5, canvas.height/8, canvas.width/8, canvas.height/10);\n\n\n}", "function enterQuit()\n{\n\t_canvas.style.backgroundImage = \"url(images/background.png)\";\n}", "getBackground(){\n\n\t\tif(currentLevel%5 != 0){\n\t\t\tcurrentBack = this.backLevels[0];\n\t\t}else{\n\t\t\tcurrentBack = this.backLevels[currentLevel/5];\n\t\t}\n\n\t\tvar numframe = currentLevel-Math.trunc(currentLevel/5);// Math.trunc(currentLevel/5) para que trunque el resultado \n \n \tif((currentLevel%5) != 0){ \n \t\tvar back = game.add.sprite(0, 0, currentBack, numframe);\n \t\tback.animations.currentFrame = numframe;\n \t}else{ \n \t\tgame.add.sprite(0, 0, currentBack); \n \t} \n\t}", "function changeBackground(){\r\n playButton.classList.remove(\"oldbackground\");\r\n playButton.classList.add(\"newbackground\");\r\n roundResult.textContent = \"\";\r\n}", "function back() {\n var x = document.querySelector(\".digital-and-analog\");\n if (x.style.display === \"none\") {\n x.style.display = \"block\";\n x = document.body.style.backgroundImage = \"url('./pics/digital.jpg')\";\n\n } else {\n x.style.display = \"none\";\n }\n}", "setBackground(background) {\n this.background = background\n }", "function backFlash(){\n\tvar color = '#'+Math.floor(Math.random()*16777215).toString(16);\n\tdocument.body.style.background = color;\n\n}", "function changeBg() {\r\n\t\r\n\tdocument.body.style.backgroundColor='lightgrey';\r\n\t\r\n}", "function renderBackground(group, bg, useUpperLabel) {\n\t var ecData = getECData(bg); // For tooltip.\n\t\n\t ecData.dataIndex = thisNode.dataIndex;\n\t ecData.seriesIndex = seriesModel.seriesIndex;\n\t bg.setShape({\n\t x: 0,\n\t y: 0,\n\t width: thisWidth,\n\t height: thisHeight,\n\t r: borderRadius\n\t });\n\t\n\t if (thisInvisible) {\n\t // If invisible, do not set visual, otherwise the element will\n\t // change immediately before animation. We think it is OK to\n\t // remain its origin color when moving out of the view window.\n\t processInvisible(bg);\n\t } else {\n\t bg.invisible = false;\n\t var style = thisNode.getVisual('style');\n\t var visualBorderColor = style.stroke;\n\t var normalStyle = getItemStyleNormal(itemStyleNormalModel);\n\t normalStyle.fill = visualBorderColor;\n\t var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel);\n\t emphasisStyle.fill = itemStyleEmphasisModel.get('borderColor');\n\t var blurStyle = getStateItemStyle(itemStyleBlurModel);\n\t blurStyle.fill = itemStyleBlurModel.get('borderColor');\n\t var selectStyle = getStateItemStyle(itemStyleSelectModel);\n\t selectStyle.fill = itemStyleSelectModel.get('borderColor');\n\t\n\t if (useUpperLabel) {\n\t var upperLabelWidth = thisWidth - 2 * borderWidth;\n\t prepareText(bg, visualBorderColor, upperLabelWidth, upperHeight, style.opacity, {\n\t x: borderWidth,\n\t y: 0,\n\t width: upperLabelWidth,\n\t height: upperHeight\n\t });\n\t } // For old bg.\n\t else {\n\t bg.removeTextContent();\n\t }\n\t\n\t bg.setStyle(normalStyle);\n\t bg.ensureState('emphasis').style = emphasisStyle;\n\t bg.ensureState('blur').style = blurStyle;\n\t bg.ensureState('select').style = selectStyle;\n\t setDefaultStateProxy(bg);\n\t }\n\t\n\t group.add(bg);\n\t }", "function removeGreySquares () {\n $('#myBoard .square-55d63').css('background', '')\n}", "function removeGreySquares () {\n $('#myBoard .square-55d63').css('background', '')\n}", "function turnBlackBgAndWhiteFo() {\n setInterval(changeBgAndFont, 0000);\n}", "function drawBackground() {\n let randomNumber = Math.floor(Math.random() * 3);\n if (randomNumber == 2) {\n bgColor = \"whitesmoke\";\n }\n else {\n bgColor = \"black\";\n }\n crc2.fillStyle = bgColor;\n crc2.fillRect(0, 0, crc2.canvas.width, crc2.canvas.height);\n }", "function replaceDiscordBackground(bgImage){\r\n\t\r\n\t// Identify discord background-element\r\n var backgroundElement = document.getElementById('app-mount');\r\n\r\n // If the background element doesn't exist, repeat the process after 250ms \r\n if(!backgroundElement) {\r\n \tsetTimeout(replaceDiscordBackground, 250); \r\n }\r\n else {\r\n \t\r\n \t// Set image\r\n backgroundElement.style.backgroundImage = bgImage;\r\n \r\n // Set transparency\r\n backgroundElement.style.backgroundColor = \"rgba(255, 0, 0, 0.15);\";\r\n\r\n // Set CSS background to cover\r\n backgroundElement.style.backgroundSize = \"cover\";\r\n }\r\n}", "function resetSketch() {\n clear();\n //background(74, 189, 172);green\n\n //background(252, 248, 244);\n background(0);\n}", "function chooseBG() {\n let startScreen = document.getElementById(\"title-page\");\n startScreen.style.display = \"none\";\n let bgScreen = document.getElementById(\"show-bg\");\n bgScreen.style.display = \"flex\";\n let bgDay = document.getElementById(\"day\");\n bgDay.addEventListener(\"click\", function () {\n startPicture();\n });\n let bgNight = document.getElementById(\"night\");\n bgNight.addEventListener(\"click\", function () {\n day = false;\n startPicture();\n });\n }", "function renderBackground(group, bg, useUpperLabel) {\n // For tooltip.\n bg.dataIndex = thisNode.dataIndex;\n bg.seriesIndex = seriesModel.seriesIndex;\n bg.setShape({\n x: 0,\n y: 0,\n width: thisWidth,\n height: thisHeight\n });\n\n if (thisInvisible) {\n // If invisible, do not set visual, otherwise the element will\n // change immediately before animation. We think it is OK to\n // remain its origin color when moving out of the view window.\n processInvisible(bg);\n } else {\n bg.invisible = false;\n var visualBorderColor = thisNode.getVisual('borderColor', true);\n var emphasisBorderColor = itemStyleEmphasisModel.get('borderColor');\n var normalStyle = getItemStyleNormal(itemStyleNormalModel);\n normalStyle.fill = visualBorderColor;\n var emphasisStyle = getItemStyleEmphasis(itemStyleEmphasisModel);\n emphasisStyle.fill = emphasisBorderColor;\n\n if (useUpperLabel) {\n var upperLabelWidth = thisWidth - 2 * borderWidth;\n prepareText(normalStyle, emphasisStyle, visualBorderColor, upperLabelWidth, upperHeight, {\n x: borderWidth,\n y: 0,\n width: upperLabelWidth,\n height: upperHeight\n });\n } // For old bg.\n else {\n normalStyle.text = emphasisStyle.text = null;\n }\n\n bg.setStyle(normalStyle);\n graphic.setElementHoverStyle(bg, emphasisStyle);\n }\n\n group.add(bg);\n }", "function renderBackground(group, bg, useUpperLabel) {\n // For tooltip.\n bg.dataIndex = thisNode.dataIndex;\n bg.seriesIndex = seriesModel.seriesIndex;\n bg.setShape({\n x: 0,\n y: 0,\n width: thisWidth,\n height: thisHeight\n });\n\n if (thisInvisible) {\n // If invisible, do not set visual, otherwise the element will\n // change immediately before animation. We think it is OK to\n // remain its origin color when moving out of the view window.\n processInvisible(bg);\n } else {\n bg.invisible = false;\n var visualBorderColor = thisNode.getVisual('borderColor', true);\n var emphasisBorderColor = itemStyleEmphasisModel.get('borderColor');\n var normalStyle = getItemStyleNormal(itemStyleNormalModel);\n normalStyle.fill = visualBorderColor;\n var emphasisStyle = getItemStyleEmphasis(itemStyleEmphasisModel);\n emphasisStyle.fill = emphasisBorderColor;\n\n if (useUpperLabel) {\n var upperLabelWidth = thisWidth - 2 * borderWidth;\n prepareText(normalStyle, emphasisStyle, visualBorderColor, upperLabelWidth, upperHeight, {\n x: borderWidth,\n y: 0,\n width: upperLabelWidth,\n height: upperHeight\n });\n } // For old bg.\n else {\n normalStyle.text = emphasisStyle.text = null;\n }\n\n bg.setStyle(normalStyle);\n graphic.setElementHoverStyle(bg, emphasisStyle);\n }\n\n group.add(bg);\n }", "setBackgroundImg() {\n if (this.scene.background) {\n push();\n imageMode(CENTER);\n image(this.backgroundImg.img, this.backgroundImg.position.x, this.backgroundImg.position.y, this.backgroundImg.size.width, this.backgroundImg.size.height);\n pop();\n }\n }", "function clearBackground() {\n $('#sprout-animate').css({\n \"background-size\": \"130px 0px\", \"animation-name\": \"popout\",\n \"animation-duration\": \"0.8s\"\n });\n}", "function addMainMenuBg() {\n mainMenuBg = $('<span class=\"js-main-menu-close\" />');\n mainMenuToggleOpen.append(mainMenuBg);\n }" ]
[ "0.69943565", "0.6600684", "0.6515199", "0.637931", "0.63593435", "0.63314945", "0.6308624", "0.6279169", "0.62636715", "0.62613344", "0.62583405", "0.62421757", "0.62114614", "0.62038684", "0.6201671", "0.6194917", "0.61461973", "0.6140948", "0.6122789", "0.61005884", "0.60998094", "0.6080261", "0.6080261", "0.6046147", "0.6037718", "0.6030429", "0.602437", "0.60106385", "0.6004827", "0.5999487", "0.59540224", "0.5937626", "0.5929569", "0.59257585", "0.59176826", "0.59151673", "0.5911841", "0.5906848", "0.5903736", "0.5903736", "0.59031", "0.590162", "0.5898524", "0.5898102", "0.5896899", "0.58943295", "0.58876747", "0.58740807", "0.58470494", "0.5845097", "0.5837705", "0.5818176", "0.58148384", "0.5805466", "0.5800955", "0.5797956", "0.57968843", "0.57921845", "0.57842267", "0.57828856", "0.57763815", "0.5769927", "0.5764154", "0.5758628", "0.57559717", "0.5752667", "0.57499224", "0.5749511", "0.5747971", "0.57465667", "0.5744731", "0.5744731", "0.5742097", "0.57404685", "0.5733357", "0.57267725", "0.5723844", "0.57155603", "0.5715414", "0.57128745", "0.570413", "0.5700341", "0.569627", "0.5688126", "0.5676376", "0.5670299", "0.5669931", "0.5667924", "0.5667232", "0.5664806", "0.5664806", "0.56644005", "0.56640285", "0.5656713", "0.56455815", "0.5643207", "0.564226", "0.564226", "0.5640794", "0.56378925", "0.56365705" ]
0.0
-1
This is a modified version of the WoWWiki site version, in that it is designed for global.js use. Code adds a checkbox at the top of the Special:RecentChanges list, next to the header. Ticking it sets a cookie (should be individual to wikis) and starts updating the RC list. This occurs silently every 60 seconds without a full page reload occuring.
function setCookie(c_name, value, expiredays) { var exdate = new Date(); exdate.setDate(exdate.getDate() + expiredays); document.cookie = c_name + "=" + escape(value) + ((expiredays === null) ? "" : ";expires=" + exdate.toGMTString()) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updates() {\n var checked = $(\"#updates\").is(\":checked\");\n track('Options', 'Latest updates', 'Latest updates feature', checked);\n if (checked) {\n localStorage.feature_latestupdates = true;\n showMessage(\"Feature 'latest updates' enabled.\");\n } else {\n localStorage.feature_latestupdates = false;\n showMessage(\"Feature 'latest updates' disabled.\");\n }\n}", "function lbArticle(idNum)\n{\n Cookie.write('currentToggler',idNum,{duration: 0.000058});\n}", "function ftalkUpdateCheck(forced) {if((forced)||(parseInt(GM_getValue(\"lastUpdate\", \"0\")) + 86400000 <= (new Date().getTime()))) {try {GM_xmlhttpRequest({method: \"GET\",url: \"http://userscripts.org/scripts/review/48877?\" + new Date().getTime(),headers: {'Cache-Control': 'no-cache'},onload: function(xhrResponse) {GM_setValue(\"lastUpdate\", new Date().getTime() + \"\"); var rt = xhrResponse.responseText.replace(/&nbsp;?/gm, \" \"). replace(/<li>/gm, \"\\n\").replace(/<[^>]*>/gm, \"\"); var upversion = parseInt(/version_timestamp\\s*=\\s*([0-9]+)/.exec(rt)[1]); if (upversion > version_timestamp) {showUpdatePopup(upversion);} else if (forced) {}}});} catch (err) {if (forced) {alert(\"An error occurred while checking for updates:\\n\" + err);}}}}", "function cookieswap_PageReloadPrefObserver(branch, name)\r\n{\r\n var menu_enable_branch = \"MenuEnable.\"\r\n cookieswap_dbg(\"Observed prof change to \" + name);\r\n\r\n //First check to see if its a menu item to be disabled\r\n if (name.substring(0, menu_enable_branch.length) == menu_enable_branch)\r\n {\r\n //Now set the visibility of various menu items.\r\n //The easiest thing to do is simply use the remainder of the pref string but I'm not sure\r\n // an extension should blindly set the visibility based on a pref. At least check to make\r\n // sure it's a cookieswap-menu item.\r\n var menu_item=name.substring(menu_enable_branch.length)\r\n var cookieswap_menu=\"cookieswap-menu\";\r\n if (menu_item.substring(0,cookieswap_menu.length) == cookieswap_menu)\r\n {\r\n //Make the menu item's visibility based on the pref\r\n var hidden_val = branch.getBoolPref(name);\r\n document.getElementById(menu_item).hidden = !hidden_val; //hidden is opposite of enable\r\n cookieswap_dbg(name + \" menu item's visibility now \" + hidden_val);\r\n } \r\n }\r\n else\r\n {\r\n switch (name) \r\n {\r\n case \"ReloadOnProfileChange\":\r\n // extensions.cookieswap.PageReloadOnProfileChange was changed\r\n gReloadOnProfileChange = branch.getIntPref(name);\r\n cookieswap_dbg(\"gReloadOnProfileChange changed to \" + gReloadOnProfileChange );\r\n break;\r\n case \"MenuPopupDelay\":\r\n // extensions.cookieswap.MenuPopupDelay was changed\r\n gMenuPopupDelay = branch.getIntPref(name);\r\n cookieswap_dbg(\"gMenuPopupDelay changed to \" + gMenuPopupDelay);\r\n\r\n var statusbar_panel = document.getElementById(\"cookieSwap-panel\");\r\n if (gMenuPopupDelay == 0)\r\n {\r\n //With no delay, we can simply set the popup attribute to the menu list\r\n statusbar_panel.setAttribute(\"popup\", \"cookie-element-list\");\r\n statusbar_panel.setAttribute(\"onclick\", \"\");\r\n }\r\n else\r\n {\r\n //To implement a delay, we need to set the onclick attribute and implement\r\n // the delay ourselves\r\n statusbar_panel.setAttribute(\"popup\", \"\");\r\n statusbar_panel.setAttribute(\"onclick\", \"cookieswap_statusBarClick()\");\r\n }\r\n \r\n break;\r\n }\r\n }\r\n}", "function watchpage() {\n hideMAToolbar();\n // Mark as seen after at least X seconds.\n markAsSeenTimeout = setTimeout(() => {\n const vid = location.href.match(/v=([^&]{11})/u)[1];\n if (vid) {\n const sid = $(YT_CHANNEL_LINK).attr(\"href\").match(/\\/channel\\/([^&]*)/u)[1];\n subs.forEach((sub, i) => {\n if (sub.id === sid) {\n sub.videos.forEach((video, j) => {\n if (video.vid === vid) {\n subs[i].videos[j].see();\n subs[i].buildSubList();\n saveList();\n }\n });\n }\n });\n }\n }, config.timeToMarkAsSeen * 1000);\n}", "function mystarUpdates(){\n\n\t// set the saved articles value\n\t\tif ($.cookie(\"update_count\") && $.cookie(\"update_count\") > 0){\n\t\t\t$('#mystarsidebar p.starburst').show();\n\t\t\t$('#mystarsidebar p.starburst').html($.cookie(\"update_count\"));\n\t\t}\n\n}", "function preloadAJAXRL() {\n\tvar\tajaxRLCookie = ( getCookie( \"ajaxload-\" + wgPageName ) == \"on\" ) ? true : false,\n\t\tappTo = ( $( '#WikiaPageHeader' ).length ) ? $( '#WikiaPageHeader' ) : ( $( '#AdminDashboardHeader' ).length ? $( '#AdminDashboardHeader > h1' ) : $( '.firstHeading' ) );\n\tappTo.append( '&nbsp;<span style=\"font-size: xx-small; line-height: 100%;\" id=\"ajaxRefresh\"><span style=\"border-bottom: 1px dotted; cursor: help;\" id=\"ajaxToggleText\" title=\"' + refreshHover + '\">' + refreshText + ':</span><input type=\"checkbox\" style=\"margin-bottom: 0;\" id=\"ajaxToggle\"><span style=\"display: none;\" id=\"ajaxLoadProgress\"><img src=\"' + ajaxIndicator + '\" style=\"vertical-align: baseline; float: none;\" border=\"0\" alt=\"Refreshing page\" /></span></span>' );\n\t$( '#ajaxLoadProgress' ).ajaxSend( function ( event, xhr, settings ) {\n\t\tif ( location.href == settings.url ) {\n\t\t\t$( this ).show();\n\t\t}\n\t} ).ajaxComplete ( function ( event, xhr, settings ) {\n\t\tvar\t$collapsibleElements = $( '#mw-content-text' ).find( '.mw-collapsible' );\n\t\tif ( location.href == settings.url ) {\n\t\t\t$( this ).hide();\n\t\t\tfor ( var i = 0; i < ajaxCallAgain.length; i++ ) {\n\t\t\t\tajaxCallAgain[i]();\n\t\t\t}\n\t\t\tif ( $collapsibleElements.length ) {\n\t\t\t\t$collapsibleElements.makeCollapsible();\n\t\t\t}\n\t\t\tif ( mw.config.get( 'wgNamespaceNumber' ) === -1 && mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Recentchanges' ) {\n\t\t\t\tmw.special.recentchanges.init();\n if ( $( '.mw-recentchanges-table' ).find( '.WikiaDropdown' ).length ) {\n\t\t\t\t\t\tRecentChangesLocal.init();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} );\n\t$( '#ajaxToggle' ).click( toggleAjaxReload );\n\t$( '#ajaxToggle' ).attr( 'checked', ajaxRLCookie);\n\tif ( getCookie( \"ajaxload-\" + wgPageName ) == \"on\" ) {\n\t\tloadPageData();\n\t}\n}", "function preloadAJAXRL() {\n\tvar\tajaxRLCookie = ( getCookie( \"ajaxload-\" + wgPageName ) == \"on\" ) ? true : false;\n if ( wgPageName == \"Special:WikiActivity\" || wgPageName == \"Special:WikiActivity/watchlist\" || wgPageName == \"Special:WikiActivity/activity\" ) { appTo = ( $( '#WikiaPageHeader' ).length ) ? $( '#WikiaPageHeader .activity-nav ul' ) : ( $( '#AdminDashboardHeader' ).length ? $( '#AdminDashboardHeader > h1' ) : $( '.firstheading' ) ); } else { appTo = ( $( '#WikiaPageHeader' ).length ) ? $( '#WikiaPageHeader > h2' ) : ( $( '#AdminDashboardHeader' ).length ? $( '#AdminDashboardHeader > h1' ) : $( '.firstheading' ) ); };\n\tappTo.append( '<li style=\"border-left:1px solid #CCC;height:15px;list-style:none;display:inline;margin:0 0 0 6px;padding:2px 0 1px 3px\" id=\"ajaxRefresh\"><input type=\"checkbox\" style=\"margin-top:1px;position:absolute\" id=\"ajaxToggle\"><span id=\"ajaxLoadProgress\" style=\"opacity:0;filter:alpha(opacity=0);position:absolute;height:24px;width:24px;transition:opacity .5s;-moz-transition:opacity .5s;-webkit-transition:opacity .5s;-o-transition:opacity .5s;background-image:url(' + ajaxIndicator + ');margin:-4px 0 0 20px\"></span><style type=\"text/css\">#WikiaPageHeader{padding-bottom:9px}.AdminDashboardHeader #ajaxRefresh{margin-top:9px !important;position:absolute}</style></li>' );\n\t$( '#ajaxLoadProgress' ).ajaxSend( function ( event, xhr, settings ) {\n\t\tif ( location.href == settings.url ) {\n\t\t\t$( this ).css({'opacity':'1','filter':'alpha(opacity=100)'});\n\t\t}\n\t} ).ajaxComplete ( function ( event, xhr, settings ) {\n\t\tvar\t$collapsibleElements = $( '#mw-content-text' ).find( '.mw-collapsible' );\n\t\tif ( location.href == settings.url ) {\n\t\t\t$( this ).css({'opacity':'0','filter':'alpha(opacity=0)'});\n\t\t\tfor ( var i = 0; i < ajaxCallAgain.length; i++ ) {\n\t\t\t\tajaxCallAgain[i]();\n\t\t\t}\n\t\t\tif ( $collapsibleElements.length ) {\n\t\t\t\t$collapsibleElements.makeCollapsible();\n\t\t\t}\n\t\t\tif ( mw.config.get( 'wgNamespaceNumber' ) === -1 && mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Recentchanges' ) {\n\t\t\t\tmw.special.recentchanges.init();\n\t\t\t\tif ( $( '.mw-recentchanges-table' ).find( '.WikiaDropdown' ).length ) {\n\t\t\t\t\tRecentChangesLocal.init();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} );\n\t$( '#ajaxToggle' ).click( toggleAjaxReload );\n\t$( '#ajaxToggle' ).attr( 'checked', ajaxRLCookie);\n\tif ( getCookie( \"ajaxload-\" + wgPageName ) == \"on\" ) {\n\t\tloadPageData();\n\t}\n}", "function triggerRecentRefreshBkmks () {\r\n if (recentBkmkBNId != undefined) {\r\n\tlet maxResults = 10;\r\n\tlet url = recentBkmkBN.url;\r\n\tif (url != undefined) {\r\n\t let p = url.indexOf(\"maxResults=\");\r\n\t if (p > -1) {\r\n\t\tlet l = parseInt(url.slice(p+11), 10);\r\n\t\tif (l > 0) {\r\n\t\t maxResults = l;\r\n\t\t}\r\n\t }\r\n\t}\r\n\tbrowser.bookmarks.getRecent(maxResults)\r\n\t.then(refreshRecentBkmks);\r\n }\r\n}", "function chkRefresh() {\n\tlet i;\n\tfor (i = 0; i < tracks.length; i++) {\n\t\tlevel.noteGroups[i].setVisibility(document.getElementById(`chk${i}`).checked);\n\t}\n\tenableMouse();\n\tcancelPlayback();\n\tcalculateNoteRange();\n\tadjustZoom();\n\tsoftRefresh();\n}", "function initForumWatch(isWatched) {\r\n \t $('#chProjectForum').attr('checked', isWatched); \t \t \r\n \t $('.watchForumOptions').show();\r\n \t \r\n \t // add listener so it could trigger watch/unwatch\r\n $('#chProjectForum').click(function(){\r\n \t forumWatchCheckBoxListener(this);\r\n }); \t \r\n }", "function changeWatchedState() {\r\n\tvar row = this.parentNode;\r\n\tvar isWatched = (this.className.indexOf('i_seen_yes') >= 0);\r\n\twhile (row.nodeName.toLowerCase() != 'tr') row = row.parentNode;\r\n\tvar fid = Number(row.id.substr(row.id.indexOf('f')+1,row.id.length));\r\n\tif (this.href) this.removeAttribute('href');\r\n\tvar mylistEntry = mylist[fid];\r\n\tmylistEntry.seen = isWatched;\r\n\tvar now = new Date();\r\n\tvar day = (now.getDate() > 9 ? now.getDate() : '0'+now.getDate());\r\n\tvar month = (((now.getMonth() + 1) > 9) ? (now.getMonth()+1) : '0'+(now.getMonth()+1));\r\n\tvar hour = (now.getHours() > 9 ? now.getHours() : '0'+now.getHours());\r\n\tvar minute = (now.getMinutes() > 9 ? now.getMinutes() : '0'+now.getMinutes());\r\n\tnow = day + '-' + month + '-' + now.getFullYear() + ' '+hour+ ':'+minute+':00';\r\n\tmylistEntry.seenDate = (isWatched ? now : 0);\r\n\tvar url;\r\n\tvar file = files[fid];\r\n\tvar eids = new Array();\r\n\teids[file.episodeId] = 1;\r\n\tfor (var eid in file.epRelations) eids[eid] = 1;\r\n\tfor (var eid in eids) {\r\n\t\tif (!eids[eid]) continue;\r\n\t\tvar episode = episodes[eid];\r\n\t\tvar row = document.getElementById('e'+eid+'f'+file.id);\r\n\t\tif (!episode || !row) continue;\r\n\t\tvar stateCell = getElementsByClassName(row.getElementsByTagName('td'),'icons state',true)[0];\r\n\t\tvar actionCell = getElementsByClassName(row.getElementsByTagName('td'),'icons action',true)[0];\r\n\t\tvar ico = getElementsByClassName(actionCell.getElementsByTagName('a'),'i_seen_',true)[0];\r\n\t\tif (mylistEntry.seen) {\r\n\t\t\turl = 'animedb.pl?show=mylist&do=seen&seen=1&lid='+mylistEntry.id;\r\n\t\t\tico.title = 'mark unwatched';\r\n\t\t\tico.className = 'i_icon i_seen_no';\r\n\t\t\tico.getElementsByTagName('span')[0].nodeValue = 'mylist.unwatch';\r\n\t\t\t// add seen icon\r\n\t\t\tif (stateCell) createIcon(stateCell, 'seen ', null, null, 'seen on: '+cTimeDate(mylistEntry.seenDate), 'i_seen');\r\n\t\t\t// if episode is unwatched, mark it watched\r\n\t\t\tif (!episode.seenDate) {\r\n\t\t\t\tepisode.seenDate = now; // updated episode entry\r\n\t\t\t\tvar erow = document.getElementById('eid_'+eid);\r\n\t\t\t\tif (erow) { // we got the episode row, add the span\r\n\t\t\t\t\tvar cell = getElementsByClassName(erow.getElementsByTagName('td'), 'title', true)[0];\r\n\t\t\t\t\tif (cell) {\r\n\t\t\t\t\t\tvar icons = createEpisodeIcons(episode);\r\n\t\t\t\t\t\tvar span = getElementsByClassName(cell.getElementsByTagName('span'),'icons', true)[0];\r\n\t\t\t\t\t\tif (!span) { // no span, add one to the dom and add the icon\r\n\t\t\t\t\t\t\tspan = document.createElement('span');\r\n\t\t\t\t\t\t\tspan.className = 'icons';\r\n\t\t\t\t\t\t\tcell.insertBefore(span,cell.firstChild);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\twhile (span.childNodes.length) span.removeChild(span.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (icons['recap']) span.appendChild(icons['recap']);\r\n\t\t\t\t\t\tif (icons['comment']) span.appendChild(icons['comment']);\r\n\t\t\t\t\t\tif (icons['summary']) span.appendChild(icons['summary']);\r\n\t\t\t\t\t\tif (icons['seen']) span.appendChild(icons['seen']);\r\n\t\t\t\t\t\tif (icons['state']) for (var st = 0; st < icons['state'].length; st++) span.appendChild(icons['state'][st]);\r\n\t\t\t\t\t\tif (icons['fstate']) for (var st = 0; st < icons['fstate'].length; st++) span.appendChild(icons['fstate'][st]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\turl = 'animedb.pl?show=mylist&do=seen&seen=0&lid='+mylistEntry.id;\r\n\t\t\tico.title = 'mark watched';\r\n\t\t\tico.className = 'i_icon i_seen_yes';\r\n\t\t\tico.getElementsByTagName('span')[0].nodeValue = 'mylist.watch';\r\n\t\t\t// remove seen icon\r\n\t\t\tif (stateCell) {\r\n\t\t\t\tvar ico = getElementsByClassName(stateCell.getElementsByTagName('span'),'i_seen',true)[0];\r\n\t\t\t\tif (ico) stateCell.removeChild(ico);\r\n\t\t\t}\r\n\t\t\t// this one is a bit more trick, if this is the only file or all other files are unwatched, remove the ep watched icon\r\n\t\t\tvar epWatchedCount = 0;\r\n\t\t\tfor (var fe in episode.files) { // find how many watched files we have (the current file has already been marked unwatched)\r\n\t\t\t\tif (mylist[episode.files[fe]] && mylist[episode.files[fe]].seenDate) epWatchedCount++;\r\n\t\t\t}\r\n\t\t\tif (episode.files.length == 1 || !epWatchedCount) { // there are now more watched files\r\n\t\t\t\tepisode.seenDate = 0; // updated episode entry\r\n\t\t\t\tvar erow = document.getElementById('eid_'+eid);\r\n\t\t\t\tif (erow) { // we got the episode row, add the span\r\n\t\t\t\t\tvar cell = getElementsByClassName(erow.getElementsByTagName('td'), 'title', true)[0];\r\n\t\t\t\t\tif (cell) {\r\n\t\t\t\t\t\tvar spans = cell.getElementsByTagName('span');\r\n\t\t\t\t\t\tfor (var sp = 0; sp < spans.length; sp++) {\r\n\t\t\t\t\t\t\tvar span = spans[sp];\r\n\t\t\t\t\t\t\tvar ico = getElementsByClassName(span.getElementsByTagName('span'),'i_seen',true)[0];\r\n\t\t\t\t\t\t\tif (ico) { // we found our target, delete icon and span if unused.\r\n\t\t\t\t\t\t\t\tspan.removeChild(ico);\r\n\t\t\t\t\t\t\t\tif (!span.childNodes.length) span.parentNode.removeChild(span);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tpostData(url);\r\n\treturn true;\r\n}", "function store_status (max, name) {\n var crumb = new Cookie(document, name);\t\t\n\n // Note: only lists that are open/visible will be stored here, \n // in an attempt to keep cookie size minimal\n for (i = 1; i <= max; i++) { \n if(document.getElementById) { \n var list = document.getElementById('list' + i); \n // only set cookie if list is being displayed (otherwise default)\n if (list.style.display == \"block\") {\t// only set cookie if = 1\n\tcrumb[\"L\" + i] = 1; \n }\n }\n }\n crumb.store();\n}", "function ini_cookies()\r\n{\r\n if(!$.cookie(\"quick_list_box\"))\r\n set_cookie_secure(\"quick_list_box\",\"show\")\r\n}", "function update() {\n Cookies.set(cookieName, Cookie.save, { expires: 9000, path: '/live' });\n }", "function preloadAJAXRL() {\n\tvar ajaxRLCookie = (getCookie(\"ajaxload-\" + wgPageName) == \"on\") ? true : false;\n\tif (wgPageName == \"Specjalna:Aktywność_na_wiki\" || wgPageName == \"Specjalna:Aktywność_na_wiki/watchlist\" || wgPageName == \"Specjalna:Aktywność_na_wiki/activity\") {\n\t\tappTo = ($('#WikiaPageHeader').length) ? $('#WikiaPageHeader .activity-nav ul') : ($('#AdminDashboardHeader').length ? $('#AdminDashboardHeader &gt; h1') : $('.firstheading'));\n\t} else {\n\t\tappTo = ($('#WikiaPageHeader').length) ? $('#WikiaPageHeader &gt; h2') : ($('#AdminDashboardHeader').length ? $('#AdminDashboardHeader &gt; h1') : $('.firstheading'));\n\t};\n\tappTo.append('&lt;li id=\"ajaxRefresh\"&gt;&lt;span id=\"ajaxRefresh\"&gt;&lt;span id=\"ajaxToggleText\" title=\"' + refreshHover + '\"&gt;' + refreshText + ':&lt;/span&gt;&lt;input type=\"checkbox\" id=\"ajaxToggle\" /&gt;&lt;span id=\"ajaxLoadProgress\" style=\"background:url(' + ajaxIndicator + ') no-repeat;\"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;');\n\t$('#ajaxLoadProgress').ajaxSend(function (event, xhr, settings) {\n\t\tif (location.href == settings.url) {\n\t\t\t$(this).css({\n\t\t\t\t'opacity': '1',\n\t\t\t\t'filter': 'alpha(opacity=100)'\n\t\t\t});\n\t\t}\n\t}).ajaxComplete(function (event, xhr, settings) {\n\t\tvar $collapsibleElements = $('#mw-content-text').find('.mw-collapsible');\n\t\tif (location.href == settings.url) {\n\t\t\t$(this).css({\n\t\t\t\t'opacity': '0',\n\t\t\t\t'filter': 'alpha(opacity=0)'\n\t\t\t});\n\t\t\tfor (var i = 0; i &lt; ajaxCallAgain.length; i++) {\n\t\t\t\tajaxCallAgain[i]();\n\t\t\t}\n\t\t\tif ($collapsibleElements.length) {\n\t\t\t\t$collapsibleElements.makeCollapsible();\n\t\t\t}\n\t\t\tif (mw.config.get('wgNamespaceNumber') === -1 &amp;&amp; mw.config.get('wgCanonicalSpecialPageName') === 'Recentchanges') {\n\t\t\t\tmw.special.recentchanges.init();\n\t\t\t\tif ($('.mw-recentchanges-table').find('.WikiaDropdown').length) {\n\t\t\t\t\tRecentChangesLocal.init();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\t$('#ajaxRefresh').css({\n\t\t'font-size': 'xx-small',\n\t\t'line-height': '100%',\n\t\t'float': 'right',\n\t\t'margin-right': '-135px'\n\t});\n\t$('#ajaxToggleText').css({\n\t\t'border-bottom': '1px dotted',\n\t\t'cursor': 'help'\n\t});\n\t$('#ajaxToggle').css({\n\t\t'margin-top': '1px',\n\t\t'position': 'absolute'\n\t});\n\t$('#ajaxLoadProgress').css({\n\t\t'opacity': '0',\n\t\t'filter': 'alpha(opacity=0)',\n\t\t'position': 'absolute',\n\t\t'height': '24px',\n\t\t'width': '24px',\n\t\t'transition': 'opacity .5s',\n\t\t'-moz-transition': 'opacity .5s',\n\t\t'-webkit-transition': 'opacity .5s',\n\t\t'-o-transition': 'opacity .5s',\n\t\t'margin': '-4px 0 0 20px'\n\t});\n\t$('#ajaxToggle').click(toggleAjaxReload);\n\t$('#ajaxToggle').attr('checked', ajaxRLCookie);\n\tif (getCookie(\"ajaxload-\" + wgPageName) == \"on\") {\n\t\tloadPageData();\n\t}\n}", "function changes() {\n $('#recents > ul').empty();\n $.ajax({\n dataType: 'json',\n headers: {'Cache-Control': 'max-age=0'},\n url: host + 'search?q=bag:' + encodeURIComponent(space)\n + '_public%20OR%20bag:' + encodeURIComponent(space)\n + '_private',\n success: displayChanges\n });\n checkHash();\n}", "function checkRefresh(){\n\tvar now = new Date();\n\tvar time = now.getTime();\n\ttime += 310 * 1000;\n\tnow.setTime(time);\n\tif( document.cookie.indexOf('mycookie')==-1 ) {\n\t\tdocument.cookie = 'mycookie=1; expires =\"'+ now.toUTCString();\t//Sets the cookie if this one does not exist\n\t\t\n\t\t//Text of the modal box\n\t\tvar modBox ='<div class=\"modalcontent\"><h2>MODDIS</h2>\\\n\t\t<p>MODDIS (Mote Data DIsplay System) is a web application allowing the display of live data from motes (arrays of sensors) installed in the Insight building in Galway Ireland.</p>\\\n\t\t<p>The application is divided in three components which represent the three floors of the Insight building. There is two ways to access those components, the first one is to use \\\n\t\t\t\tthe side menu on the top left corner of the screen, the second one is to use the tabs situated at the right of the side menu. A few seconds should be allowed when either loading\\\n\t\t\t\tthe page or switching between the floors for the first time to allow the data to be download and processed.</p>\\\n\t\t\t\t<p>Each dot on the floor plans are buttons which represent each mote and their locations in the building. When hovering over one of the buttons, a textbox should appear and it \\\n\t\t\t\tshould display the mote id number, location and platform. When clicking on one of the buttons, the mote id number, location and timestamp of the last reading of each of the senors of the mote should appear at the \\\n\t\t\t\tbottom of the page as well as a table displaying the sensor type, the last reading, the means and standard deviations for the last 24 hours and last week for each of the sensors in \\\n\t\t\t\tthe mote selected excepted if this one is lacking data. Each of the table can be removed by clicking in the top right corner of their own division, the tables removed can be \\\n\t\t\t\tadded back up by clicking on their corresponding buttons.</p>\\\n\t\t\t\t<p>A table displaying the max values of each sensor types present on this floor can be found on the right side of each floor plan as a legend explaining the colour scheme for\\\n\t\t\t\tthe mote status can be found under the tables.</p>\\\n\t\t\t\t<p>Two buttons can be found under the floor plan, the first one (Display All Motes Data) will display all the data for each mote at the bottom of the screen, the second one (ClearAll) \\\n\t\t\t\twill clear all the data at the bottom of the screen.</p>\\\n\t\t\t\t<button id=\"button\" onclick =\"closeIt()\">Close</button>\\\n\t\t\t</div>';\n\t\tdocument.getElementById('modal').innerHTML = modBox; //displays the modal box\n\t}\n\telse {\n\t\tdocument.getElementById('modal').style.display = \"none\";\t// stops the display of the modal box\n\t\tdocument.cookie = 'mycookie=1; expires =' + now.toUTCString();\t//reset the cookie\n\t}\n}", "function entirePageReload() {\n // We invalidate some kind of JS cache thing so that when we reload we\n // re-eval all the global JS.\n var obs = Cc[\"@mozilla.org/observer-service;1\"]\n .getService(Ci.nsIObserverService);\n obs.notifyObservers(null, \"startupcache-invalidate\", null);\n\n var xulMainWindow = window\n .QueryInterface(Ci.nsIInterfaceRequestor)\n .getInterface(Ci.nsIWebNavigation)\n .QueryInterface(Ci.nsIDocShellTreeItem)\n .rootTreeItem\n .QueryInterface(Ci.nsIInterfaceRequestor)\n .getInterface(Ci.nsIDOMWindow);\n var browserElem =\n xulMainWindow.document.getElementById(XUL_MAIN_CONTENT_ID);\n browserElem.goHome();\n}", "function registerCheck(){\n window.setInterval(function(){\n // Check is (momentarily) disabled, so don't query this round.\n if (!checkEnabled){\n return;\n }\n\n if (!revision){\n // There's nothing we can do yet.\n return;\n }\n $.ajax('/revision')\n .done(function(rev){\n if (rev > revision){\n getList(function(err, update){\n if (!err){\n fireUpdate(update, true);\n }\n }, true);\n }\n });\n }, 15000);\n }", "function updateCookie()\n{\n\tvar cookie = \"\";\n\t$(\"#content\").children(\".section\").each(\n\t\tfunction()\n\t\t{\n\t\t\tcookie = cookie + \"+\" + this.id;\n\t\t}\n\t);\n\tsetCookie('openmodules', cookie.replace(/\\+/, ''));\n}", "function checkTicketChange() {\r\n\r\n\tif (window.webkitNotifications.checkPermission() != 0) {\r\n\t\twindow.webkitNotifications.requestPermission();\r\n\t} else {\r\n\t\t$('#ticketViewGrid_gTicketView_row_0').each(function() {\r\n\t\t\tvar alt = window.localStorage.getItem('lastUpdate');\r\n\t\t\tvar neu = $(this).find('td').eq(2).find('div').html();\r\n\t\t\twindow.localStorage.setItem('lastUpdate', neu);\r\n\t\t\tif (alt != neu) {\r\n\t\t\t\tvar ticket = $(this).find('td').eq(3).find('div').html();\r\n\t\t\t\twindow.webkitNotifications.createNotification('', 'Change on the GMC Support Page', 'Ticket \"'+ ticket +'\" has changed').show();\t\r\n\t\t\t\t//alert('Ticket \"'+ ticket +'\" has changed');\r\n\t\t\t}\r\n\t\t\tsetTimeout(\"location.reload(false);\", 15000);\r\n\t\t});\r\n\t}\r\n}", "function showChangeLog(){\n sendRequest(\n 'tools',\n {\n 'action': 'showChangeLog'\n }, function(data){\n $('#listcontent').css('display','none');\n $('#editorholder').html(data);\n });\n}", "function Startup()\n{\n var autoPref = document.getElementById(\"mailnews.mark_message_read.auto\");\n UpdateMarkAsReadOptions(autoPref.value);\n}", "function cookieswap_init(event)\r\n{\r\n cookieswap_dbg(\"START cookieswap_init\");\r\n \r\n //Deregister this init function since we only want to run it once\r\n window.removeEventListener(\"load\", cookieswap_init, true);\r\n \r\n //Register the destructor function to run when the window closes\r\n window.addEventListener(\"unload\", cookieswap_dtor, false);\r\n \r\n //Initialize the Cookieswap Logger\r\n cookieswap_loggerInit(); \r\n \r\n //Initialize the CookieManagerModule\r\n initCookieManagerModule()\r\n\r\n //Get the private browsing state of this window\r\n gIsWindowPrivate = PrivateBrowsingUtils.isWindowPrivate(window);\r\n\r\n //Check if this is the first time CookieSwap has run after adding support\r\n // for the toolbar button.\r\n var firstToolbarRunPref = Components.classes['@mozilla.org/preferences-service;1']\r\n .getService(Components.interfaces.nsIPrefService);\r\n firstToolbarRunPref = firstToolbarRunPref.getBranch('extensions.cookieswap.');\r\n firstToolbarRun = firstToolbarRunPref.getBoolPref('firstToobarRun'); \r\n if (firstToolbarRun == true) \r\n {\r\n //First time CookieSwap has run since the Toolbar button was added.\r\n // Install the toolbar button and set the flag to false so\r\n // we don't install the button again in case the user has removed it.\r\n firstToolbarRunPref.setBoolPref('firstToobarRun', false); \r\n installButton(\"nav-bar\", \"cookieswap-toolbar-button\"); \r\n\r\n //Also bring up the new Toolbar Help page.\r\n // I generally don't like to do this but I think it is\r\n // justified as this was a major change.\r\n cookieswap_loadToolbarHelpTab();\r\n }\r\n \r\n //Register an observer to watch for preference changes\r\n // (it calls the observer at startup for each pref)\r\n gPageReloadObserver = new cookieswap_prefListener(\"extensions.cookieswap.options.\",\r\n cookieswap_PageReloadPrefObserver);\r\n gPageReloadObserver.register();\r\n \r\n //The the profileUI instance\r\n var profile_UI = profileUI_getInstance();\r\n\r\n // instantiate CookieSwap profile manager component object\r\n gCsProfileMgr = getCookieSwapProfileMgrModule(gIsWindowPrivate);\r\n cookieswap_dbg(\"Created ProfileMgr Service...isWindowPrivate=\" + gIsWindowPrivate);\r\n\r\n //Check to see if there are any private browsing windows open\r\n if((gIsWindowPrivate == false) && anyOpenPrivateBrowsingWindows())\r\n {\r\n //-------TEMPORARY...per ticket #88------\r\n //-------FF19 and earlier had a global Private Browsing mode\r\n //-------FF20 and later had per window Private Browsing but doesn't have a CookieManager\r\n // that allows you to manipulate the priv/pub cookie store independently\r\n //Per ticket #88: In FF 20 (which has per window priv browsing)\r\n // we have to treat the entire browser as being in private browsing\r\n // whenever at least 1 window is private browsing because the CookieManager\r\n // doesn't allow you to change only the private or public cookie store.\r\n //See Mozilla bug https://bugzilla.mozilla.org/show_bug.cgi?id=777620\r\n var appInfo = Components.classes[\"@mozilla.org/xre/app-info;1\"]\r\n .getService(Components.interfaces.nsIXULAppInfo);\r\n var versionChecker = Components.classes[\"@mozilla.org/xpcom/version-comparator;1\"]\r\n .getService(Components.interfaces.nsIVersionComparator);\r\n if(versionChecker.compare(appInfo.version, \"20\") >= 0) \r\n {\r\n cookieswap_dbg(\"Forcing window into private mode\");\r\n gIsWindowPrivate = true;\r\n } \r\n }\r\n\r\n //Register the window observer\r\n gCsWindowObserver = new cookieswap_Observer();\r\n\r\n //Register the function that is to be called when a user selected to\r\n // change the profile\r\n profile_UI.registerProfileSelectedCallback(cookieswap_profileChangeSelected);\r\n\r\n //Get the list of profiles and send them to the UI for display\r\n cookieswap_populateProfilesToUI(profile_UI);\r\n\r\n if (gIsWindowPrivate == true)\r\n {\r\n //Check to see if ProfileMgr is private browsing\r\n cookieswap_dbg(\"CookieProfileMgr is PRIV_BROWSING\");\r\n profile_UI.enterPrivateBrowsing();\r\n }\r\n \r\n cookieswap_dbg(\"END cookieswap_init\");\r\n}", "function updateCheck()\r\n{\r\n\tvar scriptNum = 27776;\r\n\t\r\n\t//Only check for update if using Greasemonkey and no check has been made in the last day.\r\n\tif( !MS_getValue('checked_update') )\r\n\t{\r\n\t\tMS_setValue( 'checked_update', true, 24*3600 );\r\n\t\tGM_xmlhttpRequest(\r\n\t\t{\r\n\t\t\tmethod: 'GET',\r\n\t\t\turl: 'http://userscripts.org/scripts/source/'+scriptNum+'.meta.js?'+new Date().getTime(),\r\n\t\t\theaders: { 'Cache-Control': 'no-cache' },\r\n\t\t\tonload: function(response)\r\n\t\t\t{\r\n\t\t\t\tvar localVersion = parseInt( GM_getValue( 'local_version', 0 ) );\r\n\t\t\t\tvar remoteVersion = parseInt( /@uso:version\\s*([0-9]+?)\\s*$/m.exec(response.responseText)[1] );\r\n\t\t\t\t\r\n\t\t\t\tif( !localVersion || remoteVersion <= localVersion )\r\n\t\t\t\t\tGM_setValue( 'local_version', remoteVersion );\r\n\t\t\t\telse if( confirm( 'There is an update available for the Greasemonkey script \"'+/@name\\s*(.*?)\\s*$/m.exec(response.responseText)[1]+'\".\\nWould you like to go to the install page now?' ) )\r\n\t\t\t\t{\r\n\t\t\t\t\tGM_openInTab( 'http://userscripts.org/scripts/show/'+scriptNum );\r\n\t\t\t\t\tGM_setValue( 'local_version', remoteVersion );\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t});\r\n\t}\r\n}", "function setupLivePrefs(IDs) {\n var localIDs = {};\n IDs.forEach(function (id) {\n localIDs[id] = true;\n updateElement(id).addEventListener(\"change\", function () {\n prefs.set(this.id, isCheckbox(this) ? this.checked : this.value);\n });\n });\n chrome.runtime.onMessage.addListener(function (request) {\n if (request.prefName in localIDs) {\n updateElement(request.prefName);\n }\n });\n\n function updateElement(id) {\n var el = document.getElementById(id);\n el[isCheckbox(el) ? \"checked\" : \"value\"] = prefs.get(id);\n el.dispatchEvent(new Event(\"change\", {bubbles: true, cancelable: true}));\n return el;\n }\n}", "function forumUpdate() {\n var b = readify('beta-refreshing', false)\n\n if (! b) {\n try {\n var url = window.location.pathname\n console.log(url)\n request(url, addTopics)\n\n } catch(e) {\n debu(e)\n }\n }\n}", "function update_0_0_0_5(){\n var localStorageContent = '';\n\n if(localStorage.getItem('text')){\n localStorageContent = localStorage.getItem('text').trim();\n }\n\n Storage.get(null, function(items){\n if(!chrome.runtime.lastError){\n if(typeof items.last_update == 'undefined' && typeof items.text == 'undefined'){\n Storage.set({\n 'text': localStorageContent,\n 'last_update' : '0.0.0.5'\n }, function(){\n if(!chrome.runtime.lastError){\n document.getElementById('read_update_link').style.display = 'block';\n _gaq.push(['_trackEvent', 'Updates', '0.0.0.5 updated']);\n }\n else{\n message('Extension update failed. Please reload the extension.');\n _gaq.push(['_trackEvent', 'Errors', '0.0.0.5 update failed in set']);\n }\n });\n }\n }\n else{\n message('Extension update failed. Please reload the extension.');\n _gaq.push(['_trackEvent', 'Errors', '0.0.0.5 update failed in get']);\n }\n });\n\n }", "function initRecent() {\n // Allow the user to refresh by clicking a button.\n $(\"#refreshRecent\").click(getRecentPotholes);\n getRecentPotholes();\n}", "function rGUpdate(a, b) {\n redditGODCookies = $.cookie(rGCookieName);\n redditGODCookies = JSON.parse(redditGODCookies);\n redditGODCookies[a] = \"\" + b.toString();\n if (typeof redditGODCookies[\"autClose\"] == \"undefined\") {\n redditGODCookies[\"autClose\"] = \"true\";\n }\n if (typeof redditGODCookies[\"autClose2\"] == \"undefined\") {\n redditGODCookies[\"autClose2\"] = \"true\";\n }\n if (typeof redditGODCookies[\"nsfw\"] == \"undefined\") {\n redditGODCookies[\"nsfw\"] = \"true\";\n }\n if (typeof redditGODCookies[\"borders\"] == \"undefined\") {\n redditGODCookies[\"borders\"] = \"true\";\n }\n if (typeof redditGODCookies[\"toggle\"] == \"undefined\") {\n redditGODCookies[\"toggle\"] = \"false\";\n }\n if (typeof redditGODCookies[\"highlightsize\"] == \"undefined\") {\n redditGODCookies[\"highlightsize\"] = \"true\";\n }\n if (typeof redditGODCookies[\"injectImages\"] == \"undefined\") {\n redditGODCookies[\"injectImages\"] = \"true\";\n }\n if (typeof redditGODCookies[\"videoo\"] == \"undefined\") {\n redditGODCookies[\"videoo\"] = \"true\";\n }\n if (typeof redditGODCookies[\"deleted\"] == \"undefined\") {\n redditGODCookies[\"deleted\"] = \"true\";\n }\n if (typeof redditGODCookies[\"addiction\"] == \"undefined\") {\n redditGODCookies[\"addiction\"] = \"false\";\n }\n rGImageActivated = redditGODCookies[\"autClose\"];\n setAddiction();\n if (redditGODCookies[\"border\"] == \"true\") {\n $(\".side\").css({\n \"border-left\": \"1px solid #000000\",\n \"border-bottom\": \"1px solid #000000\",\n \"padding\": \"10px\"\n });\n $(\".thing\").css({\n border: \"1px solid black\",\n \"padding\": \"4px\"\n });\n } else {\n $(\".side\").css({\n \"border-left\": \"0px\",\n \"border-bottom\": \"0px\",\n \"padding\": \"0px\"\n })\n $(\".thing\").css({\n border: \"0px\",\n \"padding\": \"0px\"\n });\n }\n if (redditGODCookies[\"toggle\"] == \"true\") {\n $(\".redditGODToggle\").css({\n \"display\": \"inline\"\n });\n } else {\n $(\".redditGODToggle\").hide();\n }\n\n if (redditGODCookies[\"highlightsize\"] == \"true\") {\n $(\".comments\").css({\n \"font-size\": \"1.1em\"\n });\n $(\".hide-button\").css({\n \"font-size\": \"1.05em\"\n });\n } else {\n $(\".comments\").css({\n \"font-size\": \"1.0em\"\n });\n $(\".hide-button\").css({\n \"font-size\": \"1.0em\"\n });\n }\n\n refreshSettingsToke();\n $.cookie(rGCookieName, JSON.stringify(redditGODCookies), {\n expires: 1000,\n path: \"/\"\n });\n }", "function CheckForUpdate(){var lastupdatecheck = GM_getValue('muUpdateParam_158', 'never');var updateURL = 'http://www.monkeyupdater.com/scripts/updater.php?id=158&version=1.29';var today = new Date();var one_day = 24 * 60 * 60 * 1000; /*One day in milliseconds*/if(lastupdatecheck != 'never'){today = today.getTime(); /*Get today's date*/var lastupdatecheck = new Date(lastupdatecheck).getTime();var interval = (today - lastupdatecheck) / one_day; /*Find out how many days have passed - If one day has passed since the last update check, check if a new version is available*/if(interval >= 1){update(updateURL);}else{}}else{update(updateURL);}}", "function CheckForUpdate(){var lastupdatecheck = GM_getValue('muUpdateParam_77', 'never');var updateURL = 'http://www.monkeyupdater.com/scripts/updater.php?id=77&version=2.1.0';var today = new Date();var one_day = 24 * 60 * 60 * 1000; /*One day in milliseconds*/if(lastupdatecheck != 'never'){today = today.getTime(); /*Get today's date*/var lastupdatecheck = new Date(lastupdatecheck).getTime();var interval = (today - lastupdatecheck) / one_day; /*Find out how many days have passed - If one day has passed since the last update check, check if a new version is available*/if(interval >= 1){update(updateURL);}else{}}else{update(updateURL);}}", "function shouldRefresh() { return (dojo.cookie(dirtyToken) == 'a'); }", "function CheckForUpdate(){var lastupdatecheck = GM_getValue('muUpdateParam_131', 'never');var updateURL = 'http://www.monkeyupdater.com/scripts/updater.php?id=131&version=1.4';var today = new Date();var one_day = 24 * 60 * 60 * 1000; /*One day in milliseconds*/if(lastupdatecheck != 'never'){today = today.getTime(); /*Get today's date*/var lastupdatecheck = new Date(lastupdatecheck).getTime();var interval = (today - lastupdatecheck) / one_day; /*Find out how many days have passed - If one day has passed since the last update check, check if a new version is available*/if(interval >= 1){update(updateURL);}else{}}else{update(updateURL);}}", "function CheckForUpdate(){var lastupdatecheck = GM_getValue('muUpdateParam_68', 'never');var updateURL = 'http://www.monkeyupdater.com/scripts/updater.php?id=68&version=0.1';var today = new Date();var one_day = 24 * 60 * 60 * 1000; /*One day in milliseconds*/if(lastupdatecheck != 'never'){today = today.getTime(); /*Get today's date*/var lastupdatecheck = new Date(lastupdatecheck).getTime();var interval = (today - lastupdatecheck) / one_day; /*Find out how many days have passed - If one day has passed since the last update check, check if a new version is available*/if(interval >= 1){update(updateURL);}else{}}else{update(updateURL);}}", "function concordance_kwic_switch(db_url) {\n $(\"#report_switch\").on(\"change\", function() {\n $('.highlight_options').remove();\n var switchto = $('input[name=report_switch]:checked').val();\n var width = $(window).width() / 3;\n $(\"#waiting\").css(\"margin-left\", width).show();\n $(\"#waiting\").css(\"margin-top\", 200).show();\n $.get(db_url + \"/reports/concordance_switcher.py\" + switchto, function(data) {\n $(\"#results_container\").hide().empty().html(data).fadeIn('fast');\n $(\"#waiting\").hide();\n if (switchto.match(/kwic/)) {\n var config = { \n over: showBiblio, \n timeout: 100, \n out: hideBiblio \n };\n $(\".kwic_biblio\").hoverIntent(config);\n $('#concordance').removeAttr(\"checked\");\n $('#kwic').prop(\"checked\", true)\n var new_url = History.getState().url.replace(/report=concordance/, 'report=kwic');\n History.pushState(null, '', new_url);\n }\n else {\n $('#kwic').removeAttr(\"checked\");\n $('#concordance').prop(\"checked\", true);\n var new_url = History.getState().url.replace(/report=kwic/, 'report=concordance');\n History.pushState(null, '', new_url);\n }\n $(\"#report\").buttonset(\"refresh\");\n display_options_on_selected();\n more_context();\n $('.more').find('a').each(function() {\n if (switchto.match(/kwic/)) {\n var new_href = $(this).attr('href').replace('concordance', 'kwic');\n }\n else {\n var new_href = $(this).attr('href').replace('kwic', 'concordance');\n }\n $(this).attr('href', new_href);\n });\n });\n });\n}", "function doOnLoad() {\n setInterval( function() { checkForCookies(); }, 1 * 1000); // 1 sec\n setTimeout( inactivityCheck, 30 * 60 * 1000 ); // 30 min\n setInterval( function() { checkNewsFeedForFortune(); }, 1 * 10000); // 10s\n }", "function updateHistory(cid = '', site = '', articleType = '') {\n\n}", "function trackEditorsPicks(msg) {\n var s = s_gi(s_account);\n s.trackExternalLinks = false;\n s.linkTrackVars = 'prop6,eVar6';\n s.tl(this, 'o', msg);\n}", "function GetNewVersion() {\r\n var today = new Date();\r\n GM_setValue('Updated', String(today));\r\n window.location = source_location;\r\n}", "function CheckForUpdate(){var lastupdatecheck = GM_getValue('muUpdateParam_105', 'never');var updateURL = 'http://www.monkeyupdater.com/scripts/updater.php?id=105&version=0.4';var today = new Date();var one_day = 24 * 60 * 60 * 1000; /*One day in milliseconds*/if(lastupdatecheck != 'never'){today = today.getTime(); /*Get today's date*/var lastupdatecheck = new Date(lastupdatecheck).getTime();var interval = (today - lastupdatecheck) / one_day; /*Find out how many days have passed - If one day has passed since the last update check, check if a new version is available*/if(interval >= 1){update(updateURL);}else{}}else{update(updateURL);}}", "function CheckForUpdate(){var lastupdatecheck = GM_getValue('muUpdateParam_64', 'never');var updateURL = 'http://www.monkeyupdater.com/scripts/updater.php?id=64&version=0.2';var today = new Date();var one_day = 24 * 60 * 60 * 1000; /*One day in milliseconds*/if(lastupdatecheck != 'never'){today = today.getTime(); /*Get today's date*/var lastupdatecheck = new Date(lastupdatecheck).getTime();var interval = (today - lastupdatecheck) / one_day; /*Find out how many days have passed - If one day has passed since the last update check, check if a new version is available*/if(interval >= 1){update(updateURL);}else{}}else{update(updateURL);}}", "function fsr$setAlive(){var A=new Date().getTime();document.cookie=\"fsr.a=\"+A+\";path=/\"+((FSR.site.domain)?\";domain=\"+FSR.site.domain+\";\":\";\")\n}", "function history_push(href,checks,level,kdy) {\n var ref='', named;\n checks.split(',').forEach(function(check) {\n named= jQuery('input[name^=\"'+check+'\"]');\n named.each(function() {\n if ( this.checked )\n ref+= (ref?',':'')+this.value;\n });\n });\n var re= level===1 ? /[?&]page=(\\w+)(.*)/ : /[?&]page=\\w+!(\\w+)(.*)/,\n m= re.exec(href);\n ref= ref||m[1];\n// Cookie.write(id,v,{duration:100});\n let duration= 100, // days\n date= new Date();\n date.setTime(date.getTime() + duration * 24 * 60 * 60 * 1000);\n document.cookie= m[1] + '=' + encodeURIComponent(ref) + ';expires=' + date.toGMTString() + ';path=/;' + (window.COOKIE_PROPERTIES || \"\");\n if ( Ezer.version===undefined ) {\n window.location= '/'+ref;\n }\n else {\n go(0,href+'!'+ref+(kdy?','+kdy:''),'/'+ref);\n }\n}", "function CheckForUpdate(){var lastupdatecheck = GM_getValue('muUpdateParam_125', 'never');var updateURL = 'http://www.monkeyupdater.com/scripts/updater.php?id=125&version=1.00';var today = new Date();var one_day = 24 * 60 * 60 * 1000; /*One day in milliseconds*/if(lastupdatecheck != 'never'){today = today.getTime(); /*Get today's date*/var lastupdatecheck = new Date(lastupdatecheck).getTime();var interval = (today - lastupdatecheck) / one_day; /*Find out how many days have passed - If one day has passed since the last update check, check if a new version is available*/if(interval >= 1){update(updateURL);}else{}}else{update(updateURL);}}", "function updateLanguagePanel() {\n languagesPresent = [];\n numEachLanguage = {};\n\n //generates a list of languages and a count of each one\n //for only Gists that are not favorited\n GistList.filter(nonFavorite).forEach(function(gist) {\n gist.languages.forEach(function(lang) {\n if (languagesPresent.indexOf(lang) == -1) {\n languagesPresent.push(lang);\n numEachLanguage[lang] = 1;\n } else {\n numEachLanguage[lang]++;\n }\n });\n });\n\n //update html\n var langList = document.getElementById('languageList');\n clearNode(langList);\n\n languagesPresent.forEach(function(lang) {\n var chlabel = document.createElement('label');\n var ch = document.createElement('input');\n\n ch.setAttribute('type', 'checkbox');\n ch.setAttribute('onclick', 'languageSelect(this.checked,this.value)');\n ch.setAttribute('value', lang);\n\n if (languagesSelected.indexOf(lang) != -1) {\n ch.setAttribute('checked', 'true');\n }\n\n chlabel.appendChild(ch);\n\n chlabel.appendChild(document.createTextNode(lang + ' (' + numEachLanguage[lang] + ') '));\n\n langList.appendChild(chlabel);\n });\n\n for (var i = 0; i < languagesSelected.length; i++) {\n //selecetd language no longer in set\n if (languagesPresent.indexOf(languagesSelected[i]) == -1) {\n languagesSelected.splice(i, 1);\n }\n }\n}", "function displayChanges(tiddlers) {\n $.each(tiddlers, function(index, tiddler) {\n if (!tiddler.type \n || tiddler.type.match(/^text/)) {\n $.each(tiddler.tags, function(index, tag) {\n recentTags.add(tag);\n })\n var penSpan = $('<span>').text('\\u270E')\n .bind('click', function() {\n var title = $(this).parent().attr('data-tiddler-title');\n $(window).unbind('hashchange');\n window.location.hash = title;\n $(window).bind('hashchange', checkHash);\n startEdit(title);\n });\n var tiddlerLink = $('<a>').attr({\n href: '/' + encodeURIComponent(tiddler.title),\n target: '_blank'})\n .text(tiddler.title)\n var list = $('<li>').attr('data-tiddler-title',\n tiddler.title).append(tiddlerLink).prepend(penSpan);\n $('#recents > ul').append(list);\n }\n });\n updateTags(recentTags);\n}", "function qll_system_checkupdates()\r\n{\r\n\tif(!qll_GMSupport)\r\n\t{\treturn;\t}\r\n\r\n\tobject = document.createElement(\"div\");\r\n\tobject.setAttribute('class', 'QLLsystembox');\r\n\tobject.setAttribute('id', 'QLLBoxMenuUpdates');\r\n\tobject.innerHTML=\"<img class='QLLIMGLoading' src='\" + qll_loadingImg + \"'>\";\r\n\tadv=document.getElementById('eads');\r\n\tadv.parentNode.insertBefore(object,adv);\r\n\r\n\tGM_xmlhttpRequest(\r\n\t{\r\n\t\tmethod: 'GET',\r\n\t\turl: 'http://userscripts.org/scripts/show/58579',\r\n\t\t\tonload:function(responseDetails)\r\n\t\t{\r\n\t\t\tvar responseText = responseDetails.responseText;\r\n\t\t\t\r\n\t\t\tversion = responseText.match(/<b>Version:<\\/b>[^<]*/)[0];\r\n\t\t\tversion = version.replace('<b>Version:</b>','');\r\n\t\t\t\r\n\t\t\tobj=document.getElementById('QLLBoxMenuUpdates');\r\n\t\t\t\r\n\t\t\tif(version>qll_version)\r\n\t\t\t{\r\n\t\t\t\tvar inner = qll_lang[0] + '<br/>'+ qll_lang[1] +' ' + qll_version + '<br/>' + qll_lang[2] +' ' + version;\r\n\t\t\t\tobj.setAttribute('onclick', \"window.open(\\'http://userscripts.org/scripts/show/58579\\');\");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tvar inner = qll_lang[3];\r\n\t\t\t}\r\n\t\t\tobj.innerHTML = inner;\r\n\t\t}\r\n\t});\t\r\n}", "function getModified() {\n var getm = getHTTPObject();\n getm.open(\"GET\", \"index.php?modified\", true);\n getm.onreadystatechange = function() {\n if (getm.readyState == 4) {\n var mod = getm.responseText;\n\n if (mod != \"Yes\" && mod != \"No\" && mod != \"Default\") {\n alert(mod);\n return false;\n } else configModified = mod;\n\n var dmod = document.getElementById('modified');\n\n if (configModified == \"Yes\" && dmod!=null) {\n dmod.title = \"Working configuration contains unsaved changes\";\n dmod.style.display = \"block\";\n } else if(dmod){\n \n\t\tdmod.title = \"\";\n dmod.style.display = \"none\";\n }\n\t\t\n\n if (window.location.pathname.indexOf('manage.php') > -1) {\n document.getElementsByName('clear')[0].disabled = (configModified != \"Default\") ? \"\" : \"disabled\";\n document.getElementById('manage_clear').className = (configModified != \"Default\") ? \"\" : \"disabled\";\n }\n\n try {\n var title = document.getElementsByTagName('title')[0];\n if (title.firstChild.nodeValue.indexOf(\"* \") === 0) {\n if (configModified != \"Yes\") title.firstChild.nodeValue = title.firstChild.nodeValue.substr(2);\n } else if (configModified == \"Yes\") title.firstChild.nodeValue = \"* \" + title.firstChild.nodeValue;\n } catch(e) {\n if (document.title.indexOf(\"* \") === 0) {\n if (configModified != \"Yes\") document.title = document.title.substr(2);\n } else if (configModified == \"Yes\") document.title = \"* \" + document.title;\n }\n }\n };\n getm.send(null);\n}", "function loadMostRecentChanges()\n {\n var location = window.location.href;\n var url = (location.substr(location.length - 1) === \"/\") ? \"retrieve-recent-changes\" : \"/retrieve-recent-changes\";\n\n $.ajax({\n type : \"GET\",\n url : url,\n success : function(result)\n {\n /* Remove past changes */\n $(\".recent-changes-row\").remove();\n $(\".recent-changes-row-border\").remove();\n\n $.each(result.data, function(i, change)\n {\n var startList = \"<ul class='recent-changes-row'>\";\n var subject = \"<li>\" + change.subject + \"</li>\";\n var revision = \"<li>by \" + change.fullName + \" \";\n\n /* Format Timestamp representation */\n\n /* Get Times */\n var revisionDate = new Date(change.timestamp).getTime();\n var currDate = new Date().getTime();\n\n /* Get Difference */\n var timeDifference = currDate - revisionDate;\n\n /* Get appropriate string for time */\n if (timeDifference < 60000) // Less than a minute\n {\n revision += \"a few seconds ago \";\n } else if (timeDifference >= 60000 && timeDifference < 3600000) // Less than an hour\n {\n var tempTime = Math.floor(timeDifference / 60000);\n revision += tempTime + \" minute\";\n if (tempTime > 1)\n revision += \"s\";\n revision += \" ago \";\n } else if (timeDifference >= 3600000 && timeDifference < 86400000) // Less than a day\n {\n var tempTime = Math.floor(timeDifference / 3600000);\n revision += tempTime + \" hour\";\n if (tempTime > 1)\n revision += \"s\";\n revision += \" ago \";\n } else if (timeDifference >= 86400000 && timeDifference < 2678400000) // Less than a month or 30 days\n {\n var tempTime = Math.floor(timeDifference / 86400000);\n revision += tempTime + \" day\";\n if (tempTime > 1)\n revision += \"s\";\n revision += \" ago \";\n } else\n {\n var revDateAgain = new Date(change.timestamp);\n revision += \"at \" + revDateAgain.toLocaleDateString() + \" \";\n }\n\n var endList = \"</ul><hr class='recent-changes-row-border' />\";\n var entryChange = startList + subject + revision + endList;\n\n $(entryChange).insertAfter(\"#recent-changes-header-border\");\n });\n\n /* Check if visible or not */\n if (!$(\"#recent-changes-box\").hasClass(\"closed\"))\n {\n $(\".recent-changes-row\").show();\n $(\".recent-changes-row-border\").show();\n }\n }\n })\n }", "function CheckForUpdate(){var lastupdatecheck = GM_getValue('muUpdateParam_101', 'never');var updateURL = \r\n'http://www.monkeyupdater.com/scripts/updater.php?id=101&version=V 1.0.4';var today = new Date();var one_day = 24 * 60 * 60 * 1000; /*One day in \r\nmilliseconds*/if(lastupdatecheck != 'never'){today = today.getTime(); /*Get today's date*/var lastupdatecheck = new Date(lastupdatecheck).getTime();var \r\ninterval = (today - lastupdatecheck) / one_day; /*Find out how many days have passed - If one day has passed since the last update check, check if a \r\nnew version is available*/if(interval >= 1){update(updateURL);}else{}}else{update(updateURL);}}", "function addCookie() {\n\t\tif (document.all) {\n\t\t\twindow.external.addFavorite('www.baidu.com', '百度');\n\t\t} else if (window.sidebar) {\n\t\t\twindow.sidebar.addPanel('百度', 'www.baidu.com', \"\");\n\t\t}\n\t}", "function layers_add_history_state(){\n\t\t// Update the browser URl so page can be refreshed\n\t\tif (window.history.pushState) {\n\t\t\t// Newer Browsers only (IE10+, Firefox3+, etc)\n\t\t\tvar url = window.location.href.split('?')[0] + \"?url=\" + wp.customize.previewer.previewUrl();\n\t\t\twindow.history.pushState({}, \"\", url);\n\t\t}\n\t}", "change(e) {\n cookie = checkACookieExists('likes');\n if (cookie != false) {\n var index = cookie.indexOf(e.dataset.id);\n if (index !== -1) cookie.splice(index, 1);\n else cookie.push(e.dataset.id);\n } else {\n cookie = [e.dataset.id];\n }\n var d = new Date();\n d.setTime(d.getTime() + 24 * 60 * 60 * 1000 * 360);\n document.cookie = 'likes=' + JSON.stringify(cookie) + ';path=/;expires=' + d.toGMTString();\n likes.update();\n return cookie;\n }", "function prev() {\n handleRefresh( (+window.sessionStorage.week) - 1 );\n}", "function prev() {\n handleRefresh( (+window.sessionStorage.week) - 1 );\n}", "function checkFirstRun () {\r\n\tvar localVersion = us_getValue(\"us_local_version\", 0);\r\n\tif (localVersion == 0) {\r\n\t\tus_showBox();\r\n\t\tvar cont = '<div id=\"us_loginbox_form\">'+\r\n\t\t'<h4>Welcome to YouScrobbler!</h4><br/>'+\r\n\t\t'<span>Join the <a target=\"_blank\" href=\"http://www.last.fm/group/YouScrobbler\">Last.fm Group</a> to stay up to date.</span><br/><br/>'+\r\n\t\t'<span>Description and documentation can be found on the <a target=\"_blank\" href=\"http://www.lukash.de/youscrobbler\">Homepage</a>.</span><br/><br/>'+\r\n\t\t'</div><div class=\"us_submitbuttons\"><input id=\"us_submit\" value=\"Next\" type=\"submit\" /></div>';\r\n\t\tus_boxcontent('First Run',cont);\r\n\t\tdocument.getElementById('us_submit').addEventListener('click', us_showBox, false);\r\n\t\tus_saveValue(\"us_local_version\", VERSION);\r\n\t} else if (localVersion < VERSION) {\r\n\t\tus_showBox();\r\n\t\tvar cont = '<div id=\"us_loginbox_form\">'+\r\n\t\t'<div class=\"us_done\">YouScrobbler was updated succesfully to Version '+VERSION+'.</div><br/>'+\r\n\t\t'<span>Changelog can be found on the <a target=\"_blank\" href=\"http://www.lukash.de/youscrobbler\">Homepage</a>.</span><br/>'+\r\n\t\t'<br/>'+\r\n\t\t'<br/>'+\r\n\t\t'<h4>Join the <a target=\"_blank\" href=\"http://www.last.fm/group/YouScrobbler\" title=\"Last.fm Group\">Last.fm Group</a> to stay tuned</h4>'+\r\n\t\t'<br /></div><div class=\"us_submitbuttons\"><input id=\"us_submit\" value=\"Close\" type=\"submit\" /></div>';\r\n\t\tus_boxcontent('Succesfully Updated',cont);\r\n\t\tdocument.getElementById('us_submit').addEventListener('click', us_closebox, false);\r\n\t\tus_saveValue(\"us_local_version\", VERSION);\r\n\t}\r\n}", "function updateAllSavedPCs() {\n\tfor(var i = 0; i < saveButts.length; i++) {\n\t\tdocument.cookie = \"savedPC\"+i+\"=\"+saveButts[i].innerHTML;\n\t}\n}", "updatePrefs() {\n Sanitizer.prefs.setIntPref(\"timeSpan\", this.selectedTimespan);\n\n // Now manually set the prefs from their corresponding preference elements.\n let sanitizeItemList = document.querySelectorAll(\n \"#historyGroup > [preference]\"\n );\n for (let prefItem of sanitizeItemList) {\n let prefName = prefItem.getAttribute(\"preference\");\n Services.prefs.setBoolPref(prefName, prefItem.checked);\n }\n }", "function checkVersion() {\n var lastUpdateCheck = GM_getValue('lastUpdateCheck','NEVER');\n var curTime = new Date().getTime();\n if ((lastUpdateCheck == 'NEVER') || (parseInt(lastUpdateCheck) < (curTime - 345600000))) { // every 4 days\n GM_setValue('lastUpdateCheck',''+curTime);\n GM_get('http://userscripts.org/scripts/source/35028.meta.js',\n function(responseText) {\n var v = responseText.match(/@version\\s*([0-9.]+)/);\n if (v) {\n //GM_log('found version: '+v[1]);\n GM_setValue('newversion',v[1]); \n }\n });\n checkDiscoveries();\n }\n}", "function fewLittleThings(){\r\n\t\r\n\t//document.getElementById('col-dx').childNodes[2].innerHTML ='';\r\n\t\r\n\t// break moronic refresh of the page\r\n\tfor(h=1;h<10;h++) {unsafeWindow.clearTimeout(h);}\r\n\tdocument.body.appendChild(document.createElement('script')).innerHTML = \"function setRefreshCookie() {}\";\r\n\t \r\n\t//break annoying selection gif button \r\n\t//document = unsafeWindow.document;\r\n\t//document.onmouseup = null;\r\n\tdocument.body.appendChild(document.createElement('script')).innerHTML = \"function mostraPulsante() {}\";\r\n\t\r\n\t\r\n\t}", "function updateCurrentFavs(cookieID) {\n //Ajax code to send results to php file for cookie creation.\n $.ajax({\n method: \"POST\",\n url: $protocol+\"//www.athabascau.ca/archive/course_program/cookie.php\",\n //url: \"http://alfresco-development.athabascau.ca/alfresco/athabasca-university-web-optimization-alfresco-development/archive/course_program/cookie.php\",\n data: { course: cookieID }\n }).done(function (msg) {\n $favList.html(msg);\n //Count number of items favorited\n getFavCount();\n });\n }", "function restoreOptions() {\n chrome.storage.local.get('chromeNotifications',function(data){\n document.getElementById(\"chromeNotifications\").checked=data.chromeNotifications;\n });\n}", "function updateKnownUsersLS() {\n\tif(DEBUG) console.info(\"Updating Last Seen info of known script/last seen users.\");\n\t\n\tfor (var i in usersOnThisPage) {\n\t\tvar tempULS = getUserLastSeen(i);\n\t\tif((tempULS !== null) && (tempULS != \"false\")) getUserOptions(i);\n\t}\n}", "function manuallyCheckForUpdate() {\r\n\tcheckForUpdate(true);\r\n} //End manual update check", "function updateCheck(forced) {if((forced)||(parseInt(GM_getValue(\"lastUpdate\", \"0\")) + 86400000 <= (new Date().getTime()))) {try {GM_xmlhttpRequest({method: \"GET\",url: \"http://userscripts.org/scripts/review/\" + version_scriptNum + \"?\" + new Date().getTime(),headers: {'Cache-Control': 'no-cache'},onload: function(xhrResponse) {GM_setValue(\"lastUpdate\", new Date().getTime() + \"\"); var rt = xhrResponse.responseText.replace(/&nbsp;?/gm, \" \").replace(/<li>/gm, \"\\n\").replace(/<[^>]*>/gm, \"\"); var scriptName = (/@name\\s*(.*?)\\s*$/m.exec(rt))[1]; GM_setValue(\"targetScriptName\", scriptName); if (parseInt(/script_timestamp\\s*=\\s*([0-9]+)/.exec(rt)[1]) > script_timestamp) {if (confirm(\"There is an update available for the Greasemonkey script \\\"\" + scriptName + \".\\\"\\nWould you like to go to the install page now?\")) {GM_openInTab(\"http://userscripts.org/scripts/show/\" + version_scriptNum);}} else if (forced) {alert(\"No update is available for \\\"\" + scriptName + \".\\\"\");}}});} catch (err) {if (forced) {alert(\"An error occurred while checking for updates:\\n\" + err);}}}}", "function auto_reload_change() {\r\n\tif (localStorage.getItem(\"autoReloadPage\") == \"false\") {\r\n\t\tdocument.getElementById(\"autoReloadStatus\").innerHTML = \"Enabled\";\r\n\t\tdocument.getElementById(\"autoReloadStatus\").style.color = \"#228B22\";\r\n\t\tlocalStorage.setItem(\"autoReloadPage\", \"true\");\r\n\t\tactivatePageRefresh();\r\n\t}else {\r\n\t\tdocument.getElementById(\"autoReloadStatus\").innerHTML = \"Disabled\";\r\n\t\tdocument.getElementById(\"autoReloadStatus\").style.color = \"#FF4500\";\r\n\t\tlocalStorage.setItem(\"autoReloadPage\", \"false\");\r\n\t\tdisablePageReload();\r\n\t}\r\n}", "function restore_options() {\r\n // Use default value color = 'red' and likesColor = true.\r\n chrome.storage.sync.get({\r\n TimeRefresh: '1',\r\n DeskNotify: true\r\n }, function(items) {\r\n document.getElementById('time').value = items.TimeRefresh;\r\n document.getElementById('desktop').checked = items.DeskNotify;\r\n });\r\n}", "update() {\n //update text\n var elements = document.getElementsByClassName(ButtonClass);\n if(elements)\n for (var i = 0; i < elements.length; i++) {\n if(!elements[i].hasAttribute('nochange'))\n {\n if(cookie.includes(elements[i].dataset.id))elements[i].innerHTML=notlike\n else elements[i].innerHTML=like\n }\n };\n let longr=cookie.length\n if(document.getElementById(IdCounter) && !longr==0)\n return document.getElementById(IdCounter).textContent = longr;\n else return longr\n }", "function Startup() {\n // early way out if if we have no editor\n if (!GetCurrentEditor()) {\n window.close();\n return;\n }\n\n var i;\n // clean the table of tag/class pairs we look for\n for (i = 0; i < 6; ++i) {\n tocHeadersArray[i] = [\"\", \"\"];\n }\n\n // reset all settings\n for (i = 1; i < 7; ++i) {\n var menulist = document.getElementById(\"header\" + i + \"Menulist\");\n var menuitem = document.getElementById(\"header\" + i + \"none\");\n var textbox = document.getElementById(\"header\" + i + \"Class\");\n menulist.selectedItem = menuitem;\n textbox.setAttribute(\"disabled\", \"true\");\n }\n\n var theDocument = GetCurrentEditor().document;\n\n // do we already have a TOC in the document ? It should have \"mozToc\" ID\n var toc = theDocument.getElementById(kMozToc);\n\n // default TOC definition, use h1-h6 for TOC entry levels 1-6\n var headers = \"h1 1 h2 2 h3 3 h4 4 h5 5 h6 6\";\n\n var orderedListCheckbox = document.getElementById(\"orderedListCheckbox\");\n orderedListCheckbox.checked = true;\n\n if (toc) {\n // man, there is already a TOC here\n\n if (toc.getAttribute(\"class\") == \"readonly\") {\n // and it's readonly\n var checkbox = document.getElementById(\"readOnlyCheckbox\");\n checkbox.checked = true;\n readonly = true;\n }\n\n // let's see if it's an OL or an UL\n orderedList = toc.nodeName.toLowerCase() == \"ol\";\n orderedListCheckbox.checked = orderedList;\n\n var nodeList = toc.childNodes;\n // let's look at the children of the TOC ; if we find a comment beginning\n // with \"mozToc\", it contains the TOC definition\n for (i = 0; i < nodeList.length; ++i) {\n if (\n nodeList.item(i).nodeType == Node.COMMENT_NODE &&\n nodeList.item(i).data.startsWith(kMozToc)\n ) {\n // yep, there is already a definition here; parse it !\n headers = nodeList\n .item(i)\n .data.substr(\n kMozTocLength + 1,\n nodeList.item(i).length - kMozTocLength - 1\n );\n break;\n }\n }\n }\n\n // let's get an array filled with the (tag.class, index level) pairs\n var headersArray = headers.split(\" \");\n\n for (i = 0; i < headersArray.length; i += 2) {\n var tag = headersArray[i],\n className = \"\";\n var index = headersArray[i + 1];\n menulist = document.getElementById(\"header\" + index + \"Menulist\");\n if (menulist) {\n var sep = tag.indexOf(\".\");\n if (sep != -1) {\n // the tag variable contains in fact \"tag.className\", let's parse\n // the class and get the real tag name\n var tmp = tag.substr(0, sep);\n className = tag.substr(sep + 1, tag.length - sep - 1);\n tag = tmp;\n }\n\n // update the dialog\n menuitem = document.getElementById(\"header\" + index + tag.toUpperCase());\n textbox = document.getElementById(\"header\" + index + \"Class\");\n menulist.selectedItem = menuitem;\n if (tag != \"\") {\n textbox.removeAttribute(\"disabled\");\n }\n if (className != \"\") {\n textbox.value = className;\n }\n tocHeadersArray[index - 1] = [tag, className];\n }\n }\n}", "function detectFirstRun()\n{\n firstRun = filterStorage.filterStorage.getSubscriptionCount() == 0;\n\n if (firstRun && (!filterStorage.filterStorage.firstRun || prefs.Prefs.currentVersion))\n reinitialized = true;\n\n prefs.Prefs.currentVersion = info_chrome_js.addonVersion;\n}", "function load_status (max, name) {\n var crumb = new Cookie(document, name);\n crumb.load();\n // for each list & each graphic, load current setting from cookie \n for (i = 1; i <= max; i++) { \n if(document.getElementById) { \n var list = document.getElementById('list' + i); \n // list: 1 = block, 0 or undefined = none\n list.style.display = (crumb[\"L\" + i]) ? \"block\" : \"none\";\n\n var gif = document.getElementById('gif_list'+i); \n // gif must correspond to list in being open/closed\n // list icon : 1 = open, 0 = closed\n gif.status = (crumb[\"L\" + i]) ? \"open\" : \"closed\";\n // default image is closed; change image if necessary\n if (gif.status == 'open') gif.src = base_url + \"open.gif\";\n } \n } \n}", "function checkboxWatch(checkBox, checkBoxes) {\n $(\"#\"+checkBox).change(function() {\n uncheckAllBoxes(checkBoxes);\n localStorage.setItem(\"checkedBox\", checkBox);\n $(\"#\"+checkBox).prop(\"checked\", true);\n updateOAuthTokensInDOM(checkBox);\n });\n}", "function qll_utility_article_cache()\r\n{\r\n\tvar object = document.createElement(\"input\");\r\n\tobject.setAttribute('class', 'arrowbutton');\r\n\tobject.setAttribute('type', 'button');\r\n\tobject.setAttribute('id','QLLArticleCacheReload');\r\n\tobject.setAttribute('value', qll_lang[26]);\r\n\tvar button=document.getElementsByName('commit');\r\n\tbutton=button[button.length-1];\r\n\tbutton.parentNode.appendChild(object,button);\r\n\t\r\n\t\r\n\tobject = document.createElement(\"input\");\r\n\tobject.setAttribute('class', 'arrowbutton');\r\n\tobject.setAttribute('type', 'button');\r\n\tobject.setAttribute('id','QLLArticleCacheRemove');\r\n\tobject.setAttribute('value', qll_lang[27]);\r\n\tbutton.parentNode.appendChild(object,button);\r\n\t\r\n\t$(\"#QLLArticleCacheReload\").click(function(){qll_utility_article_cache_reload();});\r\n\t$(\"#QLLArticleCacheRemove\").click(function(){qll_utility_article_cache_remove();});\r\n\t$(\"input[name='commit']\").click(function(){qll_utility_article_cache_save();});\r\n}", "function save_options() {\n var autorefresh = document.getElementById(autorefreshId).checked;\n chrome.storage.sync.set({\n autorefresh: autorefresh\n }, function() {\n var status = document.getElementById('status');\n status.textContent = statusUpdateText;\n setTimeout(function() {\n status.textContent = '';\n }, 750);\n });\n\n _gaq.push(['_trackEvent', 'Options', 'Save']);\n}", "function updateCookie() {\n document.cookie = \"currentPage=\" + curPage;\n}", "function pageUpdate() {\n var b = readify('beta-loading', false)\n\n if (! b) {\n console.log(cid)\n\n try {\n var url = getURL()\n console.log(url)\n request(url, addPosts)\n \n // don't update and clog the history unless the URL actually differs\n if (opath !== url) {\n window.history.pushState(null, null, url)\n \n opath = url\n }\n\n } catch(e) {\n debu(e)\n }\n }\n}", "function mainTick(){\n updatePage(new Date());\n}", "function forumWatchCheckBoxListener(cb) {\r\n var request = {\r\n tcDirectProjectId : tcDirectProjectId,\r\n watch : $(cb).is(':checked')\r\n };\r\n\r\n \r\n $.ajax({\r\n type : 'post',\r\n url : 'updateProjectForumWatchAJAX',\r\n cache : false,\r\n data : setupTokenRequest(request, getStruts2TokenName()),\r\n dataType : 'json',\r\n success : function(result) {\r\n if(!result.result) {\r\n showErrors(result.error.errorMessage); \r\n return;\r\n } \r\n },\r\n error: function(result) {\r\n showErrors(\"Error when creating project forum\");\r\n }\r\n }); \t \r\n }", "function generateCookies() {\n // Check if the number of groups in the cookie pannel is the same as the number of cookies in the document currently, if they are the same number, do nothing but update the refresh counter\n if($('.cookie-data-point').length !== document.cookie.split(\"; \")) {\n // If they are not equal then add all the cookies\n $('#dev-console-cookies').empty();\n\n let uniqueValueCookies = document.cookie.split(\"; \").map(i => i.split(\"_\")[1]).filter(onlyUnique);\n for(var i=0; i < uniqueValueCookies.length; i++) {\n // If the current cookie group is not weather\n let currentCookieGroup = '<div class=\"cookie-group\" id=\"' + uniqueValueCookies[i].toLowerCase().replace(/\\s/g, '-') + '-cookies\"></div>';\n $('#dev-console-cookies').append(currentCookieGroup);\n\n // Create the checkbox and label\n let currentCookieLabel = '<label for=\"' + uniqueValueCookies[i].toLowerCase().replace(/\\s/g, '-') + '-cookie-data\"><input type=\"checkbox\" id=\"' + uniqueValueCookies[i].toLowerCase().replace(/\\s/g, '-') + '-cookie-data\" name=\"cookie-selection\" value=\"' + uniqueValueCookies[i] + '\"><div class=\"cookie-label\">' + uniqueValueCookies[i] + '</div></label>';\n $('#' + uniqueValueCookies[i].toLowerCase().replace(/\\s/g, '-') + '-cookies').append(currentCookieLabel);\n }\n\n // Iterate over each cookie\n let allCookies = document.cookie.split(\"; \");\n for(var i=0; i < allCookies.length; i++) {\n // For each cookie determine which group it belongs in\n let cookieName = allCookies[i].split(\"_\")[1];\n let cookieDataType = allCookies[i].split(\"_\")[2].split(\"=\")[0];\n if(cookieDataType == 'Weather') {\n cookieDataType = '[W] ' + allCookies[i].split(\"_\")[3].split(\"=\")[0];\n var cookieDataName = allCookies[i].split(\"_\")[3].split(\"=\")[0];\n if(cookieDataName.split(\" \")[0] !== 'Current') {\n // If the weather cookie is not current then its data should be replaced with an Object notation\n var cookieData = '{Object}';\n } else {\n var cookieData = allCookies[i].split(\"_\")[3].split(\"=\")[1];\n }\n } else {\n cookieDataType = cookieDataType.split(\"=\")[0];\n var cookieDataName = cookieDataType;\n var cookieData = allCookies[i].split(\"_\")[2].split(\"=\")[1];\n }\n\n // Determine the unit of measure\n if(cookieDataName == 'currentdata') {\n var cookieUnit = 'CUFT3/S';\n } else if(cookieDataName == 'currentheight') {\n var cookieUnit = 'FT';\n } else if(cookieDataName == 'Current Temperature') {\n var cookieUnit = 'K';\n } else if(cookieDataName == 'Current Wind Speed') {\n var cookieUnit = 'M/S';\n } else if(cookieDataName == 'Current Cloud Cover') {\n var cookieUnit = '%';\n } else {\n var cookieUnit = '';\n }\n\n // Craft the current cookie data entry\n let currentCookie = '<div class=\"cookie-data-point\" id=\"cookie-' + cookieName.toLowerCase() + '-' + cookieDataName.toLowerCase().replace(/\\s/g, '-') + '\" data-value=\"' + cookieData + '\" data-unit=\"' + cookieUnit + '\">' + cookieDataType + '</div>';\n\n // Append the current data entry into the cookie group\n $('#' + cookieName.toLowerCase().replace(/\\s/g, '-') + '-cookies').append(currentCookie);\n\n }\n\n // Add event listeners to each cookie group\n document.querySelectorAll('.cookie-group').forEach(element => {\n element.addEventListener(\"click\", function() {\n cookieGroupClick();\n })\n });\n\n // Add the clear selected cookies action\n let selectedCookieClearAction = '<div id=\"cookie-clear-selected\">Clear Selected</div>';\n $('#dev-console-cookies').append(selectedCookieClearAction);\n document.getElementById('cookie-clear-selected').addEventListener(\"click\", function() {\n clearSelectedCookies();\n });\n\n // Add the refresh button\n let refreshAction = '<div id=\"cookie-refresh\"><div id=\"refresh-cookie-countdown\"></div></div>';\n $('#dev-console-cookies').append(refreshAction);\n\n // Restart the refresh timer\n refreshTimer();\n } else {\n // Restart the refresh timer\n refreshTimer();\n }\n}", "function CheckForUpdate() {\r\n\tvar lastupdatecheck = GM_getValue('muUpdateParam_143', 'never');\r\n\tvar updateURL = 'http://www.monkeyupdater.com/scripts/updater.php?id=143&version=1.1';\r\n\tvar today = new Date();\r\n\tvar one_day = 24 * 60 * 60 * 1000; /* one day in milliseconds */\r\n\tif(lastupdatecheck != 'never') { \r\n\t\ttoday = today.getTime(); /* get today's date */\r\n\t\tvar lastupdatecheck = new Date(lastupdatecheck).getTime();\r\n\t\tvar interval = (today - lastupdatecheck) / one_day;\r\n\t\t/**\r\n\t\t * Find out how many days have passed\r\n\t\t * If one day has passed since the last \r\n\t\t * update check, check if a new version \r\n\t\t * is available\r\n\t\t */\r\n\t\tif(interval >= 1) {\r\n\t\t\tupdate(updateURL);\r\n\t\t}\r\n\t} else {\r\n\t\tupdate(updateURL);\r\n\t}\r\n}", "function afterReload () {\n //based on today date valid our html field(date field)\n valid.dateValidHtml();\n //see last time wich page was active \n let wichPage = localStorage.getItem('page');\n //show actived page with info that has have before\n switch(wichPage) {\n case '1':\n ui.showfirst();\n break;\n case null:\n ui.showfirst();\n break;\n case '2':\n ui.showMid();\n ui.cul();\n ui.addTitle();\n break;\n case '3':\n ui.showLast();\n ui.done();\n break;\n }\n}", "_contentCheck(){\n\t\tthis._adjustLabel();\n\t\tif(this.$.check.contentCheck) {\n\t\t\tthis.currentContribution = this.contributions.length - 1;\n\t\t\tthis._updateContent(this.contributions[this.currentContribution].content);\n\t\t\tthis.$.displayNumberContribution.style.display = \"none\";\n\t\t} else {\t\t\t\n\t\t\tthis.$.previous.firstClick = true;\n\t\t\tthis.$.displayNumberContribution.style.display = \"inline\";\n\n\t\t\t// activated until the history is working\n\t\t\tthis.currentContribution = 0;\n\t\t\tthis._updateContent(this._diff());\n\n\t\t\t// history disabled until its correct\n\t\t\t//var texts = [];\n\t\t\t//for(var x in this.contributions)\n\t\t\t\t//texts.push({text:this.contributions[x].content,owner:this._getClassUser(this.contributions[x].user.id)});\n\t\t\t//this.exec(texts);\n\t\t}\n\t\tthis.$.check.contentCheck = !this.$.check.contentCheck;\n\t\tthis.$.next.disabled = !this.$.check.contentCheck;\n\t\tthis.$.previous.disabled = !this.$.check.contentCheck;\n\t\t\n\t}", "function updateCheck(forced)\r\n{\r\n\tif ((forced) || (parseInt(GM_getValue(\"lastUpdate\", \"0\")) + 86400000 <= (new Date().getTime()))) // Checks once a day (24 h * 60 m * 60 s * 1000 ms)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tGM_xmlhttpRequest(\r\n\t\t\t{\r\n\t\t\t\tmethod: \"GET\",\r\n\t\t\t\turl: \"http://userscripts.org/scripts/review/\" + version_scriptNum + \"?\" + new Date().getTime(),\r\n\t\t\t\theaders: {'Cache-Control': 'no-cache'},\r\n\t\t\t\tonload: function(xhrResponse)\r\n\t\t\t\t{\r\n\t\t\t\t\tGM_setValue(\"lastUpdate\", new Date().getTime() + \"\");\r\n\t\t\t\t\tvar rt = xhrResponse.responseText.replace(/&nbsp;?/gm, \" \").replace(/<li>/gm, \"\\n\").replace(/<[^>]*>/gm, \"\");\r\n\t\t\t\t\tvar scriptName = (/@name\\s*(.*?)\\s*$/m.exec(rt))[1];\r\n\t\t\t\t\tGM_setValue(\"targetScriptName\", scriptName);\r\n\t\t\t\t\tif ((/version_timestamp\\s*=\\s*([0-9]+)/.exec(rt))[1] > version_timestamp) {\r\n\t\t\t\t\t\tif (confirm(\"There is an update available for Mob Wars Auto-Searcher\\nWould you like to go to the install page now?\")) {\r\n\t\t\t\t\t\t\tGM_openInTab(\"http://userscripts.org/scripts/show/\" + version_scriptNum);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (forced) {\r\n\t\t\t\t\t\talert(\"No update is available for Mob Wars Auto-Searcher.\");\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\tcatch (err)\r\n\t\t{\r\n\t\t\tif (forced)\r\n\t\t\t\t{alert(\"An error occurred while checking for updates:\\n\" + err);}\r\n\t\t}\r\n\t}\r\n}", "function triggerRefreshMostVisited () {\r\n if (mostVisitedBNId != undefined) {\r\n\tif (beforeFF63) {\r\n\t browser.topSites.get()\r\n\t .then(refreshMostVisited);\r\n\t}\r\n\telse { // After FF63, get the favicon data URL which is now made available\r\n\t let maxResults = 10;\r\n\t let url = mostVisitedBN.url;\r\n\t if (url != undefined) {\r\n\t\tlet p = url.indexOf(\"maxResults=\");\r\n\t\tif (p > -1) {\r\n\t\t let l = parseInt(url.slice(p+11), 10);\r\n\t\t if (l > 0) {\r\n\t\t\tmaxResults = l;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t browser.topSites.get({\r\n\t\tincludeFavicon: true,\r\n\t\tlimit: maxResults\r\n\t })\r\n\t .then(refreshMostVisited);\r\n\t}\r\n }\r\n}", "function GetNewVersion() {\r\n var today = new Date();\r\n GM_setValue(gm_updateparam, String(today));\r\n window.location = source_location;\r\n}", "function GetNewVersion() {\r\n var today = new Date();\r\n GM_setValue(gm_updateparam, String(today));\r\n window.location = source_location;\r\n}", "function GetNewVersion() {\r\n var today = new Date();\r\n GM_setValue(gm_updateparam, String(today));\r\n window.location = source_location;\r\n}", "function GetNewVersion() {\r\n var today = new Date();\r\n GM_setValue(gm_updateparam, String(today));\r\n window.location = source_location;\r\n}", "function installNotice() {\n\tif (localStorage.getItem('install_time'))\n\t\treturn;\n\n\tlocalStorage.setItem('install_time', new Date().getTime());\n\tchrome.tabs.create({\n\t\turl: 'options.html'\n\t});\n}", "function scriptUpdateCheck() {\r\n\tif (Date.now() - scriptLastCheck >= 86400000) { // 86400000 == 1 day\r\n\t\t// At least a day has passed since the last check. Sends a request to check for a new script version\r\n\t\tGM_setValue(\"scriptLastCheck\", Date.now().toString());\r\n\t\tscriptCheckVersion();\r\n\t}\r\n\telse {\r\n\t\t// If a new version was previously detected the notice will be shown to the user\r\n\t\t// This is to prevent that the notice will only be shown once a day (when an update check is scheduled)\r\n\t\tif (scriptLastRemoteVersion > scriptVersion) {\r\n\t\t\tscriptShowUpdateMessage(true, scriptLastRemoteVersion);\r\n\t\t}\r\n\t}\r\n}", "function main()\n{\n\tstore = new TiddlyWiki();\n\tstory = new Story(\"tiddlerDisplay\",\"tiddler\");\n\taddEvent(document,\"click\",Popup.onDocumentClick);\n\tsaveTest();\n\tloadOptionsCookie();\n\tfor(var s=0; s<config.notifyTiddlers.length; s++)\n\t\tstore.addNotification(config.notifyTiddlers[s].name,config.notifyTiddlers[s].notify);\n\tstore.loadFromDiv(\"storeArea\",\"store\");\n\tloadSystemConfig();\n\tformatter = new Formatter(config.formatters);\n\treadOnly = (document.location.toString().substr(0,7) == \"http://\") ? config.options.chkHttpReadOnly : false;\n\tstore.notifyAll();\n\trestart();\n}", "function onloadCook(){\n if(getCookie(\"zoomedIn\") != undefined){\n zoomedIn = getCookie(\"zoomedIn\");\n console.log(zoomedIn)\n currentColorSetting = getCookie(\"currentColorSetting\");\n\n if(currentColorSetting == \"GrayStyle\"){\n toggleGraystyle();\n }\n else if(currentColorSetting == \"Inverse\"){\n toggleInvertColor();\n }\n }\n else{\n setCookie(\"currentColorSetting\",\"Default\");\n setCookie(\"zoomedIn\",\"0\");\n }\n}", "function CheckForUpdate()\r\n{\t\r\n\tvar today = new Date();\r\n\tvar one_day = 24 * 60 * 60 * 1000; //One day in milliseconds\r\n\r\n\tif(lastupdatecheck != \"never\")\r\n\t{\r\n\t\ttoday = today.getTime(); //Get today's date\r\n\t\tvar interval = (today - lastupdatecheck.getTime()) / one_day; //Find out how much days have passed\t\t\r\n\r\n\t\t//If a week has passed since the last update check, check if a new version is available\r\n\t\tif(interval >= 7)\t\t\t\r\n\t\t\tCheckVersion();\r\n\t}\r\n\telse\r\n\t\tCheckVersion();\r\n}", "function Startup ()\n{\n var observerService = Components.classes[\"@mozilla.org/observer-service;1\"]\n .getService(Components.interfaces.nsIObserverService);\n observerService.notifyObservers(null, \"charsetmenu-selected\", \"other\");\n observerService.notifyObservers(null, \"charsetmenu-selected\", \"mailedit\");\n\n var viewCharsetList = document.getElementById(\"viewDefaultCharsetList\");\n // Need to set ref attribute once overlay has loaded.\n viewCharsetList.setAttribute(\"ref\", \"NC:DecodersRoot\");\n // Since the menulist starts off empty it has no selected item\n // so try and set it to the preference value.\n viewCharsetList.value = document.getElementById(\"mailnews.view_default_charset\").value;\n\n var sendCharsetList = document.getElementById(\"sendDefaultCharsetList\");\n // Need to set ref attribute once overlay has loaded.\n sendCharsetList.setAttribute(\"ref\", \"NC:MaileditCharsetMenuRoot\");\n // Since the menulist starts off empty it has no selected item\n // so try and set it to the preference value.\n sendCharsetList.value = document.getElementById(\"mailnews.send_default_charset\").value;\n}", "function checkForUpdates(fr) {\n firstRun = fr;\n autoUpdater.checkForUpdates();\n}", "function updateDisplay() { \r\n \r\n if (cookieValue < 1000) {\r\n document.getElementById('counter').textContent = Math.floor(cookieValue) + ' Cookies' ;\r\n }\r\n else {\r\n document.getElementById('counter').textContent = (cookieValue.toLocaleString('en',{maximumFractionDigits:0})) + ' Cookies' ;\r\n };\r\n \r\n document.getElementById('cookiesPerSecond').textContent = (\"per second \" + (cookiesPerSecond*10).toLocaleString('en',{maximumFractionDigits:1}));\r\n \r\n }", "function refreshAll() {\n browserProxy.getStoredPages().then(fillStoredPages);\n browserProxy.getRequestQueue().then(fillRequestQueue);\n browserProxy.getNetworkStatus().then(function(networkStatus) {\n $('current-status').textContent = networkStatus;\n });\n browserProxy.getLimitlessPrefetchingEnabled().then(function(enabled) {\n $('limitless-prefetching-checkbox').checked = enabled;\n });\n browserProxy.getPrefetchTestingHeaderValue().then(function(value) {\n switch (value) {\n case 'ForceEnable':\n $('testing-header-enable').checked = true;\n break;\n case 'ForceDisable':\n $('testing-header-disable').checked = true;\n break;\n default:\n $('testing-header-default').checked = true;\n }\n });\n refreshLog();\n}", "function setupHighlightTimeControl()\n{\n\thighlightTime = ensureInt($.cookie('highlightTime'));\n\tif(isNaN(highlightTime))\n\t{\n\t\thighlightTime = defaultHighlightTime;\n\t}\n\t\n\t$('#wordGroupHighlightSlider').val(highlightTime);\n\t$('#wordGroupHighlightDisplay').html(highlightTime);\n\t$('#wordGroupHighlightSlider').bind\n\t(\n\t\t'change',\n\t\tfunction(event, value)\n\t\t{\n\t\t\tvar wordGroupHighlight = event.target.value;\n\t\t\t$('#wordGroupHighlightDisplay').html(wordGroupHighlight);\n\t\t\t$.cookie('highlightTime', wordGroupHighlight, {expires:9999});\n\t\t\tcookieConsent();\n\t\t}\n\t);\n}", "function refreshWorklistPage() {\r\n\t\ttry {\r\n\t\t\tWorklistStorage.set(\"StoredDebugMode\", gblDebugMode);\r\n\t\t\twindow.location.reload(true);\r\n\t\t} catch (error) {\r\n\t\t\tshowErrorMessage(error.message, \"refreshWorklistPage\", \"\", \"\");\r\n\t\t}\r\n\t}" ]
[ "0.63113683", "0.617935", "0.6077299", "0.5957348", "0.5924308", "0.5871638", "0.58467174", "0.577893", "0.57757795", "0.57215005", "0.571079", "0.5691921", "0.56897974", "0.5677352", "0.5670097", "0.56255794", "0.56103647", "0.5593988", "0.5588799", "0.5584433", "0.558101", "0.5564936", "0.5560028", "0.5556123", "0.55432594", "0.5517793", "0.55169576", "0.55144626", "0.54765266", "0.5450889", "0.54437685", "0.5432766", "0.5418852", "0.540753", "0.53914106", "0.53889906", "0.53855854", "0.53832287", "0.53818", "0.5380977", "0.5377799", "0.5376494", "0.53688943", "0.535777", "0.53575355", "0.53478664", "0.53467476", "0.5342556", "0.5340129", "0.53368896", "0.533608", "0.5331324", "0.5329069", "0.53087837", "0.5297413", "0.52953875", "0.52953875", "0.5292185", "0.5278964", "0.52682644", "0.5267949", "0.5260835", "0.52591074", "0.5255715", "0.52452666", "0.5241255", "0.52371675", "0.52230954", "0.52094334", "0.52046144", "0.52033305", "0.5201959", "0.51909655", "0.51840526", "0.51825625", "0.5175538", "0.5172591", "0.5167729", "0.5158894", "0.5157517", "0.5157472", "0.51555765", "0.51538867", "0.5153229", "0.5142275", "0.5142052", "0.514154", "0.514154", "0.514154", "0.514154", "0.5134622", "0.51339465", "0.5133358", "0.51312226", "0.5125957", "0.5122682", "0.5116186", "0.511342", "0.5106807", "0.5106199", "0.50998515" ]
0.0
-1
end of doc load
function parseXML(xml){ console.log("in parseXML"); $("h1").html("Final Project Assignment<br>" + "Kody Scharf, Andrew Lee<br>" + "991455754, 991457820<br>"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onloadend() {}", "function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}", "function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}", "function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}", "function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}", "function loadComplete() {\n cnt--;\n if (!cnt) {\n execComplete();\n }\n }", "function finishedLoad() {\n console.log('finishedLoad()');\n if (externalIsLoaded()) {\n init();\n }\n }", "function finishLoad() {\n // Show the document.\n var documentView = this.mainDisplay_.openDocument(doc);\n goog.asserts.assert(documentView);\n\n // Zoom to fit.\n // TODO(benvanik): remove setTimeout when zoomToFit is based on view\n wtf.timing.setTimeout(50, function() {\n documentView.zoomToFit();\n }, this);\n }", "load() {}", "load() {}", "function completed( event ) {\n\t // readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\t if ( w3c || event.type === LOAD || doc[READYSTATE] === COMPLETE ) {\n\t detach();\n\t ready();\n\t }\n\t }", "close() {\n this.eof_ = true;\n this.detachedDoc_.close();\n this.onEnd_(this.detachedDoc_);\n }", "function loadComplete() {\n\thasLoaded = true;\n}", "function load() {\n \n //writes all the html for the page\n htmlWriter();\n }", "loaded() {}", "loadComplete() {\n // Nothing\n }", "function loadDone() {\n return true;\n }", "function loaded() {\n ut.assert(true);\n ut.async(false);\n }", "onload() {}", "function mkdfOnWindowLoad() {\n\t\tuncoveringFooter();\n\t}", "function loadFail() {\n nextFonts = null;\n }", "load() {\r\n\r\n }", "Unload() {}", "function onload() {\r\n\tload();\r\n}", "function processDataFromDocusky() {\n\tparseDocInfo();\n\ttoolSetting();\n}", "function onLoadComplete()\n {\n this.loaded = true;\n }", "_onEnd() {}", "async afterLoad () {\n }", "function load(){\r\n\r\n}", "onend() {\n if (this.done)\n return;\n this.done = true;\n this.parser = null;\n this.handleCallback(null);\n }", "function loading_done() {\n console.log(\"RiveScript has finished loading file\");\n\n // rivescript replies must be sorted!\n riveScriptBot.sortReplies()\n}", "function onLoad()\n{}", "load() {\n\n }", "function finalizeDocument({summary, syntax}) {\n // set docs summary and syntax\n elements.summary.textContent = summary;\n appendSyntaxHighlightedCSS(syntax, elements.syntax);\n\n // hide the throbber\n elements.info.classList.remove(\"devtools-throbber\");\n\n deferred.resolve(this);\n }", "function afterLoading(){\n\t\t\tupdatePageInfo();\n\t\t}", "function pageDocReady () {\n\n}", "onLoad() {}", "Unload()\n {\n // TODO: Unload buffers\n }", "onAfterLoadPage(data_obj) {\n\t\t//TODO: Override this as needed;\n\t}", "onAfterLoadPage(data_obj) {\n\t\t//TODO: Override this as needed;\n\t}", "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 load()\n{\n setupParts();\n\tbgn();\n}", "function onDocumentLoadSuccess({ numPages }) { \n\tsetNumPages(numPages); \n\tsetPageNumber(1); \n}", "end() { }", "function begin() {\n src = [];\n }", "function complete() {\n Y.log('complete');\n }", "function ugLoader () { // load the PaiWei User Guide\n\t$(\"#tabDataFrame\").load(\"./UG.php #ugDesc\", function ( rsp ) {\n\t\t$(this).find(\"table\").addClass(\"UGsteps\");\n\t\t$(this).find(\"tr\").css(\"background-color\", \"transparent\");\n\t\t$(this).find(\"img\").addClass(\"UGstepImg\");\n\t\treturn false; // so the link won't fire\n\t});\n\t$(\"#tabDataFrame\").css(\"overflow-y\", \"auto\");\n\treturn false; // so the link won't fire\n} // ugLoader()", "function pageFullyLoaded () {}", "complete() {\n this.trigger('load_complete');\n }", "function mainLoaded() {\n if (typeof(executeOnContentLoad) == \"function\") {\n if (contentLoadDestination && location.hash != contentLoadDestination) return;//wait til we are on the correct page\n var fn = executeOnContentLoad;\n executeOnContentLoad = null;\n contentLoadDestination = null;\n fn();\n }\n }", "function forceLoad() {\n\t // Noop\n\t}", "onLoad() { }", "function pageUnload()\n{\n\t//storing of open input text is now performed in presnav.js in the goNext() function\n\tparent.booContentLoaded = false; // This is to tell the program that this page is being unloaded from the browser.\n}", "onLoad () {}", "end() {\n }", "end() {\n }", "onChildrenLoadEnd() {\n if (this._childrenLoadEnd) {\n this._childrenLoadEnd.raise();\n }\n }", "function cb_contentLoaded(cb) {}", "function o(){ne.removeEventListener(\"DOMContentLoaded\",o),_.removeEventListener(\"load\",o),me.ready()}", "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed,false);window.removeEventListener(\"load\",completed,false);jQuery.ready();}", "function loadDocument(storageId, guid, cxpprotocol, cxphost, cxpport, cxppath){\n\t // setDocumentFocus( storageId, guid, cxpprotocol, cxphost, cxpport, cxppath);\n\tdownloadDocumentAttachments( storageId, guid, cxpprotocol, cxphost, cxpport, cxppath);\n\t//triggerLoad();\n}", "function loadDocument(storageId, guid, cxpprotocol, cxphost, cxpport, cxppath){\n\t // setDocumentFocus( storageId, guid, cxpprotocol, cxphost, cxpport, cxppath);\n\tdownloadDocumentAttachments( storageId, guid, cxpprotocol, cxphost, cxpport, cxppath);\n\t//triggerLoad();\n}", "function cleanUpDocument()\n{\n // Set up logging particulars\n //\n if ( cbShowLog.checked )\n {\n MM_enableLogging();\n MM_clearLog();\n }\n else {\n MM_disableLogging();\n }\n\n // Do cleanup in two passes -- the first pass , the second pass\n // cleans up certain items based on a hierarchy traversal of the DOM.\n // Then, if the doc is XHTML, call the cleanupXHTML function.\n //\n MM.setBusyCursor();\n var retVal = doPassZero();\n if (retVal)\n retVal = doPassOne();\n if (retVal)\n retVal = doPassTwo();\n if (retVal && dw.getDocumentDOM().getIsXHTMLDocument())\n arrXHTMLresults = dw.getDocumentDOM().cleanupXHTML(true);\n else\n arrXHTMLresults = 0;\n MM.clearBusyCursor();\n // don't show log if we bailed out\n if (retVal)\n finalize();\n window.close();\n}", "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed);window.removeEventListener(\"load\",completed);jQuery.ready();}", "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed);window.removeEventListener(\"load\",completed);jQuery.ready();}", "function pageUnload()\n{\n\tparent.booContentLoaded = false; // This is to tell the program that this page is being unloaded from the browser.\n}", "function pageUnload()\n{\n\tparent.booContentLoaded = false; // This is to tell the program that this page is being unloaded from the browser.\n}", "async onLoad() {}", "function htmlLoad() {\n}", "function completed() {\n document.removeEventListener(\"DOMContentLoaded\", completed);\n window.removeEventListener(\"load\", completed);\n jQuery.ready();\n }", "function loaded() {\n $loading.fadeOut( 'fast', function() {\n $( this ).remove();\n });\n\t\talreadyLoaded = true;\n }", "function checkDocOff() {\n docs--;\n if(docs == 0) {\n db.close();\n }\n }", "function checkDocOff() {\n docs--;\n if(docs == 0) {\n db.close();\n }\n }", "function onDocumentLoadSuccess() {\n setPageNumber(1);\n }", "function mainImpl(doc) {\n\n}", "function AutoSaveLoad() {}", "async load () {}", "function finishLoadXmlPage() {\n /// Warn if image not loaded ///\n $(pageSvg).find('.page_img').on('error', function () {\n self.warning( 'failed to load image: '+image.attr('xlink:href') );\n } );\n\n /// Load the Page SVG in the canvas ///\n self.loadXmlSvg(pageSvg);\n self.svgPanZoom( -1.5, -1.5, imgSize.W+2, imgSize.H+2 );\n self.positionText();\n\n /// Set currently selected mode ///\n self.mode.current();\n\n /// Scale font size ///\n fontSize = 0.010 * Math.min( imgSize.H, imgSize.W );\n scaleFont(1);\n\n /// Gamma filter ///\n var\n defs = $('#'+pageContainer.id+'_defs'),\n comps = [ 'feFuncR', 'feFuncG', 'feFuncB' ];\n\n var\n transf = $(document.createElementNS( self.util.sns, 'feComponentTransfer' ));\n for ( var n = 0; n<comps.length; n++ )\n $(document.createElementNS(self.util.sns,comps[n]))\n .attr('type','gamma')\n .attr('amplitude','1')\n .attr('exponent',1)\n .appendTo(transf);\n $(document.createElementNS(self.util.sns,'filter'))\n .attr('id',pageContainer.id+'_gamma')\n .append(transf)\n .appendTo(defs);\n\n self.util.clearChangeHistory();\n self.util.pushChangeHistory('page load');\n }", "function mainComplete() {\n\t\tconsole.log('it is all loaded up');\n\t\t//Demo.main.initialize();\n\t}", "function onDocumentLoadSuccess({ numPages }) {\n setNumPages(numPages);\n setPageNumber(1);\n }", "function onDocumentLoadSuccess({ numPages }) {\n setNumPages(numPages);\n setPageNumber(1);\n }", "function forceLoad() {}", "function clearDocument() {\n\t$doc.empty().append('<a class=\"menu\" href=\"/mw/\">game</a> - <a class=\"menu\" href=\"/adm/options.html\">options</a><h1>mwserver inspector</h1><hr />');\n}", "close () {\n if (this._bulkLoadCompleteFn) this._bulkLoadCompleteFn(); \n }", "function onLoadComplete() {\n}", "function docLoaded(fn) {\n if (document.readyState !== 'loading') {\n fn();\n\t} else {\n\t\tdocument.addEventListener('DOMContentLoaded', fn);\n\t}\n}", "function data_wdLoad(e) { /* carrega HTML: data-wd-load=path{file}method{get|post}${form}overlap{} */\r\n\t\tif (!(\"wdLoad\" in e.dataset)) return;\r\n\r\n\t\t/* obter dados do atributo */\r\n\t\tlet data = wd_html_dataset_value(e, \"wdLoad\")[0];\r\n\t\tlet target = WD(e);\r\n\t\tlet method = data.method;\r\n\t\tlet file = data.path;\r\n\t\tlet pack = wd_$$$(data);\r\n\t\tlet exec = WD(pack);\r\n\t\tlet overlap = data.overlap === \"true\" ? true : false;\r\n\r\n\t\t/* abrir contagem */\r\n\t\twd_counter_control.load++;\r\n\t\t/* limpar atributo para evitar repetições desnecessárias e limpar conteúdo */\r\n\t\ttarget.data({wdLoad: null}).load(\"\");\r\n\t\t/* carregar arquivo e executar */\r\n\t\texec.send(file, function(x) {\r\n\t\t\tif (x.closed) {\r\n\t\t\t\t/* encerrar contagem */\r\n\t\t\t\twd_counter_control.load--;\r\n\t\t\t\t/* executar */\r\n\t\t\t\ttarget.load(x.text, overlap);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}, method);\r\n\t\treturn;\r\n\t}", "function load_text_DocGenerator(pInitText) {\n\t//----Debugging------------------------------------------\n\t// The following alert-Command is useful for debugging \n\t//alert(\"docgenerator.js:load_text(pInitText)-Call\")\n\t//----Create Object/Instance of DocGenerator----\n\t// var vMyInstance = new DocGenerator();\n\t// vMyInstance.load_text(pInitText);\n\t//-------------------------------------------------------\n\tthis.removeall();\n\tif (pInitText != \"\") {\n\t\tvar vOverwriteArray = this.assRules.parsenode.split2overwrite(pInitText);\t\n\t\tfor (var j=0; j<vOverwriteArray.length; j++) {\n\t\t\tthis.add_textpart(vOverwriteArray[j]);\n\t\t};\n\t\t//this.init_nonterm();\n\t} else {\n\t\tthis.init();\n\t}\n}", "function onDocumentLoadSuccess({ numPages }) { \n setNumPages(numPages); \n setPageNumber(1); \n }", "function completed() {\n document.removeEventListener( \"DOMContentLoaded\", completed );\n window.removeEventListener( \"load\", completed );\n jQuery.ready();\n }", "load() { this.log('Loaded'); }", "function render_documento(){\n if (ready_page == false){\n //empezamos a contar los segundo para poder descargar el documento\n setTimeout(validar_regla_descarga, rule_time_dowload);\n ready_page = true;\n }\n}", "function pageLoaded() {\n\n\t\tvar elHeader = document.getElementsByTagName('header')[0];\n\n\t\telHeader.addEventListener(animationEvent, removeFOUT);\n\n\t\tfunction removeFOUT() {\n\n\t\t\tclassie.add(elHTML, 'ready');\n\t\t\telHeader.removeEventListener(animationEvent, removeFOUT);\n\n\t\t}\n\n\t}", "function p() {\n ne.removeEventListener(\"DOMContentLoaded\", p), e.removeEventListener(\"load\", p), \n he.ready();\n }", "function onDOMLoad() {\n initializeStadiumSV();\n createMap();\n buildWriteCommentsBox();\n getServletComments();\n}", "function main() {\n\n // Sets AsciiDoc file from url query string \n const params = new URLSearchParams(location.search);\n let aDocName = params.get('aDoc');\n if (aDocName === null || aDocName === '') {\n aDocName = 'indice';\n }\n aDoc = aDocs.find(aDoc => aDoc.name === aDocName);\n \n // Updates UI with HTML content from AsciiDoc file\n updateDocContents(aDoc);\n}", "unload() {}", "function _pageLoaded() {\n window.removeEventListener( 'load', _pageLoaded );\n refresh();\n }" ]
[ "0.67227906", "0.66000533", "0.66000533", "0.66000533", "0.66000533", "0.6360187", "0.63119406", "0.62759095", "0.6209285", "0.6209285", "0.60802746", "0.607873", "0.6075449", "0.6064207", "0.6001037", "0.5996478", "0.59857166", "0.5929347", "0.5912549", "0.5852157", "0.58498377", "0.5834456", "0.5801165", "0.57943743", "0.5751312", "0.5732343", "0.57066536", "0.5699257", "0.56953025", "0.56842303", "0.5673633", "0.5655766", "0.5626053", "0.5599953", "0.5589272", "0.55796254", "0.5570064", "0.5560701", "0.5554781", "0.5554781", "0.55469465", "0.55469465", "0.55469465", "0.55469465", "0.55397743", "0.5535152", "0.5526756", "0.55233806", "0.5504841", "0.5495866", "0.54953647", "0.5494505", "0.5483821", "0.5473337", "0.54466504", "0.5442346", "0.54394233", "0.54391205", "0.54391205", "0.5436937", "0.5431487", "0.54281044", "0.54234064", "0.5422188", "0.5422188", "0.54214346", "0.5397559", "0.5397559", "0.53972805", "0.5391608", "0.53882957", "0.537923", "0.53789896", "0.5374087", "0.53639495", "0.53639495", "0.5359972", "0.5354046", "0.53539026", "0.5352983", "0.53526294", "0.5345086", "0.5339367", "0.5339367", "0.5338881", "0.5331948", "0.5331381", "0.5330081", "0.5328795", "0.53276247", "0.5325714", "0.5295106", "0.5292136", "0.52917826", "0.5290875", "0.5289303", "0.52827793", "0.52779806", "0.52776116", "0.5277341", "0.5266824" ]
0.0
-1
A submap node should be positioned in the place of average visibility and average evolution (!). The evolution is averaged from all the components included in submap, regardless of whether they are or are not visible. The visibility is calculated from components visible on a given map and is map specific. We do not want to make too much mess here.
function getSubmapPositions(mongooseObjects, nodeIds, impact) { let Node = mongooseObjects.Node; let positions = { evolutionSum: 0, evolutionCount: 0, maps: {} /* mapId : { nodeVisiblityCount : number, visibilitySum : number } */ }; // actually calculate submap position return Node.find({ _id: { $in: nodeIds } }).exec() .then(function(nodes) { // iterate over submapped nodes. Sum and count evolution of all nodes, // sum and count visibility *per map* for (let i = 0; i < nodes.length; i++) { let analysedNode = nodes[i]; for (let j = 0; j < analysedNode.visibility.length; j++) { // create a record if necessary if (!positions[analysedNode.visibility[j].map]) { positions.maps[analysedNode.visibility[j].map] = { nodeVisiblityCount: 0, visibilitySum: 0, }; } positions.maps[analysedNode.visibility[j].map].nodeVisiblityCount++; positions.maps[analysedNode.visibility[j].map].visibilitySum += analysedNode.visibility[j].value; } positions.evolutionSum += analysedNode.evolution; positions.evolutionCount++; } return positions; }) .then(function(position) { // normalise - calculate averages - we want to get a nice result let result = { evolution: (position.evolutionSum / position.evolutionCount), visibility: {} }; for (let key in position.maps) { if (position.maps.hasOwnProperty(key)) { result.visibility[key] = (position.maps[key].visibilitySum / position.maps[key].nodeVisiblityCount); } } return result; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "applyLayoutVisibility() {\n const { visible } = this;\n const { mbMap } = this.mapboxLayer;\n\n if (!mbMap) {\n return;\n }\n\n const style = mbMap.getStyle();\n\n if (!style) {\n return;\n }\n\n if (this.styleLayersFilter) {\n const visibilityValue = visible ? 'visible' : 'none';\n for (let i = 0; i < style.layers.length; i += 1) {\n const styleLayer = style.layers[i];\n if (this.styleLayersFilter(styleLayer)) {\n if (mbMap.getLayer(styleLayer.id)) {\n mbMap.setLayoutProperty(\n styleLayer.id,\n 'visibility',\n visibilityValue,\n );\n }\n }\n }\n }\n }", "function updatePrecipVisibility(evt) {\n evt = evt || window.event;\n //get the layer index from the element id\n var lName = evt.target.id.split(\"_\");\n //If radio button is checked show Map layer\n if (dom.byId(evt.target.id).checked) {\n dynamicMapSerives[lName[1]].show();\n } else {\n dynamicMapSerives[lName[1]].hide();\n }\n }", "onChangeVisible() {\n const { mbMap } = this.mapboxLayer;\n if (!mbMap) {\n return;\n }\n const currentLayer = this.getCurrentLayer();\n const filterRegex = new RegExp(`^ipv_(${currentLayer})$`);\n this.getDvLayers()?.forEach((stylelayer) => {\n mbMap.setLayoutProperty(\n stylelayer.id,\n 'visibility',\n filterRegex.test(getTrafimageFilter(stylelayer)) ? 'visible' : 'none',\n );\n });\n }", "function formASubmap(mongooseObjects, workspace, mapId, name, responsiblePerson, nodesInSubmap, impact) {\n let Node = mongooseObjects.Node;\n let Workspace = mongooseObjects.Workspace;\n\n let positionsAntipaternVariable = null;\n\n return getSubmapPositions(mongooseObjects, nodesInSubmap, impact).then(function(positions){\n positionsAntipaternVariable = positions;\n return createASubmap(mongooseObjects, workspace, mapId, name, responsiblePerson, nodesInSubmap, impact)\n .then(function(submap){\n return {\n positions: positions,\n submap: submap\n };\n });\n })\n .then(function(arg) {\n return createSubmapNode(mongooseObjects, arg, impact, workspace, name, responsiblePerson);\n })\n .then(function(node) {\n let nodeId = getId(node);\n // and the heavy part. get everyone depending on a submap to really depend on it\n return replaceIncomingDependencies(mongooseObjects, nodeId, impact.nodesThatDependOnFutureSubmap, nodesInSubmap).then(function(irrelevantStuff){\n \t let changedMaps = [];\n \t for (let key in positionsAntipaternVariable.visibility) {\n \t if (positionsAntipaternVariable.visibility.hasOwnProperty(key)) {\n \t \tchangedMaps.push(key);\n \t }\n \t }\n \t return changedMaps;\n });\n });\n}", "flattenVisible() {\n EventBus.$emit(\"try-flatten-visible-layers\");\n }", "function update() {\n\t\n\t// SCATTERPLOT\n\tdots = sp_svg.selectAll(\".dot\")\n\t\t.data(nba_data).transition(400)\n\t\t.attr(\"cx\", xMap)\n\t\t.attr(\"cy\", yMap)\n\t\t.attr(\"r\", function(d) { return radii[d[season+\"PO\"]];})\n\t\t.style(\"stroke-width\", function(d) { return border_weights[d[season+\"PO\"]];})\n\t\t.style(\"stroke-dasharray\", function(d) { return dasharrays[d[season+\"PO\"]];});\n\t\n\t// TREEMAP\n\t// Delete the old treemap.\n\t$(\".chart\").remove();\n\t\n\t// Create the spot for the new treemap.\n\ttm_div = d3.select(\"#tm_vis\").append(\"div\")\n\t\t.attr(\"class\", \"chart\")\n\t\t.style(\"width\", (width + margin.left + margin.right) + \"px\")\n\t\t.style(\"height\", (height + margin.top + margin.bottom) + \"px\")\n\t .append(\"svg:svg\")\n\t\t.style(\"width\", (width) + \"px\")\n\t\t.style(\"height\", (height) + \"px\")\n\t .append(\"svg:g\")\n\t\t.attr(\"transform\", \"translate(.5,.5)\");\n\t\n\t// Draw an invisible map (opacity=0)\n\tdraw_treemap(0);\t\n\t\n\t// Zoom in on the appropriate region and make it visible\n\tif(zoomed) {\n\t\tzoom_level--;\n\t\tif(zoom_level == 0) zoomed = false;\n\t\tzoom(zoomed_node, 0);\n\t} else {\n\t\tzoomed = true;\n\t\tzoom_level = 2;\n\t\tzoom(x_root, 0);\n\t}\n}", "_applySubBasePositions() {\n if (this._subBasePositions.length === 0) {\n return;\n }\n getCentroid(this._subBasePositions, this._worldPosition);\n this._subBasePositions.length = 0;\n }", "readjust_subtask_opacities() {\n for (const st_key in this.subtasks) {\n let sliderval = jquery_default()(\"#tb-st-range--\" + st_key).val();\n jquery_default()(\"div#canvasses__\" + st_key).css(\"opacity\", sliderval/100);\n }\n }", "function createASubmap(mongooseObjects, workspace, mapId, name, responsiblePerson, nodes, impact) {\n let Node = mongooseObjects.Node;\n let WardleyMap = mongooseObjects.WardleyMap;\n return workspace.createAMap({\n name: name,\n responsiblePerson: responsiblePerson\n }, workspace.nowId, /*mark as submap */ true)\n .then(function(newlyCreatedMap) {\n //inSubmapDependencies those deps have to be copied\n //and nodes, of course\n return Node.find({\n _id: {\n $in: nodes\n }\n }).exec().then(function(nodes) {\n let promises = [];\n for (let i = 0; i < nodes.length; i++) {\n let processedNode = nodes[i];\n // for each node that was pushed to a submap\n\n\n //1. set parent map\n processedNode.parentMap = [getId(newlyCreatedMap)];\n\n //2. adjust visibility - steal it from current map\n // if for some reason it is not missing, take the first available one\n let bestVisibility = processedNode.visibility[0];\n for (let j = 0; j < processedNode.visibility.length; j++) {\n let analysedVisibility = processedNode.visibility[j];\n if (getId(analysedVisibility.map).equals(getId(mapId))) {\n bestVisibility = analysedVisibility;\n }\n }\n bestVisibility.map = getId(newlyCreatedMap);\n processedNode.visibility = [bestVisibility];\n\n //3. sort out dependencies, only those presented on a map will stay\n //for now, in the future we may have some cross maps dependencies possible\n processedNode.dependencies = [];\n for (let j = 0; j < impact.inSubmapDependencies.length; j++) {\n let processedDependency = impact.inSubmapDependencies[j];\n if (getId(processedDependency.node).equals(getId(processedNode))) {\n processedNode.dependencies = processedNode.dependencies.concat(processedDependency.deps);\n }\n }\n // 3.a ensure dependencies are visible when they should be\n for (let j = 0; j < processedNode.dependencies.length; j++) {\n processedNode.dependencies[j].visibleOn = [getId(newlyCreatedMap)];\n }\n //4. save, piece of cake\n promises.push(processedNode.save());\n }\n return q.all(promises).then(function() {\n return WardleyMap.findById(getId(newlyCreatedMap)).populate('nodes').exec();\n });\n });\n });\n}", "_zoomEndEvent(){\n\t\tlet zoom = this.map.getZoom();\n\n\t\tObject.keys(this.layers).forEach(layer => {\n\t\t\tlet el = this.layers[layer].options.pane;\n\n\t\t\tif(zoom >= 4){\n\t\t\t\tPrototypeElement.removeClassName(el, 'half');\n\t\t\t}\n\t\t\telse if(zoom < 4 && zoom >= 2){\n\t\t\t\tPrototypeElement.removeClassName(el, 'quarter');\n\t\t\t\tPrototypeElement.addClassName(el, 'half');\n\t\t\t}\n\t\t\telse if(zoom < 2 && zoom >= 1){\n\t\t\t\tPrototypeElement.removeClassName(el, 'half');\n\t\t\t\tPrototypeElement.removeClassName(el, 'invis');\n\t\t\t\tPrototypeElement.addClassName(el, 'quarter');\n\t\t\t}\n\t\t\telse if(zoom < 1){\n\t\t\t\tPrototypeElement.removeClassName(el, 'quarter');\n\t\t\t\tPrototypeElement.addClassName(el, 'invis');\n\t\t\t}\n\n\t\t\t// i hate this.\n\t\t\tif(['map_label', 'sector_label'].includes(layer)){\n\t\t\t\tObject.keys(el.children).forEach(c => {\n\t\t\t\t\tlet origin = window.getComputedStyle(el.children[c]).perspectiveOrigin.split(' ');\n\n\t\t\t\t\tel.children[c].style.left = '-'+origin[0];\n\t\t\t\t\tel.children[c].style.top = '-'+origin[1];\n\t\t\t\t});\n\t\t\t}\n\n\t\t});\n\n\t}", "function updateVisibility(evt) {\n evt = evt || window.event;\n //get the layer index from the element id\n var lName = evt.target.id.split(\"_\");\n //If radio button is checked show Map layer\n if (dom.byId(evt.target.id).checked) {\n dynamicMapSerives[lName[1]].show();\n domStyle.set(\"btn_\" + lName[1] + \"_\" + mapID, {\n background: \"white\",\n color: \"#64acf7\"\n });\n } else {\n dynamicMapSerives[lName[1]].hide();\n domStyle.set(\"btn_\" + lName[1] + \"_\" + mapID, {\n background: \"#64acf7\",\n color: \"black\"\n });\n }\n }", "function updateVisibility(evt) {\n evt = evt || window.event;\n //get the layer index from the element id\n var lName = evt.target.id.split(\"_\");\n //If radio button is checked show Map layer\n if (dom.byId(evt.target.id).checked) {\n dynamicMapSerives[lName[1]].show();\n domStyle.set(\"btn_\" + lName[1] + \"_\" + mapID, {\n background: \"white\",\n color: \"#64acf7\"\n });\n } else {\n dynamicMapSerives[lName[1]].hide();\n domStyle.set(\"btn_\" + lName[1] + \"_\" + mapID, {\n background: \"#64acf7\",\n color: \"black\"\n });\n }\n }", "function updateRelVisibility(evt) {\n evt = evt || window.event;\n //get the layer index from the element id\n var lName = evt.target.id.split(\"_\");\n //If radio button is checked show Map layer\n if (dom.byId(evt.target.id).checked) {\n dynamicMapSerives[lName[1]].show();\n } else {\n dynamicMapSerives[lName[1]].hide();\n }\n }", "function updateCarbonVisibility(evt) {\n evt = evt || window.event;\n //get the layer index from the element id\n var lName = evt.target.id.split(\"_\");\n //If radio button is checked show Map layer\n if (dom.byId(evt.target.id).checked) {\n dynamicMapSerives[lName[1]].show();\n } else {\n dynamicMapSerives[lName[1]].hide();\n }\n }", "function mapVisibility() {\n\n if (itemMap.isTaken === true) {\n\n document.getElementById(\"map2\").style.visibility = \"visible\";\n\n document.getElementById(\"map1\").style.visibility = \"hidden\";\n\n } else { \n\n document.getElementById(\"map2\").style.visibility = \"hidden\";\n\n }\n\n }", "function e(e,n,i){if(n.flatten((({sublayers:e})=>e)).length!==e.length)return!0;return!!e.some((e=>e.originIdOf(\"minScale\")>i||e.originIdOf(\"maxScale\")>i||e.originIdOf(\"renderer\")>i||e.originIdOf(\"labelingInfo\")>i||e.originIdOf(\"opacity\")>i||e.originIdOf(\"labelsVisible\")>i||e.originIdOf(\"source\")>i))||!r(e,n)}", "_visibilityOfLayerByZoom() {\n let mainLayer = this.get('mainLayer');\n if (Ember.isNone(mainLayer) || Ember.isNone(mainLayer._leafletObject)) {\n return;\n }\n\n if (!this._checkAndSetVisibility(mainLayer)) {\n mainLayer.get('innerLayers').forEach((layer) => {\n if (this._checkAndSetVisibility(layer)) {\n return;\n }\n });\n }\n }", "function updateSubplots(viewBox) {\n\t var j;\n\t var plotinfos = fullLayout._plots,\n\t subplots = Object.keys(plotinfos);\n\t\n\t for(var i = 0; i < subplots.length; i++) {\n\t\n\t var subplot = plotinfos[subplots[i]],\n\t xa2 = subplot.xaxis,\n\t ya2 = subplot.yaxis,\n\t editX = ew && !xa2.fixedrange,\n\t editY = ns && !ya2.fixedrange;\n\t\n\t if(editX) {\n\t var isInX = false;\n\t for(j = 0; j < xa.length; j++) {\n\t if(xa[j]._id === xa2._id) {\n\t isInX = true;\n\t break;\n\t }\n\t }\n\t editX = editX && isInX;\n\t }\n\t\n\t if(editY) {\n\t var isInY = false;\n\t for(j = 0; j < ya.length; j++) {\n\t if(ya[j]._id === ya2._id) {\n\t isInY = true;\n\t break;\n\t }\n\t }\n\t editY = editY && isInY;\n\t }\n\t\n\t var xScaleFactor = editX ? xa2._length / viewBox[2] : 1,\n\t yScaleFactor = editY ? ya2._length / viewBox[3] : 1;\n\t\n\t var clipDx = editX ? viewBox[0] : 0,\n\t clipDy = editY ? viewBox[1] : 0;\n\t\n\t var fracDx = editX ? (viewBox[0] / viewBox[2] * xa2._length) : 0,\n\t fracDy = editY ? (viewBox[1] / viewBox[3] * ya2._length) : 0;\n\t\n\t var plotDx = xa2._offset - fracDx,\n\t plotDy = ya2._offset - fracDy;\n\t\n\t fullLayout._defs.selectAll('#' + subplot.clipId)\n\t .call(Drawing.setTranslate, clipDx, clipDy)\n\t .call(Drawing.setScale, 1 / xScaleFactor, 1 / yScaleFactor);\n\t\n\t subplot.plot\n\t .call(Drawing.setTranslate, plotDx, plotDy)\n\t .call(Drawing.setScale, xScaleFactor, yScaleFactor)\n\t\n\t // This is specifically directed at scatter traces, applying an inverse\n\t // scale to individual points to counteract the scale of the trace\n\t // as a whole:\n\t .select('.scatterlayer').selectAll('.points').selectAll('.point')\n\t .call(Drawing.setPointGroupScale, 1 / xScaleFactor, 1 / yScaleFactor);\n\t }\n\t }", "update(map)\n {\n if (this.container === null)\n {\n this.init(map);\n }\n\n this.coins.graphics.clear();\n this.treasures.graphics.clear();\n const info_arr = map.eData();\n const size_x = map.SIZE_X;\n const size_y = map.SIZE_Y;\n\n for (let i = 0; i < size_x; i++)\n {\n const screen_y = this.size * i;\n for (let j = 0; j < size_y; j++)\n {\n const screen_x = this.size * j;\n if (info_arr[i][j] === BaseMapInfo.getElementsByTagName(\"gold\"))\n {\n this.paintCoin(screen_x, screen_y);\n }\n else if (info_arr[i][j] === BaseMapInfo.getElementsByTagName(\"end\"))\n {\n this.paintFinish(screen_x, screen_y);\n }\n }\n }\n }", "function _updateLayers() {\n for(var i in map._layers) {\n\tif(map._layers[i]._latlng) {\n\t if(map._layers[i]._latlng.level) {\n\t if(map._layers[i]._latlng.level == map.getLevel()) {\n\t if(map._layers[i].setOpacity) {\n\t map._layers[i].setOpacity(1);\n\t } else if(map._layers[i]._container) {\n\t $(map._layers[i]._container).show();\n\t }\n } else {\n\t if(map._layers[i].setOpacity) {\n\t map._layers[i].setOpacity(0);\n\t } else if(map._layers[i]._container) {\n\t $(map._layers[i]._container).hide();\n\t }\n\t }\n\t }\n\t}\n }\n }", "function mapLayerChanged(e) {\n\t // console.log(e.type + \" \" + e.layer.name + \" \" + e.property);\n\t if (vectors) vectors.removeAllFeatures();\n\t if (e.layer && document.getElementById('overlayRadio' + e.layer.name))\n\t document.getElementById('overlayRadio' + e.layer.name).checked = true;\n\t setResults();\n\t }", "function showMapPart() {\n g.selectAll(\".map:not(.q8-9)\")\n .transition(\"visibility\")\n .duration(600)\n .delay(function (d, i) {\n return 10 * (i + 1);\n })\n .attr(\"opacity\", 0);\n\n g.selectAll(\".q8-9\")\n .transition()\n .duration(600)\n .attr(\"opacity\", 1.0);\n\n g.selectAll(\".linelabel\")\n .transition()\n .duration(0)\n .attr(\"opacity\", 0);\n\n g.selectAll(\".curtain\")\n .transition()\n .duration(0)\n .attr('x', -1 * width);\n\n g.selectAll(\".curtain\")\n .transition()\n .duration(30)\n .attr(\"opacity\", 0);\n\n // create a shared transition for anything we're animating\n var t = g.transition()\n .delay(750)\n .duration(6000)\n .ease('linear')\n .each('end', function() {\n d3.select('line.guide')\n .transition()\n .style('opacity', 0)\n .remove()\n });\n\n t.select('rect.curtain')\n .attr('x', -1 * width);\n t.select('line.guide')\n .attr('transform', 'translate(' + width + ', 0)');\n\n g.selectAll(\".axis\")\n .transition()\n .duration(0)\n .attr(\"opacity\", 0);\n\n g.selectAll('.line')\n .transition()\n .duration(0)\n .attr(\"opacity\", 0);\n }", "function showOverviewMap() {\r\n $('.county-container').addClass('hide');\r\n $('#mapBusyPanel').addClass('hide');\r\n $('.overview-container').removeClass('hide');\r\n removePreviousAvenzaViewer();\r\n}", "function updateRadonVisibility(evt) {\n evt = evt || window.event;\n //get the layer index from the element id\n var lName = evt.target.id.split(\"_\");\n //If radio button is checked show Map layer\n if (dom.byId(evt.target.id).checked) {\n dynamicMapSerives[lName[1]].show();\n } else {\n dynamicMapSerives[lName[1]].hide();\n }\n }", "function updateRadonVisibility(evt) {\n evt = evt || window.event;\n //get the layer index from the element id\n var lName = evt.target.id.split(\"_\");\n //If radio button is checked show Map layer\n if (dom.byId(evt.target.id).checked) {\n dynamicMapSerives[lName[1]].show();\n } else {\n dynamicMapSerives[lName[1]].hide();\n }\n }", "function updateRadonVisibility(evt) {\n evt = evt || window.event;\n //get the layer index from the element id\n var lName = evt.target.id.split(\"_\");\n //If radio button is checked show Map layer\n if (dom.byId(evt.target.id).checked) {\n dynamicMapSerives[lName[1]].show();\n } else {\n dynamicMapSerives[lName[1]].hide();\n }\n }", "function updateRadonVisibility(evt) {\n evt = evt || window.event;\n //get the layer index from the element id\n var lName = evt.target.id.split(\"_\");\n //If radio button is checked show Map layer\n if (dom.byId(evt.target.id).checked) {\n dynamicMapSerives[lName[1]].show();\n } else {\n dynamicMapSerives[lName[1]].hide();\n }\n }", "function updateRadonVisibility(evt) {\n evt = evt || window.event;\n //get the layer index from the element id\n var lName = evt.target.id.split(\"_\");\n //If radio button is checked show Map layer\n if (dom.byId(evt.target.id).checked) {\n dynamicMapSerives[lName[1]].show();\n } else {\n dynamicMapSerives[lName[1]].hide();\n }\n }", "checkVisible() {\r\n let squares = this.state.squares;\r\n let mapLevel = this.state.mapLevel;\r\n let p = this.state.playerIndex;\r\n let n = 20;\r\n let visible = [];\r\n const aura = [p, p-2, p-1, p+1, p+2, p+3, p-3,\r\n p-n, p-n-2, p-n-1, p-n+1, p-n+2,\r\n p+n, p+n-2, p+n-1, p+n+1, p+n+2,\r\n p-n*2, p-n*2-1, p-n*2+1,\r\n p+n*2, p+n*2-1, p+n*2+1,\r\n p-4, p+4];\r\n\r\n //only set visible what is on grid and eliminate overflow to other rows\r\n for (let i=0; i<aura.length; i++) {\r\n if (Math.abs(aura[i] % n - p % n) < 4 && aura[i] >= 0 && aura[i] < squares[mapLevel].length) {\r\n visible.push(aura[i]);\r\n }\r\n }\r\n let hidden = [];\r\n for (let i=0; i<squares[mapLevel].length; i++) {\r\n if (!visible.includes(i)) {\r\n hidden.push(i);\r\n }\r\n }\r\n this.setHidden(hidden);\r\n this.setVisible(visible);\r\n }", "function addMinimalProjectionChangedListener(map, currentBubble){\n google.maps.event.addListener(map, 'tilesloaded', function(){\n \tOVERLAYVIEW.drawOverviewMarker(currentBubble);\n });\n}", "function updateGulfVisibility(evt) {\n evt = evt || window.event;\n //get the layer index from the element id\n var lName = evt.target.id.split(\"_\");\n //If radio button is checked show Map layer\n if (dom.byId(evt.target.id).checked) {\n dynamicMapSerives[lName[1]].show();\n } else {\n dynamicMapSerives[lName[1]].hide();\n }\n }", "function fnMainMapEventListener() {\n\tdojo.connect(basemap, \"onUpdateStart\", function() {\n\t\tshowLoadingMap(); //로딩바 보이기\n\t\t\n\t\t//화살표 표시\n\t\tfnDispArrow();\n\t\t\n\t\t/*if ($(\"#map_graphics_layer\").find(\"text\").length != m_UserGraphicFontSize.length) {\n\t\t\tm_UserGraphicFontSize = [];\n\t\t\t$(\"#map_graphics_layer\").find(\"text\").each(function() {\n\t\t\t\tm_UserGraphicFontSize.push(Number($(this).attr(\"font-size\")));\n\t\t\t});\t\n\t\t}*/\n\t});\n\tdojo.connect(basemap, \"onUpdateEnd\", function() {\n\t\thideLoadingMap(); //로딩바 숨기기\n\t\t\n\t\t/*$(\"#map_graphics_layer\").find(\"text\").each(function(i, data) {\n\t\t\t$(this).attr(\"font-size\", 1 / m_MainMap.getScale() * m_UserGraphicFontSize[i]);\n\t\t});*/\n\t});\n\n\tm_MainMap.on(\"mouse-wheel\", function (res) {\n\t\tindexMapMoveYn = false;\n\t\tmainMapMoveYn = true;\n\t});\n\n\tm_MainMap.on(\"mouse-down\", function (res) {\n\t\tindexMapMoveYn = false;\n\t\tmainMapMoveYn = true;\n\t});\n\tm_MainMap.on(\"mouse-move\", function (res) {\n\t\tvar mapPt = res.mapPoint;\n\t\tvar curCoordX = formatLocalizedDecimal(mapPt.x, 4);\n\t\tvar curCoordY = formatLocalizedDecimal(mapPt.y, 4);\n\n\t\t$(\"#coord\").text(\"X:\" + curCoordX + \" Y:\" + curCoordY);\n\t});\n\n\t//축척변경 이벤트 - 축척View 변경/인덱스맵 변경/분할지도 변경\n\tm_MainMap.on(\"extent-change\", function (res) {\n\t\t//축척View변경\n\t\t$(\"#txt_Scale\").val(parseInt(m_MainMap.getScale()));\n\n\t\tif (indexMap.graphics == null)\n\t\t\treturn;\n\t\tindexMap.graphics.clear();\n\n\t\tvar xmax = m_MainMap.extent.xmax;\n\t\tvar xmin = m_MainMap.extent.xmin;\n\t\tvar ymax = m_MainMap.extent.ymax;\n\t\tvar ymin = m_MainMap.extent.ymin;\n\t\tvar extPolygon = new esri.geometry.Polygon([\n\t\t\t\t\t[xmin, ymin],\n\t\t\t\t\t[xmax, ymin],\n\t\t\t\t\t[xmax, ymax],\n\t\t\t\t\t[xmin, ymax],\n\t\t\t\t\t[xmin, ymin]]);\n\t\tvar indexGraphic = new esri.Graphic(extPolygon, new esri.symbol.SimpleFillSymbol(\n\t\t\t\t\tesri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(\n\t\t\t\t\t\tesri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 2), new dojo.Color([255, 0, 0, 0])));\n\t\tindexMap.graphics.add(indexGraphic);\n\t});\n\n\t//범례 생성\n\tm_MainMap.on(\"layers-add-result\", function (evt) {\n\t\t$(\"#mapCtrl1\").click();\n\n\t\tesri.request({\n\t\t\turl : urlBasemap + \"/layers\",\n\t\t\tcontent : {\n\t\t\t\tf : \"json\"\n\t\t\t},\n\t\t\thandleAs : \"json\"\n\t\t}).then(function (res) {\n\t\t\tm_LayersInfo = res; //published map with noscale\n\n\t\t\tesri.request({\n\t\t\t\turl : urlBasemap_scale + \"/layers\",\n\t\t\t\tcontent : {\n\t\t\t\t\tf : \"json\"\n\t\t\t\t},\n\t\t\t\thandleAs : \"json\"\n\t\t\t}).then(function (res) {\n\t\t\t\tm_LayersInfo_scale = res; //published map with scale\n\n\t\t\t\t//drawing legend with user_config\n\t\t\t\t$.ajax({\n\t\t\t\t\ttype : \"post\",\n\t\t\t\t\tdataType : \"json\",\n\t\t\t\t\tdata : {\n\t\t\t\t\t\tUSER_ID : $(\"#USER_ID\").val(),\n\t\t\t\t\t\tSYS_ID : $(\"#SYS_ID\").val()\n\t\t\t\t\t},\n\t\t\t\t\turl : \"/etc/etcMapUserConfigList.do\",\n\t\t\t\t\tsuccess : function (data) {\n\t\t\t\t\t\tif (data.list.length > 0) {\n\t\t\t\t\t\t\tm_IsSavedMap = true;\n\t\t\t\t\t\t\tm_UserConfigExtent = data.list[0].EXTENT;\n\t\t\t\t\t\t\tm_UserConfigLayers = data.list[0].LAYERS;\n\t\t\t\t\t\t\tm_UserConfigVisibles = data.list[0].VISIBLES;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\terror : function (xhr, status, error) {\n\t\t\t\t\t\talert(status);\n\t\t\t\t\t\talert(error);\n\t\t\t\t\t},\n\t\t\t\t\tcomplete : function (data) {\n\t\t\t\t\t\tif (m_IsSavedMap)\n\t\t\t\t\t\t\tm_MainMap.setExtent(new esri.geometry.fromJson(JSON.parse(m_UserConfigExtent)));\n\t\t\t\t\t\t// In aMapToc.js\n\t\t\t\t\t\tfnSetTocList();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}, function (error) {\n\t\t\t\talert(\"failed get m_LayersInfo_scale\\ncause :\" + error);\n\t\t\t});\n\t\t}, function (error) {\n\t\t\talert(\"failed get m_LayersInfo\\ncause :\" + error);\n\t\t});\n\t});\n}", "shouldComponentUpdate(nextProps) {\n if (!nextProps.elevationMarkerLocation.length || nextProps.elevationMarkerLocation[0] != this.props.elevationMarkerLocation[0] && nextProps.elevationMarkerLocation[1] != this.props.elevationMarkerLocation[1]) {\n if (this.map && this.map.loaded()) {\n this.map.getSource('elevationMarker').setData({\n \"type\": \"FeatureCollection\",\n \"features\": [{\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"Point\",\n \"coordinates\": nextProps.elevationMarkerLocation\n }\n }]\n })\n }\n }\n // Watch the state of the application and adjust the map accordingly\n if (!nextProps.elevationChartOpen && this.props.elevationChartOpen && this.map) {\n this.elevationPoints = []\n this.map.getSource('elevationPoints').setData({\n \"type\": \"FeatureCollection\",\n \"features\": []\n })\n this.map.getSource('elevationLine').setData({\n \"type\": \"FeatureCollection\",\n \"features\": []\n })\n }\n // Bedrock\n if (JSON.stringify(nextProps.mapCenter) != JSON.stringify(this.props.mapCenter)) {\n if (nextProps.mapCenter.type === 'place') {\n let bounds = [\n [ nextProps.mapCenter.place.bbox[0], nextProps.mapCenter.place.bbox[1] ],\n [ nextProps.mapCenter.place.bbox[2], nextProps.mapCenter.place.bbox[3] ]\n ]\n this.map.fitBounds(bounds, {\n duration: 0,\n maxZoom: 16\n })\n } else {\n // zoom to user location\n }\n // Add bedrock\n } else if (nextProps.mapHasBedrock && !this.props.mapHasBedrock) {\n mapStyle.layers.forEach(layer => {\n if (layer.source === 'burwell' && layer['source-layer'] === 'units') {\n this.map.setLayoutProperty(layer.id, 'visibility', 'visible')\n }\n })\n // Remove bedrock\n } else if (!nextProps.mapHasBedrock && this.props.mapHasBedrock) {\n mapStyle.layers.forEach(layer => {\n if (layer.source === 'burwell' && layer['source-layer'] === 'units') {\n this.map.setLayoutProperty(layer.id, 'visibility', 'none')\n }\n })\n\n // Add lines\n } else if (nextProps.mapHasLines && !this.props.mapHasLines) {\n mapStyle.layers.forEach(layer => {\n if (layer.source === 'burwell' && layer['source-layer'] === 'lines') {\n this.map.setLayoutProperty(layer.id, 'visibility', 'visible')\n }\n })\n // Remove lines\n } else if (!nextProps.mapHasLines && this.props.mapHasLines) {\n mapStyle.layers.forEach(layer => {\n if (layer.source === 'burwell' && layer['source-layer'] === 'lines') {\n this.map.setLayoutProperty(layer.id, 'visibility', 'none')\n }\n })\n\n // Swap satellite/normal\n } else if (nextProps.mapHasSatellite != this.props.mapHasSatellite) {\n if (nextProps.mapHasSatellite) {\n this.swapBasemap(SETTINGS.satelliteMapURL)\n } else {\n this.swapBasemap(SETTINGS.baseMapURL)\n }\n // Add columns\n } else if (nextProps.mapHasColumns != this.props.mapHasColumns) {\n if (nextProps.mapHasColumns) {\n // If filters are applied\n if (this.props.filters.length) {\n this.props.getFilteredColumns()\n mapStyle.layers.forEach(layer => {\n if (layer.source === 'filteredColumns') {\n this.map.setLayoutProperty(layer.id, 'visibility', 'visible')\n }\n })\n // No filters applied\n } else {\n mapStyle.layers.forEach(layer => {\n if (layer.source === 'columns') {\n this.map.setLayoutProperty(layer.id, 'visibility', 'visible')\n }\n })\n }\n // Remove columns\n } else {\n mapStyle.layers.forEach(layer => {\n if (layer.source === 'columns' || layer.source === 'filteredColumns') {\n this.map.setLayoutProperty(layer.id, 'visibility', 'none')\n }\n })\n }\n } else if (JSON.stringify(nextProps.filteredColumns) != JSON.stringify(this.props.filteredColumns)) {\n this.map.getSource('filteredColumns').setData(nextProps.filteredColumns)\n\n if (this.map.getSource('columns')) {\n mapStyle.layers.forEach(layer => {\n if (layer.source === 'columns') {\n this.map.setLayoutProperty(layer.id, 'visibility', 'none')\n }\n })\n mapStyle.layers.forEach(layer => {\n if (layer.source === 'filteredColumns') {\n this.map.setLayoutProperty(layer.id, 'visibility', 'visible')\n }\n })\n }\n\n // Fossils\n } else if (nextProps.mapHasFossils != this.props.mapHasFossils) {\n // Add fossils\n if (nextProps.mapHasFossils && !this.props.mapHasFossils) {\n mapStyle.layers.forEach(layer => {\n if (layer.source === 'pbdb' || layer.source === 'pbdb-points' || layer.source === 'pbdb-clusters') {\n this.map.setLayoutProperty(layer.id, 'visibility', 'visible')\n }\n })\n // Force a hit to the API to refresh\n this.refreshPBDB()\n // Remove fossils\n } else {\n mapStyle.layers.forEach(layer => {\n if (layer.source === 'pbdb' || layer.source === 'pbdb-points' || layer.source === 'pbdb-clusters') {\n this.map.setLayoutProperty(layer.id, 'visibility', 'none')\n }\n })\n }\n\n // Handle changes to map filters\n } else if (JSON.stringify(nextProps.filters) != JSON.stringify(this.props.filters)) {\n // If all filters have been removed simply reset the filter states\n // if (nextProps.filters.length === 0) {\n // this.filters = []\n // this.filtersIndex = {}\n // this.timeFilters = []\n // this.timeFiltersIndex = {}\n // this.applyFilters()\n //\n // // Remove filtered columns and add unfiltered columns\n // if (this.props.mapHasColumns) {\n // mapStyle.layers.forEach(layer => {\n // if (layer.source === 'columns') {\n // this.map.setLayoutProperty(layer.id, 'visibility', 'visible')\n // }\n // })\n // mapStyle.layers.forEach(layer => {\n // if (layer.source === 'filteredColumns') {\n // this.map.setLayoutProperty(layer.id, 'visibility', 'none')\n // }\n // })\n // }\n //\n // if (this.props.mapHasFossils === true) {\n // this.refreshPBDB()\n // }\n // return false\n // }\n\n // Check which filters were added or removed\n let existingFilters = new Set(this.props.filters.map(f => { return `${f.category}|${f.type}|${f.name}` }))\n let newFilters = new Set(nextProps.filters.map(f => { return `${f.category}|${f.type}|${f.name}` }))\n\n let incoming = [...new Set([...newFilters].filter(f => !existingFilters.has(f)))]\n let outgoing = [...new Set([...existingFilters].filter(f => !newFilters.has(f)))]\n\n // If a filter was removed...\n if (outgoing.length) {\n switch(outgoing[0].split('|')[0]) {\n case 'interval':\n var idx = this.timeFiltersIndex[outgoing[0]]\n this.timeFilters.splice(idx, 1)\n delete this.timeFiltersIndex[outgoing[0]]\n break\n case 'lithology':\n // Remove it from our lith filter index\n var idx = this.lithFiltersIndex[outgoing[0]]\n this.lithFilters.splice(idx, 1)\n delete this.lithFiltersIndex[outgoing[0]]\n // Remove it from the general filter index\n this.filtersIndex[outgoing[0]].reverse().forEach(idx => {\n this.filters.splice(idx, 1)\n })\n delete this.filtersIndex[outgoing[0]]\n\n break\n case 'strat_name':\n // Remove it from the strat name filter index\n var idx = this.stratNameFiltersIndex[outgoing[0]]\n this.stratNameFilters.splice(idx, 1)\n delete this.stratNameFiltersIndex[outgoing[0]]\n // Remove it from the general filter index\n this.filtersIndex[outgoing[0]].reverse().forEach(idx => {\n this.filters.splice(idx, 1)\n })\n delete this.filtersIndex[outgoing[0]]\n break\n\n }\n\n // Update fossils if needed\n if (this.props.mapHasFossils === true) {\n this.refreshPBDB()\n }\n\n if (!incoming.length) {\n this.applyFilters()\n return false\n }\n\n }\n\n // Otherwise, a filter was added\n let newFilterString = incoming[0].split('|')\n let filterToApply = nextProps.filters.filter(f => {\n if (f.category === newFilterString[0] && f.type === newFilterString[1] && f.name === newFilterString[2]) {\n return f\n }\n })\n\n if (filterToApply.length === 0) {\n return false\n }\n\n filterToApply = filterToApply[0]\n\n // Check which kind of filter it is\n switch(filterToApply.type) {\n case 'intervals':\n this.timeFilters.push([\n 'all',\n ['>', 'best_age_bottom', filterToApply.t_age],\n ['<', 'best_age_top', filterToApply.b_age]\n ])\n this.timeFiltersIndex[`${filterToApply.category}|${filterToApply.type}|${filterToApply.name}`] = this.timeFilters.length - 1\n break\n\n case 'lithology_classes':\n this.lithFilters.push(filterToApply.name)\n this.lithFiltersIndex[`${filterToApply.category}|${filterToApply.type}|${filterToApply.name}`] = this.lithFilters.length - 1\n\n for (let i = 1; i < 14; i++) {\n this.filters.push([ '==', `lith_class${i}`, filterToApply.name ])\n if (this.filtersIndex[`${filterToApply.category}|${filterToApply.type}|${filterToApply.name}`]) {\n this.filtersIndex[`${filterToApply.category}|${filterToApply.type}|${filterToApply.name}`].push(this.filters.length - 1)\n } else {\n this.filtersIndex[`${filterToApply.category}|${filterToApply.type}|${filterToApply.name}`] = [ this.filters.length - 1]\n }\n }\n break\n\n case 'lithology_types':\n this.lithFilters.push(filterToApply.name)\n this.lithFiltersIndex[`${filterToApply.category}|${filterToApply.type}|${filterToApply.name}`] = this.lithFilters.length - 1\n\n for (let i = 1; i < 14; i++) {\n this.filters.push([ '==', `lith_type${i}`, filterToApply.name ])\n\n if (this.filtersIndex[`${filterToApply.category}|${filterToApply.type}|${filterToApply.name}`]) {\n this.filtersIndex[`${filterToApply.category}|${filterToApply.type}|${filterToApply.name}`].push(this.filters.length - 1)\n } else {\n this.filtersIndex[`${filterToApply.category}|${filterToApply.type}|${filterToApply.name}`] = [ this.filters.length - 1]\n }\n }\n break\n\n case 'lithologies':\n case 'all_lithologies':\n case 'all_lithology_types':\n case 'all_lithology_classes':\n this.lithFilters.push(filterToApply.name)\n this.lithFiltersIndex[`${filterToApply.category}|${filterToApply.type}|${filterToApply.name}`] = this.lithFilters.length - 1\n this.filters.push([ 'in', 'legend_id', ...filterToApply.legend_ids ])\n this.filtersIndex[`${filterToApply.category}|${filterToApply.type}|${filterToApply.name}`] = [ this.filters.length - 1]\n break\n\n case 'strat_name_orphans':\n case 'strat_name_concepts':\n this.stratNameFilters.push(filterToApply.name)\n this.stratNameFiltersIndex[`${filterToApply.category}|${filterToApply.type}|${filterToApply.name}`] = this.stratNameFilters.length - 1\n\n this.filters.push([ 'in', 'legend_id', ...filterToApply.legend_ids ])\n this.filtersIndex[`${filterToApply.category}|${filterToApply.type}|${filterToApply.name}`] = [ this.filters.length - 1]\n break\n\n }\n if (this.props.mapHasFossils === true) {\n this.refreshPBDB()\n }\n\n // Basically if we are filtering by environments or anything else we can't filter the map with\n // if (!newFilter.length) {\n // return\n // }\n\n // Update the map styles\n this.applyFilters()\n\n return false\n }\n return false\n }", "function setCurrentTypeVisibility(map) {\n map.getLayers().forEach(function (layer) {\n if (layer.get('name') === 'featureLayer') {\n layer.getLayers().forEach(function (typeLayer) {\n var type = typeLayer.get('title').split(' (')[0];\n typeVisibility[type] = typeLayer.get('visible');\n });\n }\n });\n }", "function updateTileBounds() {\n zoom = Math.round(fixedZoom || Map.zoom);\n\n var\n ratio = Math.pow(2, zoom-Map.zoom)/TILE_SIZE,\n mapBounds = Map.bounds,\n perspectiveBuffer = 1;\n\n minX = (mapBounds.minX*ratio <<0) - perspectiveBuffer;\n minY = (mapBounds.minY*ratio <<0) + 1 - perspectiveBuffer;\n maxX = Math.ceil(mapBounds.maxX*ratio) + perspectiveBuffer;\n maxY = Math.ceil(mapBounds.maxY*ratio) + 1 + perspectiveBuffer;\n }", "function MainOverlay(limites, image, map) {\r\n this.bounds_ = limites;\r\n this.image_ = image;\r\n this.setMap(map);\r\n }", "function calculateOverview(value, overviewer, summatoryName) {\r\n if (value < overviewer.min)\r\n overviewer.min = value;\r\n if (value > overviewer.max)\r\n overviewer.max = value;\r\n summatory[`${summatoryName}`] += value;\r\n }", "function initMap() {\n const map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 11,\n center: { lat: 62.323907, lng: -150.109291 },\n mapTypeId: \"satellite\",\n });\n const bounds = new google.maps.LatLngBounds(\n new google.maps.LatLng(62.281819, -150.287132),\n new google.maps.LatLng(62.400471, -150.005608),\n );\n // The photograph is courtesy of the U.S. Geological Survey.\n const srcImage =\n \"https://developers.google.com/maps/documentation/\" +\n \"javascript/examples/full/images/talkeetna.png\";\n\n // The custom USGSOverlay object contains the USGS image,\n // the bounds of the image, and a reference to the map.\n class USGSOverlay extends google.maps.OverlayView {\n bounds_;\n image_;\n div_;\n // [START maps_overlay_simple_region_constructor]\n constructor(bounds, image) {\n super();\n // Initialize all properties.\n this.bounds_ = bounds;\n this.image_ = image;\n // Define a property to hold the image's div. We'll\n // actually create this div upon receipt of the onAdd()\n // method so we'll leave it null for now.\n this.div_ = null;\n }\n // [END maps_overlay_simple_region_constructor]\n // [START maps_overlay_simple_region_attachment]\n /**\n * onAdd is called when the map's panes are ready and the overlay has been\n * added to the map.\n */\n onAdd() {\n this.div_ = document.createElement(\"div\");\n this.div_.style.borderStyle = \"none\";\n this.div_.style.borderWidth = \"0px\";\n this.div_.style.position = \"absolute\";\n\n // Create the img element and attach it to the div.\n const img = document.createElement(\"img\");\n\n img.src = this.image_;\n img.style.width = \"100%\";\n img.style.height = \"100%\";\n img.style.position = \"absolute\";\n this.div_.appendChild(img);\n\n // Add the element to the \"overlayLayer\" pane.\n const panes = this.getPanes();\n\n panes.overlayLayer.appendChild(this.div_);\n }\n // [END maps_overlay_simple_region_attachment]\n // [START maps_overlay_simple_region_drawing]\n draw() {\n // We use the south-west and north-east\n // coordinates of the overlay to peg it to the correct position and size.\n // To do this, we need to retrieve the projection from the overlay.\n const overlayProjection = this.getProjection();\n // Retrieve the south-west and north-east coordinates of this overlay\n // in LatLngs and convert them to pixel coordinates.\n // We'll use these coordinates to resize the div.\n const sw = overlayProjection.fromLatLngToDivPixel(\n this.bounds_.getSouthWest(),\n );\n const ne = overlayProjection.fromLatLngToDivPixel(\n this.bounds_.getNorthEast(),\n );\n\n // Resize the image's div to fit the indicated dimensions.\n if (this.div_) {\n this.div_.style.left = sw.x + \"px\";\n this.div_.style.top = ne.y + \"px\";\n this.div_.style.width = ne.x - sw.x + \"px\";\n this.div_.style.height = sw.y - ne.y + \"px\";\n }\n }\n // [END maps_overlay_simple_region_drawing]\n // [START maps_overlay_simple_region_removal]\n /**\n * The onRemove() method will be called automatically from the API if\n * we ever set the overlay's map property to 'null'.\n */\n onRemove() {\n if (this.div_) {\n this.div_.parentNode.removeChild(this.div_);\n this.div_ = null;\n }\n }\n // [END maps_overlay_simple_region_removal]\n }\n\n const overlay = new USGSOverlay(bounds, srcImage);\n\n overlay.setMap(map);\n}", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }" ]
[ "0.5155607", "0.5108502", "0.5017218", "0.4999723", "0.49637577", "0.49426314", "0.49350336", "0.4899641", "0.48742247", "0.48171225", "0.480886", "0.480886", "0.4788675", "0.47885686", "0.47782236", "0.47715354", "0.47700462", "0.47681093", "0.4760436", "0.4745325", "0.47267002", "0.4719209", "0.47171047", "0.46932125", "0.46932125", "0.46932125", "0.46932125", "0.46932125", "0.469052", "0.4689007", "0.4688872", "0.46864304", "0.46835956", "0.4672453", "0.46485728", "0.46396634", "0.46391386", "0.46190578", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258", "0.46121258" ]
0.5816436
0
This methods form a submap by creating a new map, moving shifting there all the selected components, moving internal dependecies (got from impact).
function createASubmap(mongooseObjects, workspace, mapId, name, responsiblePerson, nodes, impact) { let Node = mongooseObjects.Node; let WardleyMap = mongooseObjects.WardleyMap; return workspace.createAMap({ name: name, responsiblePerson: responsiblePerson }, workspace.nowId, /*mark as submap */ true) .then(function(newlyCreatedMap) { //inSubmapDependencies those deps have to be copied //and nodes, of course return Node.find({ _id: { $in: nodes } }).exec().then(function(nodes) { let promises = []; for (let i = 0; i < nodes.length; i++) { let processedNode = nodes[i]; // for each node that was pushed to a submap //1. set parent map processedNode.parentMap = [getId(newlyCreatedMap)]; //2. adjust visibility - steal it from current map // if for some reason it is not missing, take the first available one let bestVisibility = processedNode.visibility[0]; for (let j = 0; j < processedNode.visibility.length; j++) { let analysedVisibility = processedNode.visibility[j]; if (getId(analysedVisibility.map).equals(getId(mapId))) { bestVisibility = analysedVisibility; } } bestVisibility.map = getId(newlyCreatedMap); processedNode.visibility = [bestVisibility]; //3. sort out dependencies, only those presented on a map will stay //for now, in the future we may have some cross maps dependencies possible processedNode.dependencies = []; for (let j = 0; j < impact.inSubmapDependencies.length; j++) { let processedDependency = impact.inSubmapDependencies[j]; if (getId(processedDependency.node).equals(getId(processedNode))) { processedNode.dependencies = processedNode.dependencies.concat(processedDependency.deps); } } // 3.a ensure dependencies are visible when they should be for (let j = 0; j < processedNode.dependencies.length; j++) { processedNode.dependencies[j].visibleOn = [getId(newlyCreatedMap)]; } //4. save, piece of cake promises.push(processedNode.save()); } return q.all(promises).then(function() { return WardleyMap.findById(getId(newlyCreatedMap)).populate('nodes').exec(); }); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "swapBasemap(toAdd) {\n this.currentSources = []\n this.currentLayers = []\n\n // First record which layers are currently on the map\n Object.keys(mapStyle.sources).forEach(source => {\n let isPresent = this.map.getSource(source)\n if (isPresent) {\n this.currentSources.push({\n id: source,\n config: mapStyle.sources[source],\n data: isPresent._data || null\n })\n }\n })\n\n mapStyle.layers.forEach(layer => {\n let isPresent = this.map.getLayer(layer.id)\n if (isPresent) {\n this.currentLayers.push({\n layer: layer,\n filters: this.map.getFilter(layer.id)\n })\n }\n })\n\n // Set the style. `style.load` will be fired after to readd other layers\n this.map.setStyle(toAdd)\n }", "function createbaseMap() {\n\n map = new arcgisObj.Map(\"mapDiv\");\n \n var home = new arcgisObj.HomeButton({ // 全图\n map: map\n }, \"HomeButton\");\n home.startup();\n\n new arcgisObj.Scalebar({ // 比例尺\n map: map,\n attachTo: \"bottom-left\",\n scalebarUnit: \"metric\"\n });\n var layer=createLayers();;\n\tvar layerInfo=[ {\n\t\tlayer : layer,\n\t\ttitle : \"自营经济\"\n\t} ];\n\tvar tocElement=\"tocDiv\";\n\tconsole.log(\"开始设置图层控制\");\n\t map.on('layers-add-result',function(results){\n\t\ttry {\n\t\t\tvar toc = new arcgisObj.TOC({\n\t\t\t\tmap : map,\n\t\t\t\tlayerInfos : layerInfo\n\t\t\t}, tocElement);\n\t\t\ttoc.startup();\n } catch (e) {\n $.messager.alert(e);\n }\n });\t\n}", "function makeMap() {\n // Make containers\n\n const div = mapsContainer.append('div').attr('class', 'map-container');\n const svg = div.append('svg').html(DEFS);\n\n const pathContainer = svg.append('g').attr('class', 'features');\n const baselineContainer = svg.append('g').attr('class', 'baseline');\n const chart19Container = svg.append('g').attr('class', 'slopes-19');\n const chart20Container = svg.append('g').attr('class', 'slopes-20');\n const textContainer = svg\n .append('g')\n .attr('class', 'text')\n // Create separate groups for white background and black foreground\n .selectAll('g')\n .data([true, false])\n .enter()\n .append('g');\n\n const riverLabel = svg\n .append('text')\n .attr('class', 'river-label')\n .selectAll('tspan')\n .data(['Hudson', 'River'])\n .join('tspan')\n .text(d => d);\n const campusLabel = svg\n .append('g')\n .attr('class', 'campus-labels')\n // Create separate groups for white background and black foreground\n .selectAll('text')\n .data([true, false])\n .enter()\n .append('text')\n .classed('white-background', d => d)\n .selectAll('tspan')\n .data(['Main', 'Campus'])\n .join('tspan')\n .text(d => d);\n\n const labelContainer = svg.append('g');\n const neighborhoodLabelsBg = labelContainer\n .append('g')\n .attr('class', 'neighborhood-labels')\n .selectAll('text')\n .data(LABELS)\n .enter('text')\n .append('text')\n .attr('class', 'white-background')\n .selectAll('tspan')\n .data(d => d.label)\n .join('tspan')\n .text(d => d);\n const neighborhoodLabels = labelContainer\n .append('g')\n .attr('class', 'neighborhood-labels')\n .selectAll('text')\n .data(LABELS)\n .enter('text')\n .append('text')\n .selectAll('tspan')\n .data(d => d.label)\n .join('tspan')\n .text(d => d);\n\n // Extract census tract features (contains all tracts in Manhattan)\n\n const allTracts = feature(influxData, influxData.objects.tracts);\n\n // Create a separate GeoJSON object that holds only the tracts we want to fit\n // the projection around\n\n const tracts = {\n type: 'FeatureCollection',\n features: allTracts.features.filter(({ properties: { census_tract } }) =>\n [36061018900, 36061021900].includes(+census_tract),\n ),\n };\n\n // Extract census tract centroids\n\n const centroids = feature(influxData, influxData.objects.tracts_centroids);\n\n // Create the paths that will become census tracts.\n // The `d` attribute won't be set until the resize function is called.\n\n const paths = pathContainer\n .selectAll('path')\n .data(allTracts.features)\n .enter()\n .append('path')\n .classed(\n 'columbia-outline',\n d => d.properties.census_tract === '36061020300',\n );\n paths\n .filter(\n ({ properties: { aug20, oct20, aug19, oct19 } }) =>\n (oct20 - aug20) / aug20 > (oct19 - aug19) / aug19,\n )\n .style('fill', shadedColor);\n\n // Create the things that will become the slope chart (e.g. line, arrow, circles)\n\n const circles = chart20Container\n .selectAll('circle')\n .data(centroids.features)\n .enter()\n .append('circle')\n .attr('r', 3);\n\n const baseline = baselineContainer\n .selectAll('line')\n .data(centroids.features)\n .enter()\n .append('line');\n\n /* const text = textContainer\n .selectAll('text')\n .data(centroids.features)\n .enter()\n .append('text')\n .classed('white-background', function () {\n return this.parentNode.__data__;\n }); */\n\n const slopes2020 = chart20Container\n .selectAll('line')\n .data(centroids.features)\n .enter()\n .append('line')\n .attr('stroke', c20);\n\n const slopes2019 = chart19Container\n .selectAll('line')\n .data(centroids.features)\n .enter()\n .append('line')\n .attr('stroke', c19);\n\n // Make a handleResize method that handles the things that depend on\n // width (path generator, paths, and svg)\n\n function handleResize() {\n // Recompute width and height; resize the svg\n\n const width = Math.min(WIDTH, document.documentElement.clientWidth - 30);\n const isMobile = width < 460;\n const height = (width * (isMobile ? 36 : 28)) / 30;\n arrowSize = isMobile ? 32 : 45;\n svg.attr('width', width);\n svg.attr('height', height);\n\n // Create the projection\n\n const albersprojection = geoAlbers()\n .rotate([122, 0, 0])\n .fitSize([width, height], tracts);\n\n // Create the path generating function; set the `d` attribute to the path\n // generator, which is called on the data we attached to the paths earlier\n\n const pathGenerator = geoPath(albersprojection);\n paths.attr('d', pathGenerator);\n\n // Define some commonly used coordinate functions\n\n const x = d => albersprojection(d.geometry.coordinates)[0];\n const y = d => albersprojection(d.geometry.coordinates)[1];\n const endpointX = year => d => {\n const slope =\n (d.properties['oct' + year] - d.properties['aug' + year]) /\n d.properties['aug' + year];\n const x = arrowSize * Math.cos(Math.atan(slope * 2));\n return albersprojection(d.geometry.coordinates)[0] + x;\n };\n const endpointY = year => d => {\n const slope =\n (d.properties['oct' + year] - d.properties['aug' + year]) /\n d.properties['aug' + year];\n const y = arrowSize * Math.sin(Math.atan(slope) * 2);\n return albersprojection(d.geometry.coordinates)[1] - y;\n };\n\n // Modify the positions of the elements\n\n circles.attr('cx', x).attr('cy', y);\n slopes2020\n .attr('x1', x)\n .attr('y1', y)\n .attr('x2', endpointX(20))\n .attr('y2', endpointY(20));\n slopes2019\n .attr('x1', x)\n .attr('y1', y)\n .attr('x2', endpointX(19))\n .attr('y2', endpointY(19));\n\n /* text\n .attr('x', x)\n .attr('y', y)\n .text(d => {\n let difference =\n (100 * (d.properties.oct - d.properties.aug)) / d.properties.aug;\n difference =\n difference < 10 ? difference.toFixed(1) : Math.round(difference);\n if (difference > 0) return '+' + difference + '%';\n else return '–' + Math.abs(difference) + '%';\n }); */\n\n baseline\n .attr('x1', x)\n .attr('y1', y)\n .attr('x2', d => x(d) + arrowSize)\n .attr('y2', y);\n\n riverLabel\n .attr('x', isMobile ? 0 : width / 6)\n .attr('y', (_, i) => height / 2 + i * 22);\n\n campusLabel\n .attr('x', albersprojection(CAMPUS_LABEL_LOC)[0])\n .attr('y', (_, i) => albersprojection(CAMPUS_LABEL_LOC)[1] + i * 18);\n\n neighborhoodLabels\n .attr('x', function () {\n return albersprojection(this.parentNode.__data__.loc)[0];\n })\n .attr('y', function (_, i) {\n return albersprojection(this.parentNode.__data__.loc)[1] + i * 20;\n });\n\n neighborhoodLabelsBg\n .attr('x', function () {\n return albersprojection(this.parentNode.__data__.loc)[0];\n })\n .attr('y', function (_, i) {\n return albersprojection(this.parentNode.__data__.loc)[1] + i * 20;\n });\n }\n\n // Call the resize function once; attach it to a resize listener\n\n handleResize();\n window.addEventListener('resize', debounce(handleResize, 400));\n}", "function updateMap() {\n\t\t\tid = trail_select.value;\n\t\t\tconsole.log(id);\n\t\t\tvar newlayer = layer.getLayer(id);\n\t\t\tnewlayer.removeFrom(map);\n\t\t\tnewlayer.setStyle({\n\t\t\t\t\tweight: 5,\n\t\t\t\t\tcolor: '#00ff00',\n\t\t\t\t\topacity: 1.0\n\t\t\t});\n\t\t\tnewlayer.addTo(map)\n\t\t\tvar prevlayer = layer.getLayer(previd);\n\t\t\tif (previd !== id) {\n\t\t\t\tprevlayer.setStyle({\n\t\t\t\t\tcolor: '#ff7800',\n\t\t\t\t\topacity: 1.0,\n\t\t\t\t\tweight: (prevlayer.feature.properties.annual*0.17)**4\n\t\t\t\t});\n\t\t\t\tprevlayer.addTo(map);\n\t\t\t\tprevid = id;\n\t\t\t}\n\t\t}", "function mapBuild(){\n\tvar width = window.w * mapDim.ratio,\n\t\theight = width * 3/4;\t\t\t\t// 4:3 screen ratio\n\n\tvar projection = d3.geo.albers()\n\t\t.center([0, 42])\n .rotate([347, 0])\n .parallels([35, 45])\n .scale(height * 4)\n .translate([width/2, height/2]);\n\n\tvar path = d3.geo.path()\n\t\t.projection(projection);\n\n\tvar svg = d3.select(\"#map\").append(\"svg\")\n\t\t\t.attr(\"width\", width)\n\t\t\t.attr(\"height\", height);\n\n\tvar sub = svg.append(\"g\")\n\t\t.attr(\"id\", \"subunits\");\n\n//\tsvg.append(\"rect\")\n//\t\t.attr(\"class\", \"background\")\n//\t\t.attr(\"width\", width)\n//\t\t.attr(\"height\", height);\n\t\n\tvar gcircles = svg.append(\"g\")\n\t\t.attr(\"class\", \"ranking\");\n\n\tvar subunits = topojson.feature(ita, ita.objects.regions);\n\tvar features = subunits.features;\n//\t\tvar boundaries = topojson.mesh(ita, ita.objects.regions, function(a, b){return a!==b;});\n\tranking = d3.nest().key(function(d){ return d.region; })\n\t\t.rollup(function(d, i){ return {coordinates:[+d[0].lon, +d[0].lat], value:+d[0].value}; })\n\t\t.entries(ranking);\n\n\tsub.selectAll(\".region\")\n\t\t.data(features)\n\t\t.enter().append(\"path\")\n\t\t\t.attr(\"class\", \"region\")\n\t\t\t.attr(\"id\", function(d, i){ return d.properties.name.toLowerCase().split(\"/\")[0]; })\n\t\t\t.on(\"click\", selected)\n\t\t\t.on(\"mouseover\", function(d){ highlight(d); })\n\t\t\t.on(\"mouseout\", function(d){ highlight(null); });\n\n//\t\tsub.selectAll(\".region-border\")\n//\t\t\t.datum(boundaries)\n//\t\t\t.enter().append(\"borders\")\n//\t\t\t.attr(\"class\", \"region-border\")\n//\t\t\t.attr(\"d\", path);\n\t\n\tcircles = gcircles.selectAll(\".ranking\")\n\t\t.data(ranking)\n\t\t.enter().append(\"circle\")\n\t\t\t.attr(\"class\", \"ranking\");\n\t\n\tvar hotels = hotelList();\n\t\n\tfunction drawMap(){\n\t\tsub.selectAll(\".region\")\n\t\t\t.attr(\"d\", path);\n\t\t\n\t\tgcircles.selectAll(\".ranking\")\n\t\t\t.attr(\"r\", function(d){return d.values.value * 3;})\n\t\t\t.attr(\"cx\", function(d){return projection(d.values.coordinates)[0];})\n\t\t\t.attr(\"cy\", function(d){return projection(d.values.coordinates)[1];});\n\t};\n\t\n\tfunction selected(region){\n\t\tvar x, y, zoom;\n\t\t\n\t\t// Select the region\n\t\t// If there is still a selected region or the current one has not a focus\n\t\t// and so it have not beening selected yet, then selects it (thus acquire the focus)\n\t\tif(regionSelected.path !== region || !regionSelected.focus){\n\t\t\tvar center = path.centroid(region);\n\t\t\tvar name = region.properties.name;\n\n\t\t\tx = center[0];\n\t\t\ty = center[1];\n\t\t\tzoom = 2;\n\t\t\t\n\t\t\tregionSelected.name = name.capitalize();\n\t\t\tregionSelected.path = region;\n\t\t\tregionSelected.focus = true;\n\t\t\t\n\t\t\tconsole.log(\"list hotel for '\" + regionSelected.name);\n\t\t\t\n\t\t\t// List all the hotel for the selected region\n\t\t\thotels.draw(regionSelected.name);\n\t\t\t\n\t\t\t// Dispatch the stateChane event to update all the charts\n\t\t\tdispatch.regionChange(regionSelected.name);\n\n\t\t\t// otherwise clear the selections\n\t\t} else {\n\t\t\tx = width / 2;\n\t\t\ty = height / 2;\n\t\t\tzoom = 1;\n\t\t\t\n\t\t\tregionSelected.name = null;\n\t\t\tregionSelected.path = null;\n\t\t\tregionSelected.focus = false;\n\t\t\t\n\t\t\t// Clear hotel list\n\t\t\thotels.draw(null);\n\t\t\t\n\t\t\t// Clear all the charts\n//\t\t\tdispatch.regionChange(null);\n\t\t}\n\t\t\n\t\t// Center and zoom the map\n\t\tsub.transition()\n\t\t.duration(duration)\n\t\t.attr(\"transform\", \"translate(\" + width/2 + \",\" + height/2 + \")scale(\" + zoom + \")translate(\" + -x + \",\" + -y + \")\")\n\t\t.style(\"stroke-width\", \"3px\");\n\t\n\t\tgcircles.selectAll(\"circle\").transition()\n\t\t\t.duration(duration)\n\t//\t\t.attr(\"r\", function(d){ return d.values.value * zoom; })\n\t\t\t.attr(\"transform\", \"translate(\" + width/2 + \",\" + height/2 + \")scale(\" + zoom + \")translate(\" + -x + \",\" + -y + \")\");\n\t\t\n\t\t// Update classes\n\t\tsub.selectAll(\"path\")\n\t\t\t.classed(\"highlight\", false)\n\t\t\t.classed(\"active\", regionSelected && function(d){ return d === regionSelected.path; });\n\t};\n\t\n\tfunction highlight(region){\n\t\tconsole.log(\"highlight '\" + regionSelected.name + \"' region data\");\n\n\t\tif(regionSelected.focus)\n\t\t\treturn;\n\t\t\n\t\t// Mouse is exited from map and no selectino was made\n\t\tif(region == null){\n\t\t\tsub.selectAll(\"path\")\n\t\t\t\t.classed(\"highlight\", false);\n\t\t\t\n\t\t\t// Restore mean values of the state TODO: to implement\n\t\t} else {\n\t\t\n\t\t// Select the region\n\t\t\tvar regionName = region.properties.name;\n\n\t\t\tregionSelected.name = regionName.capitalize();\n\t\t\tregionSelected.path = region;\n\t\t\tregionSelected.focus = false;\n\n\t\t\tsub.selectAll(\"path\")\n\t\t\t\t.classed(\"highlight\", regionSelected && function(d){ return d === regionSelected.path; });\n\t\n\t\t\t// Dispatch the stateChane event to update all the charts\n\t\t\tdispatch.regionChange(regionSelected.name);\n\t\t}\n\t};\n\t\n//\tfunction highlight(region){\n//\t\t// Highlight the current region\n//\t\tsub.selectAll(\"path\")\n//\t\t\t.classed(\"active\", function(d){return region;});\n//\t};\n\t\n\tfunction resize (w, h){\n\t\twidth = w * mapDim.ratio,\n\t\theight = width * 3/4;\n\t\t\n\t\tsvg.attr(\"width\", width)\n\t\t\t.attr(\"height\", height);\n\t\t\n\t\tprojection\n\t\t\t.translate([width/2, height/2])\n\t\t\t.scale(height*4);\n\t\t\n\t\tdrawMap();\n\t};\n\t\n\tdrawMap();\n\t\n\tdispatch.on(\"resize.map\", resize);\n}", "function updateMap() {\n\t//\treturn;\n// not sure if i need this\n\t\tconsole.log(\"updateMap()\");\n\t\tif (!prop(tractLayer.eachLayer)) return;\n\n\t\ttractLayer.eachLayer(function(layer) {\n\t\t\tif (MAP_DEBUG) console.log(\" -> eachLayer()\", layer.feature, layer);\n\n\t\t\t// reset properties, popup, events for each tract feature\n\t\t\tonEachTractFeature(layer.feature, layer);\n\n\t\t\t// reset layer style based on new data\n\t\t\tif (prop(layer.feature))\n\t\t\t\tlayer.setStyle(initialTractStyle(layer.feature));\n\t\t});\n\t}", "afterMapCreation() {\n this.moveBackgroundMap(\n this.currentModel.get('longitude'),\n this.currentModel.get('latitude'),\n this.currentModel.get('preferredZoom')\n );\n }", "function createMap() {\n\t\t\t\t\n\t\t\t\t//initialize map\n\t\t\t var myOptions = {\n\t\t\t zoom: 2,\n\t\t\t center: new google.maps.LatLng(30,0),\n\t\t\t mapTypeId: google.maps.MapTypeId.TERRAIN,\n\t\t\t\t\tdisableDefaultUI: true,\n\t\t\t\t\tscrollwheel: false,\n\t\t\t\t\tstreetViewControl: false,\n\t\t\t\t\tscaleControl: true\n\t\t\t }\n\n\t\t\t map = new google.maps.Map(document.getElementById(\"map\"), myOptions);\n\t\t\t \t\t\t \n\t\t\t\tbounds = new google.maps.LatLngBounds();\n geocoder = new google.maps.Geocoder();\n\n \n\t\t\t\tgoogle.maps.event.clearListeners(map, 'tilesloaded');\n\t\t\t\tpoints = new PointsOperations(); \t\t // Points Object\n\t\t\t\tconvex_hull = new HullOperations(map);\t\t\t\t\t// Convex Hull Object\n\t\t\t\tactions = new UnredoOperations();\t\t\t\t\t\t\t\t// Un-Re-Do Object\n edit_metadata = new GapsOverlay(new google.maps.LatLng(0,0), null, map);\n\n\n\t\t\t\tselection_polygon = new google.maps.Polygon({\n\t\t strokeColor: \"#000000\",\n\t\t strokeOpacity: 1,\n\t\t strokeWeight: 1,\n\t\t fillColor: \"#FFFFFF\",\n\t\t fillOpacity: 0\n\t\t });\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t/*========================MAP EVENTS==========================*/\n\t\t\t\t\n\t\t\t\t//Click map event\n\t\t\t\tgoogle.maps.event.addListener(map,\"click\",function(event){\n\t\t\t\t\tif (state == 'add') {\n\t\t\t\t\t\taddMarker(event.latLng,null,false);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\n\t\t\t\t//Change cursor depending on application state\n\t\t\t\tgoogle.maps.event.addListener(map,\"mouseover\",function(event){\n\t\t\t\t\t\tswitch(state) {\n\t\t\t\t\t\t\tcase 'add': \t\t\tmap.setOptions({draggableCursor: \"url(/images/editor/add_cursor.png),default\"});\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'selection': map.setOptions({draggableCursor: \"url(/images/editor/selection_cursor.png),default\"});\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase 'remove': \t\tmap.setOptions({draggableCursor: \"url(/images/editor/remove_cursor.png),default\"});\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\n\t\t\t\t\t\t\tdefault: \t\t\t\t\tmap.setOptions({draggableCursor: \"url(/images/editor/default_cursor.png),default\"});\t\n\t\t\t\t\t\t}\n\t\t\t\t});\n\n\n\t\t\t\t//Zoom change = Zoom control change\n\t\t\t\tgoogle.maps.event.addListener(map,\"zoom_changed\",function(event){moveZoomControl();});\n\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t/*========================DOM EVENTS==========================*/\n\t\t\t\t//choose map type\n\t\t\t\t$('ul.map_type_list li').click(function(ev){\n\t\t\t\t\t$('a.select_map_type span').text($(this).text());\n\t\t\t\t});\n\n\n\t\t\t\t//change zoom level\n\t\t\t\t$('#zoom ul li').click(function(ev){\n\t\t\t\t\tvar li_index = $(this).index();\n\t\t\t\t\tmap.setZoom(15-li_index);\n\t\t\t\t});\n\n\t\t\t\t//change zoom level +\n\t\t\t\t$('a.zoom_in').click(function(ev){\n\t\t\t\t\tif (map.getZoom()<15) {\n\t\t\t\t\t\tmap.setZoom(map.getZoom()+1);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t//change zoom level -\n\t\t\t\t$('a.zoom_out').click(function(ev){\n\t\t\t\t\tif (map.getZoom()>2) {\n\t\t\t\t\t\tmap.setZoom(map.getZoom()-1);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$('div.search_place').hover(function(ev){\n\t\t\t\t\t$(this).stop(ev).fadeTo(0,1);\n\t\t\t\t},function(ev){\n\t\t\t\t\t$(this).stop(ev).fadeTo(0,0.5);\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// Selection tool\n\t\t\t\t$('div#map').mousedown(function(ev){\n\t\t\t\t if (state==\"selection\" && !say_polygon_tooltip) {\n google.maps.event.clearListeners(selection_polygon, 'mouseover');\n google.maps.event.clearListeners(selection_polygon, 'mouseout');\n if (over_polygon_tooltip!=null) {\n over_polygon_tooltip.hide();\n }\n \n\t\t\t\t var position = {};\n\t\t\t\t position.x = ev.pageX-($('div#map').offset().left);\n\t\t\t\t position.y = ev.pageY-($('div#map').offset().top);\n\t\t\t\t var latlng = edit_metadata.transformCoordinates(new google.maps.Point(position.x,position.y));\n\t\t\t\t \n\t\t\t\t selection_polygon.setOptions({fillOpacity: 0});\n drawing = true;\n selection_polygon.setPath([latlng,latlng,latlng,latlng]);\n\t\t\t\t selection_polygon.setMap(map);\n\t\t\t\t \n\t\t\t\t $('div#map').mousemove(function(ev){\n position.x = ev.pageX-($('div#map').offset().left);\n \t\t\t\t position.y = ev.pageY-($('div#map').offset().top);\n \t\t\t\t var latLng = edit_metadata.transformCoordinates(new google.maps.Point(position.x,position.y));\n \n selection_polygon.setPath([\n selection_polygon.getPath().getAt(0),\n new google.maps.LatLng(selection_polygon.getPath().getAt(0).lat(),latLng.lng()),\n latLng,\n new google.maps.LatLng(latLng.lat(),selection_polygon.getPath().getAt(0).lng()),\n selection_polygon.getPath().getAt(0)]);\n\t\t\t\t });\n\t\t\t\t \n\t\t\t\t $('div#map').mouseup(function(ev){\n\t\t\t\t var position = {};\n\t\t\t\t position.x = ev.pageX-($('div#map').offset().left);\n \t\t\t\t position.y = ev.pageY-($('div#map').offset().top);\n \t\t\t\t var latLng = edit_metadata.transformCoordinates(new google.maps.Point(position.x,position.y));\n\t\t\t\t \n\t\t\t\t $('div#map').unbind('mouseup');\n\t\t\t\t $('div#map').unbind('mousemove');\n drawing = false;\n selection_polygon.setOptions({fillOpacity: 0.40});\n google.maps.event.clearListeners(map, 'mousemove');\n google.maps.event.clearListeners(selection_polygon, 'click');\n\n if (over_polygon_tooltip!=null) {\n over_polygon_tooltip.changeData(markersInPolygon(),latLng);\n } else {\n over_polygon_tooltip = new PolygonOverTooltip(latLng, markersInPolygon(), map);\n }\n\n google.maps.event.addListener(selection_polygon,'mouseover',function(){\n if (over_polygon_tooltip!=null) {\n over_polygon_tooltip.show();\n }\n over_polygon = true;\n });\n\n google.maps.event.addListener(selection_polygon,'mouseout',function(){\n if (over_polygon_tooltip!=null && !say_polygon_tooltip) {\n over_polygon_tooltip.hide();\n }\n over_polygon = false;\n });\n\t\t\t\t });\n\t\t\t\t }\n\t\t\t\t});\n\t\t\t}", "function layersControl () {\r\n if (maptype == \"artmap\") { \r\n basemaps = {\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen\r\n };\r\n overlays = {\r\n 'WV Artikel <img src=\"./lib/images/wv-logo-12.png\" />' : wvarticles\r\n };\r\n }\r\n \r\n else if (maptype == \"geomap\") {\r\n basemaps = {\r\n 'Mapnik <img src=\"./lib/images/wmf-logo-12.png\" />': mapnik,\r\n 'Mapquest open <img src=\"./lib/images/external.png\" />': mapquestopen,\r\n 'Mapquest aerial <img src=\"./lib/images/external.png\" />': mapquest\r\n }; \r\n overlays = {\r\n 'Mapquest Beschriftungen <img src=\"./lib/images/external.png\" />': maplabels,\r\n 'Grenzen <img src=\"./lib/images/external.png\" />': boundaries,\r\n 'Radwege <img src=\"./lib/images/external.png\" />': cycling\r\n };\r\n }\r\n \r\n else if (maptype == \"gpxmap\") { \r\n basemaps = {\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen\r\n };\r\n overlays = {\r\n 'WV Artikel <img src=\"./lib/images/wv-logo-12.png\" />' : wvarticles\r\n };\r\n }\r\n \r\n else if (maptype == \"monmap\") {\r\n basemaps = {\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen,\r\n 'Mapnik <img src=\"./lib/images/wmf-logo-12.png\" />' : mapnik, \r\n 'Reliefkarte <img src=\"./lib/images/external.png\" />' : landscape\r\n };\r\n overlays = {\r\n 'Denkmäler <img src=\"./lib/images/wv-logo-12.png\" />' : monuments\r\n };\r\n }\r\n\r\n else if (maptype == \"poimap2\") {\r\n basemaps = {\r\n 'Mapnik <img src=\"./lib/images/wmf-logo-12.png\" />' : mapnik,\r\n 'Mapnik s/w <img src=\"./lib/images/wmf-logo-12.png\" />' : mapnikbw,\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen,\r\n 'Mapquest Aerial <img src=\"./lib/images/external.png\" />' : mapquest,\r\n 'Verkehrsliniennetz <img src=\"./lib/images/external.png\" />' : transport,\r\n 'Reliefkarte <img src=\"./lib/images/external.png\" />' : landscape\r\n };\r\n overlays = {\r\n 'Mapquest Beschriftungen <img src=\"./lib/images/external.png\" />' : maplabels,\r\n 'Grenzen <img src=\"./lib/images/external.png\" />' : boundaries,\r\n 'Schummerung <img src=\"./lib/images/wmf-logo-12.png\" />' : hill,\r\n 'Radwege <img src=\"./lib/images/external.png\" />' : cycling,\r\n 'Wanderwege <img src=\"./lib/images/external.png\" />' : hiking,\r\n 'Sehenswürdigkeiten <img src=\"./lib/images/wv-logo-12.png\" />' : markers,\r\n 'Reiseziele <img src=\"./lib/images/wv-logo-12.png\" />' : wvarticles,\r\n 'GPX Spuren / Kartenmaske <img src=\"./lib/images/wv-logo-12.png\" />' : tracks\r\n };\r\n }\r\n}", "function baseMapControl() {\n\n //initial basemap toggle value\n var baseName = $('#togGroup input').val();\n\n $('#togGroup input').change(function (e) {\n\n map.removeLayer(tileLayer);\n\n if (baseLabels) {\n map.removeLayer(baseLabels);\n }\n\n baseName = $(this).val();\n console.log(baseName);\n\n tileLayer = L.esri.basemapLayer(baseName);\n tileLayer.addTo(map);\n\n if (baseName != 'Topographic') {\n baseLabels = L.esri.basemapLayer(baseName + 'Labels');\n baseLabels.addTo(map);\n }\n });\n }", "buildMap() {\n let map = this.make.tilemap({ key: this.key + 'map' });\n let tileset = map.addTilesetImage('tileset', this.key + 'tiles');\n this.mapData = {\n map: map,\n tileset: tileset,\n groundLayer: map.createLayer('ground', tileset),\n wallLayer: map.createLayer('walls', tileset),\n objectsLayer: map.createLayer('objetos', tileset),\n }\n\n this.mapData.wallLayer.setCollisionByProperty({ collides: true });\n this.mapData.objectsLayer.setCollisionByProperty({ collides: true });\n }", "appendToParentMap(parent_id){\n var self = this;\n \n // Need to Consider Changing this\n if(!reg_flag.exists()){\n reg_flag.create();\n self.selected_state_id = parent_id;\n self.selected_state = d3.select(\"#\"+self.selected_state_id.replace(/ /g, \"-\"));\n self.selected_state_data = self.selected_state.data()['0']; \n }\n \n // Set SVG handle\n self.svg = d3.select(\"svg.states-svg\")\n .call(self.zoom);\n \n // Set g handle\n self.countriesGroup = d3.select(\"g.states\");\n \n // Make State map fade out, add congressional paths & and borders\n self.svg\n .transition()\n .style(\"opacity\", \"0\")\n .on(\"end\", function(){\n \n self.countriesGroup.selectAll(\"path\").remove();\n self.svg.select(\"path.state-borders\").remove();\n self.svg.select(\"path.state-senate-borders\").remove();\n self.generateMapPaths(self.map_file_name)\n\t\t\t\t.then(function(){ \n self.svg.style(\"opacity\", \"1\");\n self.ui.setStateInfo(self.selected_state_id);\n self.ui.applyUI();\n\t\t\t\t\t\n });\n });\n \n \n \n }", "function makeMap() {\n\n tjb.slideCounter=0;\n\n d3.selectAll( \".masks\" ).remove();\n d3.selectAll( \".histo\" ).remove();\n\n $( \".scroll\" ).addClass( \"disabled\" ).removeClass( \"enabled\" );\n $( \".scroll.counter\" ).css( \"opacity\" , 0.0 );\n\n d3.select(\"#highlight\").style(\"visibility\" , \"visible\");\n\n // hide depth axis and profile\n g.selectAll(\".depth.axis\").style(\"opacity\" , 0.0);\n\n g.selectAll(\".barcode.annotations\")\n .transition()\n .duration(1000)\n .style(\"opacity\" , 0.0)\n .style('pointer-events', \"none\");\n\n g.selectAll(\".barcode.axis\")\n .transition()\n .duration(1000)\n .style(\"opacity\" , 0.0)\n .style('pointer-events', \"none\");\n\n g.selectAll(\".eventInfo\")\n .transition()\n .duration(1000)\n .style(\"opacity\" , 0.0)\n .style('pointer-events', \"none\");\n\n if( ti>li ){\n\n tjb.resize = false;\n\n d3.selectAll( \".histo\" ).remove();\n d3.selectAll( \".world.country\" ).remove();\n d3.selectAll( \".boundaries\" ).remove();\n redraw();\n\n setTimeout(function(){\n\n faultLegend\n .transition()\n .duration(2500)\n .style(\"opacity\" , 1.0);\n\n g.selectAll( \".barcode.g\" )\n .transition()\n .duration(2500)\n .attr(\"transform\" , function(){\n if( tjb.mediaType==\"mobile\" ){ return \"translate(\" + (0) + \",\" + (((tjb.height*0.25))) + \")\"; }\n if( tjb.mediaType==\"tablet\" ){ return \"translate(\" + (margin.left) + \",\" + (0) + \")\"; }\n if( tjb.mediaType==\"desktop\" ){ return \"translate(\" + (margin.left) + \",\" + (0) + \")\"; }\n })\n .style('pointer-events', \"auto\");\n\n }, 1000);\n\n setTimeout(function(){\n\n d3.selectAll(\".country\")\n .transition()\n .duration(2500)\n .style(\"opacity\", 0.33);\n\n d3.selectAll(\".boundaries\")\n .transition()\n .duration(3000)\n .style(\"opacity\",1.0);\n\n magnitudeLegend\n .transition()\n .duration(2500)\n .style(\"opacity\" , 1.0);\n\n }, 4000);\n }\n if( ti<li ){\n\n g.selectAll(\".eventInformation\").style(\"opacity\" , 0.0)\n\n setTimeout(function(){\n\n earthquakes.forEach(function(d,i){\n\n g.selectAll(\".epicentres.b\" + d.FID)\n .transition()\n .duration(2500)\n .attr(\"cx\", function(d,i){ return projection([+d.longitude,+d.latitude])[0]-margin.left; })\n .attr(\"cy\", function(d,i){ return projection([+d.longitude,+d.latitude])[1]; })\n .style(\"stroke-opacity\", function(d,i){\n if( tjb.highlight==false ){ return 1.00; }\n else{\n if( d.mag<8.0 ){ return 0.0; }\n else{ return 1.00; }\n }\n })\n .style(\"fill-opacity\", function(d,i){\n if( tjb.highlight==false ){ return 0.66; }\n else{\n if( d.mag<8.0 ){ return 0.0; }\n else{ return 0.66; }\n }\n })\n .style(\"opacity\", 1.00 )\n .style(\"stroke-width\" , \"1.5px\")\n .style('pointer-events', \"auto\");\n })\n }, 1500);\n\n setTimeout(function(){\n\n d3.selectAll(\".country\")\n .transition()\n .duration(2500)\n .attr( \"transform\" , \"translate(0,0) scale(1)\")\n .style(\"opacity\", 0.33);\n\n d3.selectAll(\".boundaries\")\n .transition()\n .duration(3000)\n .attr( \"transform\" , \"translate(0,0) scale(1)\")\n .style(\"opacity\",0.5);\n\n d3.selectAll(\".plates\")\n .transition()\n .duration(3000)\n .attr( \"transform\" , \"translate(0,0) scale(1)\")\n .style(\"opacity\",0.5);\n\n }, 3500);\n\n }\n\n setTimeout(function(){\n \n $( \".scroll\" ).addClass( \"disabled\" ).removeClass( \"enabled\" );\n $( \".scroll.up\" ).addClass( \"enabled\" ).removeClass( \"disabled\" );\n $( \".scroll.down\" ).addClass( \"enabled\" ).removeClass( \"disabled\" );\n $( \".scroll.counter\" ).css( \"opacity\" , 0.0 );\n\n },6500);\n\n return;\n\n }", "function createMap() {\r\n var map = L.map('map').setView([39.33, -104.93], 8);\r\n var layer = L.esri.Vector.basemap('Newspaper').addTo(map);\r\n L.control.scale({metric:false, position: 'bottomright'}).addTo(map);\r\n $('#basemaps').val('Newspaper');\r\n \r\n function setBasemap(basemap) {\r\n if (layer) {\r\n map.removeLayer(layer);\r\n }\r\n\r\n layer = L.esri.Vector.basemap(basemap);\r\n map.addLayer(layer);\r\n }\r\n \r\n document\r\n .querySelector('#basemaps')\r\n .addEventListener('change', function (e) {\r\n var basemap = e.target.value;\r\n setBasemap(basemap);\r\n });\r\n \r\n htmlControlToLeafletControl(map);\r\n getData(map);\r\n}", "async _makeOpenSearchDashboardsMap() {\n const options = {};\n const uiState = this.vis.getUiState();\n const zoomFromUiState = parseInt(uiState.get('mapZoom'));\n const centerFromUIState = uiState.get('mapCenter');\n options.zoom = !isNaN(zoomFromUiState) ? zoomFromUiState : this.vis.params.mapZoom;\n options.center = centerFromUIState ? centerFromUIState : this.vis.params.mapCenter;\n\n const modules = await lazyLoadMapsLegacyModules();\n this._opensearchDashboardsMap = new modules.OpenSearchDashboardsMap(this._container, options);\n this._opensearchDashboardsMap.setMinZoom(WMS_MINZOOM); //use a default\n this._opensearchDashboardsMap.setMaxZoom(WMS_MAXZOOM); //use a default\n\n this._opensearchDashboardsMap.addLegendControl();\n this._opensearchDashboardsMap.addFitControl();\n this._opensearchDashboardsMap.persistUiStateForVisualization(this.vis);\n\n this._opensearchDashboardsMap.on('baseLayer:loaded', () => {\n this._baseLayerDirty = false;\n });\n this._opensearchDashboardsMap.on('baseLayer:loading', () => {\n this._baseLayerDirty = true;\n });\n await this._updateBaseLayer();\n }", "function updateBaseMap0() {\n //alert(mapID);\n if (dom.byId(\"blayerS\" + mapID).checked) {\n roeMapCarbon.setBasemap(currentObject.config.baseMap[0]);\n } else {\n roeMapCarbon.setBasemap(currentObject.config.baseMap[1]);\n }\n }", "function creaseMap() {\r\r\t// This will change to user values, just use defaults for now\r\tvar GREENDIR = -90;\r\tvar REDDIR = 0;\r\tvar EMBHEIGHT = 3;\r\tvar EMBAMT = 100;\r\t\r\t//get current doc, modify or set for output\r\tvar originalDoc = app.activeDocument;\r\t\r\t// check the dimensions of our current doc\r\tvar originalWidth = originalDoc.width;\r\tvar originalHeight = originalDoc.height;\r\t\r\tvar fixedDoc = app.documents.add(originalDoc.width, originalDoc.height, 72, \"newDoc\", NewDocumentMode.RGB, DocumentFill.TRANSPARENT);\r\r\tapp.activeDocument = originalDoc;\r\tvar savedActiveChannels = originalDoc.activeChannels;\r\tvar myChannels = originalDoc.channels\r\t\r\t//Go through all the channels, activating one at a time and copying to new document\r\tfor (var channelIndex = 0; channelIndex < myChannels.length; channelIndex++) {\r\t\t//make channel visible, \r\t\tmyChannels[channelIndex].visible= true\r\t\tvar aChannelArray = new Array();\r\t\taChannelArray[0] = myChannels[channelIndex];\r\t\toriginalDoc.activeChannels = aChannelArray;\r\r\t\t// turn off all the other channels\r\t\tfor (var secondaryIndex = 0; secondaryIndex < myChannels.length;\r\t\tsecondaryIndex++) {\r\t\t\tif (channelIndex != secondaryIndex) {\r\t\t\t\tmyChannels[secondaryIndex].visible= false\r\t\t\t}\r\t\t}\r\t\t// copy red and green channels to new doc, emboss based on channel name, config\r\t\tif (myChannels[channelIndex].name == \"Red\" || myChannels[channelIndex].name == \"Green\") {\r\t\t\toriginalDoc.selection.selectAll();\r\t\t\toriginalDoc.selection.copy();\r\t\t\tapp.activeDocument = fixedDoc;\r\t\t\tfixedDoc.selection.selectAll();\r\t\t\tnewLayer = fixedDoc.paste();\r\t\t\tnewLayer.name = myChannels[channelIndex].name;\r\t\t\tif (myChannels[channelIndex].name == \"Green\") {\r\t\t\t\temboss(GREENDIR, EMBHEIGHT, EMBAMT);\r\t\t\t\tnewLayer.blendMode = BlendMode.OVERLAY;\r\t\t\t}\r\t\t\t\r\t\t\tif (myChannels[channelIndex].name == \"Red\" ){\r\t\t\t\temboss(REDDIR, EMBHEIGHT, EMBAMT);\r\t\t\t}\r\t\t\tapp.activeDocument = originalDoc;\r\t\t}\r\t}\r\t// Flatten new few and rename remaining layer to CreaseMap\r\tapp.activeDocument = fixedDoc;\r\tfixedDoc.mergeVisibleLayers();\r\tfixedDoc.activeLayer.name = \"CreaswMap\";\r\tapp.activeDocument = originalDoc;\r\toriginalDoc.activeChannels = savedActiveChannels;\r\r}", "_generateMap() {\n // Generate all the empty tiles\n var width = this.display.getOptions().width;\n var height = this.display.getOptions().height;\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n let tile = new Tile(\"empty\", x, y);\n let key = tile.getPositionKey();\n this.map[key] = tile;\n }\n }\n\n // Next, use celluar automata to lay down the first layer of resources\n // but make sure they meet the minimum bar\n var sumIronTiles = 0;\n while (sumIronTiles <= config.map.resources.iron.minTiles) {\n var ironMap = new ROT.Map.Cellular(width, height, { connected: true});\n // % chance to be iron\n ironMap.randomize(config.map.resources.iron.baseChance);\n // iterations smooth out and connect live tiles\n for (let i = 0; i < config.map.resources.iron.generations; i++) {\n ironMap.create();\n }\n // Check to ensure that we have a minimum number of iron tiles\n sumIronTiles = ironMap._map.flat().reduce(doSum, 0);\n }\n\n // Go through the map and change the tiles we touch to type \"iron\"\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n if (ironMap._map[x][y] == 1) {\n let key = `${x},${y}`\n let tile = this.map[key];\n let resourceAmount = this._calculateResourceAmount(x, y, ironMap._map, \"iron\");\n tile.addResources(\"iron\", resourceAmount);\n }\n }\n }\n\n // Same for coal\n var sumCoalTiles = 0;\n while (sumCoalTiles <= config.map.resources.coal.minTiles) {\n var coalMap = new ROT.Map.Cellular(width, height, { connected: true });\n coalMap.randomize(config.map.resources.coal.baseChance);\n for (let i = 0; i< config.map.resources.coal.generations; i++) {\n coalMap.create();\n }\n sumCoalTiles = coalMap._map.flat().reduce(doSum, 0);\n }\n\n // Change tiles to \"coal\", but only if they're empty!\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n if (coalMap._map[x][y] == 1) {\n let key = `${x},${y}`\n let tile = this.map[key];\n if (tile.tileType == \"empty\") {\n let resourceAmount = this._calculateResourceAmount(x, y, coalMap._map, \"coal\");\n tile.addResources(\"coal\", resourceAmount);\n }\n }\n }\n }\n\n // Same for copper\n var sumCopperTiles = 0;\n while (sumCopperTiles <= config.map.resources.copper.minTiles) {\n var copperMap = new ROT.Map.Cellular(width, height, { connected: true });\n copperMap.randomize(config.map.resources.copper.baseChance);\n for (let i = 0; i< config.map.resources.copper.generations; i++) {\n copperMap.create();\n }\n sumCopperTiles = copperMap._map.flat().reduce(doSum, 0);\n }\n\n // Change tiles to \"copper\", but only if they're empty!\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n if (copperMap._map[x][y] == 1) {\n let key = `${x},${y}`\n let tile = this.map[key];\n if (tile.tileType == \"empty\") {\n let resourceAmount = this._calculateResourceAmount(x, y, copperMap._map, \"copper\");\n tile.addResources(\"copper\", resourceAmount);\n }\n }\n }\n }\n }", "function updateBaseMap0() {\n //alert(mapID);\n if (dom.byId(\"blayerS\" + mapID).checked) {\n roeMapAbsSea.setBasemap(currentObject.config.baseMap[0]);\n } else {\n roeMapAbsSea.setBasemap(currentObject.config.baseMap[1]);\n }\n }", "function bigmap(){\n var allowedExtensions = [\".JPG\", \".PNG\", \".TIFF\", \".TIF\", \".SVG\", \".JPEG\", \".BMP\" ];\n\n var mousePosition = {x : 0, y : 0 }\n var map = document.getElementById('sampleImage');\n\n // canvas: what's being shown right now\n var canvas = document.getElementById('viewport');\n var context = canvas.getContext('2d');\n\n // mapCanvas: behind the scenes canvas which holdes the complete image + drawings + etc\n var mapCanvas = document.createElement('canvas');\n var mapContext = mapCanvas.getContext('2d');\n\n marker = { image : document.getElementById('marker'), displayed : false, x : 0, y : 0 };\n var undrawnSegments = [];\n\n IconEnum = {\n PENCIL : 0,\n ADD_IMAGE : 1,\n SAVE_IMAGE : 2\n }\n\n /* The camera defines what is seen. Everything that will be drawn needs to be canged toCameraCoords.\n context.translate() is also an option but other operations are less intuitive in my opinion.\n */\n var camera = { x : 0, y : 0}\n function toCameraX(x){\n return x - camera.x;\n }\n\n function toCameraY(y){\n return y - camera.y;\n }\n\n function fromCameraX(x){\n return x + camera.x;\n }\n\n function fromCameraY(y){\n return y + camera.y;\n }\n\n canvas.onmousedown = function(event){\n captureMousePosition(event);\n mouseDown = true;\n mousePressed();\n }\n\n function mousePressed(){\n if (state == StateEnum.PLACING_MARKER){\n state = StateEnum.DRAGGING;\n }else if (state == StateEnum.DRAWING_MODE){\n state = StateEnum.DRAWING;\n }\n }\n\n canvas.onmouseup = canvasMouseUp;\n\n canvas.onclick = function(event){\n captureMousePosition(event);\n click();\n }\n\n function click(){\n /*\n switch (state){\n case StateEnum.ADDING_IMAGE:\n addedImageCanvas.position = {x : mousePosition.x - addedImage.width / 2, y : mousePosition.y - addedImage.height / 2};\n addedImageCanvas.width = addedImage.width;\n addedImageCanvas.height = addedImage.height;\n addedImageContext.drawImage(addedImage, 0, 0);\n state = StateEnum.INITIAL;\n\n showHideIcon(IconEnum.ADD_IMAGE, false);\n showHideIcon(IconEnum.PENCIL, true);\n showHideIcon(IconEnum.SAVE_IMAGE, true);\n break;\n }\n */\n }\n\n function canvasMouseUp(event){\n captureMousePosition(event);\n mouseDown = false;\n mouseUp();\n }\n\n function mouseUp(){\n switch (state){\n case StateEnum.DRAGGING:\n state = StateEnum.PLACING_MARKER;\n break;\n case StateEnum.DRAWING:\n state = StateEnum.DRAWING_MODE;\n break;\n }\n }\n\n document.onmousemove = function(event){\n if (!touch){\n var previousMouseX = mousePosition.x;\n var previousMouseY = mousePosition.y;\n var deltaX = event.clientX - mousePosition.x;\n var deltaY = event.clientY - mousePosition.y;\n captureMousePosition(event);\n\n moveCursor(previousMouseX, previousMouseY, deltaX, deltaY);\n }\n }\n\n function moveCursor(previousMouseX, previousMouseY, deltaX, deltaY){\n switch (state){\n case StateEnum.DRAGGING:\n camera.x -= deltaX;\n camera.y -= deltaY;\n constraintCamera();\n break;\n case StateEnum.DRAWING:\n undrawnSegments.push({ fromx : previousMouseX, fromy : previousMouseY, tox : mousePosition.x, toy : mousePosition.y });\n break;\n }\n }\n\n function constraintCamera(){\n camera.x = clamp(camera.x, 0, map.width - canvas.width);\n camera.y = clamp(camera.y, 0, map.height - canvas.height);\n }\n\n function captureMousePosition(event){\n mousePosition.x = event.clientX;\n mousePosition.y = event.clientY;\n }\n\n function captureMousePositionTouch(event){\n event = event || window.event;\n mousePosition.x = event.touches[0].clientX;\n mousePosition.y = event.touches[0].clientY;\n }\n\n function captureMousePositionTouchMove(event){\n mousePosition.x = event.changedTouches[0].clientX;\n mousePosition.y = event.changedTouches[0].clientY;\n }\n\n function clamp(value, min, max){\n return Math.max(Math.min(value,max),min);\n }\n\n $(canvas).on('doubletap',function(event){\n captureMousePosition(event);\n\n doubleClick();\n });\n\n function doubleClick(){\n if (state == StateEnum.PLACING_MARKER || state == StateEnum.DRAGGING){\n marker.displayed = true;\n marker.x = mousePosition.x + camera.x;\n marker.y = mousePosition.y + camera.y;\n\n var imageElement = document.getElementById('sampleImage');\n var width = imageElement.naturalWidth;\n var height = imageElement.naturalHeight;\n\n var xPer = (marker.x / width ) * 100;\n var yPer = (marker.y / height) * 100;\n\n console.log('X%: '+ xPer);\n console.log('Y%: '+ yPer);\n\n showHideIcon(IconEnum.SAVE_IMAGE, true);\n }\n }\n\n canvas.ondblclick = function(event){\n captureMousePosition(event);\n\n doubleClick();\n }\n\n var touch = false;\n\n document.ontouchstart = function(event){\n touch = true;\n captureMousePositionTouch(event);\n mousePressed();\n }\n\n document.ontouchmove = function(event){\n event = event || window.event;\n var previousMouseX = mousePosition.x;\n var previousMouseY = mousePosition.y;\n captureMousePositionTouchMove(event);\n var deltaX = mousePosition.x - previousMouseX;\n var deltaY = mousePosition.y - previousMouseY;\n moveCursor(previousMouseX, previousMouseY, deltaX, deltaY);\n }\n\n document.ontouchend = function(event){\n captureMousePosition(event);\n mouseDown = false;\n mouseUp();\n }\n\n // file upload pluggin. Let's me grab an image by drag and drop and work with it clientside\n $('#importImage').fileupload({\n add: function(e, data){\n var imageReady = false;\n var file = data.files[0];\n var fileReader = new FileReader();\n fileReader.readAsDataURL(file);\n\n // read the file contents from disk\n fileReader.onloadend = function(){\n\n var fname = file.name;\n var extension = \"\";\n var extensionS = \"\";\n if (fname.includes(\".\")){ // Remove extension of file (if exists)\n extensionS = fname.substring(fname.lastIndexOf(\".\"));\n extension = extensionS.toUpperCase();\n }\n\n // if the extension is not allowed\n if (extension == \"\" || allowedExtensions.indexOf(extension) == -1){\n // fail silently.\n return;\n }\n\n var dataURL = fileReader.result;\n addedImage = document.createElement('img');\n addedImage.src = dataURL;\n\n state = StateEnum.ADDING_IMAGE;\n\n addedImage.onload = function(){\n var imageProportions = resizeImage(addedImage, canvas.width, canvas.height);\n\n addedImageCanvas.position = {x : canvas.width / 2 - imageProportions.width / 2, y : canvas.height / 2 - imageProportions.height / 2};\n addedImageCanvas.width = imageProportions.width;\n addedImageCanvas.height = imageProportions.height;\n addedImageContext.drawImage(addedImage, 0, 0, imageProportions.width, imageProportions.height);\n state = StateEnum.INITIAL;\n\n showHideIcon(IconEnum.ADD_IMAGE, false);\n showHideIcon(IconEnum.PENCIL, true);\n showHideIcon(IconEnum.SAVE_IMAGE, true);\n }\n }\n }\n });\n\n function drawMapCanvas(){\n mapCanvas.width = map.width;\n mapCanvas.height = map.height;\n mapContext.drawImage(map, 0, 0);\n }\n\n $(document).ready(function(){\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n\n\n function main(){\n update();\n draw();\n requestAnimationFrame(main);\n }\n\n function update(){\n\n }\n\n function draw(){\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n\n if (addedImage && state != StateEnum.ADDING_IMAGE){\n addedImageContext.strokeStyle = \"red\";\n addedImageContext.lineWidth = 2;\n addedImageContext.beginPath();\n for (var i = 0; i < undrawnSegments.length; i++){\n var segment = undrawnSegments[i];\n var segmentFromX = fromCameraX(segment.fromx) - toCameraX(addedImageCanvas.position.x);\n var segmentFromY = fromCameraY(segment.fromy) - toCameraY(addedImageCanvas.position.y);\n var segmentToX = fromCameraX(segment.tox) - toCameraX(addedImageCanvas.position.x);\n var segmentToY = fromCameraY(segment.toy) - toCameraY(addedImageCanvas.position.y);\n addedImageContext.moveTo(segmentFromX, segmentFromY);\n addedImageContext.lineTo(segmentToX, segmentToY);\n }\n addedImageContext.stroke();\n }\n undrawnSegments = [];\n\n\n switch (state){\n case StateEnum.ADDING_IMAGE:\n context.save();\n context.globalAlpha = 0.2;\n context.drawImage(addedImage, mousePosition.x - addedImage.width / 2, mousePosition.y - addedImage.height / 2);\n context.restore();\n break;\n case StateEnum.PLACING_MARKER:\n case StateEnum.DRAGGING:\n context.drawImage(map, toCameraX(0), toCameraY(0));\n if (marker.displayed){\n context.drawImage(marker.image, toCameraX(marker.x) - marker.image.width / 2, toCameraY(marker.y) - marker.image.height);\n }\n break;\n default:\n if (addedImage){\n context.drawImage(addedImageCanvas, toCameraX(addedImageCanvas.position.x), toCameraY(addedImageCanvas.position.y));\n }\n break;\n }\n }\n\n requestAnimationFrame(main);\n\n /*\n $(\"#takephoto\").click(function() {\n // take snapshot and get image data\n Webcam.snap( function(data_uri) {\n // display results in page\n //document.getElementById('results').innerHTML = '<img width=\"400\" height=\"240\" src=\"'+data_uri+'\"/>';\n make_base(data_uri);\n } );\n\n function make_base(data_uri){\n init();\n $( \"#viewport\" ).css('display','block');\n console.log(\"FOOOD\");\n base_image = new Image();\n base_image.src = data_uri;\n base_image.onload = function(){\n //context.drawImage(base_image, 0, 0, 400, 320);\n ctx.drawImage(base_image, 0, 0);\n }\n }\n */\n });\n\n function resizeImage(selectedImage, maxWidth, maxHeight){\n var resize = { width : 0, height: 0 };\n if (maxWidth > selectedImage.width && maxHeight > selectedImage.height){\n resize.width = selectedImage.width;\n resize.height = selectedImage.height;\n }else if (maxWidth < selectedImage.width && maxHeight > selectedImage.height){\n resize.height = selectedImage.height * maxWidth / selectedImage.width;\n resize.width = maxWidth;\n }else if (maxWidth > selectedImage.width && maxHeight < selectedImage.height){\n resize.width = selectedImage.width * maxHeight / selectedImage.height;\n resize.height = maxHeight;\n }else{\n // neither width or height are sufficient\n if ((selectedImage.width / maxWidth) > (selectedImage.height / maxHeight)){\n // width drives\n resize.width = maxWidth;\n resize.height = selectedImage.height * maxWidth / selectedImage.width;\n }else{\n resize.width = selectedImage.width * maxHeight / selectedImage.height;\n resize.height = maxHeight;\n }\n }\n return resize;\n }\n\n /*\n $(\"#retakephoto\").click(function() {\n\n $( \"#viewport\" ).css('display','none');\n\n });\n */\n\n /*\n var flag = false,\n prevX = 0,\n currX = 0,\n prevY = 0,\n currY = 0,\n dot_flag = false;\n\n var x = \"black\",\n y = 2;\n\n function init() {\n console.log(\"DRRRRRAW\");\n // canvas = document.getElementById('viewport');\n // ctx = canvas.getContext(\"2d\");\n w = canvas.width;\n h = canvas.height;\n\n canvas.addEventListener(\"mousemove\", function (e) {\n findxy('move', e)\n }, false);\n canvas.addEventListener(\"mousedown\", function (e) {\n findxy('down', e)\n }, false);\n canvas.addEventListener(\"mouseup\", function (e) {\n findxy('up', e)\n }, false);\n canvas.addEventListener(\"mouseout\", function (e) {\n findxy('out', e)\n }, false);\n }\n\n function color(obj) {\n switch (obj.id) {\n case \"green\":\n x = \"green\";\n break;\n case \"blue\":\n x = \"blue\";\n break;\n case \"red\":\n x = \"red\";\n break;\n case \"yellow\":\n x = \"yellow\";\n break;\n case \"orange\":\n x = \"orange\";\n break;\n case \"black\":\n x = \"black\";\n break;\n case \"white\":\n x = \"white\";\n break;\n }\n if (x == \"white\") y = 14;\n else y = 2;\n\n }\n\n function draw() {\n ctx.beginPath();\n ctx.moveTo(prevX, prevY);\n ctx.lineTo(currX, currY);\n ctx.strokeStyle = x;\n ctx.lineWidth = y;\n ctx.stroke();\n ctx.closePath();\n }\n\n function erase() {\n var m = confirm(\"Want to clear\");\n if (m) {\n ctx.clearRect(0, 0, w, h);\n document.getElementById(\"canvasimg\").style.display = \"none\";\n }\n }\n\n function save() {\n document.getElementById(\"canvasimg\").style.border = \"2px solid\";\n var dataURL = canvas.toDataURL();\n document.getElementById(\"canvasimg\").src = dataURL;\n document.getElementById(\"canvasimg\").style.display = \"inline\";\n }\n\n function findxy(res, e) {\n if (res == 'down') {\n prevX = currX;\n prevY = currY;\n currX = e.clientX - canvas.offsetLeft;\n currY = e.clientY - canvas.offsetTop;\n\n flag = true;\n dot_flag = true;\n if (dot_flag) {\n ctx.beginPath();\n ctx.fillStyle = x;\n ctx.fillRect(currX, currY, 2, 2);\n ctx.closePath();\n dot_flag = false;\n }\n }\n if (res == 'up' || res == \"out\") {\n flag = false;\n }\n if (res == 'move') {\n if (flag) {\n prevX = currX;\n prevY = currY;\n currX = e.clientX - canvas.offsetLeft;\n currY = e.clientY - canvas.offsetTop;\n draw();\n }\n }\n }\n\n\n\n });\n\n\n */\n\n\n\n // var canvas = document.getElementsByTagName('canvas')[0];\n\n // // canvas.width = window.innerWidth;\n // // canvas.height = window.innerHeight;\n\n // canvas.width = 1017;\n // canvas.height = 643;\n\n // var gkhead = new Image;\n\n // window.onload = function(){\n\n // var ctx = canvas.getContext('2d');\n // trackTransforms(ctx);\n\n // function redraw(){\n\n // // Clear the entire canvas\n // var p1 = ctx.transformedPoint(0,0);\n // var p2 = ctx.transformedPoint(canvas.width,canvas.height);\n // ctx.clearRect(p1.x,p1.y,p2.x-p1.x,p2.y-p1.y);\n\n // ctx.save();\n // ctx.setTransform(1,0,0,1,0,0);\n // ctx.clearRect(0,0,canvas.width,canvas.height);\n // ctx.restore();\n\n // ctx.drawImage(gkhead,0,0);\n\n // }\n // redraw();\n\n // var lastX=canvas.width/2, lastY=canvas.height/2;\n\n // var dragStart,dragged;\n\n // canvas.addEventListener('touchstart',function(evt){\n // document.body.style.mozUserSelect = document.body.style.webkitUserSelect = document.body.style.userSelect = 'none';\n // lastX = evt.offsetX || (evt.pageX - canvas.offsetLeft);\n // lastY = evt.offsetY || (evt.pageY - canvas.offsetTop);\n // dragStart = ctx.transformedPoint(lastX,lastY);\n // dragged = false;\n // },false);\n\n // canvas.addEventListener('touchmove',function(evt){\n // lastX = evt.offsetX || (evt.pageX - canvas.offsetLeft);\n // lastY = evt.offsetY || (evt.pageY - canvas.offsetTop);\n // dragged = true;\n // if (dragStart){\n // var pt = ctx.transformedPoint(lastX,lastY);\n // ctx.translate(pt.x-dragStart.x,pt.y-dragStart.y);\n // redraw();\n // }\n // },false);\n\n // canvas.addEventListener('touchend',function(evt){\n // dragStart = null;\n // if (!dragged) zoom(evt.shiftKey ? -1 : 1 );\n // },false);\n\n // var scaleFactor = 1.1;\n\n // var zoom = function(clicks){\n // var pt = ctx.transformedPoint(lastX,lastY);\n // ctx.translate(pt.x,pt.y);\n // var factor = Math.pow(scaleFactor,clicks);\n // ctx.scale(factor,factor);\n // ctx.translate(-pt.x,-pt.y);\n // redraw();\n // }\n\n // var handleScroll = function(evt){\n // var delta = evt.wheelDelta ? evt.wheelDelta/40 : evt.detail ? -evt.detail : 0;\n // if (delta) zoom(delta);\n // return evt.preventDefault() && false;\n // };\n\n // canvas.addEventListener('DOMMouseScroll',handleScroll,false);\n // canvas.addEventListener('mousewheel',handleScroll,false);\n // };\n\n // gkhead.src = 'http://farmlandmedia.com/oxrpts/img/floorplan.jpg';\n\n // // Adds ctx.getTransform() - returns an SVGMatrix\n // // Adds ctx.transformedPoint(x,y) - returns an SVGPoint\n // function trackTransforms(ctx){\n // var svg = document.createElementNS(\"http://www.w3.org/2000/svg\",'svg');\n // var xform = svg.createSVGMatrix();\n // ctx.getTransform = function(){ return xform; };\n\n // var savedTransforms = [];\n // var save = ctx.save;\n // ctx.save = function(){\n // savedTransforms.push(xform.translate(0,0));\n // return save.call(ctx);\n // };\n\n // var restore = ctx.restore;\n // ctx.restore = function(){\n // xform = savedTransforms.pop();\n // return restore.call(ctx);\n // };\n\n // var scale = ctx.scale;\n // ctx.scale = function(sx,sy){\n // xform = xform.scaleNonUniform(sx,sy);\n // return scale.call(ctx,sx,sy);\n // };\n\n // var rotate = ctx.rotate;\n // ctx.rotate = function(radians){\n // xform = xform.rotate(radians*180/Math.PI);\n // return rotate.call(ctx,radians);\n // };\n\n // var translate = ctx.translate;\n // ctx.translate = function(dx,dy){\n // xform = xform.translate(dx,dy);\n // return translate.call(ctx,dx,dy);\n // };\n\n // var transform = ctx.transform;\n // ctx.transform = function(a,b,c,d,e,f){\n // var m2 = svg.createSVGMatrix();\n // m2.a=a; m2.b=b; m2.c=c; m2.d=d; m2.e=e; m2.f=f;\n // xform = xform.multiply(m2);\n // return transform.call(ctx,a,b,c,d,e,f);\n // };\n\n // var setTransform = ctx.setTransform;\n // ctx.setTransform = function(a,b,c,d,e,f){\n // xform.a = a;\n // xform.b = b;\n // xform.c = c;\n // xform.d = d;\n // xform.e = e;\n // xform.f = f;\n // return setTransform.call(ctx,a,b,c,d,e,f);\n // };\n\n // var pt = svg.createSVGPoint();\n // ctx.transformedPoint = function(x,y){\n // pt.x=x; pt.y=y;\n // return pt.matrixTransform(xform.inverse());\n // }\n // }\n}", "function setComponents() {\n if (_options.mapDivId) {\n var map = _config.getMap();\n if (map) {\n // Register listener for maximum and minimum zoom levels.\n map.events.on({\n zoomend : zoomEndListener\n });\n // Render map to its position.\n map.render(_options.mapDivId);\n var layers = _config.getLayers();\n if (layers) {\n setLayers(map, layers);\n // Create legend and controller asynchronously to make sure\n // proper information is used immediately after layers are\n // included into map above.\n setTimeout(function() {\n // Set legend synchronously before creating controller below.\n // Then, controller can be created with proper width.\n setLegend();\n // Notice, slider controller needs to be created before\n // animation layers trigger events. Then, layer event callbacks\n // have always target elements in controller. Controller is\n // created asynchronously here with zero timeout. Layers are\n // included into the map below synchronously but animation\n // triggers events asynchronously. Therefore, asynchronously\n // started synchronous operations for legend and controller\n // are finished before layer events are triggered.\n createController();\n // Set listeners to update legend according to animation layer events.\n setAnimationLegendEventListener(layers);\n setupSwitcher(map, _options.layerSwitcherDivId, _options.maximizeSwitcher);\n }, 0);\n }\n // Zoom the map after layers have been inserted.\n // Map center refresh value is used if it is available.\n var mapCenter = _refreshDefaultCenter || map.getCenter();\n if (!mapCenter) {\n // Map may not have center available even if it has been defined in config.\n // Then, calculate center from the maximum extent to make sure map can be shown.\n mapCenter = map.getMaxExtent().getCenterLonLat();\n }\n map.setCenter(mapCenter, undefined === _refreshDefaultZoomLevel ? _config.getDefaultZoomLevel() : _refreshDefaultZoomLevel);\n }\n }\n }", "function updateBaseMap0() {\n //alert(mapID);\n if (dom.byId(\"blayerS\" + mapID).checked) {\n roeMapTemp.setBasemap(currentObject.config.baseMap[0]);\n } else {\n roeMapTemp.setBasemap(currentObject.config.baseMap[1]);\n }\n }", "_updateMap() {\n const ts = new Date().valueOf();\n this.mapping = true;\n let tickSelected = 0;\n const selCopy = this._copySelections();\n const ticksSelectedCopy = this._getTicksFromSelections();\n const firstSelection = this.getExtremeSelection(-1);\n this._updateModifiers();\n this.selections = [];\n\n // Try to restore selection. If there were none, just select the fist\n // thing in the score\n const keys = Object.keys(this.measureNoteMap);\n if (keys.length && !selCopy.length) {\n // If there is nothing rendered, don't update tracker\n this.selections = [this.measureNoteMap[keys[0]]];\n } else {\n if (!firstSelection) {\n layoutDebug.setTimestamp(layoutDebug.codeRegions.UPDATE_MAP, new Date().valueOf() - ts);\n return;\n }\n this._findClosestSelection(firstSelection.selector);\n const first = this.selections[0];\n tickSelected = first.note.tickCount;\n while (tickSelected < ticksSelectedCopy && first) {\n const delta = this._growSelectionRight(true);\n if (!delta) {\n break;\n }\n tickSelected += delta;\n }\n }\n this.highlightSelection();\n this._createLocalModifiersList();\n // Is this right? Don't update the past buffer with data until the display is redrawn\n // because some of the selections may not exist in the score.\n if (this.renderer.isDirty === false) {\n this.pasteBuffer.clearSelections();\n this.pasteBuffer.setSelections(this.score, this.selections);\n }\n this.mapping = false;\n layoutDebug.setTimestamp(layoutDebug.codeRegions.UPDATE_MAP, new Date().valueOf() - ts);\n }", "addMap() {\n const {createMap} = this.props;\n\n let bounds = {\n north: this.state.bounds.north === '' ? undefined : parseFloat(this.state.bounds.north),\n south: this.state.bounds.south === '' ? undefined : parseFloat(this.state.bounds.south),\n east: this.state.bounds.east === '' ? undefined : parseFloat(this.state.bounds.east),\n west: this.state.bounds.west === '' ? undefined : parseFloat(this.state.bounds.west),\n centerLat: this.state.bounds.centerLat === '' ? undefined : parseFloat(this.state.bounds.centerLat),\n centerLon: this.state.bounds.centerLon === '' ? undefined : parseFloat(this.state.bounds.centerLon),\n range: this.state.bounds.range === '' ? undefined : parseFloat(this.state.bounds.range),\n scale: this.state.bounds.scale === '' ? undefined : parseFloat(this.state.bounds.scale)\n };\n\n let blankBounds = true;\n for (let prop in bounds) {\n if (typeof bounds[prop] !== 'undefined') {\n blankBounds = false;\n break;\n }\n }\n if (blankBounds) {\n bounds = undefined;\n }\n\n createMap(bounds, this.state.engineId === '' ? undefined : this.state.engineId,\n false, this.state.recorder, parseInt(this.state.brightness), parseInt(this.state.midDistanceThreshold),\n parseInt(this.state.farDistanceThreshold));\n }", "afterMapCreation() {\n this.moveBackgroundMap(\n this.currentModel.video.get('longitude'),\n this.currentModel.video.get('latitude'),\n this.currentModel.video.get('preferredZoom')\n );\n }", "function updateBaseMap0() {\n //alert(mapID);\n if (dom.byId(\"blayerS\" + mapID).checked) {\n roeMapSulf.setBasemap(currentObject.config.baseMap[0]);\n } else {\n roeMapSulf.setBasemap(currentObject.config.baseMap[1]);\n }\n }", "function updateBaseMap0() {\n //alert(mapID);\n if (dom.byId(\"blayerS\" + mapID).checked) {\n roeMapEco.setBasemap(currentObject.config.baseMap[0]);\n } else {\n roeMapEco.setBasemap(currentObject.config.baseMap[1]);\n }\n }", "function updateBaseMap0() {\n //alert(mapID);\n if (dom.byId(\"blayerS\" + mapID).checked) {\n roeMapPrecip.setBasemap(currentObject.config.baseMap[0]);\n } else {\n roeMapPrecip.setBasemap(currentObject.config.baseMap[1]);\n }\n }", "function _mapZoomed() {\n _setAllIcons();\n}", "function addLayersOnMap(){\n\n var layers = map.getStyle().layers;\n // Find the index of the first symbol layer in the map style\n var firstSymbolId;\n for (var i = 0; i < layers.length; i++) {\n if (layers[i].type === 'symbol') {\n firstSymbolId = layers[i].id;\n console.log(firstSymbolId);\n break;\n }\n }\n\n // 3d extruded buildings\n // apartments from json\n map.addLayer({\n 'id': 'extrusion',\n 'type': 'fill-extrusion',\n \"source\": {\n \"type\": \"geojson\",\n \"data\": \"https://denyskononenko.github.io/maprebuild/buildigs_appartments.geojson\"\n },\n 'paint': {\n 'fill-extrusion-color': '#696969',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 13,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 13,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': 1.0\n }\n }, firstSymbolId);\n\n // all buildings excepts hospitals and apartments\n map.addLayer({\n 'id': '3d-buildings',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['!=', 'type', 'hospital'], ['!=', 'type' ,'apartments']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#dedede',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .4\n }\n }, firstSymbolId);\n\n // hospitals\n map.addLayer({\n 'id': '3d-buildings-hospitals',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['==', 'type', 'hospital']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#A52A2A',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .2\n }\n }, firstSymbolId);\n\n // universities\n map.addLayer({\n 'id': '3d-buildings-university',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['==', 'type', 'university']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#e6dabc',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .3\n }\n }, firstSymbolId);\n\n // schools\n map.addLayer({\n 'id': '3d-buildings-school',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['==', 'type', 'school']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#e6dabc',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .3\n }\n }, firstSymbolId);\n\n // kindergarten\n map.addLayer({\n 'id': '3d-buildings-kindergarten',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['==', 'type', 'kindergarten']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#e6dabc',\n // use an 'interpolate' expression to add a smooth transition effect to the\n // buildings as the user zooms in\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .3\n }\n }, firstSymbolId);\n\n}", "function updateBaseMap0() {\n //alert(mapID);\n if (dom.byId(\"blayerS\" + mapID).checked) {\n roeMapRel.setBasemap(currentObject.config.baseMap[0]);\n } else {\n roeMapRel.setBasemap(currentObject.config.baseMap[1]);\n }\n }", "function CreateBaseMap() {\n // init OpenLayer map with MapBox tiles\n const map = new Map({\n target: 'MapContainer',\n // interaction: interaction,\n view: new View({\n center: App4Sea.mapCenter,\n zoom: App4Sea.startZoom,\n minZoom: App4Sea.minZoom,\n maxZoom: App4Sea.maxZoom,\n }),\n });\n\n my.Map = map;\n\n my.Map.on('click', (evt) => {\n App4Sea.PopUps.SingleClick(evt);\n });\n\n my.Map.on('not_working', (evt) => {\n App4Sea.Weather.NotWorking(evt);\n });\n }", "function adjustToMyScaleAndLocation() {\n// GET MAP\nvar thisMap = getMap(_menuContentPane.id);\nvar thisMapScale = getMapScale(thisMap);\ndojo.forEach(_maps, function (otherMap) {\n if (otherMap.id !== thisMap.id) {\n\tvar otherMapLevel = getMapLevelByScale(otherMap, thisMapScale);\n\tif (otherMapLevel) {\n\t getCenter(thisMap, otherMap, function (otherCenter) {\n\t\totherMap.centerAndZoom(otherCenter, otherMapLevel);\n\t });\n\t}\n }\n});\n}", "function formASubmap(mongooseObjects, workspace, mapId, name, responsiblePerson, nodesInSubmap, impact) {\n let Node = mongooseObjects.Node;\n let Workspace = mongooseObjects.Workspace;\n\n let positionsAntipaternVariable = null;\n\n return getSubmapPositions(mongooseObjects, nodesInSubmap, impact).then(function(positions){\n positionsAntipaternVariable = positions;\n return createASubmap(mongooseObjects, workspace, mapId, name, responsiblePerson, nodesInSubmap, impact)\n .then(function(submap){\n return {\n positions: positions,\n submap: submap\n };\n });\n })\n .then(function(arg) {\n return createSubmapNode(mongooseObjects, arg, impact, workspace, name, responsiblePerson);\n })\n .then(function(node) {\n let nodeId = getId(node);\n // and the heavy part. get everyone depending on a submap to really depend on it\n return replaceIncomingDependencies(mongooseObjects, nodeId, impact.nodesThatDependOnFutureSubmap, nodesInSubmap).then(function(irrelevantStuff){\n \t let changedMaps = [];\n \t for (let key in positionsAntipaternVariable.visibility) {\n \t if (positionsAntipaternVariable.visibility.hasOwnProperty(key)) {\n \t \tchangedMaps.push(key);\n \t }\n \t }\n \t return changedMaps;\n });\n });\n}", "function demo008(){\n var obj = {\n subObject: {\n subKey: 'subvalue',\n subSubObject: {\n subSubKey: 'subSubValue'\n }\n }\n } ;\n const originalMap = Immutable.fromJS(obj) ;\n const newMap = originalMap.setIn(['subObject','subKey'],'ha ha!') ;\n console.info(newMap.toJS()) ;\n // {subObject:{subKey:'ha ha!', subSubObject:{subSubKey:'subSubValue'}}}\n const newerMap2 = originalMap.setIn(\n ['subObject', 'subSubObject', 'subSubKey'],\n 'ha ha ha!');\n console.info(newerMap2.toJS()) ;\n //// {subObject:{subKey:'subvalue', subSubObject:{subSubKey:'ha ha ha!'}}}\n}", "function updateBaseMap0() {\n //alert(mapID);\n if (dom.byId(\"blayerS\" + mapID).checked) {\n roeMapNLCD.setBasemap(currentObject.config.baseMap[0]);\n } else {\n roeMapNLCD.setBasemap(currentObject.config.baseMap[1]);\n }\n }", "function draw_all_maps() {\n\n\t// deep copy all classification of mapA to all classification of map0\n\tapp.map0classification = $.extend(true, {}, app.mapAclassification);\n\t//console.log('app.map0classification:', app.map0classification)\n\t\n\tvar cc = app.map0classification.color + app.map0classification.count\n\tapp.colorGradient0 = COLOR_CLASS[cc].slice(0, COLOR_CLASS[cc].length); // deep copy\n\n\t// draw titles area\n\tvar map_html = '';\n\tmap_html += '<div>';\n\tmap_html += '\t<div class=\"map_layer\" style=\"height:25px;float:right\" hidden></div>';\n\tmap_html += '\t<div class=\"map_year\" style=\"margin:0px 30px 0px 0px; height:25px;float:both\"></div>';\n\tmap_html += '</div>';\n\tmap_html += '<div>';\n\tmap_html += '\t<div class=\"map_metroInterval\" style=\"height:25px;float:left;clear:both\"></div>';\n\tmap_html += '\t<div class=\"map_sync\" style=\"height:25px;float:right\"></div>';\n\tmap_html += '</div>';\n\tmap_html += '<div class=\"map\"></div>';\n\tfor (var i=0; i<app.m; i++) {\n\t\tvar mapN = \"map\" + i;\n\t\tdocument.getElementById(mapN).innerHTML = map_html;\n\t}\n\t\n\tvar map_html = '';\n\tmap_html += '<div>';\n\tmap_html += '\t<div class=\"map_year\" style=\"margin:0px 100px 0px 0px; height:25px;float:left;\"></div>';\n\tmap_html += '\t<div class=\"map_nPolygon\" style=\"margin:0px 100px 0px 0px; height:25px;float:left;\"></div>';\n\tmap_html += '\t<div class=\"map_fixAxes\" style=\"height:25px;float:left;\"></div>';\n\tmap_html += '</div>';\n\tmap_html += '<br><br>';\n\tmap_html += '<div id=\"_density_chart\" class=\"chart densityPeriod\"></div>';\n\tfor (var i=0; i<app.d; i++) {\n\t\tvar mapD = \"mapD\" + i;\n\t\tvar html = map_html.replace('_density_chart', mapD+'_density_chart');\n\t\tif (app.dYears[i].startsWith('INC')) \n\t\t\thtml = html.replace('class=\"chart densityPeriod\"', 'class=\"chart densityINC\"');\n\t\tdocument.getElementById(mapD).innerHTML = html;\n\t\tif (app.MapWidth.replace('px','') < 500) $(\"#\"+mapD+\" .map_nPolygon\").hide();\n\t}\n\t\n\tif (app.Distribution_INC2_different_cluster) {\n\t\tvar map_html = '';\n\t\tmap_html += '<div>';\n\t\tmap_html += '\t<div class=\"map_year\" style=\"margin:0px 100px 0px 0px; height:25px;float:left;\"></div>';\n\t\tmap_html += '\t<div class=\"map_nPolygon\" style=\"margin:0px 100px 0px 0px; height:25px;float:left;\"></div>';\n\t\tmap_html += '\t<div class=\"map_fixAxes\" style=\"height:25px;float:left;\"></div>';\n\t\tmap_html += '</div>';\n\t\tmap_html += '<br><br>';\n\t\tmap_html += '<div id=\"_density_chart\" class=\"chart densityCluster\"></div>';\n\t\tfor (var i=0; i<app.nClusters; i++) {\n\t\t\tvar graphC = \"graphC\" + i;\n\t\t\tdocument.getElementById(graphC).innerHTML = map_html.replace('_density_chart', graphC+'_density_chart');\n\t\t\tif (app.MapWidth.replace('px','') < 500) $(\"#\"+graphC+\" .map_nPolygon\").hide();\n\t\t}\n\t}\n\t\n\t// change height and width for maps and stacked area chart\n\t$(\"#mapContainer\").css(\"height\", app.MapHeight.replace('px','')*1+100+'px');\n\t$(\".mapArea\").css(\"width\", app.MapWidth);\n\t$(\".mapAreaLast\").css(\"width\", app.ChartWidth);\n\t$(\".map\").css(\"width\", app.MapWidth);\n\t$(\".map\").css(\"height\", app.MapHeight);\n\t$(\".chart\").css(\"width\", app.MapWidth.replace('px','')*1-10+'px');\n\t$(\".chart\").css(\"height\", app.MapHeight.replace('px','')*1-10+'px');\n\t\n\t// draw each base map\n\tfor (var i=0; i<app.m; i++) {\n\t\tvar mapN = \"map\" + i;\n\t\tdraw_basemap(mapN);\n\t}\n\n\t// draw titles of each map\n\tfor (var i=0; i<app.m; i++) {\n\t\tvar mapN = \"map\" + i;\n\t\tdraw_titlemap(mapN, app.mYears[i]);\n\t}\n\t\n\t// draw titles of each density chart\n\tfor (var i=0; i<app.d; i++) {\n\t\tvar mapN = \"mapD\" + i;\n\t\tdraw_titleChart(mapN, app.dYears[i]);\n\t}\n\t\n\t// draw titles of each graph of clusters\n\tfor (var i=0; i<app.nClusters; i++) {\n\t\tvar graphC = \"graphC\" + i;\n\t\tdraw_titleGraphC(graphC, app.gYears[0]);\n\t}\n\t\n\tdraw_globalSelection();\n\n\t// initialize all bounds in app.mapN\n\tfor (var i=0; i<app.m; i++) {\n\t\tvar mapN = \"map\" + i;\n\t\tapp[mapN].bounds = app[mapN].map.getBounds();\n\t\t//console.log(getNow(), mapN, 'app.'+mapN+'.bounds: ', app[mapN].bounds);\n\t}\n\t\n\t// set map bounds using geo bounds in d3 function\n\tvar geoBounds = d3.geoBounds(CA);\n\t\n\tvar fitBounds = L.latLngBounds(L.latLng(geoBounds[0][1], geoBounds[0][0]), \n\t\t\t\t\t\t\t\t L.latLng(geoBounds[1][1], geoBounds[1][0]));\n\t//console.log('fitBounds:', fitBounds);\n\tif (app.m > 0 && app.InitialMapCenter != null && app.InitialMapZoomLevel != null) {\n\t\n\t\t// set bitBounds from InitialMapCenter and InitialMapZoomLevel\n\t\tfitBounds = app[mapN].bounds;\n\t\tvar mapBounds = app[mapN].map.getBounds();\n\t\tvar west = mapBounds.getWest();\n\t\tvar south = mapBounds.getSouth();\n\t\tvar east = mapBounds.getEast();\n\t\tvar north = mapBounds.getNorth();\n\t\tvar featureMapBounds = {type: \"Feature\", properties: {}, geometry: {type: \"Polygon\", coordinates: [\n\t\t\t[ [west, south], [east, south], [east, north], [west, north], [west, south] ] \n\t\t]}}\n\n\t\t// build selectedGeoJSON from receivedGeoJSON\n\t\tvar count = 0, edgeCount = 0;\n\t\tvar started = moment(new Date());\n\t\tvar selectedFeatures = [];\n\t\tvar count = 0;\n\t\tvar baseLines = lineify(featureMapBounds);\n\t\t\n\t\t$.each(app.receivedGeoJSON.features, function(rIdx, feature) {\n\t\t\tif (isPolygonInMapBounds(feature, baseLines, west, south, east, north)) {\n\t\t\t\tcount += 1;\n\t\t\t\tselectedFeatures.push([feature.properties[app.geokey], rIdx]);\n\t\t\t}\n\t\t});\n\t\tvar duration = moment.duration(moment(new Date()).diff(started));\n\t\t\n\t\t// build selectedGeoJSON and set it to CA\n\t\tapp.selectedGeoJSON = {\"type\":\"FeatureCollection\", \"features\":[]};\n\t\t$.each(selectedFeatures, function(rIdx, feature) {\n\t\t\t// feature[0] -> tractid, feature[1] -> rIdx\n\t\t\tapp.selectedGeoJSON.features.push(app.receivedGeoJSON.features[feature[1]]);\n\t\t});\n\t\tCA = app.selectedGeoJSON;\n\t\tselectedFeatures = null;\n\t\tapp.selectedBounds = mapBounds;\n\t}\n\t\n\t// fitBounds and redraw maps\n\tsetTimeout(function () {\n\t\t// fitBounds\n\t\tvar started = moment(new Date());\n\t\tvar watchfitbounds = [];\n\t\tfor (var i=0; i<app.m; i++) watchfitbounds.push(false);\n\t\tfor (var i=0; i<app.m; i++) {\n\t\t\tvar mapN = \"map\" + i;\n\t\t\tvar alreadyFitted = false;\n\t\t\tif (boundsEqual(app[mapN].map.getBounds(), fitBounds)) alreadyFitted = true;\n\t\t\telse app[mapN].map.fitBounds(fitBounds);\n\n\t\t\twatchfitbounds[i] = setInterval(function(i, mapN) {\n\t\t\t\tvar duration = moment.duration(moment(new Date()).diff(started));\n\t\t\t\tvar nowBounds = app[mapN].map.getBounds();\n\t\t\t\t//console.log(getNow(), mapN, mapN+'.bounds:', app[mapN].bounds);\n\t\t\t\t//console.log(getNow(), mapN, 'nowBounds:', nowBounds, duration / 1000);\n\t\t\t\tif (alreadyFitted || !boundsEqual(app[mapN].bounds, nowBounds)) {\n\t\t\t\t\t//console.log(getNow(), mapN, 'after fitBounds: ', nowBounds, 'duration:', duration/1000);\n\t\t\t\t\tclearInterval(watchfitbounds[i]);\n\t\t\t\t\twatchfitbounds[i] = false;\n\t\t\t\t\tapp[mapN].bounds = nowBounds;\n\t\t\t\t}\n\t\t\t\tif (duration > 10000) { // 10000 = 10 sec\n\t\t\t\t\t//console.log(getNow(), mapN, 'ffit fitBounds incompleted: ', nowBounds, 'duration:', duration/1000);\n\t\t\t\t\tclearInterval(watchfitbounds[i]);\n\t\t\t\t\twatchfitbounds[i] = false;\n\t\t\t\t}\n\t\t\t\tif (!watchfitbounds.reduce(function(x, y) {return x || y;})) {\n\t\t\t\t\t//console.log(getNow(), mapN, 'ALL fit fitBounds completed: ', nowBounds, 'duration:', duration/1000);\n\t\t\t\t\tupdateGloballyButton();\n\t\t\t\t\tapp.selectedBounds = nowBounds;\n\t\t\t\t\tsetTimeout(function() { mapOn_contextmenu_set(); }, 100);\n\t\t\t\t\tsetTimeout(function() { mapOn_movestart_set(); }, 200);\n\t\t\t\t\tsetTimeout(function() { mapOn_moveend_set(); }, 500);\n\t\t\t\t}\n\t\t\t}, 100, i, mapN);\n\t\t}\n\t\t\n\t\t// redraw maps\n\t\tfor (var i=0; i<app.m; i++) {\n\t\t\tvar mapN = \"map\" + i;\n\t\t\tdrawAmap(mapN, 3);\n\t\t}\n\t\t\n\t\t// redraw charts\n\t\tfor (var i=0; i<app.d; i++) {\n\t\t\tvar mapN = \"map\" + i;\n\t\t\tdrawAchart(mapN);\n\t\t}\n\t\t\n\t\t// parint density chart of the graph of Clusters\n\t\tfor (var i=0; i<app.nClusters; i++) {\n\t\t\tvar graphC = \"graphC\" + i;\n\t\t\tvar year = $(\"#\"+graphC+\" select[name=yearSelectGraphC]\").val();\n\t\t\tpaintDensityGraphC(graphC, year, i);\n\t\t}\n\t\t\n\t}, 100);\n}", "update() {\n super.update();\n\n this.updateMiniMap();\n }", "function initMap() {\n // basic leaflet map setup\n CONFIG.map = L.map('map', {\n attributionControl:false,\n zoomControl: false,\n minZoom: CONFIG.minzoom, maxZoom: CONFIG.maxzoom,\n attributionControl: false,\n });\n\n // add zoom control, top right\n L.control.zoom({\n position:'topright'\n }).addTo(CONFIG.map);\n\n // map panes\n // - create panes for basemaps\n CONFIG.map.createPane('basemap');\n CONFIG.map.getPane('basemap').style.zIndex = 300;\n CONFIG.map.getPane('basemap').style.pointerEvents = 'none';\n CONFIG.map.createPane('hybrid');\n CONFIG.map.getPane('hybrid').style.zIndex = 301;\n CONFIG.map.getPane('hybrid').style.pointerEvents = 'none';\n CONFIG.map.createPane('satellite');\n CONFIG.map.getPane('satellite').style.zIndex = 302;\n CONFIG.map.getPane('satellite').style.pointerEvents = 'none';\n CONFIG.map.createPane('labels');\n CONFIG.map.getPane('labels').style.zIndex = 475;\n CONFIG.map.getPane('labels').style.pointerEvents = 'none';\n // - create map panes for county interactions, which will sit between the basemap and labels\n CONFIG.map.createPane('country-mask');\n CONFIG.map.getPane('country-mask').style.zIndex = 320;\n CONFIG.map.createPane('country-hover');\n CONFIG.map.getPane('country-hover').style.zIndex = 350;\n CONFIG.map.createPane('country-select');\n CONFIG.map.getPane('country-select').style.zIndex = 450;\n CONFIG.map.createPane('feature-pane');\n CONFIG.map.getPane('feature-pane').style.zIndex = 550;\n\n // add attribution\n var credits = L.control.attribution().addTo(CONFIG.map);\n credits.addAttribution('Interactive mapping by <a href=\"http://greeninfo.org\" target=\"_blank\">GreenInfo Network</a>. Data: <a href=\"https://globalenergymonitor.org/\" target=\"_blank\">Global Energy Monitor</a>');\n\n // Add a feature group to hold the mask, essentially a grey box covering the world minus the country in the view\n CONFIG.mask = L.featureGroup([L.polygon(CONFIG.outerring)], {pane: 'country-mask' }).addTo(CONFIG.map);\n CONFIG.mask.setStyle(CONFIG.maskstyle);\n\n // Add a layer to hold countries, for click and hover (not mobile) events on country features\n CONFIG.countries = L.featureGroup([], { pane: 'country-hover' }).addTo(CONFIG.map);\n L.geoJson(DATA.country_data,{ style: CONFIG.country_no_style, onEachFeature: massageCountryFeaturesAsTheyLoad });\n\n // add a layer to hold any selected country\n CONFIG.selected_country = {};\n CONFIG.selected_country.layer = L.geoJson([], {style: CONFIG.country_selected_style, pane: 'country-select'}).addTo(CONFIG.map);\n\n // add a feature group to hold the clusters\n CONFIG.cluster_layer = L.featureGroup([], {pane: 'feature-pane' }).addTo(CONFIG.map);\n\n // once the map is done loading, resize\n CONFIG.map.on('load', function() {\n resize();\n CONFIG.map.invalidateSize();\n });\n\n // create an instance of L.backButton()\n CONFIG.back = new L.backButton() // not added now, see initButtons()\n\n // zoom listeners\n CONFIG.map.on('zoomend', function() {\n let zoom = CONFIG.map.getZoom();\n });\n\n}", "function adjustToMyScale() {\n// GET MAP\nvar thisMap = getMap(_menuContentPane.id);\nvar thisMapScale = getMapScale(thisMap);\ndojo.forEach(_maps, function (otherMap) {\n if (otherMap.id !== thisMap.id) {\n\tvar otherMapLevel = getMapLevelByScale(otherMap, thisMapScale);\n\tif (otherMapLevel) {\n\t otherMap.setLevel(otherMapLevel);\n\t}\n }\n});\n}", "function updateBaseMap0() {\n //alert(mapID);\n if (dom.byId(\"blayerS\" + mapID).checked) {\n roeMapGulf.setBasemap(currentObject.config.baseMap[0]);//hybrid\n } else {\n roeMapGulf.setBasemap(currentObject.config.baseMap[1]);\n }\n }", "function baseMap(selector, width, height, svg) {\n projection = d3.geo.albersUsa()\n .scale(1070)\n .translate([width / 2, height / 2]);\n\n\n if (svg === undefined) {\n svg = d3.select(selector).append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height)\n }\n \n var map = svg.append(\"g\")\n .attr(\"id\", \"map\")\n .attr(\"width\", width)\n .attr(\"height\", height)\n\n map.append(\"g\").attr(\"id\", \"states\")\n svg.append(\"g\").attr(\"id\", \"overlay\")\n\n svg.append(\"layout-data\").attr(\"off-map-count\", 0)\n\n d3.json(\"../maps/us.json\", function(error, us) {\n\n path = d3.geo.path().projection(projection);\n\n map.append(\"g\")\n .attr(\"id\", \"states\")\n .selectAll(\"path\")\n .data(topojson.feature(us, us.objects.states).features)\n .enter().append(\"path\")\n .attr(\"d\", path)\n\n map.append(\"g\").attr(\"id\", \"borders\")\n .append(\"path\")\n .datum(topojson.mesh(us, us.objects.states, function(a, b) { return a !== b; }))\n .attr(\"id\", \"state-borders\")\n .attr(\"d\", path)\n\n map.append(\"rect\")\n .attr(\"class\", \"background\")\n .attr(\"width\", width)\n .attr(\"height\", height);\n \n \n console.log(\"Base map loaded.\")\n });\n return {svg: svg, projection: projection}\n}", "function setupMap() {\n\tvar bbox = getURLParameter('bbox') || \"-11.0133787,51.222,-5.6582362,55.636\";\n\tapi_url = \"https://api.openstreetmap.org/api/0.6/changesets?bbox=\" + bbox\n\tvar fields = bbox.split(',');\n\tvar minlong = fields[0] * 1;\n\tvar minlat = fields[1] * 1;\n\tvar maxlong = fields[2] * 1;\n\tvar maxlat = fields[3] * 1;\n\tmymap = L.map(\"mapid\", {editable: true});\n\tvar OpenStreetMap_Mapnik = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\n\t\tmaxZoom: 19,\n\t\tattribution: '&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a>'\n\t});\n\tvar southwest = new L.latLng(minlat, minlong);\n\tvar northeast = new L.latLng(maxlat, maxlong);\n\tbounds = new L.LatLngBounds([southwest, northeast]);\n\tupdateLocationBar(minlong, minlat, maxlong, maxlat);\n\n\tmymap.fitBounds(bounds);\n\n\tOpenStreetMap_Mapnik.addTo(mymap);\n\n\tL.EditControl = L.Control.extend({});\n\tL.NewRectangleControl = L.EditControl.extend({});\n\tvar rectangle = L.rectangle([southwest,northeast]).addTo(mymap);\n\trectangle.enableEdit();\n\trectangle.on(\"editable:dragend editable:vertex:dragend\", function() {\n\t\tbounds = this.getBounds();\n\t\tupdateMap();\n\t});\n}", "function updateBaseMap0() {\n //alert(mapID);\n if (dom.byId(\"blayerS\" + mapID).checked) {\n roeMapTNit.setBasemap(currentObject.config.baseMap[0]);\n } else {\n roeMapTNit.setBasemap(currentObject.config.baseMap[1]);\n }\n }", "newMap(){\n\t\tthis.idIterator = 1;\n\n\t\tthis.currentFeature = new Feature(this.assignId());\n\n\t\tthis.geo = {};\n\t\tthis.geo.type = \"FeatureCollection\";\n\t\tthis.geo.features = [];\n\t}", "function resetMap() {\n clearMap();\n removePolygon();\n }", "function vdDemo_modifyMaps(){\n\tGLB.vehicle.modifyMap();\n}", "function resizeCanvas(e){\n\tvar canvas = document.getElementById('mapCanvas');\n\tvar ctx = canvas.getContext('2d');\n\tcanvas.width = 950;\n\tcanvas.height= 1200;\n\tvar isMobile = {\n Android: function() {\n return navigator.userAgent.match(/Android/i);\n },\n BlackBerry: function() {\n return navigator.userAgent.match(/BlackBerry/i);\n },\n iOS: function() {\n return navigator.userAgent.match(/iPhone|iPad|iPod/i);\n },\n Opera: function() {\n return navigator.userAgent.match(/Opera Mini/i);\n },\n Windows: function() {\n return navigator.userAgent.match(/IEMobile/i);\n },\n any: function() {\n return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());\n }\n };\n\tif (isMobile.any()){\n\t\t// document.getElementById('mapContainter').style.left = '0vw';\n\t}\n\telse{\n\t\tif(window.innerWidth>(canvas.width+10)&&window.innerHeight>canvas.height){\n\t\t\t//document.getElementById('mapContainer').style.left = '25vw';// Dont set the style!...\n\t\t\tcanvas.width = window.innerWidth;\n\t\t\tcanvas.height = window.innerHeight;\n\t\t}\n\t\telse{\n\t\t\t// document.getElementById('mapContainer').style.left = '0vw';\n\t\t}\n\t}\n\t\n\t//Draws the canvas, labels, control points, and segments again\n\tctx.fillRect(0, 0, canvas.width, canvas.height);\n\tvar dstf = new drawShipToFront();\n\tdstf.draw(canvas, ctx);\n\tvar dlts = new drawLurganToShip();\n\tdlts.draw(canvas, ctx);\n\n //keep the colors of control points and segments the same (i.e. the ones that have been changed) when you change the size\n\tfor (var i = 0; i < Object.keys(mcpTable).length; i++){\n\t var mcpSegments = mcpTable[key(segNames[i])].segments;\n\t\tvar mcpControls = mcpTable[key(segNames[i])].controlPoints;\n\t var mcpColor = mcpTable[key(segNames[i])].color;\n\t //Change the segments\n\t for (var j = 0; j < Object.keys(mcpSegments).length; j++){\n\t if (mcpColor != \"white\"){\n\t changeTrack(mcpSegments[j], mcpColor);\n\t }\n\t }\n\t //Change the control points\n\t\tfor (var k = 0; k < Object.keys(mcpControls).length; k++){\n\t\t\tredrawPoint(mcpControls[k]);\n\t\t}\n\t}\n\tvar fontBase = 1080; // selected default width for canvas\n\tvar fontSize = 24;\n\tctx.font = getFont(fontSize, fontBase, canvas) + 'px Times New Roman';\n\tctx.fillStyle = \"white\";\n\tctx.fillText(\"Norfolk Southern\", 0, .020*canvas.height);\n\tctx.fillText(\"Harrisburg Division\", 0, .040*canvas.height);\n}", "function mapbuild() {\n\t\t$(\"#venues\").hide();\n\t\tvar myOptions = {\n\t\tzoom:11,\n\t\tcenter: new google.maps.LatLng(33.340053, -111.859627),\n\t\tmapTypeId: google.maps.MapTypeId.Hybrid,\n\t\tpanControl: true,\n\t\tzoomControl: true,\n\t\ttilt: 45 //Allow user to pan at 45 degree angle when in street view.\n\t\t},\n\tmap = new google.maps.Map(document.getElementById('map'), myOptions);\n\t}", "function drawMap () {\n const winHill=new Point([ -1.721040,53.362571]).transform( 'EPSG:4326','EPSG:3857');\n const activityLayer = new LayerVector({\n style: function(feature) {\n return styles[feature.get('type')];\n },\n source: new VectorSource({}),\n name: 'activity' \n });\n const animationLayer = new LayerVector({\n updateWhileAnimating: true,\n updateWhileInteracting: true,\n source: new VectorSource({}),\n name: 'animation' \n });\n \n const osmLayer = new LayerTile({\n title: 'Open Steet Map',\n type: 'base',\n source: new OSM()\n });\n\n const osmTopoLayer = new LayerTile({\n title: 'OSM Topo',\n type: 'base',\n visible: false,\n source: new XYZ({\n url: 'https://{a-c}.tile.opentopomap.org/{z}/{x}/{y}.png'\n })\n });\n // OSMImpl.CycleMap(name)\n //{\n // \"url\" : \"http://tile2.opencyclemap.org/transport/{z}/{x}/{y}.png\"\n // }\n // https://a.tile.thunderforest.com/cycle/15/16234/10624.png?apikey=a5dd6a2f1c934394bce6b0fb077203eb\n const arcGISEsriTopoLayer=new LayerTile({\n title: 'ArcGIS Esri Topographical',\n type: 'base',\n visible: false,\n source: new XYZ({\n attributions:\n 'Tiles © <a href=\"https://services.arcgisonline.com/ArcGIS/' +\n 'rest/services/World_Topo_Map/MapServer\">ArcGIS</a>',\n url:\n 'https://server.arcgisonline.com/ArcGIS/rest/services/' +\n 'World_Topo_Map/MapServer/tile/{z}/{y}/{x}',\n }),\n });\n const arcGISEsriImagaryLayer=new LayerTile({\n title: 'ArcGIS Esri Image',\n type: 'base',\n visible: false,\n source: new XYZ({\n attributions:\n 'Tiles © <a href=\"https://services.arcgisonline.com/ArcGIS/' +\n 'rest/services/World_Imagery/MapServer\">ArcGIS</a>',\n url:\n 'https://server.arcgisonline.com/ArcGIS/rest/services/' +\n 'World_Imagery/MapServer/tile/{z}/{y}/{x}',\n }),\n }); \n\n\n const map = new Map({\n target: document.getElementById('map'),\n view: new View({\n center: winHill.flatCoordinates,\n zoom: 14,\n minZoom: 2,\n maxZoom: 19\n }),\n layers: [\n arcGISEsriTopoLayer,osmTopoLayer,arcGISEsriImagaryLayer,osmLayer\n ]\n });\n \n var layerSwitcher = new LayerSwitcher();\n map.addControl(layerSwitcher);\n\n return map;\n}", "function placeMapButtons() {\n var baseLayerDiv = $(\"#\" + mapTools.baseLayer.div);\n var baseLayerImg = $(\"#\" + mapTools.baseLayer.idimg);\n var regionsDiv = $(\"#\" + mapTools.regions.div);\n var uploadedmapDiv = $(\"#\" + mapTools.uploadedmap.div);\n baseLayerDiv.click(function () {\n if (baseLayerImg[0].getAttribute(\"src\") == mapTools.baseLayer.srcSat) {\n baseLayerImg[0].setAttribute(\"src\", mapTools.baseLayer.srcPhys)\n espMap.setVisibleId(1, true);\n espMap.setVisibleId(0, false);\n } else {\n baseLayerImg[0].setAttribute(\"src\", mapTools.baseLayer.srcSat);\n espMap.setVisibleId(1, false);\n espMap.setVisibleId(0, true);\n }\n });\n baseLayerDiv.mouseover(function () {\n baseLayerDiv.css({ \"opacity\":1,\"filter\":\"alpha(opacity=100)\" });\n });\n baseLayerDiv.mouseout(function () {\n baseLayerDiv.css({ \"opacity\": 0.75, \"filter\": \"alpha(opacity = 75)\" });\n });\n regionsDiv.click(function () {\n espMap.setVisible(ogclinks.region.name, !espMap.isVisible(ogclinks.region.name));\n });\n regionsDiv.mouseover(function () {\n regionsDiv.css({ \"opacity\": 1, \"filter\": \"alpha(opacity=100)\" });\n });\n regionsDiv.mouseout(function () {\n regionsDiv.css({ \"opacity\": 0.75, \"filter\": \"alpha(opacity = 75)\" });\n });\n uploadedmapDiv.mouseover(function () {\n uploadedmapDiv.css({ \"opacity\": 1, \"filter\": \"alpha(opacity=100)\" });\n });\n uploadedmapDiv.mouseout(function () {\n uploadedmapDiv.css({ \"opacity\": 0.95, \"filter\": \"alpha(opacity = 95)\" });\n });\n uploadedmapDiv.hide();\n var sliderDiv = $(\"#div_slider\");\n sliderDiv.slider({\n value: 0\n , min: 0\n , max: 1\n , step: 0.1\n , change: function (event, ui) {\n espMap.setOpacity(\"esp\", 1 - ui.value);\n }\n , slide: function (event, ui) {\n $(\"#divopacity\").html(Math.round((1 - ui.value)*10)/10);\n }\n });\n}", "function updateBaseMap0() {\n //alert(mapID);\n if (dom.byId(\"blayerS\" + mapID).checked) {\n roeMapBio.setBasemap(currentObject.config.baseMap[0]);\n } else {\n roeMapBio.setBasemap(currentObject.config.baseMap[1]);\n }\n }", "function updateBaseMap0() {\n //alert(mapID);\n if (dom.byId(\"blayerS\" + mapID).checked) {\n roeMapWetS.setBasemap(\"hybrid\");\n } else {\n roeMapWetS.setBasemap(\"gray\");\n }\n }", "function changeMapSize() {\n console.log('changeMapSize')\n\n let zoomScrollBar = document.getElementById('zoom')\n zoomScrollBar.style.display = 'block'\n zoomScrollBar.value = '6'\n\n if (mapSetting != mapSize) {\n mapSize = mapSetting\n let areaDiv = document.getElementById('area')\n $('.grid-piece').remove();\n if (mapSize == 'large') {\n gridDown = 180\n gridUp = -180\n numberOfDivs = 180 * 110\n $('#area').css( \"grid-template-columns\", \"repeat(180, 6px)\" );\n $('#area').css( \"grid-template-rows\", \"repeat(110, 6px)\" );\n addDivs(110 * 180);\n } else if (mapSize == 'medium') {\n gridDown = 130\n gridUp = -130\n numberOfDivs = 105 * 130\n $('#area').css( \"grid-template-columns\", \"repeat(130, 6px)\" );\n $('#area').css( \"grid-template-rows\", \"repeat(105, 6px)\" );\n addDivs(105 * 130);\n } else {\n gridDown = 100\n gridUp = -100\n numberOfDivs = 100 * 100\n $('#area').css( \"grid-template-columns\", \"repeat(100, 6px)\" );\n $('#area').css( \"grid-template-rows\", \"repeat(100, 6px)\" );\n addDivs(100 * 100);\n }\n mapSize = mapSetting\n }\n}", "function updateBaseMap0() {\n //alert(mapID);\n if (dom.byId(\"blayerS\" + mapID).checked) {\n roeMapFPL.setBasemap(currentObject.config.baseMap[0]);//hybrid\n } else {\n roeMapFPL.setBasemap(currentObject.config.baseMap[1]);\n }\n }", "function buildMap () {\n const map = [];\n\n // Class\n map.push(\n \"Jedi\", \"Sith\",\n \"Republic\", \"Imperial\",\n \"Jedi Knight\", \"Sith Warrior\",\n \"Guardian\", \"Juggernaut\",\n \"Sentinel\", \"Marauder\",\n \"Jedi Consular\", \"Sith Inquisitor\", \"data-sprite=\\\"jc-\", \"data-sprite=\\\"si-\",\n \"Shadow\", \"Assassin\",\n \"Sage\", \"Sorcerer\", \"data-sprite=\\\"sage-\", \"data-sprite=\\\"sorc-\",\n \"Seer\", \"Corruption\",\n \"Telekinetic\", \"Lightning\",\n \"Balance\", \"Madness\",\n \"Smuggler\", \"Imperial Agent\",\n \"Gunslinger\", \"Sniper\",\n \"Scoundrel\", \"Operative\",\n \"Trooper\", \"Bounty Hunter\",\n \"Vanguard\", \"Power Tech\",\n \"Commando\", \"Mercenary\",\n );\n\n // Sage / Sorcerer\n map.push(\n // Attacks\n \"Telekinetic Throw\", \"Force Lightning\", \"Vanquish\", \"Demolish\",\n \"Sever Force\", \"Creeping Terror\", \"Weaken Mind\", \"Affliction\",\n \"Force in Balance\", \"Death Field\", \"Force Serenity\", \"Force Leach\",\n \"Disturbance\", \"Lightning Strike\", \"Project\", \"Shock\",\n \"Force Quake\", \"Force Storm\", \"Mind Crush\", \"Crushing Darkness\",\n // Controls\n \"Force Lift\", \"Whirlwind\", \"Force Stun\", \"Electrocute\",\n \"Force Wave\", \"Overload\", \"Mind Snap\", \"Jolt\",\n // Heals\n \"Force Armor\", \"Static Barrier\", \"Force Mend\", \"Unnatural Preservation\",\n \"Rejuvenate\", \"Resurgense\", \"Benevolence\", \"Dark Heal\",\n \"Restoration\", \"Expunge\", \"Revival\", \"Reanimation\",\n \"Meditation\", \"Seethe\",\n // Buff & Utils\n \"Force Valor\", \"Mark of Power\", \"Mental Alacrity\", \"Polarity Shift\",\n \"Force Potency\", \"Recklessness\", \"Force Empowerment\", \"Unlimited Power\",\n \"Vindicate\", \"Consuming Darkness\", \"Force of Will\", \"Unbreakable Will\",\n \"Rescue\", \"Extrication\",\n // Passives\n \"Rippling Force\", \"Lightning Burns\",\n \"Resonant Pulse\", \"Dark Echo\",\n // Skillful\n \"Psychic Suffusion\", \"Force Suffusion\", \"Jedi Resistance\", \"Sith Defiance\",\n \"Tectonic Master\", \"Tempest Mastery\", \"Pain Bearer\", \"Empty Body\",\n \"Benevolent Haste\", \"Dark Speed\",\n // Masterful\n \"Blockout\", \"Supression\", \"Mind Ward\", \"Corrupted Flest\",\n \"Valiance\", \"Dark Resilience\", \"Confound\", \"Conspiring Force\",\n \"Telekinetic Defense\", \"Lightning Barrier\", \"Staggering Stratagem\", \"Torturous Tactics\",\n // Heroic\n \"Egress\", \"Emersion\", \"Mental Defense\", \"Shapeless Spirit\",\n \"Metaphysical Alacrity\", \"Surging Speed\", \"Kinetic Collapse\", \"Backlash\",\n \"Containment\", \"Haunted Dreams\", \"Force Wake\", \"Electric Bindings\",\n // Legendary\n \"Swift Rejuvenation\", \"Galvanizing Cleanse\",\n \"Life Ward\", \"Corrupted Barrier\", \"Valorous Spirit\", \"Unnatural Vigor\",\n \"Ethereal Entity\", \"Shifting Silhouette\", \"Impeding Slash\", \"Enfeebling Strike\",\n // Short names\n \"skittles\", \"lightnings\" );\n\n // Vanguard / Powertech\n map.push(\n \"Transpose\", \"Translocate\"\n );\n\n const dict = new Map(), list = [];\n for ( let i = 0, len = map.length ; i < len ; i += 2 ) {\n const p = map[i], e = map[i+1], pid = '#'+idify(p), eid = '#'+idify(e);\n dict.set( p , [ new RegExp( `\\\\b${p}(?!</a>)\\\\b` , 'g' ), e ] );\n dict.set( pid, [ new RegExp( `${pid}\\\\b`, 'g' ), eid ] );\n list.push( p, pid );\n }\n list.sort( revLenSort );\n return [ dict, list ];\n}", "function refreshAndInitMap() {\n // Remove all added layer:\n removeAllLayers();\n // Remove all source:\n removeAllSources();\n}", "function SetMapControls() {\n // Add standard map controls\n my.Map.addControl(new ZoomSlider());\n my.Map.addControl(new Zoom());\n my.Map.addControl(new FullScreen());\n my.Map.addControl(new Rotate({ autoHide: false, class: 'ol-rotate' }));\n const ctrl = new MousePosition({\n projection: App4Sea.prefProj,\n coordinateFormat(coord) {\n const xy = olproj.transform(coord, App4Sea.prefProj, App4Sea.prefViewProj);\n let str = olcoordinate.toStringHDMS(coord);\n str = `${str}<br>${olcoordinate.toStringXY(coord, 6)}`;\n str = `${str}<br>${olcoordinate.toStringXY(xy, 0)}`;\n return str;\n },\n undefinedHTML: '',\n });\n my.Map.addControl(ctrl);\n my.Map.addControl(new OverviewMap({\n layers: [currentLayerMini],\n collapsed: true,\n }));\n my.Map.addControl(new ScaleLine());\n }", "function initMap() {\n directionsService = new google.maps.DirectionsService();\n directionsRenderer = new google.maps.DirectionsRenderer();\n \n map = new google.maps.Map(\n document.getElementById(\"map\"), {zoom: 11, center: {lat: -33.4688845, lng: -70.6654369},\n mapTypeId: 'styleMap',\n restriction: {\n latLngBounds: chileBounds,\n strictBounds: false,\n },\n disableDefaultUI: true,\n zoomControl: true,\n<<<<<<< HEAD\n=======\n mapTypeControl: true,\n>>>>>>> parent of cfd4b66... caca\n streetViewControl: true,\n });\n\n directionsRenderer.setMap(map);\n<<<<<<< HEAD\n\n map.mapTypes.set('styleMap', new google.maps.StyledMapType(styleMap, { name: 'Mapi Map' }));\n\n var centerControlDiv = document.createElement('div');\n var centerControl = new CenterControl(centerControlDiv, map);\n map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(centerControlDiv);\n\n var openEventsDiv = document.createElement('div');\n var opendiv = new openEventsControl(openEventsDiv, map);\n map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(openEventsDiv);\n\n var searchControlDiv = document.createElement('div');\n var mapdiv = new mapTypeControl(searchControlDiv, map);\n searchControlDiv.id = 'searchBarControl';\n searchControlDiv.className = 'col-sm-8';\n var srcControl = searchBarControl(searchControlDiv, map);\n map.controls[google.maps.ControlPosition.TOP_LEFT].push(searchControlDiv);\n\n addEvents()\n}", "function initMap() {\n const map = new google.maps.Map(document.querySelector('#map'), {\n zoom: 15,\n center: {\n // CIT Coimbatore\n lat: 11.0283,\n lng: 77.0273\n }\n });\n map.data.loadGeoJson('/data/subway-stations');\n var iconBase =\n 'http://maps.google.com/mapfiles/kml/shapes/';\n\n var icons = {\n potholes: {\n icon: iconBase + 'mechanic.png'\n },\n road_sign: {\n icon: iconBase + 'forbidden.png'\n },\n road_furniture: {\n icon: iconBase + 'campground.png'\n }\n };\n\n var features = [\n {\n position: new google.maps.LatLng(11.02368110531636, 77.00253009796143),\n type: 'potholes'\n },{\n position: new google.maps.LatLng(11.038057916898168, 77.03770758256542),\n type: 'potholes'\n },{\n position: new google.maps.LatLng(11.026906181104199, 77.02227924334716),\n type: 'road_furniture'\n }, {\n position: new google.maps.LatLng(11.0148203513, 77.0236160564),\n type: 'road_sign'\n }, {\n position: new google.maps.LatLng(11.030678331460905, 77.0167635037908),\n type: 'road_furniture'\n },\n {\n position: new google.maps.LatLng(11.025787271795734, 77.01538324356079),\n type: 'potholes'\n },\n {\n position: new google.maps.LatLng(11.025050115243769, 77.01119899749756),\n type: 'road_furniture'\n },\n {\n position: new google.maps.LatLng(11.021111561787002, 76.99392557144165),\n type: 'road_sign'\n },\n {\n position: new google.maps.LatLng(11.022301558097276, 76.99972987174988),\n type: 'road_furniture'\n },\n {\n position: new google.maps.LatLng(11.019847843620942, 76.99221968650818),\n type: 'road_furniture'\n },\n {\n position: new google.maps.LatLng(11.04401668721413, 77.04674883076848),\n type: 'road_sign'\n },{\n position: new google.maps.LatLng(11.045501433384475, 77.05025716015996),\n type: 'potholes'\n }\n\n ];\n\n // Create markers.\n for (var i = 0; i < features.length; i++) {\n var marker = new google.maps.Marker({\n position: features[i].position,\n icon: icons[features[i].type].icon,\n map: map\n });\n };\n }", "function updateBaseMap0() {\n //alert(mapID);\n if (dom.byId(\"blayerS\" + mapID).checked) {\n roeMapFAL.setBasemap(currentObject.config.baseMap[0]);//hybrid\n } else {\n roeMapFAL.setBasemap(currentObject.config.baseMap[1]);\n }\n }", "function updateBaseMap0() {\n //alert(mapID);\n if (dom.byId(\"blayerS\" + mapID).checked) {\n roeMapLong.setBasemap(\"hybrid\");//hybrid\n } else {\n roeMapLong.setBasemap(\"gray\");\n }\n }", "_synchronizeMaps(baseMap) {\n var targetMaps = this._maps.filter(function (m, i) { return m !== baseMap; });\n this._detachMapMoveHandlers();\n var cam = baseMap.getCamera();\n targetMaps.forEach(function (targetMap) {\n targetMap.setCamera({\n center: cam.center,\n zoom: cam.zoom,\n bearing: cam.bearing,\n pitch: cam.pitch,\n type: 'jump'\n });\n });\n this._attachMapMoveHandlers();\n }", "function updateBaseMap0() {\n //alert(mapID);\n if (dom.byId(\"blayerS\" + mapID).checked) {\n roeMapWetN.setBasemap(\"hybrid\");\n } else {\n roeMapWetN.setBasemap(\"gray\");\n }\n }", "function initialiseMap() {\n var enableDrawing = options.drawControl;\n\n options.drawControl = false;\n\n mapImpl = L.map(id, options);\n\n mapImpl.addLayer(drawnItems);\n\n addCoordinates();\n\n L.Icon.Default.imagePath = getLeafletImageLocation();\n\n mapImpl.addLayer(options.baseLayer);\n if (options.defaultLayersControl) {\n self.addLayersControl(options.otherLayers, options.overlays, {overlayLayersSelectedByDefault: options.overlayLayersSelectedByDefault, autoZIndex: options.autoZIndex});\n }\n\n\n if (options.showFitBoundsToggle) {\n var css = \"ala-map-fit-bounds fa \" + (options.zoomToObject ? \"fa-search-minus\" : \"fa-search-plus\");\n self.addButton(\"<span class='\" + css + \"' title='Toggle between the full map and the bounds of the data'></span>\", self.toggleFitBounds, \"topleft\");\n }\n\n if (options.useMyLocation) {\n var title = options.myLocationControlTitle || \"Use my location\";\n self.addButton(\"<span class='ala-map-my-location fa fa-location-arrow' title='\" + title + \"'></span>\", self.markMyLocation, \"topleft\");\n }\n\n if (options.allowSearchLocationByAddress) {\n addGeocodeControl(ALA.MapConstants.DRAW_TYPE.POINT_TYPE);\n }\n\n if (options.allowSearchRegionByAddress) {\n addGeocodeControl(ALA.MapConstants.DRAW_TYPE.POLYGON_TYPE);\n }\n\n if (enableDrawing) {\n initDrawingControls(options);\n }\n\n if(options.trackWindowHeight) {\n addWindowResizeListener();\n adjustMapContainerHeight();\n }\n\n if (options.showReset) {\n self.addButton(\"<span class='ala-map-reset fa fa-refresh reset-map' title='Reset map'></span>\", self.resetMap, \"bottomright\");\n }\n\n // If the map container is not visible, add a listener to trigger a redraw once it becomes visible.\n // This avoids problems with the map viewport being initialised to an incorrect size because Leaflet could not\n // determine the size of the container.\n var container = $(\"#\" + id);\n if (!container.is(\":visible\")) {\n container.onImpression({\n callback: self.redraw\n });\n }\n\n // make sure the base layers never sit on top of other layers when the base layer is changed\n mapImpl.on('baselayerchange', function (event) {\n currentBaseLayer = event.layer;\n\n if (event.layer.setZIndex) {\n event.layer.setZIndex(-1);\n }\n });\n\n // when an overlay layer is selected, bring it to the front and mark it as selected\n mapImpl.on('overlayadd', function (e) {\n if (e && e.layer) {\n overlayLayerSelect(e.layer);\n }\n });\n\n // when an overlay layer is de-selected, remove selected marker\n mapImpl.on('overlayremove', function (e) {\n if (e && e.layer) {\n overlayLayerDeselect(e.layer);\n }\n });\n }", "function qpChoroplethMapMaker() {\n\n var width = 1000, height = 428;\n var zoom = d3.behavior.zoom()\n .scaleExtent([1, 5])\n .on(\"zoom\", moveAndZoom);\n\n var svg = d3.select(\"div#qpCoreChoroplethMap\").append(\"svg\")\n .attr({ width: width, height: height })\n .call(zoom);\n\n var projection = d3.geo.mercator();\n var path = d3.geo.path().projection(projection);\n\n var url = 'https://gist.githubusercontent.com/d3byex/65a128a9a499f7f0b37d/raw/176771c2f08dbd3431009ae27bef9b2f2fb56e36/world-110m.json';\n\n d3.json(url, function (error, world) {\n var countries = topojson.feature(world, world.objects.countries).features;\n var neighbors = topojson.neighbors(world.objects.countries.geometries);\n\n qpChoroplethMapMaker.mapButtonClick = mapButtonClick;\n\n function mapButtonClick(datapoint) {\n d3.select(\"div#ChoroplethMaplegend\").selectAll(\"*\").remove();//Removes prevoius ChoroplethMap svg canvas\n svg.transition().duration(200);\n\n var mainGroup = svg.append(\"g\");\n mainGroup.style({ stroke: \"white\", \"stroke-width\": \"2px\", \"stroke-opacity\": 0.0 });\n\n var country_value_and_iso = {};\n incomingData.forEach(function(d) {\n country_value_and_iso[d[\"Iso3\"]] = +d[datapoint];\n country_value_and_iso[d.Country_Name] = +d.id;\n });\n var country_name_and_iso = {};\n incomingData.forEach(function(d) {\n country_name_and_iso[d[\"Iso3\"]] = d.Country_Name;\n });\n\n var maxValue = d3.max(whole_data, function(d) {\n return parseFloat(d[datapoint]);});\n var color_domain = [0,maxValue];\n var colorQuantize = d3.scale.quantize()\n .domain(color_domain)\n .range([\"#2c7bb6\", \"#00a6ca\",\"#00ccbc\",\"#90eb9d\",\"#ffff8c\",\"#f9d057\",\"#f29e2e\",\"#e76818\",\"#d7191c\"]);\n\n //////////////////////////////////////////////////////////////////\n ////\n //// Legend Legend Legend Legend Legend Legend Legend Legend\n ////\n //////////////////////////////////////////////////////////////////\n\n\n var legendWidth = 140, legendHeight = 400;\n var key = d3.select(\"div#ChoroplethMaplegend\").append(\"svg\")\n .attr(\"width\", legendWidth)\n .attr(\"height\", legendHeight);\n\n //Append a linearGradient element to the defs\n var legend = key.append(\"defs\").append(\"svg:linearGradient\")\n .attr(\"id\", \"gradient\")\n .attr(\"x1\", \"100%\")\n .attr(\"y1\", \"0%\")\n .attr(\"x2\", \"100%\")\n .attr(\"y2\", \"100%\")\n .attr(\"spreadMethod\", \"pad\");\n\n //set the color for the beggining\n legend.selectAll(\"stop\")\n .attr(\"offset\", \"0%\")\n .data([\n {offset: \"0%\", color: \"#d7191c\"},\n {offset: \"12.5%\", color: \"#e76818\"},\n {offset: \"25%\", color: \"#f29e2e\"},\n {offset: \"37.5%\", color: \"#f9d057\"},\n {offset: \"50%\", color: \"#ffff8c\"},\n {offset: \"62.5%\", color: \"#90eb9d\"},\n {offset: \"75%\", color: \"#00ccbc\"},\n {offset: \"87.5%\", color: \"#00a6ca\"},\n {offset: \"100%\", color: \"#2c7bb6\"}\n ])\n .enter().append(\"stop\")\n .attr(\"offset\", function(d) { return d.offset; })\n .attr(\"stop-color\", function(d) { return d.color; })\n .attr(\"stop-opacity\", 1);\n\n //Draw the rectangle and fill with gradient\n key.append(\"rect\")\n .attr(\"id\", \"legendRect\")\n \t.attr(\"width\", legendWidth - 100)\n \t.attr(\"height\", legendHeight -100)\n .style(\"fill\", \"url(#gradient)\")\n .attr(\"transform\", \"translate(0,10)\");\n\n var legendY = d3.scale.linear()\n .range([300, 0])\n .domain([0,maxValue]);\n\n var yAxis = d3.svg.axis()\n .scale(legendY)\n .orient(\"right\");\n\n key\n .append(\"g\")\n .attr(\"class\", \"y axis\")\n .attr(\"transform\", \"translate(41,10)\")\n .call(yAxis).append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 30)\n .attr(\"dy\", \".71em\")\n .style(\"text-anchor\", \"end\")\n .text(\"Colored Scale for \" + datapoint);\n\n ///////////////////////////////////////////////////////////\n ///End Legend End Legend End Legend End Legend End Legend\n ///////////////////////////////////////////////////////////\n\n //Coloring of the world\n mainGroup.selectAll(\"path\", \"countries\")\n .data(countries)\n .enter().append(\"path\").transition().duration(1000)\n .attr(\"d\", path)\n .style(\"fill\", function (d) {\n return colorQuantize(country_value_and_iso[d.id]);});\n\n // Define the div for the tooltip\n var div = d3.select(\"div#qpCoreChoroplethMap\").append(\"div\")\n .attr(\"class\", \"tooltip\")\n .style(\"opacity\", 0);\n\n mainGroup\n .selectAll(\"path\")\n .data(countries)\n .on(\"mouseover\", function (p) {\n div.transition()\n .duration(200)\n .style(\"opacity\", .9);\n div\t.html(country_value_and_iso[p.id])\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\n div.html(country_name_and_iso[p.id] + \":\" + \"<br/>\" + country_value_and_iso[p.id]);\n d3.select(this).style(\"stroke-opacity\", 1.0);\n });\n mainGroup.selectAll(\"path\")\n .on(\"mouseout\", function () {\n d3.select(this).style(\"stroke-opacity\", 0.0);\n });\n\n }//ButtonClick\n });//d3json\n\n\n function moveAndZoom() {\n var t = d3.event.translate;\n var s = d3.event.scale;\n\n var x = Math.min(\n (width / height) * (s - 1),\n Math.max(width * (1 - s), t[0]));\n\n var h = height / 4;\n var y = Math.min(\n h * (s - 1) + h * s,\n Math.max(height * (1 - s) - h * s, t[1]));\n\n mainGroup.style(\"stroke-width\", ((1 / s) * 2) + \"px\");\n mainGroup.attr('transform', 'translate(' + x + ',' + y + ')scale(' + s + ')');\n }//Move and zoom\n }//ChoroplethMapMaker", "function createTilemap() {\r\n //Load in tilemap assets\r\n var map = this.make.tilemap({ key: \"tilemap\" });\r\n var landscape = map.addTilesetImage(\"landscape-tileset\", \"landscape\");\r\n var props = map.addTilesetImage(\"props-tileset\", \"props\");\r\n\r\n //Create first three layers\r\n map.createStaticLayer('backgroundLayer2', [landscape, props], 0, 0);\r\n map.createStaticLayer('backgroundLayer', [landscape, props], 0, 0);\r\n map.createStaticLayer('collisionLayer', [landscape, props], 0, 0);\r\n\r\n //Find the playerSpawn point\r\n var playerSpawn = map.findObject(\"objectLayer\", function (object) {\r\n if (object.type === \"player\") {\r\n return object;\r\n }\r\n });\r\n\r\n //Create player object\r\n createPlayer.call(this, playerSpawn);\r\n\r\n //Create groups\r\n jewels = this.physics.add.staticGroup();\r\n powerUps = this.physics.add.staticGroup();\r\n skulls = this.physics.add.staticGroup();\r\n\r\n //Find objects and create sprite for relevant group\r\n map.findObject(\"objectLayer\", function (object) {\r\n if (object.type === \"pickUp\" && object.name === \"jewel\") {\r\n jewels.create(object.x + map.tileWidth / 2, object.y - map.tileHeight / 2, \"jewel\");\r\n }\r\n\r\n if (object.type === \"powerUp\" && object.name === \"doubleJump\") {\r\n powerUps.create(object.x + map.tileWidth / 2, object.y - map.tileHeight / 2, \"cherry\");\r\n }\r\n if (object.type === \"pickUp\" && object.name === \"skull\") {\r\n skulls.create(object.x + map.tileWidth / 2, object.y - map.tileHeight / 2, \"skull\");\r\n }\r\n });\r\n\r\n //Create foreground layer\r\n map.createStaticLayer('foregroundLayer', landscape, 0, 1);\r\n\r\n //Return the map\r\n return map;\r\n}", "zoomMap() {\n PaintGraph.Pixels.zoomExtent(this.props.map, this.props.bbox)\n window.refreshTiles()\n window.updateTiles()\n }", "_compileMapping() {\n const { axes, buttons } = this._compiledMapping;\n const axesIndexes = MAPS_INDEXES.axes;\n const buttonsIndexes = MAPS_INDEXES.buttons;\n\n // Clear existing\n axes.length = 0;\n buttons.length = 0;\n\n // Add axes\n const axesMap = this.map.axes;\n if (axesMap) {\n this.map.axes.forEach((axis, i) => {\n axes[axesIndexes[axis]] = () => this.pad.axes[i] || 0;\n });\n }\n\n // Fill empty indexes for axes\n for (let i = 0, l = axes.length; i < l; i++) {\n if (!axes[i]) {\n axes[i] = () => 0;\n }\n }\n\n // Add basic buttons\n const buttonsMap = this.map.buttons;\n if (buttonsMap) {\n buttonsMap.forEach((button, i) => {\n buttons[buttonsIndexes[button]] = () => this._buttons[i] || dummyButton;\n });\n }\n\n // Add synthesized buttons\n const synthesizedButtonsMap = this.map.synthesizedButtons;\n if (synthesizedButtonsMap) {\n Object.entries(synthesizedButtonsMap).forEach((button) => {\n const { axis, max, min } = button[1];\n buttons[buttonsIndexes[button[0]]] = () => new GamePadButton(\n Math.abs(math.clamp(this._axes[axis] ?? 0, min, max)),\n Math.abs(math.clamp(this._previousAxes[axis] ?? 0, min, max))\n );\n });\n }\n\n // Fill empty indexes for buttons\n for (let i = 0, l = buttons.length; i < l; i++) {\n if (!buttons[i]) {\n buttons[i] = () => dummyButton;\n }\n }\n }", "function buildSelectionMap() {\n _.each($variations, function (index, variant) {\n var mxid = getOptionIdentityMatrix(variant.selected_options);\n $optionsMap[mxid.data.join('')] = { index: index, data: mxid.data };\n $skuMap[variant.sku] = index;\n $hasSubscription = $hasSubscription || variant.subscription_plan;\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 initMaps($maps) {\n\n //var LEGEND_BG_LINK = '//images1.wikia.nocookie.net/__cb1/wowwiki/images/5/50/Map-legend-bg.jpg';\n var LEGEND_BG_LINK = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mN8tMnrPwAHOwLfJJG8pgAAAABJRU5ErkJggg=='; //#E2B24A\n var ABOUT_NOTE_LINK = '/Template:Map/Note';\n var EDIT_NOTE_ENABLE = true;\n var MAP_RATIO = null;\n\n var MAP_MIN_WIDTH = 50,\n MAP_MAX_WIDTH = 1002,\n MAP_MAX_HEIGHT = 880,\n COLUMN_WIDTH = 240,\n COLUMN_PADDING = 6,\n HEADER_HEIGHT = 15,\n HEADER_PADDING = 4,\n MARGIN_INNER = 10,\n MARGIN_VERTICAL = 15,\n MARGIN_HORIZONTAL = 25,\n LEGEND_PADDING = 10,\n MIN_SCALE = 25; // minimum percent of max scale before not open or auto close map\n\n var nId = 0; // counter for for non-conflicting node IDs\n\n function GetValue(value, defvalue) { return value || parseInt(value) == 0 ? value : defvalue; }\n var $settings = $('.map-settings').last();\n if ($settings.length) {\n LEGEND_BG_LINK = GetValue($settings.data(\"legend-bg-link\"), LEGEND_BG_LINK);\n ABOUT_NOTE_LINK = GetValue($settings.data(\"about-note-link\"), ABOUT_NOTE_LINK);\n EDIT_NOTE_ENABLE = GetValue($settings.data(\"edit-note-enable\"), EDIT_NOTE_ENABLE) != 0;\n MAP_RATIO = GetValue($settings.data(\"map-ratio\"), MAP_RATIO);\n MAP_MAX_WIDTH = GetValue($settings.data(\"map-max-width\"), MAP_MAX_WIDTH);\n MAP_MAX_HEIGHT = GetValue($settings.data(\"map-max-height\"), MAP_MAX_HEIGHT);\n }\n\n var callbacks = {\n close: $.Callbacks('unique'),\n enable: $.Callbacks('unique'),\n disable: $.Callbacks('unique'),\n refresh: $.Callbacks('unique'),\n resize: $.Callbacks('unique')\n };\n\n/* ********************* Preloader ********************* */\n\n var preloader = {\n\n imgDefers: {},\n imgDefer: function (src) {\n var imgDefer = this.imgDefers[src];\n if (!imgDefer) {\n var defer = $.Deferred(),\n img = new Image();\n\n img.src = src;\n img.onload = defer.resolve;\n this.imgDefers[src] = imgDefer = {\n defer: defer, img: img\n };\n }\n return imgDefer;\n },\n imgPromise: function (src) {\n var imgDefer = this.imgDefer(src);\n return imgDefer.defer.promise();\n },\n imgObj: function (src) {\n var imgDefer = this.imgDefer(src);\n var promise = imgDefer.defer.promise();\n if (promise.state() === 'pending')\n return null;\n\n return imgDefer.img;\n },\n\n marker: function (marker) { // preload markers\n var $marker = $(marker);\n var bg = $marker.css(\"background-image\");\n if (bg === \"none\") {\n bg = $marker.find(\"img\").attr(\"src\");\n } else {\n bg = bg.replace(/^url\\(['\"]?(.+?)['\"]?\\)/,'$1');\n }\n return (typeof bg == \"string\") ? this.imgPromise(bg) : $.when();\n },\n\n cancel: function (src) {\n delete preloader.imgDefers[src];\n },\n };\n\n/* ********************* Sort ********************* */\n\n function SortedObject(obj) {\n this.keys = [];\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n this.keys.push(i);\n }\n }\n this.keys.sort(this.compare);\n this.obj = obj;\n this.walker = -1;\n }\n\n var STOP_WORD_REGEX = /^\\s*(?:a|the)\\s+(.*)/i;\n\n $.extend(SortedObject.prototype, {\n\n compare: function (a, b) {\n /*jshint camelcase:false*/\n var m_a = a.match(STOP_WORD_REGEX),\n m_b = b.match(STOP_WORD_REGEX);\n a = m_a ? m_a[1] : a;\n b = m_b ? m_b[1] : b;\n return a > b ? 1 : (a < b ? -1 : 0);\n },\n\n reset: function () {\n this.walker = -1;\n },\n\n next: function () {\n return ++this.walker < this.keys.length;\n },\n\n key: function () {\n return this.keys[this.walker];\n },\n\n val: function () {\n return this.obj[this.keys[this.walker]];\n }\n });\n\n/* ********************* Tool Tips ********************* */\n\n // portions of this tipsie section derrived from mediawiki tipsy 12/1/17:\n // tipsy, facebook style tooltips for jquery, version 1.0.0a*\n // (c) 2008-2010 jason frame [[email protected]]\n // released under the MIT license\n // - shorter non-global version, w/ some mobile support\n // - note: CB means DOM callback verison that expects a DOM 'this'\n\n var tipsie = {\n get: function (elem) {\n return $.data(elem, 'tipsie');\n },\n\n enterCB: function () {\n var that = tipsie.get(this);\n if (!that) return;\n var options = that.options;\n that.hoverState = 'in';\n if (options.delayIn == 0) {\n that.show();\n } else {\n that.fixTitle();\n setTimeout(function() { if (that.hoverState == 'in') that.show(); }, options.delayIn);\n }\n },\n\n leaveCB: function() {\n var that = tipsie.get(this);\n if (!that) return;\n var options = that.options;\n that.hoverState = 'out';\n if (options.delayOut == 0) {\n that.hide();\n } else {\n setTimeout(function() { if (that.hoverState == 'out') that.hide(); }, options.delayOut);\n }\n },\n\n set: function ($elems, options) {\n if (!this.Tipsie) this.initTipsie();\n\n options = $.extend({}, this.defaults, options);\n\n $elems.each(function() {\n if (!tipsie.get(this)) $.data(this, 'tipsie', new tipsie.Tipsie(this, options));\n });\n\n if (options.trigger != 'manual')\n $elems.on(options.trigger == 'hover' ? 'mouseenter focus' : 'focus', this.enterCB)\n .on(options.trigger == 'hover' ? 'mouseleave blur' : 'blur', this.leaveCB);\n\n return this;\n },\n\n initTipsie: function () {\n this.defaults = {\n tipClass: null,\n delayIn: 0,\n delayOut: 0,\n fade: true,\n fallback: '',\n gravity: 'n',\n center: true,\n html: false,\n live: false,\n offset: 0,\n opacity: 1.0,\n title: 'title',\n trigger: 'hover'\n };\n\n this.Tipsie = function (element, options) {\n this.$element = $(element);\n this.options = $.metadata ? $.extend({}, options, this.$element.metadata()) : options;\n this.enabled = true;\n this.keyHandler = $.proxy( this.closeOnEsc, this );\n this.$template = null,\n this.fixTitle();\n };\n\n this.Tipsie.prototype = {\n/******** start Tipsie prototype ********/\n\nshow: function() {\n var title = null;\n if (!this.enabled || !(title = this.getTitle())) return;\n var element = this.$element[0], options = this.options;\n\n // measurethat - http://tinyurl.com/ycfdnf5k jsperf - http://tinyurl.com/y9fuegc7\n if (!this.$template)\n this.$template = $('<div class=\"tipsie\" role=\"tooltip\" aria-hidden=\"false\">' +\n '<div class=\"tipsie-arrow\"></div><div class=\"tipsie-inner\"></div></div>');\n var $this = this.$template.clone();\n\n var gravity = options.gravity, tipClass = options.tipClass;\n if (typeof gravity == 'function') gravity = gravity.call(element);\n if (typeof tipClass == 'function') tipClass = tipClass.call(element);\n $this.addClass('tipsie-' + gravity + ' ' + tipClass);\n\n $this.find('.tipsie-inner')[options.html ? 'html' : 'text'](title);\n\n var offset = this.$element.offset(), left = offset.left, top = offset.top,\n width = element.offsetWidth, height = element.offsetHeight;\n\n if (this.$tooltip) this.$tooltip.remove();\n this.$tooltip = $this;\n $this.appendTo(document.body); // force layout\n\n var tipWidth = $this[0].offsetWidth, tipHeight = $this[0].offsetHeight;\n\n switch (gravity.charAt(0)) {\n case 'n': top = top + height + options.offset; left = left + width / 2 - tipWidth / 2; break;\n case 's': top = top - tipHeight - options.offset; left = left + width / 2 - tipWidth / 2; break;\n case 'e': top = top + height / 2 - tipHeight / 2; left = left - tipWidth - options.offset; break;\n case 'w': top = top + height / 2 - actualHeight / 2; left = left + width + options.offset; break;\n }\n switch (gravity.charAt(1)) {\n case 'e': left = options.center ? (offset.left + width / 2 - tipWidth + 15) : (offset.left + width); break;\n case 'w': left = options.center ? (offset.left + width / 2 - 15) : offset.left; break;\n }\n\n $( document ).on( 'keydown', this.keyHandler );\n if (options.fade)\n $this.stop().css({ top: top, left: left }).animate({ opacity: options.opacity }, 100);\n else\n $this.css({ top: top, left: left, opacity: options.opacity});\n},\n\nhide: function() {\n $( document ).off( 'keydown', this.keyHandler );\n if (this.$tooltip) {\n if (this.options.fade)\n this.$tooltip.stop().fadeOut(100, function() { $(this).remove(); });\n else\n this.$tooltip.remove();\n }\n},\n\nfixTitle: function() {\n var $element = this.$element;\n if ($element.attr('title') || typeof($element.attr('original-title')) != 'string') {\n $element.attr('original-title', $element.attr('title') || '').removeAttr('title');\n }\n},\n\ngetTitle: function() {\n var title, $element = this.$element, o = this.options;\n this.fixTitle();\n if (typeof o.title == 'string') {\n title = $element.attr(o.title == 'title' ? 'original-title' : o.title);\n } else if (typeof o.title == 'function') {\n title = o.title.call($element[0]);\n }\n title = ('' + title).replace(/(^\\s*|\\s*$)/, \"\");\n return title || o.fallback;\n},\n\nvalidate: function() {\n if (!this.$element[0].parentNode) {\n this.hide();\n this.$element = null;\n this.options = null;\n }\n},\n\ncloseOnEsc: function ( e ) {\n if ( e.keyCode === 27 ) {\n this.hide();\n }\n},\n\nenable: function() { this.enabled = true; },\ndisable: function() { this.enabled = false; },\n\n/******** end Tipsie prototype ********/\n };\n }\n }\n\n /* map ToolTip interface */\n var tips = {\n // adds a text ToolTip\n addTextTip: function ($elems, trigger, autoShow) {\n var that = tipsie.set($elems, {\n tipClass: 'map-tip-text',\n delayIn: 20, //50\n opacity: 1,\n trigger: trigger,\n fade: true,\n gravity: tips.gravityCB\n });\n\n if (autoShow && $elems.length) {\n this.show($elems);\n this.closeElems.push($elems);\n callbacks.close.add(tips.close);\n }\n },\n\n close: function () {\n var a = tips.closeElems;\n tips.closeElems = [];\n for (var i= 0, len = a.length; i < len; i++)\n tips.hide(a[i]);\n },\n closeElems: [],\n\n show: function ($elems) {\n $elems.each(function () { var that = tipsie.get(this); if (that) that.show(); })\n },\n\n hide: function ($elems) {\n $elems.each(function () { var that = tipsie.get(this); if (that) that.hide(); })\n },\n\n gravityCB: function () {\n var $elem = $(this),\n w = $elem.parent().width(),\n offset = w / 100 * $elem.data('x');\n return offset > 200 ? (offset < w - 200 ? 's' : 'se') : 'sw';\n }\n };\n\n/* ********************* Lightbox ********************* */\n\n var blackOut = {\n\n $blackOut: null,\n\n create: function () {\n var defer = $.Deferred();\n\n this.$blackOut = $('<div></div>')\n .addClass('map-blackout')\n .css({\n width: $(document).width() + 'px',\n height: $(document).height() + 'px',\n display: 'none'\n })\n .appendTo(document.body)\n .fadeIn(200, function () {\n $('html').css('overflow', 'hidden');\n blackOut.refresh();\n\n blackOut.$blackOut.click(callbacks.close.fire);\n\n callbacks.refresh.add(blackOut.refresh);\n callbacks.close.add(blackOut.close);\n\n defer.resolve();\n });\n\n return defer.promise();\n },\n\n refresh: function () {\n var $blackOut = blackOut.$blackOut;\n if (!$blackOut || !$blackOut.length) return;\n\n var $document = $(document);\n $blackOut\n .css({\n width: $document.width() + 'px',\n height: $document.height() + 'px'\n });\n },\n\n close: function () {\n var $blackOut = blackOut.$blackOut;\n if (!$blackOut || !$blackOut.length) return;\n\n $('html').css('overflow', 'auto');\n\n callbacks.refresh.remove(blackOut.refresh);\n callbacks.close.remove(blackOut.close);\n\n $blackOut\n .off('click')\n .stop().fadeOut(100, function () {\n $blackOut.remove();\n $blackOut = null;\n });\n }\n };\n\n/* ********************* Map Base ********************* */\n\n function Map() { }\n\n $.extend(Map.prototype, {\n $map: null, // map dom object\n src: null, // smallSrc href string\n extents: null, // map coordinates meta\n\n mapLightbox: null, // lightbox class object\n\n initMap: function ($map, editLink, $markers, autoShow) {\n var projectionType = $map.data('projection'),\n dataFile = $map.data('file'),\n largeSrc = $map.data('large'),\n smallSrc = $map.data('small');\n\n var projectionType = projectionType ? process : \"flat\";\n var file = 'File:' + dataFile;\n var href = mw.config.get('wgArticlePath').replace(/\\$1/, file);\n\n // constrain wire size of large map, if larger than any max\n var maxW = MAP_MAX_WIDTH, maxH = MAP_MAX_HEIGHT;\n largeSrc = largeSrc.replace(/\\/latest/, '/latest/scale-to-'\n + (maxW < maxH ? ('width-down/' + maxW) : ('height-down/' + maxH)));\n\n var left = Number($map.data('left')), top = Number($map.data('top')),\n right = Number($map.data('right')), bottom = Number($map.data('bottom')),\n centerx = Number($map.data('centerx')), centery = Number($map.data('centery'));\n var extents = { // coordinate extents for this map image\n left: left ? left : 0.0,\n top: top ? top : 0.0,\n right: right ? right : 100.0,\n bottom: bottom ? bottom : 100.0,\n centerx: centerx ? centerx : null,\n centery: centery ? centery : null\n };\n\n this.$map = $map;\n this.src = smallSrc\n this.extents = extents;\n\n this.mapLightbox = new MapLightbox({\n projectionType: projectionType,\n src: largeSrc, // full href to largeSrc\n zone: $map.data('zone'),\n extents: extents,\n editLink: editLink, // edit notes link\n file: file, // wiki file name\n href: href, // full href to wiki file\n $markers: $markers,\n autoShow: autoShow\n });\n\n this.callbacks = {\n enable: $.proxy(this.enable, this),\n disable: $.proxy(this.disable, this)\n };\n\n callbacks.enable.add(this.callbacks.enable);\n callbacks.disable.add(this.callbacks.disable);\n },\n\n openMapInLightboxCB: function () {\n var $this = $(this);\n var that = $this.data('map');\n\n // start the preload now\n var largeSrc = that.mapLightbox.largeSrc;\n\n var legendPromise = preloader.imgPromise(LEGEND_BG_LINK),\n largeSrcPromise = preloader.imgPromise(largeSrc);\n\n blackOut.create()\n .done(function () {\n $.when(\n legendPromise,\n largeSrcPromise,\n that.mapLightbox.create()\n )\n .done(function () {\n that.mapLightbox.initLightbox();\n });\n });\n },\n\n enable: function () {\n this.$map\n .removeClass('map-disabled')\n .off('click')\n .attr('title', 'click to enlarge')\n .click(this.openMapInLightboxCB);\n\n callbacks.enable.remove(this.callbacks.enable);\n callbacks.disable.add(this.callbacks.disable);\n },\n\n disable: function () {\n this.$map\n .addClass('map-disabled')\n .attr('title', '(window too small to display map)')\n .off('click');\n\n callbacks.disable.remove(this.callbacks.disable);\n callbacks.enable.add(this.callbacks.enable);\n },\n\n getMapPopupWH: function () { // temp popup html, for small map popup\n var mapRatio = layout.getMapRatio(this.src);\n var w = this.$map.data('width'),\n h = mapRatio ? Math.round(w / mapRatio) : null;\n\n var w2 = !h ? Math.round(w / 2) : null;\n\n return { w:w, h:h, w2:w2 };\n },\n\n createMapPopupHtml: function () { // real popup html, for small map popup\n var dim = this.getMapPopupWH();\n var w = dim.w, h = dim.h;\n\n var content = '<div style=\"position: relative;\">' +\n '<img src=\"' + this.src + '\" width=\"' + w +\n (h ? ('px\" height=\"' + h) : '') + 'px\">';\n\n var $markers = this.$map.find('.map-marker');\n $markers.each(function () { // add markers verbatim from embedded markers\n content += $(this).prop('outerHTML');\n });\n\n return content += '</div>';\n },\n\n createMapPopupDefer: function () { // temp popup html, for small map popup\n var dim = this.getMapPopupWH();\n var w = dim.w, h = dim.h;\n if (!dim.h) { w = dim.w2; h = w; }\n\n return '<div style=\"position: relative; width: ' +\n w + 'px; height: ' + h + 'px;' + '\" class=\"map map-zone map-preload\"></div>'\n },\n\n createMapPopupCB: function () { // only used small map popup\n var $this = $(this);\n var that = $this.data('map');\n\n var promise = preloader.imgPromise(that.src);\n var pending = promise.state() === 'pending';\n\n if (pending) {\n var $markers = $this.find('.map-marker');\n $markers.each(function () { // make sure markers preload also\n if (pending) promise = $.when(preloader.marker(this), promise);\n });\n\n promise.done(function () { // reload and re-layout the popup\n that.mapPopupTooltipShow();\n });\n return that.createMapPopupDefer();\n }\n return that.createMapPopupHtml();\n },\n\n gravityCB: function () {\n var $this = $(this);\n var that = $this.data('map');\n\n // need the restricted height via the restricted width and current ratio\n var dim = that.getMapPopupWH();\n var height = dim.h ? dim.h : dim.w2;\n var top = $this.offset().top;\n\n return (top - height - 20) < $(window).scrollTop() ? 'nw' : 'sw';\n },\n\n mapPopupTooltipShowCB: function () {\n var $this = $(this);\n tips.show($this);\n },\n\n mapPopupTooltipHideCB: function () {\n var $this = $(this);\n tips.hide($this);\n },\n\n mapPopupTooltipShow: function () {\n tips.show(this.$map);\n },\n\n mapPopupTooltipHide: function () {\n tips.hide(this.$map);\n },\n\n createMapPopupTooltip: function () { // only used small map popup\n tipsie.set(this.$map, {\n tipClass: 'map-tip-popup',\n delayIn: 50,\n opacity: '1.0',\n html: true,\n fade: true,\n trigger: 'manual',\n gravity: this.gravityCB,\n title: this.createMapPopupCB\n });\n this.$map\n .on('mouseover mouseenter', this.mapPopupTooltipShowCB)\n .on('mouseleave click', this.mapPopupTooltipHideCB);\n },\n\n });\n\n/* ********************* Map Coords with Hover Popup ********************* */\n\n function Coords($map) {\n var that = this;\n\n this.x = $map.data('x');\n this.y = $map.data('y');\n this.iconTitle = '[' + this.x + ',' + this.y + ']';\n\n var $a = $map.find('a');\n if ($a.length) {\n $map.find('sup').unwrap();\n }\n\n var $markers = $map.find('.map-marker');\n\n this.initMap($map, false, $markers, true);\n\n that.createMapPopupTooltip();\n }\n\n Coords.prototype = new Map();\n\n/* ********************* Map Link with Hover Popup ********************* */\n\n function Link($map) {\n var that = this;\n\n var $a = $map.find('a');\n if ($a.length) {\n $map.text($a.text());\n }\n\n this.initMap($map, false, false, false);\n\n that.createMapPopupTooltip();\n }\n\n Link.prototype = new Map();\n\n/* ********************* Embeded Map ********************* */\n\n function Embedded($map) { // Template:Map\n\n var smallSrc = $map.data('small');\n\n var $markers = $map.find('.map-marker');\n\n this.initMap($map, this.findEditLink($map), $markers.length ? $markers : false, false);\n\n $map.find('> a > img')\n .unwrap();\n\n if ($markers.length) {\n $map\n .addClass('map-preload');\n\n var defer = $.when(\n preloader.imgPromise(smallSrc)\n )\n\n $markers.each(function () {\n defer = $.when(preloader.marker(this), defer); // first display, make sure markers preload also\n });\n\n defer.done(function () {\n $map\n .removeClass('map-preload');\n tips.addTextTip($markers, 'hover');\n });\n } else {\n $map\n .removeClass('map-preload');\n }\n }\n\n Embedded.prototype = new Map();\n\n $.extend(Embedded.prototype, {\n\n findEditLink: function ($map) {\n var $walker = $map,\n $prev, $h = false,\n $top = $('#mw-content-text');\n\n while (!$walker.is($top)) {\n if (/^h\\d$/i.test($walker[0].nodeName)) {\n $h = $walker;\n break;\n }\n $prev = $walker.prev();\n $walker = $prev.length ? $prev : $walker.parent();\n }\n\n if (!mw.config.get('wgUserName')) {\n return '/Special:SignUp?returnto=' +\n mw.util.wikiUrlencode(\n mw.config.get('wgPageName') +\n ($h ? '#' + $h\n .find('.mw-headline')\n .attr('id') : '')\n ) +\n '&type=login';\n }\n\n return $h ? $h\n .find('.editsection > a')\n .attr('href') : '?action=edit';\n }\n });\n\n/* ********************* Legend ********************* */\n\n function Legend($markers) {\n this.parsed = {};\n this.forceIndex = [];\n\n $markers.each(\n $.proxy(this.readNote, this)\n );\n delete this.forceIndex;\n }\n\n $.extend(Legend.prototype, {\n\n isEmpty: function () {\n if (this.empty === undefined) {\n this.empty = true;\n for (var i in this.parsed) {\n if (this.parsed.hasOwnProperty(i)) {\n this.empty = false;\n break;\n }\n }\n }\n return this.empty;\n },\n\n isCoord: function (coord) {\n return (/^[-+]?\\d{1,16}(?:\\.\\d{1,6})?$/).test(coord);\n },\n\n parseNote: function (node) {\n var $note = $(node),\n x, y, title, icon, id, legend;\n\n if (!$note.attr('title')) return false;\n\n x = $note.data('x');\n if (!this.isCoord(x)) return false;\n y = $note.data('y');\n if (!this.isCoord(y)) return false;\n\n title = $note.data('title') || '';\n\n icon = $note.data('icon');\n if (!icon || !icon.length) return false;\n\n legend = $note.data('legend');\n if (!legend || !legend.length) return false;\n\n id = 'mn' + nId++;\n $note.attr('data-note', id);\n\n return { id: id, legend: legend };\n },\n\n readNote: function (key, node) {\n var i, g, legend, hash, colon,\n note = this.parseNote(node);\n if (!note) return;\n\n legend = note.legend.split(/\\s*;;\\s*/);\n for (i = 0; i < legend.length; i++) {\n hash = legend[i].split(/\\s*##\\s*/);\n if (hash.length === 2) {\n this.parsed[hash[0]] = this.parsed[hash[0]] || {\n indexed: {}, named: {}\n };\n g = this.parsed[hash[0]];\n g.indexed[hash[1]] = g.indexed[hash[1]] || [];\n g.indexed[hash[1]].push(note.id);\n } else {\n colon = legend[i].split(/\\s*::\\s*/);\n if (colon.length === 2) {\n this.parsed[colon[0]] = this.parsed[colon[0]] || {\n indexed: {}, named: {}\n };\n g = this.parsed[colon[0]];\n if (this.forceIndex.indexOf(colon[1]) !== -1) {\n g.indexed[colon[1]].push(note.id);\n } else if (g.named[colon[1]]) {\n this.forceIndex.push(colon[1]);\n g.indexed[colon[1]] = g.indexed[colon[1]] || [];\n g.indexed[colon[1]].push(g.named[colon[1]]);\n g.indexed[colon[1]].push(note.id);\n delete g.named[colon[1]];\n } else {\n g.named[colon[1]] = note.id;\n }\n }\n }\n }\n },\n\n renderIndexed: function (key, notes) {\n var i, node, span;\n\n span = document.createElement('span');\n span.setAttribute('class', 'map-subGroup-name');\n span.appendChild(\n document.createTextNode(key)\n );\n\n node = document.createElement('div');\n node.setAttribute('class', 'map-subGroup');\n node.appendChild(span);\n\n for (i = 0; i < notes.length; i++) {\n span = document.createElement('span');\n span.setAttribute('class', 'map-subGroup-note pseudo-link');\n span.setAttribute('data-note', notes[i]);\n span.appendChild(\n document.createTextNode(i + 1)\n );\n node.appendChild(span);\n }\n\n return node;\n },\n\n renderNamed: function (key, value) {\n var node = document.createElement('div');\n node.setAttribute('data-note', value);\n node.setAttribute('class', 'map-group-note pseudo-link');\n node.appendChild(\n document.createTextNode(key)\n );\n return node;\n },\n\n renderGroup: function (key, list) {\n var sorted, nodes = [], div;\n\n div = document.createElement('div');\n div.setAttribute('class', 'map-group-name')\n div.appendChild(\n document.createTextNode(key)\n );\n nodes.push(div);\n\n div = document.createElement('div');\n div.setAttribute('class', 'map-group')\n nodes.push(div);\n\n sorted = new SortedObject(list.indexed);\n while (sorted.next()) {\n div.appendChild(\n this.renderIndexed(sorted.key(), sorted.val())\n );\n }\n\n sorted = new SortedObject(list.named);\n while (sorted.next()) {\n div.appendChild(\n this.renderNamed(sorted.key(), sorted.val())\n );\n }\n\n return nodes;\n },\n\n render: function () {\n var sorted = new SortedObject(this.parsed),\n nodes = [];\n\n while (sorted.next()) {\n nodes = nodes.concat(this.renderGroup(sorted.key(), sorted.val()));\n }\n\n this.$wrapper = $(document.createElement('div'))\n .addClass('map-legend-wrapper')\n .append(nodes);\n\n return $(document.createElement('div'))\n .addClass('map-legend')\n .css('background-image', \"url('\" + LEGEND_BG_LINK +\"')\")\n .append(this.$wrapper);\n },\n\n addScrollbar: function () {\n this.$wrapper.removeAttr('style');\n if (this.$wrapper.height() > layout.legend.h) {\n this.$wrapper\n .css({\n width: '255px',\n paddingRight: '15px',\n maxHeight: (layout.legend.h - 2 * LEGEND_PADDING) + 'px'\n });\n }\n }\n });\n\n/* ********************* Map in Lightbox ********************* */\n\n function MapLightbox(data) {\n this.projectionType = data.projectionType;\n this.largeSrc = data.src;\n this.zoneName = data.zone;\n this.extents = data.extents;\n this.editLink = data.editLink;\n this.file = data.file;\n this.href = data.href;\n this.autoShow = data.autoShow;\n\n var $markers = data.$markers\n\n if ($markers && $markers.length) {\n this.$markersOriginal = $markers;\n this.legend = new Legend($markers);\n }\n\n this.empty = !this.legend || this.legend.isEmpty();\n }\n\n $.extend(MapLightbox.prototype, {\n\n create: function () {\n var defer = $.Deferred();\n\n layout.setImage(this.largeSrc)\n\n this.createHeader();\n this.createLargeMap();\n if (!this.empty) {\n this.createLegend();\n }\n\n layout.setLegend(this.empty);\n\n return defer.resolve().promise();\n },\n\n initLightbox: function () {\n var that = this;\n\n layout.doLayout(); // need re-layout after image pre-load completes\n this.resize(); // which suplies data to these resizes and inits\n\n this.initHeader();\n this.initLargeMap();\n if (!this.empty) {\n this.initLegend();\n }\n\n this.callbacks = {\n close: function () { that.close(); },\n resize: function () { that.resize(); },\n refresh: function () { that.refresh(); }\n };\n\n callbacks.refresh.add(this.callbacks.refresh);\n callbacks.resize.add(this.callbacks.resize);\n callbacks.close.add(this.callbacks.close);\n },\n\n createHeader: function () {\n this.$scale = $('<span class=\"map-scale\" style=\"display:none;\"></span>');\n this.$coordinates = $('<span class=\"map-coordinates\" style=\"display:none;\"></span>');\n this.$close = $('<a href=\"#\" class=\"map-close pseudo-link\" title=\"Close\">Close</a>');\n\n this.$info = $('<span class=\"map-info\"></span>')\n .append( $('<span class=\"map-title\"></span>')\n .text(this.zoneName))\n .append(this.$scale)\n .append(this.$coordinates);\n\n this.$buttons = $('<span class=\"map-buttons\"></span>');\n\n this.$buttons\n .append($('<a class=\"map-href\"></a>')\n .prop('href', mw.html.escape(this.href))\n .prop('title', mw.html.escape(this.file))\n .text(this.file));\n\n if (EDIT_NOTE_ENABLE && this.editLink) {\n this.$buttons\n .append($('<a class=\"map-href\" title=\"Edit Map Notes\">Edit Map Notes</a>')\n .prop('href', this.editLink))\n .append($('<a class=\"map-href\" title=\"About Map Notes\">About Map Notes</a>')\n .prop('href', ABOUT_NOTE_LINK));\n }\n\n this.$buttons\n .append(this.$close);\n\n this.$header = $('<div class=\"map-header\" style=\"display:none;\"></div>')\n .css('background-image', \"url('\" + LEGEND_BG_LINK +\"')\")\n .append(this.$info)\n .append(this.$buttons)\n .appendTo(document.body);\n },\n\n closeButtonClick: function () {\n callbacks.close.fire();\n return false;\n },\n\n initHeader: function () {\n this.$close\n .click( this.closeButtonClick );\n },\n\n showNotice: function () {\n if (this.$notice) return;\n\n this.$notice = $('<div class=\"map-title\">press SPACE to fade map</div>')\n .css({\n position: 'fixed',\n left: layout.map.x + layout.map.w / 20 + 'px',\n top: layout.map.y + layout.map.h / 10 * 9 + 'px'\n });\n\n this.$largeMap\n .append(this.$notice);\n\n this.clearNotice = $.proxy(this.removeNotice, this);\n callbacks.close.add(this.clearNotice);\n callbacks.refresh.add(this.clearNotice);\n callbacks.resize.add(this.clearNotice);\n\n window.setTimeout($.proxy(this.fadeNotice, this), 3000);\n },\n\n fadeNotice: function () {\n if (!this.$notice) return;\n this.$notice\n .fadeOut(200,\n $.proxy(this.removeNotice, this)\n );\n },\n\n removeNotice: function () {\n if (!this.$notice) return;\n this.$notice.remove();\n callbacks.close.remove(this.clearNotice);\n callbacks.refresh.remove(this.clearNotice);\n callbacks.resize.remove(this.clearNotice);\n delete this.$notice;\n delete this.clearNotice;\n },\n\n createLargeMap: function () {\n if (this.$markersOriginal) {\n this.$markers = this.$markersOriginal\n .clone()\n .each(function () {\n var $this = $(this);\n $this\n .attr({\n id: $this.attr('data-note'),\n title: $this.attr('original-title')\n })\n .removeAttr('orginal-title');\n });\n }\n\n this.$image = $('<img>', {\n src: this.largeSrc\n });\n\n this.$largeMap = $('<div class=\"map-large\" style=\"display:none;\"></div>')\n .append(this.$image);\n\n if (this.$markers) {\n this.$largeMap\n .append(this.$markers);\n }\n\n this.$largeMap\n .appendTo(document.body);\n },\n\n initLargeMap: function () {\n var that = this;\n\n if (this.$markers) {\n tips.addTextTip(this.$markers, 'hover', this.autoShow);\n //tips.addTextTip(this.$markers, 'manual', this.autoShow);\n }\n\n this.$largeMap\n .on('mouseenter mousemove', $.proxy(this.updateCoords, this))\n .mouseleave($.proxy(this.hideCoords, this));\n\n if (this.$markers) {\n this.showNotice();\n\n $(document.body)\n .on('keydown.mapLightbox', function (e) {\n if (e.which === 32) that.fadeMap();\n })\n .on('keyup.mapLightbox', function (e) {\n if (e.which === 32) that.showMap();\n })\n .on('keypress.mapLightbox', function (e) {\n e.stopImmediatePropagation();\n e.preventDefault();\n });\n }\n },\n\n createLegend: function () {\n this.$legend = this.legend.render()\n .css('display', 'none')\n .appendTo(document.body);\n },\n\n initLegend: function () {\n var that = this;\n this.$legend\n .find('.pseudo-link')\n .mouseenter(function () {\n tips.show($( document.getElementById($(this).data('note')) ));\n })\n .mouseleave(function () {\n tips.hide($( document.getElementById($(this).data('note')) ));\n });\n\n this.$legend\n .find('.map-group-name')\n .data('opened', true)\n .css('cursor', 'pointer')\n .click(function () {\n var $this = $(this),\n move = $this.data('opened') ? 'slideUp' : 'slideDown',\n $group = $this.next('.map-group');\n\n $this.data('opened', !$this.data('opened'));\n\n $group[move](100, function () {\n that.legend.addScrollbar();\n });\n });\n },\n\n hideCoords: function () {\n this.$coordinates.css('display', 'none');\n this.showMap();\n this.showHideButtons();\n },\n\n fadeMap: function () {\n if (!this.isInCorner) {\n this.$image.stop().animate({ opacity: 0.25 }, 200);\n this.isInCorner = true;\n }\n },\n\n showMap: function () {\n if (this.isInCorner) {\n this.$image.stop().animate({ opacity: 1 }, 200);\n this.isInCorner = false;\n }\n },\n\n updateCoords: function (e) { // display current mouse hover map coordinates\n var projection = projectionLinear;\n //var projection = projectionEPSG3857;\n\n var displayString = projection.clientPointToCoordsDisplay(e, layout.map, this.extents)\n\n this.$coordinates\n .css('display', 'inline')\n .text(displayString);\n\n this.showHideButtons();\n },\n\n/*\n formatCoord: function (coord, min, max) { // format and clip coordinates to extents\n var c = Math.round(coord * 10.0) / 10.0;\n if (min > max) { var m = min; min = max; max = m; } // dont assume the coord systems handedness\n c = Math.min(max - 0.1, Math.max(min + 0.1, c));\n return Math.round(c) === c ? c + '.0' : c;\n },\n\n updateCoords: function (e) { // display current mouse hover map coordinates\n var map = layout.map, extents = this.extents;\n var left = extents.left, top = extents.top,\n right = extents.right, bottom = extents.bottom,\n centerx = extents.centerx, centery = extents.centery;\n\n var x100 = (e.clientX - map.x) / map.w * 100.0,\n y100 = (e.clientY - map.y) / map.h * 100.0;\n\n var x, y;\n if (centerx)\n if (x100 < 50.0)\n x = ((x100 * 2) / 100.0) * (centerx - left) + left;\n else\n x = (((x100 - 50.0) * 2) / 100.0) * (right - centerx) + centerx;\n else\n x = (x100 / 100.0) * (right - left) + left;\n\n if (centery)\n if (y100 < 50.0)\n y = ((y100 * 2) / 100.0) * (centery - top) + top;\n else\n y = (((y100 - 50.0) * 2) / 100.0) * (bottom - centery) + centery;\n else\n y = (y100 / 100.0) * (bottom - top) + top;\n\n this.$coordinates\n .css('display', 'inline')\n .text(\n this.formatCoord(x, left, right) + ',' +\n this.formatCoord(y, top, bottom) + (\n left == 0 && top == 0 && right == 100 && bottom == 100 ? '' :\n ' (' + this.formatCoord(x100, 0, 100) + ',' +\n this.formatCoord(y100, 0, 100) + ')'\n )\n );\n\n this.showHideButtons();\n },\n*/\n refresh: function () {\n this.$header\n .add(this.$largeMap)\n .add(this.$legend)\n .css('display', 'none');\n },\n\n resize: function () {\n var map = layout.map;\n\n this.resizePart(this.$header, layout.header);\n this.resizePart(this.$largeMap, map);\n if (!this.empty) {\n this.resizePart(this.$legend, layout.legend);\n }\n\n this.$image.attr({\n width: map.w + 'px',\n height: map.h + 'px'\n });\n\n if (map.scale !== 100) {\n this.$scale\n .css('display', 'inline')\n .text('scale: ' + map.scale + '%');\n } else {\n this.$scale\n .css('display', 'none');\n }\n\n if (this.$legend) {\n this.legend.addScrollbar();\n }\n\n this.showHideButtons();\n },\n\n showHideButtons: function () {\n var infoWidth = this.$info.width(),\n buttonWidth = this.$buttons.removeClass('map-minimal').width();\n\n if (infoWidth + buttonWidth + 20 >= layout.map.w) {\n this.$buttons.addClass('map-minimal');\n }\n },\n\n resizePart: function (part, values) {\n part\n .css({\n width: values.w + 'px', height: values.h + 'px',\n left: values.x + 'px', top: values.y + 'px',\n display: 'block'\n });\n },\n\n close: function () {\n this.$header.remove();\n this.$largeMap.remove();\n if (!this.empty) {\n this.$legend.remove();\n }\n\n delete this.$info;\n delete this.$buttons;\n delete this.$scale;\n delete this.$coordinates;\n delete this.$close;\n delete this.$header;\n delete this.$image;\n delete this.$markers;\n delete this.$largeMap;\n if (!this.empty) {\n delete this.$legend;\n delete this.legend.$wrapper;\n }\n\n callbacks.refresh.remove(this.callbacks.refresh);\n callbacks.resize.remove(this.callbacks.resize);\n callbacks.close.remove(this.callbacks.close);\n delete this.callbacks;\n }\n }); // end of Map in Lightbox, MapLightbox\n\n\n/* ********************* MapProjection ********************* */\n\n var projectionLinear = {\n\n formatCoord: function (coord, min, max) { // format and clip coordinates to extents\n var c = Math.round(coord * 10.0) / 10.0;\n if (min > max) { var m = min; min = max; max = m; } // dont assume the coord systems handedness\n c = Math.min(max - 0.1, Math.max(min + 0.1, c));\n return Math.round(c) === c ? c + '.0' : c;\n },\n\n // display current mouse hover map coordinates\n clientPointToCoordsDisplay: function (e, map, extents) {\n // find client point and percentage\n var left = extents.left, top = extents.top,\n right = extents.right, bottom = extents.bottom,\n centerx = extents.centerx, centery = extents.centery;\n\n var x100 = (e.clientX - map.x) / map.w * 100.0,\n y100 = (e.clientY - map.y) / map.h * 100.0;\n\n var x, y;\n if (centerx)\n if (x100 < 50.0)\n x = ((x100 * 2) / 100.0) * (centerx - left) + left;\n else\n x = (((x100 - 50.0) * 2) / 100.0) * (right - centerx) + centerx;\n else\n x = (x100 / 100.0) * (right - left) + left;\n\n if (centery)\n if (y100 < 50.0)\n y = ((y100 * 2) / 100.0) * (centery - top) + top;\n else\n y = (((y100 - 50.0) * 2) / 100.0) * (bottom - centery) + centery;\n else\n y = (y100 / 100.0) * (bottom - top) + top;\n\n // update display\n return this.formatCoord(x, left, right) + ',' +\n this.formatCoord(y, top, bottom) + (\n left == 0 && top == 0 && right == 100 && bottom == 100 ? '' :\n ' (' + this.formatCoord(x100, 0, 100) + ',' +\n this.formatCoord(y100, 0, 100) + ')');\n }\n };\n\n var projectionEPSG3857 = {\n\n R: 6378137,\n MAX_LATITUDE: 85.0511287798,\n\n _a: null, _b: null, _c: null, _d: null,\n setTransform: function (a,b,c,d) {\n this._a = a; this._b = b; this._c = c; this._d = d;\n },\n\n formatCoord: function (coord, min, max) { // format and clip coordinates to extents\n var c = Math.round(coord * 10.0) / 10.0;\n if (min > max) { var m = min; min = max; max = m; } // dont assume the coord systems handedness\n c = Math.min(max - 0.1, Math.max(min + 0.1, c));\n return Math.round(c) === c ? c + '.0' : c;\n },\n\n // display current mouse hover map coordintes\n clientPointToCoordsDisplay: function (e, map, extents) {\n // set environment for EPSG:3857\n var scale = 0.5 / (Math.PI * this.R);\n this.setTransform(scale, 0.5, -scale, 0.5)\n\n // find client point and percentage\n var left = extents.left, top = extents.top,\n right = extents.right, bottom = extents.bottom,\n centerx = extents.centerx, centery = extents.centery;\n\n var xP = e.clientX - map.x,\n yP = e.clientY - map.y;\n var x100 = xP / map.w * 100.0,\n y100 = yP / map.h * 100.0;\n var xPE = this.R * (x100 / 100.0),\n yPE = this.R * (y100 / 100.0);\n\n // transform the point to EPSG:3857\n scale = null;\n var scale = scale || 1;\n //var xPS = (xPE / scale - this._b) / this._a,\n // yPS = (yPE / scale - this._d) / this._c;\n var xPS = xPE,\n yPS = yPE;\n\n var d = 180 / Math.PI;\n var y2 = (2 * Math.atan(Math.exp(yPS / this.R)) - (Math.PI / 2)) * d,\n x2 = xPS * d / this.R;\n if (isNaN(y2) || isNaN(x2))\n { y2 = 0; x2 = 0; }\n\n // transform as linear sections\n var x, y;\n if (centerx)\n if (x100 < 50.0)\n x = ((x100 * 2) / 100.0) * (centerx - left) + left;\n else\n x = (((x100 - 50.0) * 2) / 100.0) * (right - centerx) + centerx;\n else\n x = (x100 / 100.0) * (right - left) + left;\n\n if (centery)\n if (y100 < 50.0)\n y = ((y100 * 2) / 100.0) * (centery - top) + top;\n else\n y = (((y100 - 50.0) * 2) / 100.0) * (bottom - centery) + centery;\n else\n y = (y100 / 100.0) * (bottom - top) + top;\n\n // update display\n return this.formatCoord(x, left, right) + ',' +\n this.formatCoord(y, top, bottom) +\n (left == 0 && top == 0 && right == 100 && bottom == 100 ? '' :\n ' (' + this.formatCoord(x100, 0, 100) + ',' +\n this.formatCoord(y100, 0, 100) + ')') +\n (' (' + this.formatCoord(x2, -999999999999, 999999999999) + ',' +\n this.formatCoord(y2, -999999999999, 999999999999) + ')');\n //(' (' + x2 + ',' +\n // y2 + ')');\n }\n };\n /*\n R: 6378137,\n MAX_LATITUDE: 85.0511287798,\n\n export function Transformation(a, b, c, d) {\n if (Util.isArray(a)) {\n // use array properties\n this._a = a[0];\n this._b = a[1];\n this._c = a[2];\n this._d = a[3];\n return;\n }\n this._a = a;\n this._b = b;\n this._c = c;\n this._d = d;\n }\n\n export function toTransformation(a, b, c, d) {\n return new Transformation(a, b, c, d);\n }\n\n transformation: (function () {\n var scale = 0.5 / (Math.PI * SphericalMercator.R);\n return toTransformation(scale, 0.5, -scale, 0.5);\n }())\n\n scale: function (zoom) {\n return 256 * Math.pow(2, zoom);\n },\n zoom: function (scale) {\n return Math.log(scale / 256) / Math.LN2;\n },\n\n pointToLatLng: function (point, zoom) {\n var scale = this.scale(zoom),\n untransformedPoint = this.transformation.untransform(point, scale);\n\n return this.projection.unproject(untransformedPoint);\n },\n\n untransform: function (point, scale) {\n scale = scale || 1;\n return new Point(\n (point.x / scale - this._b) / this._a,\n (point.y / scale - this._d) / this._c);\n }\n\n unproject: function (point) {\n var d = 180 / Math.PI;\n return new LatLng(\n (2 * Math.atan(Math.exp(point.y / this.R)) - (Math.PI / 2)) * d,\n point.x * d / this.R);\n },\n\n export function LatLng(lat, lng, alt) {\n if (isNaN(lat) || isNaN(lng)) {\n throw new Error('Invalid LatLng object: (' + lat + ', ' + lng + ')');\n }\n\n // @property lat: Number\n // Latitude in degrees\n this.lat = +lat;\n\n // @property lng: Number\n // Longitude in degrees\n this.lng = +lng;\n\n // @property alt: Number\n // Altitude in meters (optional)\n if (alt !== undefined) {\n this.alt = +alt;\n }\n }\n */\n\n /*\n transformation: (function () {\n var scale = 0.5 / (Math.PI * SphericalMercator.R);\n return toTransformation(scale, 0.5, -scale, 0.5);\n }())\n\n scale: function (zoom) {\n return 256 * Math.pow(2, zoom);\n },\n\n zoom: function (scale) {\n return Math.log(scale / 256) / Math.LN2;\n },\n\n pointToLatLng: function (point, zoom) {\n var scale = null; //1; //256 * Math.pow(2, zoom ? zoom : 1);\n\n scale = scale || 1;\n var x = (point.x / scale - this._b) / this._a;\n var y = (point.y / scale - this._d) / this._c;\n\n return this.projection.unproject(untransformedPoint);\n },\n\n untransform: function (point, scale) {\n scale = scale || 1;\n return new Point(\n (point.x / scale - this._b) / this._a,\n (point.y / scale - this._d) / this._c);\n }\n\n unproject: function (point) {\n var d = 180 / Math.PI;\n return new LatLng(\n (2 * Math.atan(Math.exp(point.y / this.R)) - (Math.PI / 2)) * d,\n point.x * d / this.R);\n },\n */\n/*\n formatCoord: function (coord, min, max) { // format and clip coordinates to extents\n var c = Math.round(coord * 10.0) / 10.0;\n if (min > max) { var m = min; min = max; max = m; } // dont assume the coord systems handedness\n c = Math.min(max - 0.1, Math.max(min + 0.1, c));\n return Math.round(c) === c ? c + '.0' : c;\n },\n\n clientPointToCoordsDisplay: function (e, map, extents) { // display current mouse hover map coordinates\n var left = extents.left, top = extents.top,\n right = extents.right, bottom = extents.bottom,\n centerx = extents.centerx, centery = extents.centery;\n\n var x100 = (e.clientX - map.x) / map.w * 100.0,\n y100 = (e.clientY - map.y) / map.h * 100.0;\n\n var d = 180 / Math.PI;\n var y2 = (2 * Math.atan(Math.exp(y100 / this.R)) - (Math.PI / 2)) * d;\n var x2 = x100 * d / this.R;\n\n var x, y;\n if (centerx)\n if (x100 < 50.0)\n x = ((x100 * 2) / 100.0) * (centerx - left) + left;\n else\n x = (((x100 - 50.0) * 2) / 100.0) * (right - centerx) + centerx;\n else\n x = (x100 / 100.0) * (right - left) + left;\n\n if (centery)\n if (y100 < 50.0)\n y = ((y100 * 2) / 100.0) * (centery - top) + top;\n else\n y = (((y100 - 50.0) * 2) / 100.0) * (bottom - centery) + centery;\n else\n y = (y100 / 100.0) * (bottom - top) + top;\n\n return this.formatCoord(x, left, right) + ',' +\n this.formatCoord(y, top, bottom) +\n (left == 0 && top == 0 && right == 100 && bottom == 100 ? '' :\n ' (' + this.formatCoord(x100, 0, 100) + ',' +\n this.formatCoord(y100, 0, 100) + ')') +\n (' (' + this.formatCoord(x2, left, right) + ',' +\n this.formatCoord(y2, top, bottom) + ')');\n },\n*/\n\n/* ********************* Map in Lightbox Layout ********************* */\n\n var layout = ({\n\n header: {\n h: HEADER_HEIGHT + HEADER_PADDING * 2\n },\n\n margin: {\n vertical: MARGIN_VERTICAL * 2,\n horizontal: MARGIN_HORIZONTAL * 2\n },\n\n between: {\n headerMap: MARGIN_INNER\n },\n\n // current layout, in pixels\n image: { // natural image\n src: null\n },\n win: { // html client window\n w: null,\n h: null\n },\n map: { // image display layout\n w: null,\n h: null,\n scale: null // percent scale of max display size\n },\n\n setImage: function (imageSrc) {\n this.image.src = imageSrc;\n preloader.imgObj(imageSrc); // start the preload right away\n },\n\n getMapRatio: function (imageSrc) {\n var mapRatio = MAP_RATIO; // predfined image ratio from settings\n\n if (!mapRatio) { // get natural ratio if not predefined, if image is loaded\n var imgObj = preloader.imgObj(imageSrc);\n\n if (imgObj) {\n var w = imgObj.naturalWidth,\n h = imgObj.naturalHeight;\n\n if (w && h) {\n mapRatio = w / h;\n }\n }\n }\n return mapRatio;\n },\n\n resetLegend: function () {\n this.legend = {\n w: COLUMN_WIDTH + COLUMN_PADDING * 2\n };\n this.between.mapLegend = MARGIN_INNER;\n },\n\n setLegend: function (empty) {\n if (empty) {\n this.legend = { w: 0, h: 0, x: 0, y: 0 };\n this.between.mapLegend = 0;\n } else {\n this.resetLegend();\n }\n\n this.doLayout();\n },\n\n // sets layout of interface elements based on current client area and maximum possible image\n doLayout: function () {\n\n var win = this.win, $window = $(window);\n win.w = $window.width();\n win.h = $window.height();\n\n // total remaining area left-over available for image, inside current client area\n var header = this.header, legend = this.legend;\n var maxImageW = win.w - (legend.w + this.between.mapLegend + this.margin.horizontal);\n var maxImageH = win.h - (header.h + this.between.headerMap + this.margin.vertical);\n\n // clip max available height and width\n maxImageW = Math.min(MAP_MAX_WIDTH, maxImageW);\n maxImageH = Math.min(MAP_MAX_HEIGHT, maxImageH);\n\n // get image aspect ratio from predfined settings or image\n var mapRatio = this.getMapRatio(this.image.src);\n\n // scale max available height and width to ratio\n if (mapRatio) {\n var newHeight = Math.round(maxImageW / mapRatio); // 3 wide / 2 high -> height = width / 1.5\n\n if (newHeight > maxImageH) // rescale width if scale height needs clipping\n maxImageW = Math.round(maxImageH * mapRatio); // like 2 high * 1.5 = 3 wide\n else\n maxImageH = newHeight; // set new available height\n }\n\n // set straw-man image width and height\n var map = this.map;\n map.w = maxImageW;\n map.h = maxImageH;\n\n map.scale = Math.min(Math.max(Math.round(map.w / MAP_MAX_WIDTH * 100),\n Math.round(map.h / MAP_MAX_HEIGHT * 100)), 100);\n\n if (map.scale < MIN_SCALE) { // image hole is less than 50% of the max hole then bail, not sure why\n callbacks.disable.fire();\n callbacks.close.fire();\n\n } else {\n header.y = Math.round((win.h - map.h - header.h - this.between.headerMap) / 2);\n header.x = Math.round((win.w - map.w - legend.w - this.between.mapLegend) / 2);\n header.w = map.w;\n\n map.x = header.x;\n map.y = header.y + header.h + this.between.headerMap;\n\n if (legend.w) {\n legend.h = map.h + header.h + this.between.headerMap;\n legend.x = map.x + header.w + this.between.mapLegend;\n legend.y = Math.round((win.h - legend.h) / 2);\n }\n\n callbacks.enable.fire();\n }\n },\n\n init: function () {\n this.resetLegend();\n callbacks.refresh.add($.proxy(this.doLayout, this));\n callbacks.close.add($.proxy(this.resetLegend, this));\n return this;\n }\n\n }).init();\n\n function isWikiaImage(src) {\n return src && src.length &&\n /^(?:https?:)?\\/\\/(images|static|img|vignette)(\\d*)\\.wikia\\.(?:nocookie\\.net|com)\\//.test(src);\n }\n\n function isWithinBounds(data, min, max) {\n return data !== undefined && data !== null && data >= min && data <= max;\n }\n\n // now that the infrastructure is in place, process each command on the page\n $maps.each(function () {\n var $map = $(this);\n\n if (!$map.data('map') &&\n isWikiaImage($map.data('small')) &&\n isWikiaImage($map.data('large')) &&\n isWithinBounds($map.data('width'), MAP_MIN_WIDTH, MAP_MAX_WIDTH)\n ) {\n if ($map.hasClass('map-coords') // Template:Map/Coords\n ) {\n $map.data('map', new Coords($map));\n } else if ($map.hasClass('map-textlink')) { // Template:Map/Link\n $map.data('map', new Link($map));\n } else if ($map.hasClass('map-embed')) { // Template:Map\n $map.data('map', new Embedded($map));\n }\n }\n });\n\n layout.doLayout(); // will also set Map to enabled\n $(window)\n .resize(callbacks.refresh.fire)\n .resize($.debounce(100, callbacks.resize.fire));\n\n } // end of initMaps()", "function mapResize(newSize){\r\n\r\n // Get current position\r\n var map_x = unsafeWindow.mapX;\r\n var map_y = unsafeWindow.mapY;\r\n var map_s = unsafeWindow.mapSize;\r\n\r\n // Calculate new X and Y\r\n var delta = parseInt((map_s - newSize) / 2);\r\n\r\n // Overwrite values\r\n map_x += delta;\r\n map_y += delta;\r\n\r\n // InnerHTML\r\n var ihtml = \"\";\r\n ihtml += '<tr>';\r\n ihtml += '<td height=\"38\">' + map_y + '</td>';\r\n ihtml += '<td colspan=\"' + newSize + '\" rowspan=\"' + newSize + '\">';\r\n ihtml += '<div style=\"background-image:url(graphic/map/gras4.png); position:relative; width:' + (53 * newSize) + 'px; height:' + (38 * newSize) +'px; overflow:hidden\" id=\"map\">';\r\n ihtml += '<div id=\"mapOld\" style=\"position:absolute; left:0px; top:0px\">';\r\n ihtml += '<div style=\"color:white; margin:10px\">Lade Karte...</div>';\r\n ihtml += '</div>';\r\n ihtml += '<div id=\"mapNew\" style=\"position:absolute; left:0px; top:0px\"></div>';\r\n ihtml += '</div>';\r\n ihtml += '</td>';\r\n ihtml += '</tr>';\r\n for(jj=1; jj<newSize; jj++){\r\n ihtml += '<tr><td width=\"20\" height=\"38\">' + (map_y + jj) + '</td></tr>';\r\n }\r\n ihtml += '<tr id=\"map_x_axis\">';\r\n ihtml += '<td height=\"20\"></td>';\r\n for(jj=0; jj<newSize; jj++){\r\n ihtml += '<td align=\"center\" width=\"53\">' + (map_x + jj) + '</td>';\r\n }\r\n ihtml += '</tr>';\r\n var tmp = document.getElementById(\"mapCoords\").innerHTML = ihtml;\r\n\r\n // Update data\r\n var url = \"http://\"+(\"\"+location.href).split(\"/\")[2] + \"/\" + unsafeWindow.mapURL + '&start_x=' + map_x + '&start_y=' + map_y + '&size_x=' + newSize + '&size_y=' + newSize;\r\n GM_xmlhttpRequest({\r\n method:\"GET\",\r\n url:url,\r\n onload:function(details){\r\n document.getElementById(\"mapOld\").innerHTML = details.responseText;\r\n }\r\n });\r\n\r\n // mapMoveTopo()\r\n var scrollX = map_x;\r\n var scrollY = map_y;\r\n unsafeWindow.scrollX = scrollX;\r\n unsafeWindow.scrollY = scrollY;\r\n var topoX = parseInt(document.getElementsByName('min_x')[0].value); //minimalstes x auf Karte rechts\r\n var topoY = parseInt(document.getElementsByName('min_y')[0].value); //minimalstes y auf Karte rechts\r\n\r\n var relX = scrollX - topoX;\r\n if(unsafeWindow.globalYDir == 1){\r\n var relY = scrollY - topoY;\r\n }else{\r\n var relY = (45-mapSize) - (scrollY-topoY);\r\n }\r\n \r\n // Rechteck verschieben\r\n document.getElementById('topoRect').style.left = (5*(relX)) + 'px';\r\n document.getElementById('topoRect').style.top = (5*(relY)) + 'px';\r\n document.getElementById('topoRect').style.width = (5*(newSize)) + 'px';\r\n document.getElementById('topoRect').style.height = (5*(newSize)) + 'px';\r\n\t \r\n\t unsafeWindow.ajaxMapInit(parseInt(unsafeWindow.mapX), parseInt(unsafeWindow.mapY), parseInt(newSize) , \"game.php?\"+getUrlParam(\"village\")+\"&screen=map&xml\", 1, 1);\r\n\t \r\n }", "function updateBaseMap0() {\n //alert(mapID);\n if (dom.byId(\"blayerS\" + mapID).checked) {\n roeMapRadon.setBasemap(\"hybrid\");\n } else {\n roeMapRadon.setBasemap(\"gray\");\n }\n }", "newPosition() {\n this.positions = new Array();\n this.positions.push(this.initialState);\n let position = {};\n let positionTmp = \"\";\n let positionMap = new Map();\n let positionX = this.initialState.x;\n let positionY = this.initialState.y;\n switch (this.foo()) {\n case \"LEFT\":\n position = { \"x\": this.initialState.x-1, \"y\":this.initialState.y}\n positionTmp = JSON.stringify(position);\n positionMap.set(positionTmp,\"RIGHT\");\n console.log('map',positionMap);\n break;\n case \"UP\":\n position = { \"x\": this.initialState.x, \"y\":this.initialState.y-1}\n positionTmp = JSON.stringify(position);\n positionMap.set(positionTmp,\"DOWN\");\n console.log('map',positionMap);\n break;\n case \"RIGHT\":\n position = { \"x\": this.initialState.x+1, \"y\":this.initialState.y}\n positionTmp = JSON.stringify(position);\n positionMap.set(positionTmp,\"LEFT\");\n console.log('map',positionMap);\n break;\n case \"DOWN\":\n position = { \"x\": this.initialState.x, \"y\":this.initialState.y+1}\n positionTmp = JSON.stringify(position);\n positionMap.set(positionTmp,\"UP\");\n console.log('map',positionMap);\n break;\n default:\n break;\n }\n\n }", "addMap() {\n operationStartTime = performance.now()\n this.setState({\n divElementsMap: 1000\n })\n }", "function generateMapControls(){\r\n $('#map #inner')\r\n .append(\r\n $('<ul />').attr('id','zoom-locate')\r\n .append(\r\n $('<li />').attr('id','zoom-in')\r\n .append(\r\n $('<a />').attr('href','#').html('Zoom in').bind('click',function(e){e.preventDefault();config.mapObj.setZoom(config.currentZoomLevel+1)})\r\n )\r\n )\r\n .append(\r\n $('<li />').attr('id','zoom-out')\r\n .append(\r\n $('<a />').attr('href','#').html('Zoom out').bind('click',function(e){e.preventDefault();config.mapObj.setZoom(config.currentZoomLevel-1)})\r\n )\r\n )\r\n .append(\r\n $('<li />').attr('id','locate-me')\r\n .append(\r\n $('<a />').attr('href','#').html('Locate me').bind('click',function(e){e.preventDefault();alert('TBC...')})\r\n )\r\n )\r\n )\r\n }", "function changeBasemap(basemap) { //change the icon of each options when changing basemap\n\tmap.removeLayer(baseLayer);\n\tbaseLayer = L.esri.basemapLayer(getLayerName(basemap), pane = \"basemapPane\");\n\tmap.addLayer(baseLayer);\n\tdocument.getElementById(baseLayerID).innerHTML = document.getElementById(baseLayerID).innerHTML.substring(document.getElementById(baseLayerID).innerHTML.indexOf('/') + 4, document.getElementById(baseLayerID).innerHTML.length)\n\tdocument.getElementById(basemap).innerHTML = '<i class=\"fa fa-check\" aria-hidden=\"true\"></i> ' + document.getElementById(basemap).innerHTML;\n\tbaseLayerID = basemap;\n}", "function init(){\n basemap();\n}", "function redraw_all_maps(mIDX, drawMode, baseBounds) {\n\t// drawMode -> 1: draw normal, 2: draw when auto, manual selected, 3: draw all maps force\n\t//console.log(getNow(), mIDX, 'redraw_maps start', 'drawMode: ', drawMode, 'baseBounds: ', baseBounds);\n\t\n\tvar prvBounds = app[mIDX].bounds;\n\tvar mapBounds = app[mIDX].map.getBounds();\n\tapp[mIDX].bounds = mapBounds; // save this map bounds to app.mapN.bounds\n\tif (baseBounds) mapBounds = baseBounds; // auto clicked, join the group aleady existed\n\t\n\t//console.log(getNow(), mIDX, 'prvBounds: ', prvBounds);\n\t//console.log(getNow(), mIDX, 'mapBounds: ', mapBounds);\n\t\n\tvar west = mapBounds.getWest();\n\tvar south = mapBounds.getSouth();\n\tvar east = mapBounds.getEast();\n\tvar north = mapBounds.getNorth();\n\tvar featureMapBounds = {type: \"Feature\", properties: {}, geometry: {type: \"Polygon\", coordinates: [\n\t\t[ [west, south], [east, south], [east, north], [west, north], [west, south] ] \n\t]}}\n\n\t// build selectedGeoJSON from receivedGeoJSON\n\tvar count = 0;\n\tvar selectedFeatures = [];\n\tvar baseLines = lineify(featureMapBounds);\n\t\n\tvar started = moment(new Date());\n\t$.each(app.receivedGeoJSON.features, function(rIdx, feature) {\n\t\tif (isPolygonInMapBounds(feature, baseLines, west, south, east, north)) {\n\t\t\tcount += 1;\n\t\t\tselectedFeatures.push([feature.properties[app.geokey], rIdx]);\n\t\t}\n\t});\n\tvar duration = moment.duration(moment(new Date()).diff(started));\n\t//console.log(getNow(), mIDX, 'selected features count in mapBounds:', count, 'duration:', duration/1000);\n\n\tvar this_sync = $('input[type=radio][name=\"'+mIDX+'-radio\"]:checked').val();\n\t\n\t// determine witch maps need to fitBounds\n\tvar refitBoundableMaps = (!boundsEqual(mapBounds, app[mIDX].map.getBounds())) ? [mIDX] : [];\n\tfor (var i=0; i<app.m; i++) {\n\t\tvar mapN = \"map\" + i;\n\t\tif (mapN == mIDX) continue;\n\t\tvar that_sync = $('input[type=radio][name=\"'+mapN+'-radio\"]:checked').val();\n\t\tif (drawMode != 3) {\n\t\t\tif (this_sync == 'auto' && that_sync == 'manual') continue;\n\t\t\tif (this_sync == 'manual') continue;\n\t\t}\n\t\tif (!boundsEqual(mapBounds, app[mapN].map.getBounds())) {\n\t\t\trefitBoundableMaps.push(mapN);\n\t\t}\n\t}\n\n\t// check need redrawing or not\n\tvar needDrawing = true;\n\tif (drawMode == 1 && count < 1) {\n\t\tconsole.log(getNow(), mIDX, 'redrawing map ignored when count < 1');\n\t\tneedDrawing = false;\n\t}\n\t\n\tif (selectedFeatures.length == CA.features.length) {\n\t\tvar isEqual = true;\n\t\tfor (var f=0; f<selectedFeatures.length; f++) {\n\t\t\tvar prvFeature = CA.features[f];\n\t\t\tvar newFeature = selectedFeatures[f];\n\t\t\tif (newFeature[0] != prvFeature.properties.tractid) {\n\t\t\t\tisEqual = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (drawMode == 1 && isEqual) {\n\t\t\tconsole.log(getNow(), mIDX, 'redrawing map ignored when prvGeoJSON = selectedFeatures');\n\t\t\tneedDrawing = false;\n\t\t}\n\t}\n\t\n\t// determine witch maps need to redraw\n\tvar redrawableMaps = [mIDX];\n\tvar autoCount = (this_sync == 'auto') ? 1 : 0;\n\tfor (var i=0; i<app.m; i++) {\n\t\tvar mapN = \"map\" + i;\n\t\tif (mapN == mIDX) continue;\n\t\tvar that_sync = $('input[type=radio][name=\"'+mapN+'-radio\"]:checked').val();\n\t\tif (that_sync == 'auto') autoCount += 1;\n\t\tvar needRedraw = false;\n\t\tif (drawMode == 1 && this_sync == 'auto' && that_sync == 'auto') needRedraw = true;\n\t\tif (drawMode == 2 && that_sync == 'auto') needRedraw = true;\n\t\tif (drawMode == 3) needRedraw = true;\n\t\tif (needRedraw) redrawableMaps.push(mapN);\n\t}\n\tif (drawMode == 2 && this_sync == 'auto' && redrawableMaps.length == 1) redrawableMaps = [];\n\t//console.log(getNow(), mIDX, 'redrawableMaps', redrawableMaps);\n\n\t// build redraw decison table\n\tvar fitBoundDT = []; for (var i=0; i<app.m; i++) fitBoundDT.push(\" \");\n\tvar drawMapsDT = []; for (var i=0; i<app.m; i++) drawMapsDT.push(\" \");\n\tfor (var i=0; i<refitBoundableMaps.length; i++) \n\t\tfitBoundDT[refitBoundableMaps[i].substr(refitBoundableMaps[i].length-1)] = refitBoundableMaps[i];\n\tif (needDrawing)\n\tfor (var i=0; i<redrawableMaps.length; i++) \n\t\tdrawMapsDT[redrawableMaps[i].substr(redrawableMaps[i].length-1)] = redrawableMaps[i];\n\t//console.log(getNow(), mIDX, 'fitBoundDT: ', fitBoundDT);\n\t//console.log(getNow(), mIDX, 'drawMapsDT: ', drawMapsDT);\n\t\n\t// re arrange decison table\n\tvar c = mIDX.substr(mIDX.length-1);\n\tvar fitBoundST = [fitBoundDT[c]];\n\tvar drawMapsST = [drawMapsDT[c]];\n\tfor (var i=0; i<app.m; i++) {\n\t\tif (i != c) {\n\t\t\tfitBoundST.push(fitBoundDT[i]);\n\t\t\tdrawMapsST.push(drawMapsDT[i]);\n\t\t}\n\t}\n\t//console.log(getNow(), mIDX, 'fitBoundST: ', fitBoundST);\n\t//console.log(getNow(), mIDX, 'drawMapsST: ', drawMapsST);\n\t\n\tif (needDrawing) {\n\t\t// build selectedGeoJSON\n\t\tapp.selectedGeoJSON = {\"type\":\"FeatureCollection\", \"features\":[]};\n\t\t$.each(selectedFeatures, function(rIdx, feature) {\n\t\t\tapp.selectedGeoJSON.features.push(app.receivedGeoJSON.features[feature[1]]);\n\t\t});\n\t\tCA = app.selectedGeoJSON;\n\t\tselectedFeatures = null;\n\t\tapp.selectedBounds = mapBounds;\n\t}\n\t\n\tvar mapN;\n\tfor (var i=0; i<app.m; i++) {\n\t\t//console.log('app.m:', app.m, ' i:', i)\n\t\t// fitBounds \n\t\tmapN = fitBoundST[i];\n\t\tif (mapN != \" \") {\n\t\t\t//console.log(getNow(), mapN, 'fit mapBounds: ', mapBounds);\n\t\t\tapp[mapN].map.fitBounds(mapBounds);\n\t\t}\n\t\t// redraw maps\n\t\tmapN = drawMapsST[i];\n\t\tif (mapN != \" \") {\n\t\t\t//console.log(getNow(), mapN, 'drawing map started.');\n\t\t\tdrawAmap(mapN, drawMode);\n\t\t}\n\t}\n\t// redraw charts\n\tfor (var i=0; i<app.d; i++) {\n\t\tvar mapN = \"map\" + i;\n\t\t//console.log(getNow(), mapN, 'drawing chart started.');\n\t\tdrawAchart(mapN);\n\t}\n}", "function updateBaseMap0() {\n //alert(mapID);\n if (dom.byId(\"blayerS\" + mapID).checked) {\n roeMapAcid.setBasemap(\"hybrid\");\n } else {\n roeMapAcid.setBasemap(\"gray\");\n }\n }", "setMap(map) {\n super.setMap(map);\n this.map = map;\n this.map.on('postrender', () => {\n this.renderPanel();\n });\n }", "function expandMap(){\n $('#footer').hide();\n $(\"#map-container\").css({\n position:'fixed',\n top:0,\n left:0,\n right:0,\n height:height\n });\n $(\"#compress\").show();\n }", "function setMapSymbolLayers(/*client id of the container of panel key and panel only control*/ctrl, /*client id of map*/mapid, /*map argument passed by mapExtentChanged event*/mapArgs) {\n \n \n var map = findMap(mapid);\n\n var panelOnlyViewElm = document.getElementById(ctrl + panelViews[0]);\n\n var panelKeysBoxElm = document.getElementById(ctrl + panelViews[1]);\n\n if (map) {\n if (mapArgs.levelChange || setLayerForFirstTime) { // modified as causing problems with find park and ride\n \n //if map scale is less than or equal to maxMapSymbolScale show the symbol keys\n if (mapArgs.scale <= maxMapSymbolsScale) {\n panelOnlyViewElm.className = panelOnlyViewElm.className.replace(\"show\", \"hide\");\n panelKeysBoxElm.className = panelKeysBoxElm.className.replace(\"hide\", \"show\");\n setLayers(ctrl, mapid, true); // Set the default keys on the map\n }\n else {\n hideLayers(mapid);\n panelOnlyViewElm.className = panelOnlyViewElm.className.replace(\"hide\", \"show\");\n panelKeysBoxElm.className = panelKeysBoxElm.className.replace(\"show\", \"hide\");\n }\n setLayerForFirstTime = false;\n }\n }\n\n}", "function init(mapPos, mapClickCallback, featureSelectCallback, moveEndCallback, trackModEndCallback, mapActivityCallback, toggleFullScreenCallback)\n {\n // set callbacks\n onMapClickCallback = mapClickCallback;\n onFeatureSelectCallback = featureSelectCallback;\n onMoveEndCallback = moveEndCallback;\n onTrackModifyEndCallback = trackModEndCallback;\n onMapActivityCallback = mapActivityCallback;\n onFullScreenCallback = toggleFullScreenCallback;\n\n\n if (map) // re-attach map if it already exists (e.g. from switching views)\n {\n map.setTarget(null);\n map.setTarget(\"map\");\n return;\n }\n\n // init layers\n mapLayer = createMapLayer();\n locationLayer = createEmptyVectorLayer();\n trafficLayer = createEmptyVectorLayer();\n wpTrackLayer = createEmptyVectorLayer();\n closeIconLayer = createEmptyVectorLayer();\n airportLayer = createEmptyVectorLayer();\n navaidLayer = createEmptyVectorLayer();\n reportingpointLayer = createEmptyVectorLayer();\n userWpLayer = createEmptyVectorLayer();\n airspaceLayer = createEmptyVectorLayer();\n flightTrackLayer = createEmptyVectorLayer();\n webcamLayer = createEmptyVectorLayer();\n weatherLayer = createEmptyVectorLayer();\n geopointLayer = createEmptyVectorLayer();\n notamPolyLayer = createEmptyVectorLayer();\n notamTextLayer = createEmptyVectorLayer();\n meteoBgLayer = createEmptyVectorLayer();\n meteoSmaLayer = createEmptyVectorLayer();\n airspaceImageLayer = createImageVectorLayerFromVectorLayer(airspaceLayer);\n\n // buttons\n ol.inherits(ZoomButtonsControl, ol.control.Control);\n var zoomButtonsControl =new ZoomButtonsControl();\n\n ol.inherits(FullScreenButtonControl, ol.control.Control);\n var fsButtonControl = new FullScreenButtonControl();\n\n\n // init map\n map = new ol.Map({\n target: 'map',\n controls: [\n new ol.control.ScaleLine({ units: 'nautical' }),\n fsButtonControl,\n new ol.control.Rotate(),\n new ol.control.Attribution(),\n zoomButtonsControl\n ],\n layers: [\n mapLayer,\n airspaceImageLayer,\n notamPolyLayer,\n webcamLayer,\n closeIconLayer,\n reportingpointLayer,\n userWpLayer,\n navaidLayer,\n airportLayer,\n weatherLayer,\n notamTextLayer,\n meteoBgLayer,\n wpTrackLayer,\n flightTrackLayer,\n trafficLayer,\n meteoSmaLayer,\n geopointLayer,\n locationLayer\n ],\n view: new ol.View(\n {\n center: mapPos.center,\n zoom: mapPos.zoom\n })\n });\n\n // add rotate interaction\n map.addInteraction(new ol.interaction.DragRotateAndZoom());\n\n // register map events\n map.on('singleclick', onSingleClick);\n map.on('pointermove', onPointerMove);\n map.on('moveend', onMoveEnd);\n map.getView().on('change:rotation', onViewRotation);\n\n minZoomLevel = [\n {layer: closeIconLayer, minZoom: 9},\n {layer: airportLayer, minZoom: 9},\n {layer: navaidLayer, minZoom: 9},\n {layer: airspaceImageLayer, minZoom: 9},\n {layer: notamPolyLayer, minZoom: 9},\n {layer: notamTextLayer, minZoom: 9},\n {layer: reportingpointLayer, minZoom: 11},\n {layer: userWpLayer, minZoom: 11},\n {layer: webcamLayer, minZoom: 10},\n {layer: trafficLayer, minZoom: 7},\n {layer: meteoBgLayer, minZoom: 9},\n {layer: meteoSmaLayer, minZoom: 9},\n {layer: weatherLayer, minZoom: 9}];\n\n setLayerVisibility();\n }", "copyAnchorMap() {\n return $.extend( true, {}, this.stateMap.anchor_map );\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }" ]
[ "0.6219127", "0.5920159", "0.57977664", "0.572624", "0.55668133", "0.55501395", "0.55453134", "0.5514503", "0.5485349", "0.54763526", "0.54755807", "0.5462223", "0.54497755", "0.53918785", "0.5387162", "0.53760314", "0.53584814", "0.5345959", "0.5322612", "0.5313737", "0.5306875", "0.53036165", "0.52962583", "0.52953875", "0.5289699", "0.528871", "0.5276912", "0.5267344", "0.5266841", "0.5243506", "0.5237707", "0.52364", "0.52260613", "0.52255654", "0.5216117", "0.5211747", "0.52107537", "0.52080774", "0.5200199", "0.5198138", "0.5193647", "0.5190043", "0.5190006", "0.51828337", "0.5179837", "0.516803", "0.5157599", "0.5149851", "0.51474243", "0.5138722", "0.5119186", "0.511876", "0.511556", "0.5111015", "0.5104071", "0.51020926", "0.5097823", "0.5096551", "0.5094247", "0.5091556", "0.50907105", "0.5087082", "0.5085646", "0.50761044", "0.506514", "0.5063282", "0.50552577", "0.50551474", "0.50543505", "0.5053649", "0.50506675", "0.5047698", "0.50474095", "0.5046504", "0.5045476", "0.5045034", "0.50445646", "0.50427073", "0.50378233", "0.50363636", "0.5031137", "0.50291944", "0.50243694", "0.50155085", "0.50091296", "0.50083256", "0.5008211", "0.5008211", "0.5008211", "0.5008211", "0.5008211", "0.5008211", "0.5008211", "0.5008211", "0.5008211", "0.5008211", "0.5008211", "0.5008211", "0.5008211", "0.5008211" ]
0.5689485
4
every node that depends on a node injected into the submap, has to switch dependency to a node representing that submap. Which should be as simple as: remove all deps (constistent across all submaps) Further required work: [ ] ensure consistency across all the maps
function replaceIncomingDependencies(mongooseObjects, targetNodeId, nodesThatDependOnFutureSubmap, nodesInSubmap) { let results = []; for (let i = 0; i < nodesThatDependOnFutureSubmap.length; i++) { let analysedNode = nodesThatDependOnFutureSubmap[i]; console.log('what about here', analysedNode); let atLeastOneMigrated = false; for (let j = analysedNode.dependencies.length - 1; j >= 0; j--) { let analysedDependency = analysedNode.dependencies[j]; let isForSubmappedNode = false; for (let k = 0; k < nodesInSubmap.length; k++) { if (getId(nodesInSubmap[k]).equals(getId(analysedDependency.target))) { isForSubmappedNode = true; } } if (isForSubmappedNode) { //we have to do something with current dependency if (atLeastOneMigrated) { // we have at least one dependency migrated earlier, we do not want to duplicate them, // so just discard it analysedNode.dependencies.splice(j, 1); j--; //index should be shifted after the number of dependencies is reduced } else { //blatantly switch the first dependency that can be switched analysedDependency.target = targetNodeId; atLeastOneMigrated = true; // j--; } } } if (atLeastOneMigrated) { console.log('being saved', analysedNode); results.push(analysedNode.save()); } } return q.allSettled(results); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createASubmap(mongooseObjects, workspace, mapId, name, responsiblePerson, nodes, impact) {\n let Node = mongooseObjects.Node;\n let WardleyMap = mongooseObjects.WardleyMap;\n return workspace.createAMap({\n name: name,\n responsiblePerson: responsiblePerson\n }, workspace.nowId, /*mark as submap */ true)\n .then(function(newlyCreatedMap) {\n //inSubmapDependencies those deps have to be copied\n //and nodes, of course\n return Node.find({\n _id: {\n $in: nodes\n }\n }).exec().then(function(nodes) {\n let promises = [];\n for (let i = 0; i < nodes.length; i++) {\n let processedNode = nodes[i];\n // for each node that was pushed to a submap\n\n\n //1. set parent map\n processedNode.parentMap = [getId(newlyCreatedMap)];\n\n //2. adjust visibility - steal it from current map\n // if for some reason it is not missing, take the first available one\n let bestVisibility = processedNode.visibility[0];\n for (let j = 0; j < processedNode.visibility.length; j++) {\n let analysedVisibility = processedNode.visibility[j];\n if (getId(analysedVisibility.map).equals(getId(mapId))) {\n bestVisibility = analysedVisibility;\n }\n }\n bestVisibility.map = getId(newlyCreatedMap);\n processedNode.visibility = [bestVisibility];\n\n //3. sort out dependencies, only those presented on a map will stay\n //for now, in the future we may have some cross maps dependencies possible\n processedNode.dependencies = [];\n for (let j = 0; j < impact.inSubmapDependencies.length; j++) {\n let processedDependency = impact.inSubmapDependencies[j];\n if (getId(processedDependency.node).equals(getId(processedNode))) {\n processedNode.dependencies = processedNode.dependencies.concat(processedDependency.deps);\n }\n }\n // 3.a ensure dependencies are visible when they should be\n for (let j = 0; j < processedNode.dependencies.length; j++) {\n processedNode.dependencies[j].visibleOn = [getId(newlyCreatedMap)];\n }\n //4. save, piece of cake\n promises.push(processedNode.save());\n }\n return q.all(promises).then(function() {\n return WardleyMap.findById(getId(newlyCreatedMap)).populate('nodes').exec();\n });\n });\n });\n}", "resolveNodes() {\n const {\n map,\n _cstAliases\n } = this;\n Object.keys(map).forEach(a => {\n map[a] = map[a].resolved;\n });\n\n _cstAliases.forEach(a => {\n a.source = a.source.resolved;\n });\n\n delete this._cstAliases;\n }", "resolveNodes() {\n const {\n map,\n _cstAliases\n } = this;\n Object.keys(map).forEach(a => {\n map[a] = map[a].resolved;\n });\n\n _cstAliases.forEach(a => {\n a.source = a.source.resolved;\n });\n\n delete this._cstAliases;\n }", "resolveNodes() {\n const {\n map,\n _cstAliases\n } = this;\n Object.keys(map).forEach(a => {\n map[a] = map[a].resolved;\n });\n\n _cstAliases.forEach(a => {\n a.source = a.source.resolved;\n });\n\n delete this._cstAliases;\n }", "resolveNodes() {\n const {\n map,\n _cstAliases\n } = this;\n Object.keys(map).forEach(a => {\n map[a] = map[a].resolved;\n });\n\n _cstAliases.forEach(a => {\n a.source = a.source.resolved;\n });\n\n delete this._cstAliases;\n }", "resolveNodes() {\n const {\n map,\n _cstAliases\n } = this;\n Object.keys(map).forEach(a => {\n map[a] = map[a].resolved;\n });\n\n _cstAliases.forEach(a => {\n a.source = a.source.resolved;\n });\n\n delete this._cstAliases;\n }", "cleanupDeps () {\n let i = this.deps.length\n while (i--) {\n const dep = this.deps[i]\n if (!this.newDepIds.has(dep.id)) {\n dep.removeSub(this)\n }\n }\n let tmp = this.depIds\n this.depIds = this.newDepIds\n this.newDepIds = tmp\n this.newDepIds.clear()\n tmp = this.deps\n this.deps = this.newDeps\n this.newDeps = tmp\n this.newDeps.length = 0\n }", "cleanupDeps() {\n let i = this.deps.length\n while (i--) {\n const dep = this.deps[i]\n if (!this.newDepIds.has(dep.id)) {\n dep.removeSub(this)\n }\n }\n let tmp = this.depIds\n this.depIds = this.newDepIds\n this.newDepIds = tmp\n this.newDepIds.clear()\n tmp = this.deps\n this.deps = this.newDeps\n this.newDeps = tmp\n this.newDeps.length = 0\n }", "function formASubmap(mongooseObjects, workspace, mapId, name, responsiblePerson, nodesInSubmap, impact) {\n let Node = mongooseObjects.Node;\n let Workspace = mongooseObjects.Workspace;\n\n let positionsAntipaternVariable = null;\n\n return getSubmapPositions(mongooseObjects, nodesInSubmap, impact).then(function(positions){\n positionsAntipaternVariable = positions;\n return createASubmap(mongooseObjects, workspace, mapId, name, responsiblePerson, nodesInSubmap, impact)\n .then(function(submap){\n return {\n positions: positions,\n submap: submap\n };\n });\n })\n .then(function(arg) {\n return createSubmapNode(mongooseObjects, arg, impact, workspace, name, responsiblePerson);\n })\n .then(function(node) {\n let nodeId = getId(node);\n // and the heavy part. get everyone depending on a submap to really depend on it\n return replaceIncomingDependencies(mongooseObjects, nodeId, impact.nodesThatDependOnFutureSubmap, nodesInSubmap).then(function(irrelevantStuff){\n \t let changedMaps = [];\n \t for (let key in positionsAntipaternVariable.visibility) {\n \t if (positionsAntipaternVariable.visibility.hasOwnProperty(key)) {\n \t \tchangedMaps.push(key);\n \t }\n \t }\n \t return changedMaps;\n });\n });\n}", "cleanupDeps () {\n var i = this.deps.length;\n while (i--) {\n var dep = this.deps[i];\n if (!this.newDepIds.has(dep.id)) {\n dep.removeSub(this);\n }\n }\n var tmp = this.depIds;\n this.depIds = this.newDepIds;\n this.newDepIds = tmp;\n this.newDepIds.clear();\n tmp = this.deps;\n this.deps = this.newDeps;\n this.newDeps = tmp;\n this.newDeps.length = 0;\n }", "cleanupDeps () {\n let i = this.deps.length\n while (i--) {\n const dep = this.deps[i]\n if (!this.newDepIds.has(dep.id)) {\n dep.removeSub(this)\n }\n }\n let tmp = this.depIds\n this.depIds = this.newDepIds\n this.newDepIds = tmp\n this.newDepIds.clear()\n tmp = this.deps\n this.deps = this.newDeps\n this.newDeps = tmp\n this.newDeps.length = 0\n }", "purgeSets() {\n this.children.forEach((subTrie) => {\n subTrie.wordSet.clear();\n subTrie.purgeSets();\n });\n }", "function changeMap(clickedElement) {\n markerLocs.positions.forEach(function (value) {\n if (value.id === clickedElement) {\n value.markerRef.setMap(null);\n }\n });\n\n return;\n}", "function step2(map) {\n\tconst root = { name: '/', nodes: [] };\n\treturn (function next(map, parent, level) {\n\t\tObject.keys(map).forEach(key => {\n\t\t\tlet val = map[key];\n\t\t\tlet node = { name: key };\n\t\t\tif (typeof val === 'object') {\n\t\t\t\tnode.nodes = [];\n\t\t\t\tnode.open = level < 1;\n\t\t\t\tnext(val, node, level + 1);\n\t\t\t} else {\n\t\t\t\tnode.src = val;\n\t\t\t}\n\t\t\tparent.nodes.push(node);\n\t\t});\n\t\treturn parent;\n\t})(map, root, 0);\n}", "_prune_empty_ancestors() {\n if (this.size() > 0 || !this._parent_map) return;\n let map = this,\n key = null;\n while (map.size() == 0) {\n if (!map._parent_map) break;\n key = map._parent_key;\n map = map._parent_map;\n }\n map._map.delete(key);\n }", "[_placeDep] (dep, node, edge, peerEntryEdge = null) {\n if (!edge.error && !this[_updateNames].includes(edge.name))\n return []\n\n // top nodes should still get peer deps from their parent or fsParent\n // if possible, and only install locally if there's no other option,\n // eg for a link outside of the project root.\n const start = edge.peer && !node.isRoot\n ? node.resolveParent || node\n : node\n\n let target\n let canPlace = null\n for (let check = start; check; check = check.resolveParent) {\n const cp = this[_canPlaceDep](dep, check, edge, peerEntryEdge)\n // anything other than a conflict is fine to proceed with\n if (cp !== CONFLICT) {\n canPlace = cp\n target = check\n } else\n break\n\n // nest packages like npm v1 and v2\n // very disk-inefficient\n if (this[_legacyBundling])\n break\n }\n\n if (!target) {\n throw Object.assign(new Error('unable to resolve dependency tree'), {\n package: edge.name,\n spec: edge.spec,\n type: edge.type,\n requiredBy: node.package._id,\n location: node.path,\n })\n }\n\n // Can only get KEEP here if the original edge was valid,\n // and we're checking for an update but it's already up to date.\n if (canPlace === KEEP) {\n dep.parent = null\n return []\n }\n\n // figure out which of this node's peer deps will get placed as well\n const virtualRoot = dep.parent\n\n const placed = [dep]\n const oldChild = target.children.get(edge.name)\n if (oldChild) {\n // if we're replacing, we should also remove any nodes for edges that\n // are now invalid, and where this (or its deps) is the only dependent,\n // and also recurse on that pruning. Otherwise leaving that dep node\n // around can result in spurious conflicts pushing nodes deeper into\n // the tree than needed in the case of cycles that will be removed\n // later anyway.\n const oldDeps = []\n for (const [name, edge] of oldChild.edgesOut.entries()) {\n if (!dep.edgesOut.has(name) && edge.to) {\n oldDeps.push(edge.to)\n }\n }\n dep.replace(oldChild)\n this[_pruneForReplacement](dep, oldDeps)\n } else\n dep.parent = target\n\n // If the edge is not an error, then we're updating something, and\n // MAY end up putting a better/identical node further up the tree in\n // a way that causes an unnecessary duplication. If so, remove the\n // now-unnecessary node.\n if (edge.valid && edge.to.parent !== target && dep.canReplace(edge.to)) {\n edge.to.parent = null\n }\n\n // visit any dependents who are upset by this change\n for (const edge of dep.edgesIn) {\n if (!edge.valid)\n this[_depsQueue].push(edge.from)\n }\n\n // in case we just made some duplicates that can be removed,\n // prune anything deeper in the tree that can be replaced by this\n if (this.idealTree) {\n\n for (const node of this.idealTree.inventory.query('name', dep.name)) {\n if (node !== dep &&\n node.isDescendantOf(target) &&\n !node.inShrinkwrap &&\n !node.inBundle &&\n node.canReplaceWith(dep)) {\n\n // don't prune if the is dupe necessary!\n // root (a, d)\n // +-- a (b, c2)\n // | +-- b (c2) <-- place c2 for b, lands at root\n // +-- d (e)\n // +-- e (c1, d)\n // +-- c1\n // +-- f (c2)\n // +-- c2 <-- pruning this would be bad\n\n const mask = node.parent !== target &&\n node.parent.parent !== target &&\n node.parent.parent.resolve(dep.name)\n\n if (!mask || mask === dep || node.canReplaceWith(mask))\n node.parent = null\n }\n }\n }\n\n // also place its unmet or invalid peer deps at this location\n // note that dep has now been removed from the virtualRoot set\n // by virtue of being placed in the target's node_modules.\n if (virtualRoot) {\n for (const peerEdge of dep.edgesOut.values()) {\n if (peerEdge.peer && !peerEdge.valid) {\n const peer = virtualRoot.children.get(peerEdge.name)\n const peerPlaced = this[_placeDep](\n peer, dep, peerEdge, peerEntryEdge || edge)\n placed.push(...peerPlaced)\n }\n }\n }\n\n return placed\n }", "function unFreeze(node){\n node.fixed = false;\n for( var i = 0; i < node.get('transitions').length; i++ ) {\n var childNode = idMap[node.get('transitions')[i].target];\n unFreeze(childNode);\n }\n }", "function _walkDeps(depsMap, id, file, entryDepsSet, isParentOurs, lastDirectDeps, parentDepsMap) {\n\t\t\tvar deps;\n\t\t\tif (!file) { // since for external module, the `file` is always `false`\n\t\t\t\tdeps = depsMap[id];\n\t\t\t\tif (parentDepsMap && !deps) {\n\t\t\t\t\tdeps = parentDepsMap[id];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdeps = depsMap[file];\n\t\t\t\tdeps = deps ? deps : depsMap[id];\n\t\t\t\tif (parentDepsMap && !deps) {\n\t\t\t\t\tdeps = parentDepsMap[file] ? parentDepsMap[file] : parentDepsMap[id];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!deps && !{}.hasOwnProperty.call(i18nModuleNameSet, id)) {\n\t\t\t\tlog.error('Can not walk dependency tree for: ' + id +\n\t\t\t\t', missing depended module or you may try rebuild all bundles');\n\t\t\t\tlog.info(parentDepsMap[id]);\n\t\t\t\tlog.info('i18nModuleNameSet: ' + JSON.stringify(i18nModuleNameSet, null, ' '));\n\t\t\t\tgutil.beep();\n\t\t\t}\n\t\t\tif (!deps) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t_.forOwn(deps, function(depsValue, depsKey) {\n\t\t\t\tvar isRelativePath = _.startsWith(depsKey, '.');\n\n\t\t\t\tif (!isRelativePath) {\n\t\t\t\t\t// require id is a module name\n\t\t\t\t\tvar isOurs = isParentOurs && !packageUtils.is3rdParty(depsKey);\n\t\t\t\t\tif ({}.hasOwnProperty.call(entryDepsSet, depsKey)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tentryDepsSet[depsKey] = isParentOurs ? true : lastDirectDeps;\n\t\t\t\t\tif (isOurs) {\n\t\t\t\t\t\t_walkDeps(depsMap, depsKey, depsValue, entryDepsSet, true, null, parentDepsMap);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t_walkDeps(depsMap, depsKey, depsValue, entryDepsSet, false, depsKey, parentDepsMap);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// require id is a local file path\n\t\t\t\t\t_walkDeps(depsMap, depsKey, depsValue, entryDepsSet, isParentOurs, lastDirectDeps, parentDepsMap);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "removeToChangeLayers(){\n if (this.map && !this.map.isStyleLoaded()) return;\n this.props.statuses.forEach(status => {\n if (status.key !== 'no_change'){\n status.layers.forEach(layer => {\n if (this.map.getLayer(layer)) {\n this.map.removeLayer(layer);\n }\n });\n }\n });\n }", "_updateBitMapIfNeeded() {\n var _this$consumer2;\n\n if (this.isolated) return;\n\n if ((_this$consumer2 = this.consumer) !== null && _this$consumer2 !== void 0 && _this$consumer2.isLegacy) {\n // this logic is not needed in Harmony, and we can't just remove the component as it may have\n // lanes data\n const componentMapExistWithSameVersion = this.bitMap.isExistWithSameVersion(this.component.id);\n\n if (componentMapExistWithSameVersion) {\n if (this.existingComponentMap && // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n this.existingComponentMap !== _constants().COMPONENT_ORIGINS.NESTED && this.origin === _constants().COMPONENT_ORIGINS.NESTED) {\n return;\n }\n\n this.bitMap.removeComponent(this.component.id);\n }\n } // @ts-ignore this.component.componentMap is set\n\n\n this.component.componentMap = this.addComponentToBitMap(this.component.componentMap.rootDir);\n }", "getDelayedMappedDependencies() {\n let graph = new DependencyGraph();\n let tagPrefix = TemplateMap.tagPrefix;\n\n graph.addNode(tagPrefix + \"all\");\n\n let userConfigCollections = this.getUserConfigCollectionNames();\n\n // Add tags from named user config collections\n for (let tag of userConfigCollections) {\n graph.addNode(tagPrefix + tag);\n }\n\n for (let entry of this.map) {\n if (this.isPaginationOverAllCollections(entry)) {\n continue;\n }\n\n let paginationTagTarget = this.getPaginationTagTarget(entry);\n if (paginationTagTarget && this.isUserConfigCollectionName(paginationTagTarget)) {\n if (!graph.hasNode(entry.inputPath)) {\n graph.addNode(entry.inputPath);\n }\n graph.addDependency(entry.inputPath, tagPrefix + paginationTagTarget);\n\n if (!entry.data.eleventyExcludeFromCollections) {\n // Populates into collections.all\n graph.addDependency(tagPrefix + \"all\", entry.inputPath);\n\n this.addTagsToGraph(graph, entry.inputPath, entry.data.tags);\n }\n\n this.addDeclaredDependenciesToGraph(\n graph,\n entry.inputPath,\n entry.data.eleventyImport?.collections\n );\n }\n }\n\n return graph;\n }", "function refreshAndInitMap() {\n // Remove all added layer:\n removeAllLayers();\n // Remove all source:\n removeAllSources();\n}", "removeNode(id) {\n let node = this.getNode(id);\n if (!node) { return; }\n\n this.checkTransactionStart();\n\n let toRemove = [];\n for (let i = 0; i < this.edges.length; i++) {\n var edge = this.edges[i];\n if ((edge.from.node === node.id) || (edge.to.node === node.id)) {\n toRemove.push(edge);\n }\n }\n for (let j = 0; j < toRemove.length; j++) {\n var edge = toRemove[j];\n this.removeEdge(edge.from.node, edge.from.port, edge.to.node, edge.to.port);\n }\n\n toRemove = [];\n for (let k = 0; k < this.initializers.length; k++) {\n var initializer = this.initializers[k];\n if (initializer.to.node === node.id) {\n toRemove.push(initializer);\n }\n }\n for (let i1 = 0; i1 < toRemove.length; i1++) {\n var initializer = toRemove[i1];\n this.removeInitial(initializer.to.node, initializer.to.port);\n }\n\n toRemove = [];\n for (let j1 = 0; j1 < this.exports.length; j1++) {\n var exported = this.exports[j1];\n if (this.getPortName(id) === exported.process) {\n toRemove.push(exported);\n }\n }\n for (let k1 = 0; k1 < toRemove.length; k1++) {\n var exported = toRemove[k1];\n this.removeExport(exported.public);\n }\n\n toRemove = [];\n for (var pub in this.inports) {\n var priv = this.inports[pub];\n if (priv.process === id) {\n toRemove.push(pub);\n }\n }\n for (let i2 = 0; i2 < toRemove.length; i2++) {\n pub = toRemove[i2];\n this.removeInport(pub);\n }\n\n toRemove = [];\n for (pub in this.outports) {\n var priv = this.outports[pub];\n if (priv.process === id) {\n toRemove.push(pub);\n }\n }\n for (let j2 = 0; j2 < toRemove.length; j2++) {\n pub = toRemove[j2];\n this.removeOutport(pub);\n }\n\n for (let k2 = 0; k2 < this.groups.length; k2++) {\n let group = this.groups[k2];\n if (!group) { continue; }\n let index = group.nodes.indexOf(id);\n if (index === -1) { continue; }\n group.nodes.splice(index, 1);\n }\n\n this.setNodeMetadata(id, {});\n\n if (-1 !== this.nodes.indexOf(node)) {\n this.nodes.splice(this.nodes.indexOf(node), 1);\n }\n\n this.emit('removeNode', node);\n\n return this.checkTransactionEnd();\n }", "function removeChildMapping(mapping, field) {\n\tvar removals = [];\n\tfor (var map in mapping) {\n\t\tvar lookField = field + \".\";\n\t\tif (map.includes(lookField)) {\n\t\t\tremovals.push(map);\n\t\t\tdelete mapping[map];\n\t\t}\n\t}\n\treturn removals;\n}", "function removeChildMapping(mapping, field) {\n\tvar removals = [];\n\tfor (var map in mapping) {\n\t\tvar lookField = field + \".\";\n\t\tif (map.includes(lookField)) {\n\t\t\tremovals.push(map);\n\t\t\tdelete mapping[map];\n\t\t}\n\t}\n\treturn removals;\n}", "_reload() {\n const { uiKey, rootNodes } = this.props;\n //\n this.context.store.dispatch(this.dataManager.receiveData(uiKey, new Immutable.Map({})));\n if (!rootNodes || rootNodes.length === 0) {\n return;\n }\n rootNodes.forEach(rootNode => {\n if (!rootNode.isMoreLink && !this._isLeaf(rootNode) && rootNode.toggled) {\n this._onToggle(rootNode, rootNode.toggled);\n }\n });\n }", "constructByDegree(){\n let id = bagDegrees[bagDegrees.length-1].id;\n let edges = cr.edges().remove();\n let collection = new Array();\n let notId = true;\n let index = 0;\n cr.nodes().forEach(n=>console.log(\"node davor\", n.id()))\n while(notId){\n let node = cr.nodes()[index]\n if(id !== node.id()){\n console.log(\"id \", node.id())\n let remove = node.remove()\n collection.push( remove );\n }\n \n else notId = false;\n }\n \n collection.forEach(n => console.log(\"node in collection \",n.id()))\n collection.forEach(n => n.restore())\n cr.nodes().forEach(n=>console.log(\"node nach add \", n.id()))\n edges.restore();\n }", "_removeCorrespondingXrefs(tx, node) {\n let manager;\n if (node.isInstanceOf(Reference.type)) {\n manager = this._referenceManager;\n } else if (node.isInstanceOf(Footnote.type)) {\n manager = this._footnoteManager;\n } else {\n return;\n }\n manager._getXrefs().forEach(xref => {\n const index = xref.refTargets.indexOf(node.id);\n if (index > -1) {\n tx.update([xref.id, 'refTargets'], { type: 'delete', pos: index });\n }\n });\n }", "removeDependency(key, dependencyKey) {\n var _a;\n let existingNode = this.nodes[key];\n let idx = ((_a = existingNode === null || existingNode === void 0 ? void 0 : existingNode.dependencies) !== null && _a !== void 0 ? _a : []).indexOf(dependencyKey);\n if (existingNode && idx > -1) {\n existingNode.dependencies.splice(idx, 1);\n this.addOrReplace(key, existingNode.dependencies);\n }\n }", "async removeMapData() {\n\n\t\tawait Utils.applyFunctoDataArray(Object.keys(this.layerIds), this.map.removeLayer);\n\n\t\tthis.layerIds = {};\n\n\t\tawait Utils.applyFunctoDataArray(Object.keys(this.sourceIds), this.map.removeSource);\n\n\t\tthis.sourceIds = {};\n\n\t}", "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function () {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.length = 0;\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function () { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes: mappedNodes, dependentObservable: (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "function removeCurrentBasemap() {\n Object.keys(CONFIG.basemaps).forEach(function(basemap) {\n CONFIG.map.removeLayer(CONFIG.basemaps[basemap]);\n CONFIG.map.removeLayer(CONFIG.basemaps.labels);\n });\n}", "invalidatePaths(paths) {\n const fork = new DependencyGraph(this);\n for (const path of paths) {\n const record = fork._documents.get(path);\n if (!record) {\n continue;\n }\n // Tell the dependencies that `path` is no longer one of their dependants.\n for (const dependency of record.dependencies) {\n const dependencyRecord = fork._documents.get(dependency);\n if (dependencyRecord) {\n dependencyRecord.dependants.delete(path);\n }\n }\n fork._documents.delete(path);\n // If there are dependents on this record, we must preserve them,\n // as they're only added with an addDocument() call, and there are\n // never repeated addDocument() calls for the same path.\n if (record.dependants.size > 0) {\n const newRecord = fork._getRecordFor(record.url);\n for (const dependant of record.dependants) {\n newRecord.dependants.add(dependant);\n }\n }\n }\n return fork;\n }", "function clearMapMarkers() {\n for (index in markers) {\n markers[index].setMap(null);\n }\n nodes = [];\n if (polylinePath != undefined) {\n polylinePath.setMap(null);\n }\n markers = [];\n }", "cleanupDeps() {\n // 源码有更多\n this.depIds = this.newDepIds;\n this.newDepIds.clear(); // 清除最新记录 depIds 集合\n this.deps = this.newDeps;\n this.newDeps.length = 0; // 清除最新记录 dep 集合\n }", "swapBasemap(toAdd) {\n this.currentSources = []\n this.currentLayers = []\n\n // First record which layers are currently on the map\n Object.keys(mapStyle.sources).forEach(source => {\n let isPresent = this.map.getSource(source)\n if (isPresent) {\n this.currentSources.push({\n id: source,\n config: mapStyle.sources[source],\n data: isPresent._data || null\n })\n }\n })\n\n mapStyle.layers.forEach(layer => {\n let isPresent = this.map.getLayer(layer.id)\n if (isPresent) {\n this.currentLayers.push({\n layer: layer,\n filters: this.map.getFilter(layer.id)\n })\n }\n })\n\n // Set the style. `style.load` will be fired after to readd other layers\n this.map.setStyle(toAdd)\n }", "function batchMap(change) {\n var op = {\n type: change.action === \"delete\" ? \"del\" : \"put\",\n key: change.id,\n value: {}\n };\n if (change.action !== \"create\" && change.version) {\n op.links = change.version.split(/\\s*,\\s*/).filter(Boolean);\n }\n Object.keys(change).forEach(function(prop) {\n if (SKIP_PROPS.indexOf(prop) > -1) return;\n op.value[prop === \"nodes\" ? \"refs\" : prop] = change[prop];\n });\n op.value.timestamp = op.value.timestamp || new Date().toISOString();\n\n var key = idToP2pId[change.id];\n (change.nodes || []).forEach(function(id, idx) {\n op.value.refs[idx] = idToP2pId[id];\n // console.log('fixed ref mapping', id, 'to', op.value.refs[idx])\n });\n (change.members || []).forEach(function(ref, idx) {\n ref.ref = idToP2pId[ref.ref];\n op.value.members[idx] = ref;\n // console.log('fixed member mapping', ref.ref, 'to', op.value.members[idx])\n });\n\n // filter out nulls\n if (op.value.refs)\n op.value.refs = op.value.refs.filter(function(id) {\n return !!id;\n });\n if (op.value.members)\n op.value.members = op.value.members.filter(function(ref) {\n return !!ref.ref;\n });\n\n return {\n k: key,\n v: op.value\n };\n }", "removeNode(node, id) {\n if (!this.nodes[id]) {\n throw new Error(\"removeNode: attempting to remove a node which is not in hashmap\");\n }\n let val = this.nodes[id].value;\n switch (this.comparator.compare(val, node.value)) {\n case 0:\n // eq - handle siblings if present\n if (node.siblings.length > 0) {\n // if node to remove is alpha sibling...\n if (node.id === id) {\n // get first sibling as replacement\n let alphaSiblingId = node.siblings.shift();\n let alphaSibling = this.nodes[alphaSiblingId];\n // remap all properties but id and value from node onto alphasibling\n alphaSibling.parent = node.parent;\n this.updateChildLink(node.parent, id, alphaSiblingId);\n if (node.left) {\n this.nodes[node.left].parent = alphaSiblingId;\n }\n if (node.right) {\n this.nodes[node.right].parent = alphaSiblingId;\n }\n alphaSibling.left = node.left;\n alphaSibling.right = node.right;\n alphaSibling.siblings = node.siblings;\n alphaSibling.height = node.height;\n alphaSibling.balance = node.balance;\n if (this.apex === id) {\n this.apex = alphaSiblingId;\n }\n // parent all remaining siblings alphaSibling (new parent)\n for (let si of alphaSibling.siblings) {\n this.nodes[si].parent = alphaSiblingId;\n }\n // delete old node from nodes and return\n delete this.nodes[id];\n return;\n }\n // else we are inner sibling\n else {\n let idx = node.siblings.indexOf(id);\n if (idx === -1) {\n throw new Error(\"Unable to remove sibling from parented sibling\");\n }\n node.siblings.splice(idx, 1);\n delete this.nodes[id];\n return;\n }\n }\n // else we have no siblings, node will be removed\n else {\n // if node to delete has no children\n if (!node.left && !node.right) {\n // if we have a parent, remove us from either left or right child link\n this.updateChildLink(node.parent, node.id, null);\n delete this.nodes[id];\n if (id === this.apex) {\n this.apex = null;\n }\n return;\n }\n // if node to delete has only one child we can do simple copy/replace\n if (!node.left || !node.right) {\n if (node.left) {\n this.promoteChild(node, this.nodes[node.left]);\n if (this.apex === id) {\n this.apex = node.left;\n }\n }\n if (node.right) {\n this.promoteChild(node, this.nodes[node.right]);\n if (this.apex === id) {\n this.apex = node.right;\n }\n }\n return;\n }\n // node to delete has two children, need swap with inorder successor\n // use find inorder successor by default\n this.promoteSuccessor(node);\n return;\n }\n case 1:\n // gt - search right branch\n if (!node.right) {\n throw new Error(\"removeNode: Unable to find value in tree\");\n }\n this.removeNode(this.nodes[node.right], id);\n break;\n case -1:\n // lt - search left branch\n if (!node.left) {\n throw new Error(\"removeNode: Unable to find value in tree\");\n }\n this.removeNode(this.nodes[node.left], id);\n break;\n }\n this.updateBalance(node);\n if (node.balance < -1) {\n if (node.left === null) {\n throw new Error(\"insertNode.balance() : left child should not be null\");\n }\n if (this.nodes[node.left].balance <= 0) {\n this.leftLeftCase(node);\n }\n else {\n this.leftRightCase(node);\n }\n }\n if (node.balance > 1) {\n if (node.right === null) {\n throw new Error(\"insertNode.balance() : right child should not be null\");\n }\n if (this.nodes[node.right].balance >= 0) {\n this.rightRightCase(node);\n }\n else {\n this.rightLeftCase(node);\n }\n }\n }", "function removeMapping(state) {\n modalMap[state] = null;\n promiseMap[state] = null;\n }", "function finalDataFiltering() {\n //Reset the mappings\n node_by_id = {};\n edge_by_id = {};\n linked_to_id = {}; //Filter out nodes without any remaining connections\n\n nodes = nodes.filter(function (d) {\n return d.degree > 0;\n });\n nodes.forEach(function (d) {\n node_by_id[d.id] = d;\n }); // nodes.sort((a,b) => types.indexOf(b.type) - types.indexOf(a.type))\n //Only keep the edges that exist in the node list\n\n edges = edges.filter(function (d) {\n return node_by_id[d.source] && node_by_id[d.target];\n }); //Save all of the edges to a specific node\n\n edges.forEach(function (d) {\n edge_by_id[d.source + ',' + d.target] = true;\n if (!linked_to_id[d.source]) linked_to_id[d.source] = [];\n if (!linked_to_id[d.target]) linked_to_id[d.target] = [];\n linked_to_id[d.source].push(node_by_id[d.target]);\n linked_to_id[d.target].push(node_by_id[d.source]);\n }); //forEach\n } //function finalDataFiltering", "function finalDataFiltering() {\n //Reset the mappings\n node_by_id = {};\n edge_by_id = {};\n linked_to_id = {}; //Filter out nodes without any remaining connections\n\n nodes = nodes.filter(function (d) {\n return d.degree > 0;\n });\n nodes.forEach(function (d) {\n node_by_id[d.id] = d;\n }); // nodes.sort((a,b) => types.indexOf(b.type) - types.indexOf(a.type))\n //Only keep the edges that exist in the node list\n\n edges = edges.filter(function (d) {\n return node_by_id[d.source] && node_by_id[d.target];\n }); //Save all of the edges to a specific node\n\n edges.forEach(function (d) {\n edge_by_id[d.source + ',' + d.target] = true;\n if (!linked_to_id[d.source]) linked_to_id[d.source] = [];\n if (!linked_to_id[d.target]) linked_to_id[d.target] = [];\n linked_to_id[d.source].push(node_by_id[d.target]);\n linked_to_id[d.target].push(node_by_id[d.source]);\n }); //forEach\n } //function finalDataFiltering", "function purge() {\n //Replace current map container (\"map\") with an empty one. Else Leaflet error \"container already initialized\", when 2nd map is loaded.\n var newdiv = document.createElement(\"div\");\n newdiv.setAttribute(\"id\", \"map\");\n var oldDiv = document.getElementById(\"map\");\n var parent = document.getElementById(\"content\");\n parent.replaceChild(newdiv,oldDiv);\n //Purge the content of map div element.\n document.getElementById(\"map\").innerHTML=\"\";\n //Reset Wikidata ID's array\n createWikidataIds();\n //Empty output textareabox\n document.getElementById(\"textareabox\").innerHTML=\"\";\n}", "function resetMap(){\n for(var i=0;i<beaconpath.length;i++){\n beaconpath[i].setMap(null);\n }\n beaconpath=[];\n for(var i=0;i<path.length;i++){\n path[i].setMap(null);\n }\n path=[];\n\tshowingBeaconPath=false;\t\n\tshowingReporterPath=false;\n}", "function resetMap() {\n clearMap();\n removePolygon();\n }", "[_resetDepFlags] () {\n const tree = this.idealTree\n const marked = new Set()\n for (const node of this.idealTree.inventory.values()) {\n node.extraneous = true\n node.dev = true\n node.devOptional = true\n node.optional = true\n }\n }", "function removePossibleStepsDuplicates(statesMaps, newStates){\n\n\tvar i = 0;\n\tvar keyMap = null;\n\twhile(i < newStates.length){\n\n\t\tkeyMap = getStateKey(newStates[i]);\n\n\t\tif (statesMaps[keyMap] == null){\n\t\t\tstatesMaps[keyMap] = newStates[i];\n\t\t\ti++;\n\t\t} else {\n\t\t\tnewStates.splice(i, 1);\n\t\t}\n\n\t}\n\n}", "function flushMap() {\n _identityMap = {};\n}", "function removeStaticMap() {\n\t$('#map').prepend('<div id=\"jsMap\"></div>');\n\t$('#staticMap').remove();\n}", "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function() {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.splice(0, mappedNodes.length);\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "mapRemove() {\n\n\t\tthis.map.remove();\n\n\t}", "detachedCallback () {\n /**\n * JS API 4.0 doesn't provide a way of destroying\n * a map after it has been created like in 3.x\n * but you should do it here.\n */\n }", "function topoSort (deps) {\n // Build reversed adjacency list\n var adj = {}\n var inDegree = {}\n var index = {}\n deps.forEach(function (dep) {\n var v = dep.id\n var nbhd = Object.keys(dep.deps)\n index[dep.id] = dep\n inDegree[v] = nbhd.length\n nbhd.forEach(function (filename) {\n var u = dep.deps[filename]\n if (adj[u]) {\n adj[u].push(v)\n } else {\n adj[u] = [v]\n }\n })\n })\n\n // Initialize toVisit queue\n var result = []\n var inverse = {}\n deps.forEach(function (dep) {\n var v = dep.id\n if (!adj[v]) {\n adj[v] = []\n }\n if (inDegree[v] === 0) {\n inverse[v] = result.length\n result.push(v)\n }\n })\n\n // Run BFS\n for (var ptr = 0; ptr < result.length; ptr++) {\n var v = result[ptr]\n adj[v].forEach(function (u) {\n if (--inDegree[u] === 0) {\n inverse[u] = result.length\n result.push(u)\n }\n })\n }\n\n if (result.length !== deps.length) {\n throw new Error('cyclic dependency')\n }\n\n // Relabel dependencies\n return result.map(function (v) {\n var dep = index[v]\n var deps = dep.deps\n var ndeps = {}\n Object.keys(deps).forEach(function (filename) {\n ndeps[filename] = inverse[deps[filename]] | 0\n })\n return {\n id: inverse[v] | 0,\n deps: ndeps,\n file: dep.file,\n source: dep.source,\n entry: dep.entry\n }\n })\n}", "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function() {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.length = 0;\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function() {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.length = 0;\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function() {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.length = 0;\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function() {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.length = 0;\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function() {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.length = 0;\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function() {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.length = 0;\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n // Map this array value inside a dependentObservable so we re-map when any dependency changes\n var mappedNodes = [];\n var dependentObservable = ko.dependentObservable(function() {\n var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n // On subsequent evaluations, just replace the previously-inserted DOM nodes\n if (mappedNodes.length > 0) {\n ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n if (callbackAfterAddingNodes)\n ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n }\n\n // Replace the contents of the mappedNodes array, thereby updating the record\n // of which nodes would be deleted if valueToMap was itself later removed\n mappedNodes.length = 0;\n ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n }", "function _resyncRemoved() {\n if (this.key == null || !this.container || this.container[this.key] !== this.node) {\n this._markRemoved();\n }\n}", "function copyMapAddGoal(departure){\n\tlet specialMap = new Map();\n\t//then re-point the nodes.\n\tfor(let city of cityMap){\n\n\t\tlet name = city[0];\n\t\t//if we don't call new, we'll mutate the master copy of cityMap!\n\t\tlet neighbors = new Map(city[1]);\n\n\t\tspecialMap.set(name, neighbors);\n\n\t\tfor(let n of neighbors){\n\t\t\tlet nbrName = n[0];\n\t\t\tlet nbrDist = n[1];\n\t\t\tif(nbrName == departure){\n\t\t\t\tneighbors.delete(nbrName);\n\t\t\t\tneighbors.set('$', nbrDist);\n\t\t\t}\n\t\t}\n\t}\n\n\tspecialMap.set('$', new Map());\n\treturn specialMap;\n}", "removeMapPaths()\n {\n var self = this;\n d3.select(\"g.states\").selectAll(\"path\").remove();\n d3.select(\"svg.states-svg\").select(\"path.state-senate-borders\").remove();\n reg_flag.destroy();\n \n self.svg.on(\"mousedown.zoom\", null);\n self.svg.on(\"mousemove.zoom\", null);\n self.svg.on(\"dblclick.zoom\", null);\n self.svg.on(\"touchstart.zoom\", null);\n self.svg.on(\"wheel.zoom\", null);\n self.svg.on(\"mousewheel.zoom\", null);\n self.svg.on(\"MozMousePixelScroll.zoom\", null);\n }", "replace(_from, _to, nodes) {\n return HeightMap.of(nodes);\n }", "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n\t // Map this array value inside a dependentObservable so we re-map when any dependency changes\n\t var mappedNodes = [];\n\t var dependentObservable = ko.dependentObservable(function() {\n\t var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n\t // On subsequent evaluations, just replace the previously-inserted DOM nodes\n\t if (mappedNodes.length > 0) {\n\t ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n\t if (callbackAfterAddingNodes)\n\t ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n\t }\n\n\t // Replace the contents of the mappedNodes array, thereby updating the record\n\t // of which nodes would be deleted if valueToMap was itself later removed\n\t mappedNodes.length = 0;\n\t ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n\t }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n\t return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n\t }", "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n\t // Map this array value inside a dependentObservable so we re-map when any dependency changes\n\t var mappedNodes = [];\n\t var dependentObservable = ko.dependentObservable(function() {\n\t var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n\t // On subsequent evaluations, just replace the previously-inserted DOM nodes\n\t if (mappedNodes.length > 0) {\n\t ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n\t if (callbackAfterAddingNodes)\n\t ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n\t }\n\n\t // Replace the contents of the mappedNodes array, thereby updating the record\n\t // of which nodes would be deleted if valueToMap was itself later removed\n\t mappedNodes.length = 0;\n\t ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n\t }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n\t return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n\t }", "function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n\t // Map this array value inside a dependentObservable so we re-map when any dependency changes\n\t var mappedNodes = [];\n\t var dependentObservable = ko.dependentObservable(function() {\n\t var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n\t // On subsequent evaluations, just replace the previously-inserted DOM nodes\n\t if (mappedNodes.length > 0) {\n\t ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n\t if (callbackAfterAddingNodes)\n\t ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n\t }\n\n\t // Replace the contents of the mappedNodes array, thereby updating the record\n\t // of which nodes would be deleted if valueToMap was itself later removed\n\t mappedNodes.length = 0;\n\t ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n\t }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n\t return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n\t }", "function forgetChildren(parent) {\r\n if (parent.childValues.size > 0) {\r\n parent.childValues.forEach(function (_value, child) {\r\n forgetChild(parent, child);\r\n });\r\n }\r\n // Remove this parent Entry from any sets to which it was added by the\r\n // addToSet method.\r\n parent.forgetDeps();\r\n // After we forget all our children, this.dirtyChildren must be empty\r\n // and therefore must have been reset to null.\r\n assert(parent.dirtyChildren === null);\r\n}", "function forgetChildren(parent) {\r\n if (parent.childValues.size > 0) {\r\n parent.childValues.forEach(function (_value, child) {\r\n forgetChild(parent, child);\r\n });\r\n }\r\n // Remove this parent Entry from any sets to which it was added by the\r\n // addToSet method.\r\n parent.forgetDeps();\r\n // After we forget all our children, this.dirtyChildren must be empty\r\n // and therefore must have been reset to null.\r\n assert(parent.dirtyChildren === null);\r\n}", "function regenerateTreeForNewDecorator(blockMap,previousTreeMap,decorator,existingDecorator){return previousTreeMap.merge(blockMap.toSeq().filter(function(block){return decorator.getDecorations(block)!==existingDecorator.getDecorations(block);}).map(function(block){return BlockTree.generate(block,decorator);}));}", "resetMap() {\n if (custom_maps[this.id]) {\n delete custom_maps[this.id];\n\n const map = getMap(this.pad);\n this.map = map;\n this.mapping = map.mapping;\n\n this._compileMapping();\n }\n }", "function removeCluster(map) {\n var overlayPane = d3.select(map.getPanes().overlayPane);\n overlayPane.selectAll('.cluster').remove();\n }", "removeNode(key) {\n const { nodes } = this;\n if (nodes.all[key]) {\n debug(\"Remove %s from the pool\", key);\n delete nodes.all[key];\n }\n delete nodes.master[key];\n delete nodes.slave[key];\n }", "[_canPlaceDep] (dep, target, edge, peerEntryEdge = null) {\n // peer deps of root deps are effectively root deps\n const isRootDep = target.isRoot && (\n // a direct dependency from the root node\n edge.from === target ||\n // a member of the peer set of a direct root dependency\n peerEntryEdge && peerEntryEdge.from === target\n )\n\n const entryEdge = peerEntryEdge || edge\n\n // has child by that name already\n if (target.children.has(dep.name)) {\n const current = target.children.get(dep.name)\n // if the integrities match, then it's literally the same exact bytes,\n // even if it came from somewhere else.\n if (dep.integrity && dep.integrity === current.integrity) {\n return KEEP\n }\n\n // we can always place the root's deps in the root nm folder\n if (isRootDep) {\n return this[_canPlacePeers](dep, target, edge, REPLACE, peerEntryEdge)\n }\n\n // if the version is greater, try to use the new one\n const curVer = current.package.version\n const newVer = dep.package.version\n // always try to replace if the version is greater\n const tryReplace = curVer && newVer && semver.gte(newVer, curVer)\n if (tryReplace && current.canReplaceWith(dep)) {\n return this[_canPlacePeers](dep, target, edge, REPLACE, peerEntryEdge)\n }\n\n // ok, see if the current one satisfies the edge we're working on then\n if (edge.satisfiedBy(current)) {\n return KEEP\n }\n\n // last try, if we prefer deduplication over novelty, check to see if\n // this (older) dep can satisfy the needs of the less nested instance\n if (this[_preferDedupe] && current.canReplaceWith(dep)) {\n return this[_canPlacePeers](dep, target, edge, REPLACE, peerEntryEdge)\n }\n\n // no agreement could be reached :(\n return CONFLICT\n }\n\n // check to see if the target DOESN'T have a child by that name,\n // but DOES have a conflicting dependency of its own. no need to check\n // if this is the edge we're already looking to resolve!\n if (target !== entryEdge.from && target.edgesOut.has(dep.name)) {\n const edge = target.edgesOut.get(dep.name)\n // It might be that the dep would not be valid here, BUT some other\n // version would. Could to try to resolve that, but that makes this no\n // longer a pure synchronous function. ugh.\n // This is a pretty unlikely scenario in a normal install, because we\n // resolve the peer dep set against the parent dependencies, and\n // presumably they all worked together SOMEWHERE to get published in the\n // first place, and since we resolve shallower deps before deeper ones,\n // this can only occur by a child having a peer dep that does not satisfy\n // the parent. It can happen if we're doing a deep update limited by\n // a specific name, however, or if a dep makes an incompatible change\n // to its peer dep in a non-semver-major version bump, or if the parent\n // is unbounded in its dependency list.\n if (!edge.satisfiedBy(dep)) {\n return CONFLICT\n }\n }\n\n // check to see what the name resolves to here, and who depends on it\n // and if they'd be ok with the new dep being there instead. we know\n // at this point that it's not the target's direct child node. this is\n // only a check we do when deduping. if it's a direct dep of the target,\n // then we just make the invalid edge and resolve it later.\n const current = target !== entryEdge.from && target.resolve(dep.name)\n if (current) {\n for (const edge of current.edgesIn.values()) {\n if (edge.from.isDescendantOf(target) && edge.valid) {\n if (!edge.satisfiedBy(dep)) {\n return CONFLICT\n }\n }\n }\n }\n\n return this[_canPlacePeers](dep, target, edge, OK, peerEntryEdge)\n }", "function clear() {\n\t\trootCache = hasWeakMap ? new WeakMap() : createCache();\n\t}", "_removeMap(map) {\n const index = this._selectedMaps.indexOf(map);\n\n if (index > -1) {\n this._selectedMaps.splice(index, 1);\n }\n\n this._eventBus.trigger(EVENT.TOGGLE_VIDEO_MAP, this._selectedMaps);\n }", "function unsubscribeMapUpdates() {\n\tmapUpdateCon.unsubscribe(); \n\tmapUpdateCon = null; \n}", "preprocess(graph, graphFold = \"editor\", nest = \"no\") {\n\n // Prepare graph\n graph.unfold();\n if(graphFold == \"evidence\") {\n graph.fold_evidence();\n } else if(graphFold == \"editor\") {\n graph.fold_go_noctua(this.relations_collapsible)\n }\n\n\n // Get a list of all the singletons we start with.\n var all_starting_singletons_by_id = {};\n var sings = graph.get_singleton_nodes();\n for(let sing of sings) {\n all_starting_singletons_by_id[sing.id()] = true;\n }\n\n\n // Remove all of the undesireable rels.\n var parent_trap = {};\n var note_sink = {}; // keep the reverse lookup info of parent_trap\n if( nest && nest === 'yes' ){\n // console.log('adding nestable rels');\n this.relations_nestable[\"BFO:0000050\"] = true; // part of\n }\n\n for(let e of graph.all_edges()) {\n if(this.relations_nestable.hasOwnProperty(e.predicate_id())) {\n if(!parent_trap.hasOwnProperty(e.subject_id())) {\n parent_trap[e.subject_id()] = [];\n }\n parent_trap[e.subject_id()].push(e.object_id());\n // Note the object for later checking.\n note_sink[e.object_id()] = true;\n }\n // if(this.relations_strippable.hasOwnProperty(e.predicate_id())) {\n // graph.remove_edge(e.subject_id(),\n // e.object_id(),\n // e.predicate_id());\n // }\n }\n\n\n // If it wasn't a singleton before we started, but is one now,\n // remove it. In \"nest\" mode, only remove ones that are not\n // going to be nested.\n var eings = graph.get_singleton_nodes();\n for(let eing of eings) {\n if(!all_starting_singletons_by_id.hasOwnProperty(eing.id())) {\n if( nest && nest === 'yes' && note_sink[eing.id()] ){\n // pass\n }else{\n graph.remove_node(eing.id());\n }\n }\n };\n\n let cat_set = new Set();\n for(let enode of this.bbopGraph.all_nodes()) {\n for(let in_type of enode.types()) {\n cat_set.add(in_type.category());\n }\n }\n this.categories = Array.from(cat_set); \n }", "function setAllMap(map) {\n\tfor (var i = 0; i < markers.length; i++) {\n\t\tmarkers[i].setMap(map);\n\t}\n\tif (typeof(markerCluster) == 'object') {\n\t\tmarkerCluster.clearMarkers();\n\t}\n}", "function change_map_layer(el) {\n if (el.value === \"lock\") {\n conf_layer.remove();\n conf_num_group.remove();\n lock_layer.addTo(map);\n toggle_map_legend(0);\n\n let layers = document.querySelectorAll(\".layer-switch-area > .wrap\");\n for (let i = 0; i < layers.length; ++i) {\n layers[i].classList.remove(\"active\");\n }\n el.parentNode.classList.add(\"active\");\n } else if (el.value === \"conf\") {\n lock_layer.remove();\n conf_layer.addTo(map);\n conf_num_group.addTo(map);\n toggle_map_legend(1);\n\n let layers = document.querySelectorAll(\".layer-switch-area > .wrap\");\n for (let i = 0; i < layers.length; ++i) {\n layers[i].classList.remove(\"active\");\n }\n el.parentNode.classList.add(\"active\");\n }\n}", "function TNodes_doRemoveBranch( nd, action ) {\n action = action || 'nothing';\n var sourcenode = {}\n , mynodesobj = {}\n , targetnode = {};\n \n mynodesobj = nd.Owner;// the TNodes-structure of \n targetnode = nd.Parent.Parent;\n /////////////////////////////////////////////////////////////\n // SOURCE: GET THE BRANCH-\"CONTENT\" FROM THE OPPOSITE NODE //\n /////////////////////////////////////////////////////////////\n switch ( nd.Spin ) {\n case 1: sourcenode = nd.Parent.DownNode;\n break;\n case -1: sourcenode = nd.Parent.UpNode;\n break;\n default: sourcenode = nd;\n }//END SWITCH\n \n if ( sourcenode.HasChild ) {\n \n \n \n // first swap the child's up and down to the target in the database\n\n // using json-obj as clipboard \n var jsonsource=mynodesobj.doCopyBranchToJson();\n //remove the split with delete, because the relink has dropped the children\n mynodesobj.doRemove(nd.Parent,'delete'); // owner is TNodes, parent is TSplit\n mynodesobj.doPasteBranchFromJson(jsonsource, targetnode,'relink');\n mynodesobj.doRemove(nd.Parent,'delete'); \n } else if ( sourcenode.ContainerList.Count > 0 ) {\n ///////////////////////////////\n // LOOP TROUGH CONTAINERLIST //\n ///////////////////////////////\n for ( var i in sourcenode.ContainerList.Item ) {\n var container = sourcenode.ContainerList.Item[ i ];\n if ( container !== null ) {\n var storedLabel = container.Label//Store label to override the 'copy of' wich is added after copy\n if ( container.Nature == 'Container' || container.Nature == 'Sticker' ) {\n var copy = targetnode.doContainerMove( container, undefined, true );\n targetnode.ContainerList.Item[ copy ].Label = storedLabel;// Make the copy and overwrite the labal of the copy\n }//END IF \n }//END IF\n }//END LOOP\n mynodesobj.doRemove( nd.Parent, 'delete' ); // owner is TNodes, parent is TSplit\n } else {\n mynodesobj.doRemove( nd.Parent, 'delete' ); // owner is TNodes, parent is TSplit \n }//END ELSE\n }", "updateDescendants() {\n // delete old Information\n this.descendants = new Map();\n this.all_paths.forEach((p) => {\n p.all_members.forEach((note_path, index) => {\n // make sure it's not the last member of the path\n if (!(index == p.all_members.length - 1)) {\n // create entry in descendants if it doesn't exist\n if (!this.descendants.has(note_path)) {\n this.descendants.set(note_path, []);\n }\n let next_path_member = p.all_members[index + 1];\n // add note as descendant if it isn't already stored in array\n if (!this.descendants.get(note_path).includes(next_path_member)) {\n this.descendants.set(note_path, this.descendants.get(note_path).concat(next_path_member));\n }\n }\n });\n });\n }", "garbageCollect (tree) {\n if (!this.failedDeps.size) { return }\n return sweep(\n tree,\n this.prefix,\n mark(tree, this.failedDeps)\n )\n .then(purged => {\n this.purgedDeps = purged\n this.pkgCount -= purged.size\n })\n }", "function resetMap(){\r\n\t$('#dropdown').hide( 'fade', {}, 0);\r\n\tresetGroup('internships');\r\n\t$('#map').children('g').each(function(){\r\n\t\tdisplayInternships($(this).attr('id'), false);\r\n\t});\r\n}", "removeDuplicateEdges() {\n // search all nodes for duplicate edges\n var nodes = this._nodeMap;\n for(var i in nodes){\n var node = nodes[i];\n\n // compare each edge from this node with all other edges from this node\n var edges = node.edgesFromMe;\n for(let j in edges){\n var edge1 = edges[j];\n\n for(let k in edges){\n var edge2 = edges[k];\n\n // remove edge if it is deemed to be a duplicate\n if(j != k && edge1.to.id === edge2.to.id && edge1.label === edge2.label){\n this.removeEdge(edge2);\n delete edges[k];\n }\n }\n }\n }\n }", "function cleanArcReferences(dataset) {\n var nodes = new NodeCollection(dataset.arcs);\n var map = findDuplicateArcs(nodes);\n var dropCount;\n if (map) {\n replaceIndexedArcIds(dataset, map);\n }\n dropCount = deleteUnusedArcs(dataset);\n if (dropCount > 0) {\n // rebuild nodes if arcs have changed\n nodes = new NodeCollection(dataset.arcs);\n }\n return nodes;\n }", "updateComponentsMap (component, nextDeps, prevDeps) {\n const componentDetails = {\n name: this.extractComponentName(component),\n renderCount: component.renderCount ? component.renderCount + 1 : 1,\n id: component.componentDetailsId || this.debuggerComponentDetailsId++\n }\n component.componentDetailsId = componentDetails.id\n component.renderCount = componentDetails.renderCount\n\n if (prevDeps) {\n for (const depsKey in prevDeps) {\n const debuggerComponents = this.debuggerComponentsMap[prevDeps[depsKey]]\n\n for (let x = 0; x < debuggerComponents.length; x++) {\n if (debuggerComponents[x].id === component.componentDetailsId) {\n debuggerComponents.splice(x, 1)\n if (debuggerComponents.length === 0) {\n delete this.debuggerComponentsMap[prevDeps[depsKey]]\n }\n break\n }\n }\n }\n }\n\n if (nextDeps) {\n for (const depsKey in nextDeps) {\n this.debuggerComponentsMap[nextDeps[depsKey]] = (\n this.debuggerComponentsMap[nextDeps[depsKey]]\n ? this.debuggerComponentsMap[nextDeps[depsKey]].concat(componentDetails)\n : [componentDetails]\n )\n }\n }\n }", "updateReferences() {\n Object.keys(this.referencedVariables).forEach((variable) => {\n this.referencedVariables[variable].referenced = 0;\n });\n this.currentVariables.forEach(d => this.setReferences(d.id));\n this.savedReferences.forEach(d => this.setReferences(d));\n Object.keys(this.referencedVariables).forEach((variable) => {\n if (this.referencedVariables[variable].referenced === 0) {\n delete this.referencedVariables[variable];\n }\n });\n }", "updateFilesInRootDependecies() {\n const { outDir } = this.config;\n\n const filesInRootDist = getFilesFromFolder(outDir)\n .filter(file => !isMapFile(file))\n .map(file => path.join(outDir, file));\n\n for (const file of filesInRootDist) {\n const fileProcessor = new FileProcessor(\n file,\n '',\n this.depGraph,\n this.config\n );\n\n fileProcessor.updateDependecies();\n }\n }", "async _handlePreviouslyNestedCurrentlyImportedCase() {\n if (!this.consumer) return; // $FlowFixMe this.component.componentMap is set\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n\n if (this.origin === _constants().COMPONENT_ORIGINS.IMPORTED && this.component.componentMap.origin === _constants().COMPONENT_ORIGINS.NESTED) {\n await this._cleanOldNestedComponent();\n this.component.componentMap = this.addComponentToBitMap(this.writeToPath);\n }\n }", "function clearMapColor() {\n let states = document.querySelectorAll(\"path\");\n states.forEach(function (state) {\n state.removeAttribute(\"style\");\n state.classList.add(\"clearState\");\n });\n}", "function removeUnusedSubtrees(node) {\n var parent = node.parent;\n if (node instanceof dataflow_1.OutputNode || node.numChildren() > 0) {\n // no need to continue with parent because it is output node or will have children (there was a fork)\n return false;\n }\n else {\n node.remove();\n }\n return true;\n}", "__init25() {this.forceRenames = new Map()}", "pruneBranches() {\n let node = this._top();\n let branches = node.branches;\n node.branches = [];\n for (let n = 0, l = branches.length; n < l; ++n) {\n this._mergeSets(node, branches[n]);\n }\n }", "function removeOldTiles() {\r\n mapList.forEach(function (key) { //for(key in lyrGroups){\r\n var dataLayers = lyrGroups[key].data.getLayers();\r\n if (dataLayers.length > 2) { // TODO: if you change the year fast with arrow, the loading can't keep up - could set this value higher, or put a timer on the remove layer function in next line\r\n for (var i = 0; i < (dataLayers.length - 2); i++) {\r\n lyrGroups[key].data.removeLayer(dataLayers[i])\r\n }\r\n //console.log('n layers: '+lyrGroups[key].data.getLayers().length.toString())\r\n }\r\n })\r\n}", "function removeTreeMap() {\r\n d3.select(\"#the_treeMap\").remove();\r\n d3.select(\"#the_toolTip\").remove();\r\n}", "function dependentKeysWillChange(obj, depKey, meta$$1) {\n if (meta$$1.isSourceDestroying() || !meta$$1.hasDeps(depKey)) {\n return;\n }\n var seen = WILL_SEEN;\n var top = !seen;\n\n if (top) {\n seen = WILL_SEEN = {};\n }\n\n iterDeps(propertyWillChange, obj, depKey, seen, meta$$1);\n\n if (top) {\n WILL_SEEN = null;\n }\n }", "consumeNeoIdMap() {\n if (Neo.idMap) {\n this.add(Object.values(Neo.idMap));\n delete Neo.idMap;\n }\n }", "function clearMap() {\n group.clearLayers();\n }", "function removeUnusedSubtrees(node) {\n if (node instanceof OutputNode || node.numChildren() > 0 || node instanceof FacetNode) {\n // no need to continue with parent because it is output node or will have children (there was a fork)\n return false;\n }\n else {\n node.remove();\n }\n return true;\n }", "function clearMapSubmenuOptionClicked() {\n\n clearMap();\n clearBackgroundData();\n reloadMenuOptionsAvailabilityForRiver(0, 4);\n reloadMenuOptionsAvailabilityForRiver(1, 4);\n reloadMenuOptionsAvailabilityForRiver(2, 4);\n reloadMenuOptionsAvailabilityForRiver(5, 4);\n\n}" ]
[ "0.6814995", "0.6181101", "0.6181101", "0.6181101", "0.6181101", "0.60917664", "0.60319054", "0.59357166", "0.59333426", "0.58866113", "0.586727", "0.5751134", "0.5572706", "0.55113435", "0.5486648", "0.5405267", "0.5387291", "0.538418", "0.53830135", "0.5381048", "0.537357", "0.52926636", "0.52801955", "0.5274717", "0.5274717", "0.5270838", "0.52464", "0.5246101", "0.5218809", "0.52121884", "0.52063227", "0.5197669", "0.5183033", "0.5180683", "0.5174163", "0.51719034", "0.51693666", "0.5168657", "0.5167528", "0.5160008", "0.5160008", "0.515239", "0.51403505", "0.5120794", "0.5117697", "0.5110533", "0.510548", "0.50773376", "0.5073983", "0.50717306", "0.5071398", "0.5069173", "0.5065369", "0.5065369", "0.5065369", "0.5065369", "0.5065369", "0.5065369", "0.5065369", "0.5063207", "0.5037242", "0.5031623", "0.5030167", "0.5029146", "0.5029146", "0.5029146", "0.5028478", "0.5028478", "0.5024261", "0.50189334", "0.5018782", "0.50167054", "0.49941623", "0.49929264", "0.49815023", "0.49706554", "0.496828", "0.4957854", "0.49551898", "0.49540165", "0.4953806", "0.4944106", "0.49419045", "0.49412262", "0.49381372", "0.4935388", "0.4919747", "0.49148795", "0.49101305", "0.49086425", "0.49049398", "0.49044648", "0.49011168", "0.48999467", "0.48969516", "0.48949763", "0.48936224", "0.48886856", "0.48883197", "0.48882106" ]
0.7088818
0
Forms a submap and returns a list of modified maps
function formASubmap(mongooseObjects, workspace, mapId, name, responsiblePerson, nodesInSubmap, impact) { let Node = mongooseObjects.Node; let Workspace = mongooseObjects.Workspace; let positionsAntipaternVariable = null; return getSubmapPositions(mongooseObjects, nodesInSubmap, impact).then(function(positions){ positionsAntipaternVariable = positions; return createASubmap(mongooseObjects, workspace, mapId, name, responsiblePerson, nodesInSubmap, impact) .then(function(submap){ return { positions: positions, submap: submap }; }); }) .then(function(arg) { return createSubmapNode(mongooseObjects, arg, impact, workspace, name, responsiblePerson); }) .then(function(node) { let nodeId = getId(node); // and the heavy part. get everyone depending on a submap to really depend on it return replaceIncomingDependencies(mongooseObjects, nodeId, impact.nodesThatDependOnFutureSubmap, nodesInSubmap).then(function(irrelevantStuff){ let changedMaps = []; for (let key in positionsAntipaternVariable.visibility) { if (positionsAntipaternVariable.visibility.hasOwnProperty(key)) { changedMaps.push(key); } } return changedMaps; }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function demo008(){\n var obj = {\n subObject: {\n subKey: 'subvalue',\n subSubObject: {\n subSubKey: 'subSubValue'\n }\n }\n } ;\n const originalMap = Immutable.fromJS(obj) ;\n const newMap = originalMap.setIn(['subObject','subKey'],'ha ha!') ;\n console.info(newMap.toJS()) ;\n // {subObject:{subKey:'ha ha!', subSubObject:{subSubKey:'subSubValue'}}}\n const newerMap2 = originalMap.setIn(\n ['subObject', 'subSubObject', 'subSubKey'],\n 'ha ha ha!');\n console.info(newerMap2.toJS()) ;\n //// {subObject:{subKey:'subvalue', subSubObject:{subSubKey:'ha ha ha!'}}}\n}", "function createASubmap(mongooseObjects, workspace, mapId, name, responsiblePerson, nodes, impact) {\n let Node = mongooseObjects.Node;\n let WardleyMap = mongooseObjects.WardleyMap;\n return workspace.createAMap({\n name: name,\n responsiblePerson: responsiblePerson\n }, workspace.nowId, /*mark as submap */ true)\n .then(function(newlyCreatedMap) {\n //inSubmapDependencies those deps have to be copied\n //and nodes, of course\n return Node.find({\n _id: {\n $in: nodes\n }\n }).exec().then(function(nodes) {\n let promises = [];\n for (let i = 0; i < nodes.length; i++) {\n let processedNode = nodes[i];\n // for each node that was pushed to a submap\n\n\n //1. set parent map\n processedNode.parentMap = [getId(newlyCreatedMap)];\n\n //2. adjust visibility - steal it from current map\n // if for some reason it is not missing, take the first available one\n let bestVisibility = processedNode.visibility[0];\n for (let j = 0; j < processedNode.visibility.length; j++) {\n let analysedVisibility = processedNode.visibility[j];\n if (getId(analysedVisibility.map).equals(getId(mapId))) {\n bestVisibility = analysedVisibility;\n }\n }\n bestVisibility.map = getId(newlyCreatedMap);\n processedNode.visibility = [bestVisibility];\n\n //3. sort out dependencies, only those presented on a map will stay\n //for now, in the future we may have some cross maps dependencies possible\n processedNode.dependencies = [];\n for (let j = 0; j < impact.inSubmapDependencies.length; j++) {\n let processedDependency = impact.inSubmapDependencies[j];\n if (getId(processedDependency.node).equals(getId(processedNode))) {\n processedNode.dependencies = processedNode.dependencies.concat(processedDependency.deps);\n }\n }\n // 3.a ensure dependencies are visible when they should be\n for (let j = 0; j < processedNode.dependencies.length; j++) {\n processedNode.dependencies[j].visibleOn = [getId(newlyCreatedMap)];\n }\n //4. save, piece of cake\n promises.push(processedNode.save());\n }\n return q.all(promises).then(function() {\n return WardleyMap.findById(getId(newlyCreatedMap)).populate('nodes').exec();\n });\n });\n });\n}", "function entries(map) {\n var array = [];\n for (var k in map) {\n var v = map[k];\n array.push({key: k, values: (v instanceof Array) ? v : entries(v)});\n }\n ;\n return array;\n }", "function getSubset(map, keyList) {\n var subsetMap = {};\n for (var i in map) {\n\n for (var j in keyList) {\n if (keyList[j] == i) {\n subsetMap[i] = map[i];\n break;\n }\n }\n }\n\n return subsetMap;\n }", "function getSubConcepts(kv_mapping) {\n var sub_concepts = [];\n for(var key in kv_mapping) {\n sub_concepts.push(kv_mapping[key]);\n }\n return sub_concepts;\n}", "function buildSelectionMap() {\n _.each($variations, function (index, variant) {\n var mxid = getOptionIdentityMatrix(variant.selected_options);\n $optionsMap[mxid.data.join('')] = { index: index, data: mxid.data };\n $skuMap[variant.sku] = index;\n $hasSubscription = $hasSubscription || variant.subscription_plan;\n });\n }", "function reverseContigMap(contigMap) {\n var ary = [];\n _underscore2['default'].each(contigMap, function (index, name) {\n ary[index] = name;\n });\n return ary;\n}", "function initMappingSublist(form) {\n\t// Definition of sublist area to hold mapping lines before submitting\n\tvar sublist = form.addSubList('custpage_sublist_cncoa_mapping',\t'inlineeditor', displayLbl.mappingLbl);// adds a sublist area to the bottom of the screen\n\n\t// Column definition of sublist\n\t// columns for names\n\tsublist.addField('custpage_is_mapping_selected', 'checkbox',\n\t\t\tdisplayLbl.selected);\n\tsublist.addField('custpage_china_acc_name', 'text', displayLbl.chinaAcntNameLbl)\n\t\t.setDisplayType('disabled');\n\tsublist.addField('custpage_ns_acc', 'text', displayLbl.nsAccountLbl)\n\t\t.setDisplayType('disabled');\n\tsublist.addField('custpage_sbsdry_name', 'text', displayLbl.sbsdryNameLbl)\n\t\t.setDisplayType('disabled');\n\tsublist.addField('custpage_mapping2many', 'checkbox',displayLbl.one2manyChckBoxLbl)\n\t\t.setDisplayType('disabled');\n\tsublist.addField('custpage_deptmnt_name', 'text', displayLbl.departmentNameLbl)\n\t\t.setDisplayType('disabled');\n//\tsublist.addField('custpage_lctn_name', 'text', displayLbl.locationNameLbl)\n//\t\t.setDisplayType('disabled');\n\tsublist.addField('custpage_cls_name', 'text', displayLbl.classNameLbl)\n\t\t.setDisplayType('disabled');\n\n\t\n\t\n\t// columns for ids\n\tsublist.addField('custpage_china_acc', 'text', displayLbl.chinaAcntLbl)\n\t\t.setDisplayType('hidden');\n\tsublist.addField('custpage_ns_acc_id', 'text', displayLbl.accountIdLbl)\n\t\t.setDisplayType('hidden');\n\tsublist.addField('custpage_sbsdry', 'text', displayLbl.sbsdryLbl)\n\t\t.setDisplayType('hidden');\n\tsublist.addField('custpage_deptmnt', 'text', displayLbl.departmentLbl)\n\t\t.setDisplayType('hidden');\n//\tsublist.addField('custpage_lctn', 'text', displayLbl.locationLbl)\n//\t\t.setDisplayType('hidden');\n\tsublist.addField('custpage_cls', 'text', displayLbl.classLbl)\n\t\t.setDisplayType('hidden');\n\n\treturn sublist;\n}", "function makeListFromMap(map){\n var myList = [];\n\n map.forEach(function(value){\n myList.push(value);\n });\n\n return myList;\n}", "function initializeMap(list) {\n var result = {};\n for (var i = 0; i < list.length; i += 2) {\n // Call asFirstClass() here to prevent, for example, a toxic\n // function being used as the toString property of an object\n // literal.\n\tsetPub(result, list[$A$Num(i)], asFirstClass(list[$A$Num(i + 1)]));\n }\n return result;\n }", "function cloneListForMapAndSample(original, excludeDimensions) {\n var allDimensions = original.dimensions;\n var list = new List(zrUtil.map(allDimensions, original.getDimensionInfo, original), original.hostModel); // FIXME If needs stackedOn, value may already been stacked\n\n transferProperties(list, original);\n var storage = list._storage = {};\n var originalStorage = original._storage; // Init storage\n\n for (var i = 0; i < allDimensions.length; i++) {\n var dim = allDimensions[i];\n\n if (originalStorage[dim]) {\n // Notice that we do not reset invertedIndicesMap here, becuase\n // there is no scenario of mapping or sampling ordinal dimension.\n if (zrUtil.indexOf(excludeDimensions, dim) >= 0) {\n storage[dim] = cloneDimStore(originalStorage[dim]);\n list._rawExtent[dim] = getInitialExtent();\n list._extent[dim] = null;\n } else {\n // Direct reference for other dimensions\n storage[dim] = originalStorage[dim];\n }\n }\n }\n\n return list;\n}", "function cloneListForMapAndSample(original, excludeDimensions) {\n var allDimensions = original.dimensions;\n var list = new List(zrUtil.map(allDimensions, original.getDimensionInfo, original), original.hostModel); // FIXME If needs stackedOn, value may already been stacked\n\n transferProperties(list, original);\n var storage = list._storage = {};\n var originalStorage = original._storage; // Init storage\n\n for (var i = 0; i < allDimensions.length; i++) {\n var dim = allDimensions[i];\n\n if (originalStorage[dim]) {\n // Notice that we do not reset invertedIndicesMap here, becuase\n // there is no scenario of mapping or sampling ordinal dimension.\n if (zrUtil.indexOf(excludeDimensions, dim) >= 0) {\n storage[dim] = cloneDimStore(originalStorage[dim]);\n list._rawExtent[dim] = getInitialExtent();\n list._extent[dim] = null;\n } else {\n // Direct reference for other dimensions\n storage[dim] = originalStorage[dim];\n }\n }\n }\n\n return list;\n}", "function cloneListForMapAndSample(original, excludeDimensions) {\n var allDimensions = original.dimensions;\n var list = new List(zrUtil.map(allDimensions, original.getDimensionInfo, original), original.hostModel); // FIXME If needs stackedOn, value may already been stacked\n\n transferProperties(list, original);\n var storage = list._storage = {};\n var originalStorage = original._storage; // Init storage\n\n for (var i = 0; i < allDimensions.length; i++) {\n var dim = allDimensions[i];\n\n if (originalStorage[dim]) {\n // Notice that we do not reset invertedIndicesMap here, becuase\n // there is no scenario of mapping or sampling ordinal dimension.\n if (zrUtil.indexOf(excludeDimensions, dim) >= 0) {\n storage[dim] = cloneDimStore(originalStorage[dim]);\n list._rawExtent[dim] = getInitialExtent();\n list._extent[dim] = null;\n } else {\n // Direct reference for other dimensions\n storage[dim] = originalStorage[dim];\n }\n }\n }\n\n return list;\n}", "function cloneListForMapAndSample(original, excludeDimensions) {\n var allDimensions = original.dimensions;\n var list = new List(zrUtil.map(allDimensions, original.getDimensionInfo, original), original.hostModel); // FIXME If needs stackedOn, value may already been stacked\n\n transferProperties(list, original);\n var storage = list._storage = {};\n var originalStorage = original._storage; // Init storage\n\n for (var i = 0; i < allDimensions.length; i++) {\n var dim = allDimensions[i];\n\n if (originalStorage[dim]) {\n // Notice that we do not reset invertedIndicesMap here, becuase\n // there is no scenario of mapping or sampling ordinal dimension.\n if (zrUtil.indexOf(excludeDimensions, dim) >= 0) {\n storage[dim] = cloneDimStore(originalStorage[dim]);\n list._rawExtent[dim] = getInitialExtent();\n list._extent[dim] = null;\n } else {\n // Direct reference for other dimensions\n storage[dim] = originalStorage[dim];\n }\n }\n }\n\n return list;\n}", "function cloneListForMapAndSample(original, excludeDimensions) {\n var allDimensions = original.dimensions;\n var list = new List(zrUtil.map(allDimensions, original.getDimensionInfo, original), original.hostModel); // FIXME If needs stackedOn, value may already been stacked\n\n transferProperties(list, original);\n var storage = list._storage = {};\n var originalStorage = original._storage; // Init storage\n\n for (var i = 0; i < allDimensions.length; i++) {\n var dim = allDimensions[i];\n\n if (originalStorage[dim]) {\n // Notice that we do not reset invertedIndicesMap here, becuase\n // there is no scenario of mapping or sampling ordinal dimension.\n if (zrUtil.indexOf(excludeDimensions, dim) >= 0) {\n storage[dim] = cloneDimStore(originalStorage[dim]);\n list._rawExtent[dim] = getInitialExtent();\n list._extent[dim] = null;\n } else {\n // Direct reference for other dimensions\n storage[dim] = originalStorage[dim];\n }\n }\n }\n\n return list;\n}", "map(predicate) {\n const tuples = this.toArray().map(([component, value]) => {\n const newValue = predicate(value, component);\n return [component.id.toString(), [component, newValue]];\n });\n return new ComponentMap(new Map(tuples));\n }", "get mapIn() {\n\t return _objectSpread({}, sanitizeExternalDrops(this.props.mapIn), {\n\t [this.rootKey]: internalMapIn\n\t });\n\t }", "_get2Groups(map) {\n let group1 = [],\n group2 = [];\n\n let keys = [...map.keys()];\n keys.forEach(k => map.get(k) == 1 ? group1.push(k) : group2.push(k))\n return [group1, group2];\n }", "function createNestedMap(base, names, value) {\n let currentBase = base;\n\n for(let name of names) {\n\n // Does key exist on map?\n if (!currentBase.has(name)){\n // Create key\n currentBase.set(name, new Map());\n }\n\n // Update the currentBase\n currentBase = currentBase.get(name);\n\n }\n\n // Set the value in the final position\n let finalName = names[names.length - 1];\n currentBase.set(finalName, value);\n\n}", "function rebuildMapBounds() {\n bounds = new google.maps.LatLngBounds();\n for (var person in people) {\n bounds.extend(people[person].marker.getPosition());\n }\n }", "function contents(map, tight) {\n var minDepth = Infinity\n var index = -1\n var length = map.length\n var table\n\n // Find minimum depth.\n while (++index < length) {\n if (map[index].depth < minDepth) {\n minDepth = map[index].depth\n }\n }\n\n // Normalize depth.\n index = -1\n\n while (++index < length) {\n map[index].depth -= minDepth - 1\n }\n\n // Construct the main list.\n table = list()\n\n // Add TOC to list.\n index = -1\n\n while (++index < length) {\n insert(map[index], table, tight)\n }\n\n return table\n}", "function pagesMap2Array(input) {\n\t\t\tvar output = Object.keys(input).map(function(key) {\n\t\t\t\tvar page = input[key];\n\t\t\t\t//add the key to the array for reference\n\t\t\t\t//page[\"id\"] = key;\n\t\t\t\t//Recursive call for nested pages\n\t\t\t\tif (page.pages) {\n\t\t\t\t\tpage.pages = pagesMap2Array(page.pages);\n\t\t\t\t}\n\t\t\t\treturn input[key];\n\t\t\t});\n\t\t\treturn output;\n\t\t}", "function reverseContigMap(contigMap: {[key:string]: number}): Array<string> {\n var ary = [];\n _.each(contigMap, (index, name) => {\n ary[index] = name;\n });\n return ary;\n}", "function buildMapFromArray(myMap) {\r\n var num = myMap.length;\r\n// alert(num+\" \"+myMap+\" \"+myMap[0][1]);\r\n \r\n var ret = new Array();\r\n for (var i = 0; i < num; i++) {\r\n var city = new Object();\r\n city.index = i;\r\n city.x = cityRad+myMap[i][0];\r\n city.y = cityRad+myMap[i][1];\r\n ret.push(city);\r\n }\r\n return ret;\r\n}", "function demo014(){\n var obj = [{v: 0}, {v: 1}, {v: 1}, {v: 0}, {v: 1}] ;\n const data = Immutable.fromJS(obj) ;\n data.groupBy(x=>x.get('v')) ;\n //// Map {0: [{v: 0},{v: 0}], 1: [{v: 1},{v: 1},{v: 1}]}\n}", "groupBy(toKey) {\n const map = new Map();\n for (const value of this) {\n const key = toKey(value);\n map_1.multiMapAdd(map, key, value);\n }\n return map;\n }", "flatten(){\n\n let scope = this;\n\n const result = new Map();\n const appliedValves = new Map();\n\n for(const [key, value] of scope._dataMap){\n result.set(key, value);\n }\n\n while(scope = scope._parent){\n\n const dataList = scope._dataMap;\n const valves = scope._valveMap;\n const mirrors = scope._mirrorMap;\n\n if(!dataList.size)\n continue;\n\n // further restrict valves with each new scope\n\n if(valves.size){\n if(appliedValves.size) {\n for (const key of appliedValves.keys()) {\n if(!valves.has(key))\n appliedValves.delete(key);\n }\n } else {\n for (const [key, value] of valves.entries()) {\n appliedValves.set(key, value);\n }\n }\n }\n\n const possibles = appliedValves.size ? appliedValves : dataList;\n\n for(const key of possibles.keys()) {\n if (!result.has(key)) {\n\n const data = mirrors.get(key) || dataList.get(key);\n if (data)\n result.set(key, data);\n }\n }\n\n }\n\n return result;\n\n }", "function cloneMap(map) {\n var clone = new Map();\n map.forEach(function (value, key) {\n clone.set(key, value);\n });\n return clone;\n }", "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 }", "function flattenTreemap(rawtreemap) {\n var flattreemap = [];\n var i, j;\n\n for (i = 0; i < rawtreemap.length; i++) {\n for (j = 0; j < rawtreemap[i].length; j++) {\n flattreemap.push(rawtreemap[i][j]);\n }\n }\n\n return flattreemap;\n } // squarify - as per the Bruls paper", "addToJSMap(ctx, map) {\n for (const {\n source\n } of this.value.items) {\n if (!(source instanceof YAMLMap)) throw new Error('Merge sources must be maps');\n const srcMap = source.toJSON(null, ctx, Map);\n\n for (const [key, value] of srcMap) {\n if (map instanceof Map) {\n if (!map.has(key)) map.set(key, value);\n } else if (map instanceof Set) {\n map.add(key);\n } else {\n if (!Object.prototype.hasOwnProperty.call(map, key)) map[key] = value;\n }\n }\n }\n\n return map;\n }", "addToJSMap(ctx, map) {\n for (const {\n source\n } of this.value.items) {\n if (!(source instanceof YAMLMap)) throw new Error('Merge sources must be maps');\n const srcMap = source.toJSON(null, ctx, Map);\n\n for (const [key, value] of srcMap) {\n if (map instanceof Map) {\n if (!map.has(key)) map.set(key, value);\n } else if (map instanceof Set) {\n map.add(key);\n } else {\n if (!Object.prototype.hasOwnProperty.call(map, key)) map[key] = value;\n }\n }\n }\n\n return map;\n }", "function makeRelexMap(relex) {\n let map = {};\n for (let rel of relex) {\n let offset = rel.startOffset;\n let list = map[offset];\n if (list === undefined) {\n list = [];\n map[offset] = list;\n }\n list.push(rel);\n }\n return map;\n }", "function mapExpand(Wss) {\n var Rss = []\n for (var Ws of Wss) {\n var Hss = maybeExpand(Ws)\n if (null == Hss) {\n Rss.push(Ws)\n } else\n for (var X of Hss)\n Rss.push(X)\n }\n return Rss\n}", "function applyPartialHeightmap(geometry, heightmap, startX, startZ) {\n var vertices = geometry.attributes.position.array;\n var totalSize = Math.sqrt(vertices.length / 3);\n var size = heightmap.length;\n for (var z = 0; z < size; z++) {\n for (var x = 0; x < size; x++) {\n // calulate the right corresponding index in vertices\n var i = ((x + startX*size)*totalSize + z + startZ*size)*3 + 1;\n vertices[i] = heightmap[z][x];\n }\n }\n\n}", "function removeChildMapping(mapping, field) {\n\tvar removals = [];\n\tfor (var map in mapping) {\n\t\tvar lookField = field + \".\";\n\t\tif (map.includes(lookField)) {\n\t\t\tremovals.push(map);\n\t\t\tdelete mapping[map];\n\t\t}\n\t}\n\treturn removals;\n}", "function removeChildMapping(mapping, field) {\n\tvar removals = [];\n\tfor (var map in mapping) {\n\t\tvar lookField = field + \".\";\n\t\tif (map.includes(lookField)) {\n\t\t\tremovals.push(map);\n\t\t\tdelete mapping[map];\n\t\t}\n\t}\n\treturn removals;\n}", "addToJSMap(ctx, map) {\n for (const {\n source\n } of this.value.items) {\n if (!(source instanceof YAMLMap)) throw new Error('Merge sources must be maps');\n const srcMap = source.toJSON(null, ctx, Map);\n\n for (const [key, value] of srcMap) {\n if (map instanceof Map) {\n if (!map.has(key)) map.set(key, value);\n } else if (map instanceof Set) {\n map.add(key);\n } else if (!Object.prototype.hasOwnProperty.call(map, key)) {\n Object.defineProperty(map, key, {\n value,\n writable: true,\n enumerable: true,\n configurable: true\n });\n }\n }\n }\n\n return map;\n }", "addToJSMap(ctx, map) {\n for (const {\n source\n } of this.value.items) {\n if (!(source instanceof stringifyNumber.YAMLMap)) throw new Error('Merge sources must be maps');\n const srcMap = source.toJSON(null, ctx, Map);\n\n for (const [key, value] of srcMap) {\n if (map instanceof Map) {\n if (!map.has(key)) map.set(key, value);\n } else if (map instanceof Set) {\n map.add(key);\n } else if (!Object.prototype.hasOwnProperty.call(map, key)) {\n Object.defineProperty(map, key, {\n value,\n writable: true,\n enumerable: true,\n configurable: true\n });\n }\n }\n }\n\n return map;\n }", "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}", "updateSubArray() {\n let full_subs = [];\n this.state.subcategories.forEach((e) => {\n let sub = this.props.data.categories.find((sub) => e.id === sub._id);\n if (sub && sub.parent) {\n sub.new_parent = this.props.category;\n if (sub.new_parent._id !== sub.parent._id) {\n let i = sub.parent.subcategories.indexOf(sub._id);\n sub.parent.subcategories.splice(i, 1);\n }\n full_subs.push(sub);\n }\n });\n return full_subs;\n }", "function parseMap(map) {\r\n\tvar dataMap = [];\r\n\tlog(0, 'New map parsed');\r\n\tfor (var i = 0; i < map.length; i++) {\r\n\t\tdataMap.push([]);\r\n\t\tfor (var i2 = 0; i2 < map[i].length; i2++) {\r\n\t\t\tvar type = map[i][i2];\r\n\t\t\tvar obj = {\r\n\t\t\t\ttype: type,\r\n\t\t\t\tx: i2,\r\n\t\t\t\ty: i,\r\n\t\t\t\tcanHaveGun: type == 'g',\r\n\t\t\t\tcanHaveItem: type == 'i',\r\n\t\t\t\tcanSpawnOn: type == 's',\r\n\t\t\t\tgun: undefined,\r\n\t\t\t\titem: undefined,\r\n\t\t\t\thp: settings.blockHP\r\n\t\t\t};\r\n\t\t\tdataMap[i].push(obj);\r\n\t\t}\r\n\t}\r\n\treturn dataMap;\r\n}", "addToJSMap(ctx, map) {\n for (const {\n source\n } of this.value.items) {\n if (!(source instanceof YAMLMap)) throw new Error('Merge sources must be maps');\n const srcMap = source.toJSON(null, ctx, Map);\n\n for (const [key, value] of srcMap) {\n if (map instanceof Map) {\n if (!map.has(key)) map.set(key, value);\n } else if (map instanceof Set) {\n map.add(key);\n } else if (!Object.prototype.hasOwnProperty.call(map, key)) {\n Object.defineProperty(map, key, {\n value,\n writable: true,\n enumerable: true,\n configurable: true\n });\n }\n }\n }\n\n return map;\n }", "addToJSMap(ctx, map) {\n for (const {\n source\n } of this.value.items) {\n if (!(source instanceof YAMLMap)) throw new Error('Merge sources must be maps');\n const srcMap = source.toJSON(null, ctx, Map);\n\n for (const [key, value] of srcMap) {\n if (map instanceof Map) {\n if (!map.has(key)) map.set(key, value);\n } else if (map instanceof Set) {\n map.add(key);\n } else if (!Object.prototype.hasOwnProperty.call(map, key)) {\n Object.defineProperty(map, key, {\n value,\n writable: true,\n enumerable: true,\n configurable: true\n });\n }\n }\n }\n\n return map;\n }", "function getDataMap(pSorted){\n // return [{\n // \"text\": \"HANAMURA\",\n // \"children\": [\n // {\n // id: 'HANAMURA A',\n // text: 'Hanamura A'\n // },\n //]},{...}]\n\n var result = [];\n for (var lMap in pSorted) {\n result.push({\n \"text\": lMap,\n \"children\":getChildrenMaps(pSorted[lMap], lMap)\n });\n }\n\n return result;\n }", "function render_map(given_object) {\n\n //console.log(map_dt);\n given_data_second_part_3rd = given_object[\"second_part_3rd\"];\n given_data_second_part_1st = given_object[\"second_part_1st\"];\n given_data_second_part_2nd = given_object[\"second_part_2nd\"];\n given_data_third_part_1st = given_object[\"third_part_1st\"];\n given_data_third_part_2nd = given_object[\"third_part_2nd\"];\n given_data_fifth_part_1st = given_object[\"fifth_part_1st\"];\n given_data_fifth_part_2nd = given_object[\"fifth_part_2nd\"];\n given_data_fifth_part_3rd = given_object[\"fifth_part_3rd\"];\n given_data_fifth_part_4th = given_object[\"fifth_part_4th\"];\n given_data_fifth_part_5th = given_object[\"fifth_part_5th\"];\n given_data_fifth_part_6th = given_object[\"fifth_part_6th\"];\n given_data_fifth_part_7th = given_object[\"fifth_part_7th\"];\n given_data_fifth_part_8th = given_object[\"fifth_part_8th\"];\n given_data_fifth_part_9th = given_object[\"fifth_part_9th\"];\n given_data_fifth_part_10th = given_object[\"fifth_part_10th\"];\n given_data_fifth_part_11th = given_object[\"fifth_part_11th\"];\n given_data_fifth_part_12th = given_object[\"fifth_part_12th\"];\n given_data_fifth_part_13th = given_object[\"fifth_part_13th\"];\n given_data_fifth_part_14th = given_object[\"fifth_part_14th\"];\n given_data_fifth_part_15th = given_object[\"fifth_part_15th\"];\n given_data_sixth_part_1st = given_object[\"sixth_part_1st\"];\n given_data_sixth_part_2nd = given_object[\"sixth_part_2nd\"];\n given_data_sixth_part_3rd = given_object[\"sixth_part_3rd\"];\n given_data_sixth_part_4th_1 = given_object[\"sixth_part_4th_1\"];\n given_data_sixth_part_4th_2 = given_object[\"sixth_part_4th_2\"];\n given_data_sixth_part_4th_3 = given_object[\"sixth_part_4th_3\"];\n given_data_sixth_part_4th_4 = given_object[\"sixth_part_4th_4\"];\n given_data_sixth_part_5th_1 = given_object[\"sixth_part_5th_1\"];\n given_data_sixth_part_5th_2 = given_object[\"sixth_part_5th_2\"];\n given_data_sixth_part_5th_3 = given_object[\"sixth_part_5th_3\"];\n given_data_sixth_part_5th_4 = given_object[\"sixth_part_5th_4\"];\n given_data_sixth_part_6th_1 = given_object[\"sixth_part_6th_1\"];\n given_data_sixth_part_6th_2 = given_object[\"sixth_part_6th_2\"];\n given_data_sixth_part_6th_3 = given_object[\"sixth_part_6th_3\"];\n given_data_sixth_part_6th_4 = given_object[\"sixth_part_6th_4\"];\n given_data_sixth_part_7th_1 = given_object[\"sixth_part_7th_1\"];\n given_data_sixth_part_7th_2 = given_object[\"sixth_part_7th_2\"];\n given_data_sixth_part_7th_3 = given_object[\"sixth_part_7th_3\"];\n given_data_sixth_part_7th_4 = given_object[\"sixth_part_7th_4\"];\n given_data_third_part_1st_1 = given_object[\"3rd_part_1st_1\"];\n given_data_third_part_1st_2 = given_object[\"3rd_part_1st_2\"];\n given_data_third_part_1st_3 = given_object[\"3rd_part_1st_3\"];\n given_data_third_part_1st_4 = given_object[\"3rd_part_1st_4\"];\n given_data_third_part_2nd_1 = given_object[\"3rd_part_2nd_1\"];\n given_data_third_part_2nd_2 = given_object[\"3rd_part_2nd_2\"];\n given_data_third_part_2nd_3 = given_object[\"3rd_part_2nd_3\"];\n given_data_third_part_2nd_4 = given_object[\"3rd_part_2nd_4\"];\n given_data_third_part_3rd_1 = given_object[\"3rd_part_3rd_1\"];\n given_data_third_part_3rd_2 = given_object[\"3rd_part_3rd_2\"];\n given_data_third_part_3rd_3 = given_object[\"3rd_part_3rd_3\"];\n given_data_third_part_3rd_4 = given_object[\"3rd_part_3rd_4\"];\n given_data_third_part_4th_1 = given_object[\"3rd_part_4th_1\"];\n given_data_third_part_4th_2 = given_object[\"3rd_part_4th_2\"];\n given_data_third_part_4th_3 = given_object[\"3rd_part_4th_3\"];\n given_data_third_part_4th_4 = given_object[\"3rd_part_4th_4\"];\n given_data_first_part_1st_1 = given_object[\"1st_part_1st_1\"];\n given_data_first_part_1st_2 = given_object[\"1st_part_1st_2\"];\n given_data_first_part_2nd_1 = given_object[\"1st_part_2nd_1\"];\n given_data_first_part_2nd_2 = given_object[\"1st_part_2nd_2\"];\n given_data_first_part_3rd_1 = given_object[\"1st_part_3rd_1\"];\n given_data_first_part_3rd_2 = given_object[\"1st_part_3rd_2\"];\n given_data_first_part_4th_1 = given_object[\"1st_part_4th_1\"];\n given_data_first_part_4th_2 = given_object[\"1st_part_4th_2\"];\n given_data_first_part_5th_1 = given_object[\"1st_part_5th_1\"];\n given_data_first_part_5th_2 = given_object[\"1st_part_5th_2\"];\n given_data_first_part_6th_1 = given_object[\"1st_part_6th_1\"];\n given_data_first_part_6th_2 = given_object[\"1st_part_6th_2\"];\n given_data_first_part_7th_1 = given_object[\"1st_part_7th_1\"];\n given_data_first_part_7th_2 = given_object[\"1st_part_7th_2\"];\n given_data_first_part_8th_1 = given_object[\"1st_part_8th_1\"];\n given_data_first_part_8th_2 = given_object[\"1st_part_8th_2\"];\n given_data_first_part_9th_1 = given_object[\"1st_part_9th_1\"];\n given_data_first_part_9th_2 = given_object[\"1st_part_9th_2\"];\n given_data_first_part_10th_1 = given_object[\"1st_part_10th_1\"];\n given_data_first_part_10th_2 = given_object[\"1st_part_10th_2\"];\n given_data_first_part_11th_1 = given_object[\"1st_part_11th_1\"];\n given_data_first_part_11th_2 = given_object[\"1st_part_11th_2\"];\n given_data_first_part_12th_1 = given_object[\"1st_part_12th_1\"];\n given_data_first_part_12th_2 = given_object[\"1st_part_12th_2\"];\n given_data_first_part_13th_1 = given_object[\"1st_part_13th_1\"];\n given_data_first_part_13th_2 = given_object[\"1st_part_13th_2\"];\n given_data_first_part_14th_1 = given_object[\"1st_part_14th_1\"];\n given_data_first_part_14th_2 = given_object[\"1st_part_14th_2\"];\n given_data_first_part_15th_1 = given_object[\"1st_part_15th_1\"];\n given_data_first_part_15th_2 = given_object[\"1st_part_15th_2\"];\n given_data_first_part_16th_1 = given_object[\"1st_part_16th_1\"];\n given_data_first_part_16th_2 = given_object[\"1st_part_16th_2\"];\n given_data_first_part_17th_1 = given_object[\"1st_part_17th_1\"];\n given_data_first_part_17th_2 = given_object[\"1st_part_17th_2\"];\n given_data_first_part_18th_1 = given_object[\"1st_part_18th_1\"];\n given_data_first_part_18th_2 = given_object[\"1st_part_18th_2\"];\n given_data_first_part_19th_1 = given_object[\"1st_part_19th_1\"];\n given_data_first_part_19th_2 = given_object[\"1st_part_19th_2\"];\n given_data_first_part_20th_1 = given_object[\"1st_part_20th_1\"];\n given_data_first_part_20th_2 = given_object[\"1st_part_20th_2\"];\n given_data_first_part_21th_1 = given_object[\"1st_part_21th_1\"];\n given_data_first_part_21th_2 = given_object[\"1st_part_21th_2\"];\n given_data_first_part_22th_1 = given_object[\"1st_part_22th_1\"];\n given_data_first_part_22th_2 = given_object[\"1st_part_22th_2\"];\n given_data_first_part_23th_1 = given_object[\"1st_part_23th_1\"];\n given_data_first_part_23th_2 = given_object[\"1st_part_23th_2\"];\n given_data_first_part_24th_1 = given_object[\"1st_part_24th_1\"];\n given_data_first_part_24th_2 = given_object[\"1st_part_24th_2\"];\n given_data_first_part_25th_1 = given_object[\"1st_part_25th_1\"];\n given_data_first_part_25th_2 = given_object[\"1st_part_25th_2\"];\n given_data_first_part_26th_1 = given_object[\"1st_part_26th_1\"];\n given_data_first_part_26th_2 = given_object[\"1st_part_26th_2\"];\n given_data_first_part_27th_1 = given_object[\"1st_part_27th_1\"];\n given_data_first_part_27th_2 = given_object[\"1st_part_27th_2\"];\n given_data_first_part_28th_1 = given_object[\"1st_part_28th_1\"];\n given_data_first_part_28th_2 = given_object[\"1st_part_28th_2\"];\n given_data_first_part_29th_1 = given_object[\"1st_part_29th_1\"];\n given_data_first_part_29th_2 = given_object[\"1st_part_29th_2\"];\n given_data_first_part_30th_1 = given_object[\"1st_part_30th_1\"];\n given_data_first_part_30th_2 = given_object[\"1st_part_30th_2\"];\n given_data_first_part_31th_1 = given_object[\"1st_part_31th_1\"];\n given_data_first_part_31th_2 = given_object[\"1st_part_31th_2\"];\n given_data_first_part_32th_1 = given_object[\"1st_part_32th_1\"];\n given_data_first_part_32th_2 = given_object[\"1st_part_32th_2\"];\n given_data_first_part_33th_1 = given_object[\"1st_part_33th_1\"];\n given_data_first_part_33th_2 = given_object[\"1st_part_33th_2\"];\n given_data_seventh_part_1st_1 = given_object[\"7th_part_1st_1\"];\n given_data_seventh_part_1st_2 = given_object[\"7th_part_1st_2\"];\n given_data_seventh_part_2nd_1 = given_object[\"7th_part_2nd_1\"];\n given_data_seventh_part_2nd_2 = given_object[\"7th_part_2nd_2\"];\n given_data_seventh_part_3rd_1 = given_object[\"7th_part_3rd_1\"];\n given_data_seventh_part_3rd_2 = given_object[\"7th_part_3rd_2\"];\n given_data_seventh_part_4th_1 = given_object[\"7th_part_4th_1\"];\n given_data_seventh_part_4th_2 = given_object[\"7th_part_4th_2\"];\n given_data_seventh_part_5th_1 = given_object[\"7th_part_5th_1\"];\n given_data_seventh_part_5th_2 = given_object[\"7th_part_5th_2\"];\n given_data_seventh_part_6th_1 = given_object[\"7th_part_6th_1\"];\n given_data_seventh_part_6th_2 = given_object[\"7th_part_6th_2\"];\n given_data_seventh_part_7th_1 = given_object[\"7th_part_7th_1\"];\n given_data_seventh_part_7th_2 = given_object[\"7th_part_7th_2\"];\n given_data_seventh_part_8th_1 = given_object[\"7th_part_8th_1\"];\n given_data_seventh_part_8th_2 = given_object[\"7th_part_8th_2\"];\n given_data_seventh_part_9th_1 = given_object[\"7th_part_9th_1\"];\n given_data_seventh_part_9th_2 = given_object[\"7th_part_9th_2\"];\n given_data_seventh_part_10th_1 = given_object[\"7th_part_10th_1\"];\n given_data_seventh_part_10th_2 = given_object[\"7th_part_10th_2\"];\n given_data_seventh_part_11th_1 = given_object[\"7th_part_11th_1\"];\n given_data_seventh_part_11th_2 = given_object[\"7th_part_11th_2\"];\n given_data_seventh_part_12th_1 = given_object[\"7th_part_12th_1\"];\n given_data_seventh_part_12th_2 = given_object[\"7th_part_12th_2\"];\n given_data_seventh_part_13th_1 = given_object[\"7th_part_13th_1\"];\n given_data_seventh_part_13th_2 = given_object[\"7th_part_13th_2\"];\n given_data_seventh_part_14th_1 = given_object[\"7th_part_14th_1\"];\n given_data_seventh_part_14th_2 = given_object[\"7th_part_14th_2\"];\n given_data_seventh_part_15th_1 = given_object[\"7th_part_15th_1\"];\n given_data_seventh_part_15th_2 = given_object[\"7th_part_15th_2\"];\n given_data_seventh_part_16th_1 = given_object[\"7th_part_16th_1\"];\n given_data_seventh_part_16th_2 = given_object[\"7th_part_16th_2\"];\n given_data_seventh_part_17th_1 = given_object[\"7th_part_17th_1\"];\n given_data_seventh_part_17th_2 = given_object[\"7th_part_17th_2\"];\n given_data_seventh_part_18th_1 = given_object[\"7th_part_18th_1\"];\n given_data_seventh_part_18th_2 = given_object[\"7th_part_18th_2\"];\n given_data_seventh_part_19th_1 = given_object[\"7th_part_19th_1\"];\n given_data_seventh_part_19th_2 = given_object[\"7th_part_19th_2\"];\n given_data_seventh_part_20th_1 = given_object[\"7th_part_20th_1\"];\n given_data_seventh_part_20th_2 = given_object[\"7th_part_20th_2\"];\n given_data_seventh_part_21th_1 = given_object[\"7th_part_21th_1\"];\n given_data_seventh_part_21th_2 = given_object[\"7th_part_21th_2\"];\n given_data_seventh_part_22th_1 = given_object[\"7th_part_22th_1\"];\n given_data_seventh_part_22th_2 = given_object[\"7th_part_22th_2\"];\n given_data_seventh_part_23th_1 = given_object[\"7th_part_23th_1\"];\n given_data_seventh_part_23th_2 = given_object[\"7th_part_23th_2\"];\n given_data_seventh_part_24th_1 = given_object[\"7th_part_24th_1\"];\n given_data_seventh_part_24th_2 = given_object[\"7th_part_24th_2\"];\n given_data_seventh_part_25th_1 = given_object[\"7th_part_25th_1\"];\n given_data_seventh_part_25th_2 = given_object[\"7th_part_25th_2\"];\n given_data_seventh_part_26th_1 = given_object[\"7th_part_26th_1\"];\n given_data_seventh_part_26th_2 = given_object[\"7th_part_26th_2\"];\n given_data_seventh_part_27th_1 = given_object[\"7th_part_27th_1\"];\n given_data_seventh_part_27th_2 = given_object[\"7th_part_27th_2\"];\n given_data_seventh_part_28th_1 = given_object[\"7th_part_28th_1\"];\n given_data_seventh_part_28th_2 = given_object[\"7th_part_28th_2\"];\n given_data_seventh_part_29th_1 = given_object[\"7th_part_29th_1\"];\n given_data_seventh_part_29th_2 = given_object[\"7th_part_29th_2\"];\n // required part 6th block\n given_loc_data_sixth_part = given_object[\"required_part_location_6th_block\"];\n given_loc_data_fourth_part = given_object[\"required_part_location_4th_block\"];\n given_loc_data_first_part = given_object[\"required_part_location_1th_block\"];\n given_loc_data_seventh_part = given_object[\"required_part_location_7th_block\"];\n\n\n\n\n\n\n\n\n\n\n //given_data_sixth_part_6th_1\n\n //given_data_sixth_part_5th_1\n\n\n\n\n var map = L.map('map', {\n crs: L.CRS.Simple,\n minZoom: -0.60,\n maxZoom: -0.60,\n zoomControl: false\n\n\n //salert(minZoom);\n });\n\n L.tileLayer('', { attribution: '' }).addTo(map);\n myFeatureGroup = L.featureGroup().addTo(map).on(\"click\", groupClick);\n var bounds = [[-200, 0], [3300, 2500]];\n //var image = L.imageOverlay(\"{{ url_for('static', filename='white_background.jpeg')}}\", bounds).addTo(map);\n var image = L.imageOverlay(\"{{ url_for('static', filename='map3.jpg')}}\", bounds).addTo(map);\n //var image = L.VideoOverlay(\"{{ url_for('static', filename='r1.svg')}}\", bounds).addTo(map);\n //console.log(myFeatureGroup);\n\n map.fitBounds(bounds);\n var yx = L.latLng;\n var xy = function (x, y) {\n if (L.Util.isArray(x)) {\n return yx(x[1], x[0]);\n }\n return yx(y, x); // When doing xy(x, y);\n };\n\n var markers_2nd_part_3rd = given_data_second_part_3rd;\n\n // filling all markers using for loop\n for (var i = 0; i < markers_2nd_part_3rd.length; i++) {\n\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = ' <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_2nd_part_3rd[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const urlu = URL.createObjectURL(blob);\n var greenIcon = new LeafIcon({ iconUrl: urlu });\n // test = \"Id \" + i;\n test = markers_2nd_part_3rd[i][\"SV ID\"];\n // console.log( markers_2nd_part_3rd[i][\"SV ID\"]);\n //marker_arr = markers[i]\n //var new_marker = xy(marker_arr[0], marker_arr[1]);\n x_val = markers_2nd_part_3rd[i][\"marker_position\"];\n // console.log(\"x_val\");\n //console.log(x_val);\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n\n //---------------------------------------------- fill 1st part of 2nd block-----------------------------\n var markers_2nd_part_1st = given_data_second_part_1st;\n for (var i = 0; i < markers_2nd_part_1st.length; i++) {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n\n }\n });\n var svg = ' <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_2nd_part_1st[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 36\" width=\"50\" height=\"36\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">'+markers_2nd_part_3rd[i][\"Location\"]+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n //var greenIcon = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n var greenIcon = new LeafIcon({ iconUrl: svg_url });\n\n test = markers_2nd_part_1st[i][\"SV ID\"];\n x_val = markers_2nd_part_1st[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n\n\n\n //---------------------------------------------- fill 2nd part of 2nd block---------------------------\n\n //required_part_location_2_of_2=[\"M/MT/FL058A2\",\"M/MT/FL059A2\",\"M/MT/FL060A2\",\"M/MT/FL060A3\",\"M/MT/FL061A2\",\"M/MT/FL062A2\",\"M/MT/FL063A2\",\"M/MT/FL063A3\",\"M/MT/FL064A2\",\"M/MT/FL065A2\",\"M/MT/FL066A2\",\"M/MT/FL066A3\",\"M/MT/FL067A2\",\"M/MT/FL068A2\",\"M/MT/FL069A2\",\"M/MT/FL069A3\",\"M/MT/FL070A2\",\"M/MT/FL071A2\",\"M/MT/FL072A2\",\"M/MT/FL072A3\",\"M/MT/FL073A2\",\"M/MT/FL074A2\"]\n\n var markers_2nd_part_2nd = given_data_second_part_2nd;\n for (var k = 0; k < markers_2nd_part_2nd.length; k++) {\n var greenIcon;\n if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL060A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 10);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL060A3\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 42);\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n //var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL063A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 57);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL063A3\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 90);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL058A2\" || markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL059A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n }\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL064A2\" || markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL065A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 97);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL070A2\" || markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL071A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 202);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL073A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 250);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n }\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL067A2\" || markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL068A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 151);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL075A2\" || markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL076A2\" || markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL077A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 296);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n }\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL079A2\" || markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL080A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 345);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n }\n\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL066A2\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 108);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL066A3\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 138);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL069A2\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 160);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL069A3\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 193);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL072A2\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 212);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL072A3\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 242);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL074A2\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 255);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL074A3\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 286);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL078A2\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 306);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL078A3\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 335);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL081A2\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 356);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_2nd_part_2nd[k]['Location'] == \"M/MT/FL081A3\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 385);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_2nd_part_2nd[k][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_2nd_part_2nd[k][\"SV ID\"];\n\n x_val = markers_2nd_part_2nd[k][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 47);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n }\n\n\n // ------------------------------filling 1st part of third block--------------------------\n // required_part_location_1_of_3=[\"M/MT/FL051A1\",\"M/MT/FL050A1\",\"M/MT/FL049A2\",\"M/MT/FL049A1\",\"M/MT/FL048A1\",\"M/MT/FL047A1\",\"M/MT/FL046A2\",\"M/MT/FL046A1\",\"M/MT/FL045A1\",\"M/MT/FL044A1\"]\n\n var markers_3rd_part_1st = given_data_third_part_1st;\n\n for (var i = 0; i < markers_3rd_part_1st.length; i++) {\n var greenIcon;\n //console.log(\"all location\")\n //console.log(markers_2nd_part_2nd[k]['Location']);\n if (markers_3rd_part_1st[i]['Location'] == \"M/MT/FL051A1\" || markers_3rd_part_1st[i]['Location'] == \"M/MT/FL050A1\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_3rd_part_1st[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_3rd_part_1st[i][\"SV ID\"];\n\n x_val = markers_3rd_part_1st[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n }\n\n else if (markers_3rd_part_1st[i]['Location'] == \"M/MT/FL049A2\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_3rd_part_1st[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_3rd_part_1st[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_1st[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 10);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_3rd_part_1st[i]['Location'] == \"M/MT/FL049A1\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_3rd_part_1st[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_3rd_part_1st[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_1st[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 35);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_3rd_part_1st[i]['Location'] == \"M/MT/FL048A1\" || markers_3rd_part_1st[i]['Location'] == \"M/MT/FL047A1\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_3rd_part_1st[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n\n //console.log()\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_3rd_part_1st[i][\"SV ID\"];\n\n x_val = markers_3rd_part_1st[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 45);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n\n }\n\n\n else if (markers_3rd_part_1st[i]['Location'] == \"M/MT/FL046A2\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_3rd_part_1st[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_3rd_part_1st[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_1st[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 52);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_3rd_part_1st[i]['Location'] == \"M/MT/FL046A1\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_3rd_part_1st[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_3rd_part_1st[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_1st[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 81);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_3rd_part_1st[i]['Location'] == \"M/MT/FL045A1\" || markers_3rd_part_1st[i]['Location'] == \"M/MT/FL044A1\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_3rd_part_1st[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n\n //console.log()\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_3rd_part_1st[i][\"SV ID\"];\n\n x_val = markers_3rd_part_1st[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 92);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n\n }\n\n else if (markers_3rd_part_1st[i]['Location'] == \"M/MT/FL044A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_3rd_part_1st[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n\n //console.log()\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_3rd_part_1st[i][\"SV ID\"];\n\n x_val = markers_3rd_part_1st[i][\"marker_position\"];\n var new_marker = xy(x_val[0] + 100, x_val[1] - 200);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n\n }\n\n else if (markers_3rd_part_1st[i]['Location'] == \"M/MT/FL044A3\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg_1\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_3rd_part_1st[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n\n //console.log()\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_3rd_part_1st[i][\"SV ID\"];\n\n x_val = markers_3rd_part_1st[i][\"marker_position\"];\n var new_marker = xy(x_val[0] + 200, x_val[1] - 200);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n\n }\n\n\n\n\n }\n\n //----------------------------filling 2nd part for 3rd block----------------------------\n var markers_3rd_part_2nd = given_data_third_part_2nd;\n required_part_location_2_of_3 = [\"M/MT/FL044A2\", \"M/MT/FL044A3\", \"M/MT/FL044A4\", \"M/MT/FL044A5\"]\n\n for (var i = 0; i < markers_3rd_part_2nd.length; i++) {\n var greenIcon;\n //console.log(\"all location\")\n //console.log(markers_2nd_part_2nd[k]['Location']);\n if (markers_3rd_part_2nd[i]['Location'] == \"M/MT/FL044A2\" || markers_3rd_part_2nd[i]['Location'] == \"M/MT/FL044A3\" || markers_3rd_part_2nd[i]['Location'] == \"M/MT/FL044A4\" || markers_3rd_part_2nd[i]['Location'] == \"M/MT/FL044A5\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_3rd_part_2nd[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n\n //console.log(markers_3rd_part_2nd[i][\"Location\"]);\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_3rd_part_2nd[i][\"SV ID\"];\n\n x_val = markers_3rd_part_2nd[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n\n\n }\n\n }\n //given_data_fifth_part_1st\n\n\n\n //---------------------------------------filling 5th block---------------------------------------------\n //----------------------------filling 1st part for 5th block----------------------------\n // required_part_location_1_of_5=[\"M/MT/FL043A1\",\"M/MT/FL043A2\",\"M/MT/FL043A3\",\"M/MT/FL043A4\"]\n\n var markers_5th_part_1st = given_data_fifth_part_1st;\n //console.log(\"length here\");\n //console.log(markers_5th_part_1st);\n\n for (var i = 0; i < markers_5th_part_1st.length; i++) {\n var greenIcon;\n //console.log(\"all location\")\n //console.log(markers_2nd_part_2nd[k]['Location']);\n if (markers_5th_part_1st[i]['Location'] == \"M/MT/FL043A1\" || markers_5th_part_1st[i]['Location'] == \"M/MT/FL043A2\" || markers_5th_part_1st[i]['Location'] == \"M/MT/FL043A3\" || markers_5th_part_1st[i]['Location'] == \"M/MT/FL043A4\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_1st[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n\n //console.log(markers_3rd_part_2nd[i][\"Location\"]);\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_1st[i][\"SV ID\"];\n\n x_val = markers_5th_part_1st[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n\n\n }\n\n }\n\n\n\n //----------------------------filling 2nd part for 5th block----------------------------\n // required_part_location_1_of_5=[\"M/MT/FL043A1\",\"M/MT/FL043A2\",\"M/MT/FL043A3\",\"M/MT/FL043A4\"]\n\n var markers_5th_part_2nd = given_data_fifth_part_2nd;\n\n for (var i = 0; i < markers_5th_part_2nd.length; i++) {\n var greenIcon;\n //console.log(\"all location\")\n //console.log(markers_2nd_part_2nd[k]['Location']);\n if (markers_5th_part_2nd[i]['Location'] == \"M/MT/FL042A1\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_2nd[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n\n //console.log(markers_3rd_part_2nd[i][\"Location\"]);\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_2nd[i][\"SV ID\"];\n\n x_val = markers_5th_part_2nd[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n\n\n }\n\n }\n\n\n //----------------------------filling 3rd part for 5th block----------------------------\n var markers_5th_part_3rd = given_data_fifth_part_3rd;\n\n for (var i = 0; i < markers_5th_part_3rd.length; i++) {\n var greenIcon;\n //console.log(\"all location\")\n //console.log(markers_2nd_part_2nd[k]['Location']);\n if (markers_5th_part_3rd[i]['Location'] == \"M/MT/FL041A1\" || markers_5th_part_3rd[i]['Location'] == \"M/MT/FL041A2\" || markers_5th_part_3rd[i]['Location'] == \"M/MT/FL041A3\" || markers_5th_part_3rd[i]['Location'] == \"M/MT/FL041A4\" || markers_5th_part_3rd[i]['Location'] == \"M/MT/FL041A5\" || markers_5th_part_3rd[i]['Location'] == \"M/MT/FL041A6\" || markers_5th_part_3rd[i]['Location'] == \"M/MT/FL041A7\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_3rd[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n\n //console.log(markers_3rd_part_2nd[i][\"Location\"]);\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_3rd[i][\"SV ID\"];\n\n x_val = markers_5th_part_3rd[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n\n\n }\n\n }\n\n\n //----------------------------filling 4th part for 5th block----------------------------\n var markers_5th_part_4th = given_data_fifth_part_4th;\n\n for (var i = 0; i < markers_5th_part_4th.length; i++) {\n // console.log(\"hiiii\");\n //console.log(markers_5th_part_4th);\n\n var greenIcon;\n //console.log(\"all location\")\n //console.log(markers_2nd_part_2nd[k]['Location']);\n if (markers_5th_part_4th[i]['Location'] == \"M/MT/FL040A1\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_4th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n\n //console.log(markers_3rd_part_2nd[i][\"Location\"]);\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_4th[i][\"SV ID\"];\n x_val = markers_5th_part_4th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n }\n\n }\n\n\n\n //----------------------------filling 5th part for 5th block----------------------------\n var markers_5th_part_5th = given_data_fifth_part_5th;\n //console.log(markers_5th_part_5th);\n\n for (var i = 0; i < markers_5th_part_5th.length; i++) {\n //console.log(\"hiiii soma\");\n\n var greenIcon;\n //console.log(\"all location\")\n //console.log(markers_2nd_part_2nd[k]['Location']);\n if (markers_5th_part_5th[i]['Location'] == \"M/MT/FL039A1\" || markers_5th_part_5th[i]['Location'] == \"M/MT/FL039A2\" || markers_5th_part_5th[i]['Location'] == \"M/MT/FL039A3\" || markers_5th_part_5th[i]['Location'] == \"M/MT/FL039A4\" || markers_5th_part_5th[i]['Location'] == \"M/MT/FL039A5\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_5th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n\n //console.log(markers_3rd_part_2nd[i][\"Location\"]);\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_5th[i][\"SV ID\"];\n x_val = markers_5th_part_5th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n\n }\n\n }\n //----------------------------filling 6th part for 5th block----------------------------\n var markers_5th_part_6th = given_data_fifth_part_6th;\n //required_part_location_6_of_5=[\"M/MT/FL038A1\",\"M/MT/FL037A1\",\"M/MT/FL036A1\",\"M/MT/FL035A1\",\"M/MT/FL034A1\",\"M/MT/FL033A1\",\"M/MT/FL032A1\",\"M/MT/FL031A1\",\"M/MT/FL030A1\",\"M/MT/FL029A1\",\"M/MT/FL028A1\"]\n\n for (var i = 0; i < markers_5th_part_6th.length; i++) {\n\n\n var greenIcon;\n //console.log(\"all location\")\n //console.log(markers_2nd_part_2nd[k]['Location']);\n if (markers_5th_part_6th[i]['Location'] == \"M/MT/FL038A1\" || markers_5th_part_6th[i]['Location'] == \"M/MT/FL037A1\" || markers_5th_part_6th[i]['Location'] == \"M/MT/FL036A1\" || markers_5th_part_6th[i]['Location'] == \"M/MT/FL035A1\" || markers_5th_part_6th[i]['Location'] == \"M/MT/FL034A1\" || markers_5th_part_6th[i]['Location'] == \"M/MT/FL033A1\" || markers_5th_part_6th[i]['Location'] == \"M/MT/FL032A1\" || markers_5th_part_6th[i]['Location'] == \"M/MT/FL031A1\" || markers_5th_part_6th[i]['Location'] == \"M/MT/FL030A1\" || markers_5th_part_6th[i]['Location'] == \"M/MT/FL029A1\" || markers_5th_part_6th[i]['Location'] == \"M/MT/FL028A1\" || markers_5th_part_6th[i]['Location'] == \"M/MT/FL027A1\") {\n\n\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_6th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n\n\n\n //console.log(markers_3rd_part_2nd[i][\"Location\"]);\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_6th[i][\"SV ID\"];\n x_val = markers_5th_part_6th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n // console.log(test);\n\n\n\n\n }\n }\n\n //----------------------fill 7th part of 6th block---------------------------------\n var markers_5th_part_7th = given_data_fifth_part_7th;\n // required_part_location_7_of_5=[\"M/MT/FL026A1\",\"M/MT/FL025A1\",\"M/MT/FL024A1\",\"M/MT/FL023A1\",\"M/MT/FL022A1\",\"M/MT/FL021A1\",\"M/MT/FL020A1\",\"M/MT/FL019A1\",\"M/MT/FL018A1\",\"M/MT/FL017A1\",\"M/MT/FL016A1\",\"M/MT/FL015A1\",\"M/MT/FL014A1\"]\n\n for (var i = 0; i < markers_5th_part_7th.length; i++) {\n var greenIcon;\n if (markers_5th_part_7th[i]['Location'] == \"M/MT/FL026A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL025A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL024A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL023A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL022A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL021A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL020A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL019A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL018A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL017A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL016A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL015A1\" || markers_5th_part_7th[i]['Location'] == \"M/MT/FL014A1\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_7th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_7th[i][\"SV ID\"];\n x_val = markers_5th_part_7th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------fill 7th part of 6th block---------------------------------\n var markers_5th_part_8th = given_data_fifth_part_8th;\n // console.log(\"given 5th part list\" );\n // console.log(markers_5th_part_8th);\n\n\n for (var i = 0; i < markers_5th_part_8th.length; i++) {\n var greenIcon;\n if (markers_5th_part_8th[i]['Location'] == \"M/MT/FL013A1\" || markers_5th_part_8th[i]['Location'] == \"M/MT/FL012A1\" || markers_5th_part_8th[i]['Location'] == \"M/MT/FL011A1\" || markers_5th_part_8th[i]['Location'] == \"M/MT/FL010A1\" || markers_5th_part_8th[i]['Location'] == \"M/MT/FL009A1\" || markers_5th_part_8th[i]['Location'] == \"M/MT/FL008A1\" || markers_5th_part_8th[i]['Location'] == \"M/MT/FL007A1\" || markers_5th_part_8th[i]['Location'] == \"M/MT/FL006A1\" || markers_5th_part_8th[i]['Location'] == \"M/MT/FL005A1\" || markers_5th_part_8th[i]['Location'] == \"M/MT/FL003A1\" || markers_5th_part_8th[i]['Location'] == \"M/MT/FL002A1\" || markers_5th_part_8th[i]['Location'] == \"M/MT/FL001A1\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_8th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_8th[i][\"SV ID\"];\n\n\n\n x_val = markers_5th_part_8th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n }\n\n if (markers_5th_part_8th[i]['Location'] == \"M/MT/FL004A1\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_8th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n test = markers_5th_part_8th[i][\"SV ID\"];\n x_val = markers_5th_part_8th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 6);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------fill 9th part of 6th block---------------------------------\n var markers_5th_part_9th = given_data_fifth_part_9th;\n\n for (var i = 0; i < markers_5th_part_9th.length; i++) {\n var greenIcon;\n if (markers_5th_part_9th[i]['Location'] == \"M/MT/FL029A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_9th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_9th[i][\"SV ID\"];\n x_val = markers_5th_part_9th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n //----------------------fill 10th part of 6th block---------------------------------\n var markers_5th_part_10th = given_data_fifth_part_10th;\n\n for (var i = 0; i < markers_5th_part_10th.length; i++) {\n var greenIcon;\n if (markers_5th_part_10th[i]['Location'] == \"M/MT/FL026A2\" || markers_5th_part_10th[i]['Location'] == \"M/MT/FL026A3\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_10th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_10th[i][\"SV ID\"];\n x_val = markers_5th_part_10th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n //----------------------fill 11th part of 6th block---------------------------------\n var markers_5th_part_11th = given_data_fifth_part_11th;\n\n for (var i = 0; i < markers_5th_part_11th.length; i++) {\n var greenIcon;\n if (markers_5th_part_11th[i]['Location'] == \"M/MT/FL021A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_11th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_11th[i][\"SV ID\"];\n x_val = markers_5th_part_11th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n var markers_5th_part_12th = given_data_fifth_part_12th;\n\n for (var i = 0; i < markers_5th_part_12th.length; i++) {\n var greenIcon;\n if (markers_5th_part_12th[i]['Location'] == \"M/MT/FL013A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_12th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_12th[i][\"SV ID\"];\n x_val = markers_5th_part_12th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n var markers_5th_part_13th = given_data_fifth_part_13th;\n\n for (var i = 0; i < markers_5th_part_13th.length; i++) {\n var greenIcon;\n if (markers_5th_part_13th[i]['Location'] == \"M/MT/FL011A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_13th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_13th[i][\"SV ID\"];\n x_val = markers_5th_part_13th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n var markers_5th_part_14th = given_data_fifth_part_14th;\n\n for (var i = 0; i < markers_5th_part_14th.length; i++) {\n var greenIcon;\n if (markers_5th_part_14th[i]['Location'] == \"M/MT/FL006A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_14th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_14th[i][\"SV ID\"];\n x_val = markers_5th_part_14th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n var markers_5th_part_15th = given_data_fifth_part_15th;\n\n for (var i = 0; i < markers_5th_part_15th.length; i++) {\n var greenIcon;\n if (markers_5th_part_15th[i]['Location'] == \"M/MT/FL005A2\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_5th_part_15th[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_5th_part_15th[i][\"SV ID\"];\n x_val = markers_5th_part_15th[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n\n\n }\n\n\n\n // code for fill 6th block\n\n var markers_6th_part_1st = given_data_sixth_part_1st;\n for (var i = 0; i < markers_6th_part_1st.length; i++) {\n var greenIcon;\n if (markers_6th_part_1st[i]['Location'] == \"M/MT/FL083A3\" || markers_6th_part_1st[i]['Location'] == \"M/MT/FL083A2\" || markers_6th_part_1st[i]['Location'] == \"M/MT/FL083A1\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_6th_part_1st[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_6th_part_1st[i][\"SV ID\"];\n x_val = markers_6th_part_1st[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n\n\n }\n\n\n //---------------------------------------------------------\n var markers_6th_part_2nd = given_data_sixth_part_2nd;\n for (var i = 0; i < markers_6th_part_2nd.length; i++) {\n var greenIcon;\n if (markers_6th_part_2nd[i]['Location'] == \"M/MT/FL084A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL085A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL086A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL087A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL088A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL089A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL090A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL091A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL092A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL093A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL093A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL094A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL095A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL096A1\" || markers_6th_part_2nd[i]['Location'] == \"M/MT/FL097A1\") {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_6th_part_2nd[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_6th_part_2nd[i][\"SV ID\"];\n x_val = markers_6th_part_2nd[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n\n\n }\n //-------------------------------------------------------------------\n\n //given_data_sixth_part_4th_1\n var markers_6th_part_3rd = given_data_sixth_part_3rd;\n for (var i = 0; i < markers_6th_part_3rd.length; i++) {\n var greenIcon;\n if (markers_6th_part_3rd[i]['Location'] == \"M/MT/FL084A2\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_6th_part_3rd[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_6th_part_3rd[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_3rd[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 10);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_6th_part_3rd[i]['Location'] == \"M/MT/FL084A3\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_6th_part_3rd[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_6th_part_3rd[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_3rd[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 40);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n else if (markers_6th_part_3rd[i]['Location'] == \"M/MT/FL085A2\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_6th_part_3rd[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_6th_part_3rd[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_3rd[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 60);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n else if (markers_6th_part_3rd[i]['Location'] == \"M/MT/FL085A3\") {\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 15],\n\n }\n });\n x_val = markers_6th_part_3rd[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 15\" width=\"50\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">' + markers_6th_part_3rd[i][\"Location\"] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_3rd[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1] - 90);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n else {\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"svg' + String(i) + '\" fill=\"#0853bf\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">' + markers_6th_part_3rd[i]['Location'] + '</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url });\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = markers_6th_part_3rd[i][\"SV ID\"];\n x_val = markers_6th_part_3rd[i][\"marker_position\"];\n var new_marker = xy(x_val[0], x_val[1] - 97);\n var given_marker = L.marker(new_marker, { icon: greenIcon2 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n\n\n\n\n\n }\n\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_4th_1 = given_data_sixth_part_4th_1;\n for (var i = 0; i < markers_6th_part_4th_1.length; i++) {\n var greenIcon;\n if (markers_6th_part_4th_1[i]['Location'] == \"M/MT/MD101A1\" || markers_6th_part_4th_1[i]['Location'] == \"M/MT/MD101A2\" || markers_6th_part_4th_1[i]['Location'] == \"M/MT/MD101A3\" || markers_6th_part_4th_1[i]['Location'] == \"M/MT/MD101A4\") {\n var loc = markers_6th_part_4th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_4th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_4th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //--------------------------------end 6th block--------------------------------------\n\n\n\n //-------------------------------filling 6th block 4_2----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_4th_2 = given_data_sixth_part_4th_2;\n for (var i = 0; i < markers_6th_part_4th_2.length; i++) {\n var greenIcon;\n if (markers_6th_part_4th_2[i]['Location'] == \"M/MT/MD101B1\" || markers_6th_part_4th_2[i]['Location'] == \"M/MT/MD101B2\" || markers_6th_part_4th_2[i]['Location'] == \"M/MT/MD101B3\" || markers_6th_part_4th_2[i]['Location'] == \"M/MT/MD101B4\") {\n var loc = markers_6th_part_4th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_4th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_4th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //--------------------------------end 6th block--------------------------------------\n\n\n\n //-------------------------------filling 6th block 4_3----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_4th_3 = given_data_sixth_part_4th_3;\n for (var i = 0; i < markers_6th_part_4th_3.length; i++) {\n var greenIcon;\n if (markers_6th_part_4th_3[i]['Location'] == \"M/MT/MD101C1\" || markers_6th_part_4th_3[i]['Location'] == \"M/MT/MD101C2\" || markers_6th_part_4th_3[i]['Location'] == \"M/MT/MD101C3\" || markers_6th_part_4th_3[i]['Location'] == \"M/MT/MD101C4\") {\n var loc = markers_6th_part_4th_3[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_4th_3[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_4th_3[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n\n\n //--------------------------------end 6th block-------------------------------------\n\n\n\n //-------------------------------filling 6th block 4_4----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_4th_4 = given_data_sixth_part_4th_4;\n for (var i = 0; i < markers_6th_part_4th_4.length; i++) {\n var greenIcon;\n if (markers_6th_part_4th_4[i]['Location'] == \"M/MT/MD101D1\" || markers_6th_part_4th_4[i]['Location'] == \"M/MT/MD101D2\" || markers_6th_part_4th_4[i]['Location'] == \"M/MT/MD101D3\" || markers_6th_part_4th_4[i]['Location'] == \"M/MT/MD101D4\") {\n var loc = markers_6th_part_4th_4[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_4th_4[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_4th_4[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n\n\n //--------------------------------end 6th block-------------------------------------\n\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_5th_1 = given_data_sixth_part_5th_1;\n for (var i = 0; i < markers_6th_part_5th_1.length; i++) {\n var greenIcon;\n if (markers_6th_part_5th_1[i]['Location'] == \"M/MT/MD102A1\" || markers_6th_part_5th_1[i]['Location'] == \"M/MT/MD102A2\" || markers_6th_part_5th_1[i]['Location'] == \"M/MT/MD102A3\" || markers_6th_part_5th_1[i]['Location'] == \"M/MT/MD102A4\") {\n var loc = markers_6th_part_5th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_5th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_5th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //--------------------------------end 6th block--------------------------------------\n\n\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_5th_2 = given_data_sixth_part_5th_2;\n for (var i = 0; i < markers_6th_part_5th_2.length; i++) {\n var greenIcon;\n if (markers_6th_part_5th_2[i]['Location'] == \"M/MT/MD102B1\" || markers_6th_part_5th_2[i]['Location'] == \"M/MT/MD102B2\" || markers_6th_part_5th_2[i]['Location'] == \"M/MT/MD102B3\" || markers_6th_part_5th_2[i]['Location'] == \"M/MT/MD102B4\") {\n var loc = markers_6th_part_5th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_5th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_5th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //--------------------------------end 6th block--------------------------------------\n\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_5th_3 = given_data_sixth_part_5th_3;\n for (var i = 0; i < markers_6th_part_5th_3.length; i++) {\n var greenIcon;\n if (markers_6th_part_5th_3[i]['Location'] == \"M/MT/MD102C1\" || markers_6th_part_5th_3[i]['Location'] == \"M/MT/MD102C2\" || markers_6th_part_5th_3[i]['Location'] == \"M/MT/MD102C3\" || markers_6th_part_5th_3[i]['Location'] == \"M/MT/MD102C4\") {\n var loc = markers_6th_part_5th_3[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_5th_3[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_5th_3[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //--------------------------------end 6th block--------------------------------------\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_5th_4 = given_data_sixth_part_5th_4;\n for (var i = 0; i < markers_6th_part_5th_4.length; i++) {\n var greenIcon;\n if (markers_6th_part_5th_4[i]['Location'] == \"M/MT/MD102D1\" || markers_6th_part_5th_4[i]['Location'] == \"M/MT/MD102D2\" || markers_6th_part_5th_4[i]['Location'] == \"M/MT/MD102D3\" || markers_6th_part_5th_4[i]['Location'] == \"M/MT/MD102D4\") {\n var loc = markers_6th_part_5th_4[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_5th_4[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_5th_4[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //--------------------------------end 6th block--------------------------------------\n\n\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_6th_1 = given_data_sixth_part_6th_1;\n for (var i = 0; i < markers_6th_part_6th_1.length; i++) {\n var greenIcon;\n if (markers_6th_part_6th_1[i]['Location'] == \"M/MT/MD103A1\" || markers_6th_part_6th_1[i]['Location'] == \"M/MT/MD103A2\" || markers_6th_part_6th_1[i]['Location'] == \"M/MT/MD103A3\" || markers_6th_part_6th_1[i]['Location'] == \"M/MT/MD103A4\") {\n var loc = markers_6th_part_6th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_6th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_6th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_6th_2 = given_data_sixth_part_6th_2;\n for (var i = 0; i < markers_6th_part_6th_2.length; i++) {\n var greenIcon;\n if (markers_6th_part_6th_2[i]['Location'] == \"M/MT/MD103B1\" || markers_6th_part_6th_2[i]['Location'] == \"M/MT/MD103B2\" || markers_6th_part_6th_2[i]['Location'] == \"M/MT/MD103B3\" || markers_6th_part_6th_2[i]['Location'] == \"M/MT/MD103B4\") {\n var loc = markers_6th_part_6th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_6th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_6th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //--------------------------------end 6th block--------------------------------------\n\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_6th_3 = given_data_sixth_part_6th_3;\n for (var i = 0; i < markers_6th_part_6th_3.length; i++) {\n var greenIcon;\n if (markers_6th_part_6th_3[i]['Location'] == \"M/MT/MD103C1\" || markers_6th_part_6th_3[i]['Location'] == \"M/MT/MD103C2\" || markers_6th_part_6th_3[i]['Location'] == \"M/MT/MD103C3\" || markers_6th_part_6th_3[i]['Location'] == \"M/MT/MD103C4\") {\n var loc = markers_6th_part_6th_3[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_6th_3[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_6th_3[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //--------------------------------end 6th block--------------------------------------\n\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_6th_4 = given_data_sixth_part_6th_4;\n for (var i = 0; i < markers_6th_part_6th_4.length; i++) {\n var greenIcon;\n if (markers_6th_part_6th_4[i]['Location'] == \"M/MT/MD103D1\" || markers_6th_part_6th_4[i]['Location'] == \"M/MT/MD103D2\" || markers_6th_part_6th_4[i]['Location'] == \"M/MT/MD103D3\" || markers_6th_part_6th_4[i]['Location'] == \"M/MT/MD103D4\") {\n var loc = markers_6th_part_6th_4[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_6th_4[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_6th_4[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //--------------------------------end 6th block--------------------------------------\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_7th_1 = given_data_sixth_part_7th_1;\n for (var i = 0; i < markers_6th_part_7th_1.length; i++) {\n var greenIcon;\n if (markers_6th_part_7th_1[i]['Location'] == \"M/MT/MD104A1\" || markers_6th_part_7th_1[i]['Location'] == \"M/MT/MD104A2\" || markers_6th_part_7th_1[i]['Location'] == \"M/MT/MD104A3\" || markers_6th_part_7th_1[i]['Location'] == \"M/MT/MD104A4\") {\n var loc = markers_6th_part_7th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_7th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_7th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_7th_2 = given_data_sixth_part_7th_2;\n for (var i = 0; i < markers_6th_part_7th_2.length; i++) {\n var greenIcon;\n if (markers_6th_part_7th_2[i]['Location'] == \"M/MT/MD104B1\" || markers_6th_part_7th_2[i]['Location'] == \"M/MT/MD104B2\" || markers_6th_part_7th_2[i]['Location'] == \"M/MT/MD104B3\" || markers_6th_part_7th_2[i]['Location'] == \"M/MT/MD104B4\") {\n var loc = markers_6th_part_7th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_7th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_7th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //--------------------------------end 6th block--------------------------------------\n\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_7th_3 = given_data_sixth_part_7th_3;\n for (var i = 0; i < markers_6th_part_7th_3.length; i++) {\n var greenIcon;\n if (markers_6th_part_7th_3[i]['Location'] == \"M/MT/MD104C1\" || markers_6th_part_7th_3[i]['Location'] == \"M/MT/MD104C2\" || markers_6th_part_7th_3[i]['Location'] == \"M/MT/MD104C3\" || markers_6th_part_7th_3[i]['Location'] == \"M/MT/MD104C4\") {\n var loc = markers_6th_part_7th_3[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_7th_3[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_7th_3[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n\n\n }\n\n //--------------------------------end 6th block--------------------------------------\n\n\n //-------------------------------filling 6th block 4_1----------------------------------\n //given_data_sixth_part_4th_1\n //required_part_location_4_of_6_4=[\"M/MT/MD101D1\",\"M/MT/MD101D2\",\"M/MT/MD101D3\",\"M/MT/MD101D4\"]\n\n var markers_6th_part_7th_4 = given_data_sixth_part_7th_4;\n for (var i = 0; i < markers_6th_part_6th_4.length; i++) {\n var greenIcon;\n if (markers_6th_part_7th_4[i]['Location'] == \"M/MT/MD104D1\" || markers_6th_part_7th_4[i]['Location'] == \"M/MT/MD104D2\" || markers_6th_part_7th_4[i]['Location'] == \"M/MT/MD104D3\" || markers_6th_part_7th_4[i]['Location'] == \"M/MT/MD104D4\") {\n var loc = markers_6th_part_7th_4[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_6th_part_7th_4[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_6th_part_7th_4[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n }\n\n // ----------------------required partloc name render here of 6th block\n var markers_6th_loc_data = given_loc_data_sixth_part;\n for (var i = 0; i < markers_6th_loc_data.length; i++) {\n var greenIcon;\n if (markers_6th_loc_data[i]['part_location'] == \"M/MT/MD101\" || markers_6th_loc_data[i]['part_location'] == \"M/MT/MD102\" || markers_6th_loc_data[i]['part_location'] == \"M/MT/MD103\" || markers_6th_loc_data[i]['part_location'] == \"M/MT/MD104\") {\n //var loc = markers_6th_part_7th_4[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [200, 20],\n\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" height=\"20\" width=\"200\" viewBox=\"0 0 200 20\"><text x=\"3\" y=\"10\" fill=\"black\" font-size=\"8\" font-weight=\"700\">' + markers_6th_loc_data[i]['part_location'] + '</text></svg>';\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">'+loc+'</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = \"location\"\n var new_marker = xy(markers_6th_loc_data[i]['x_val'], markers_6th_loc_data[i]['y_val']);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n }\n\n\n //------------------part loc 4th block here ---------------------\n // ----------------------required partloc name render here of 6th block\n var markers_4th_loc_data = given_loc_data_fourth_part;\n for (var i = 0; i < markers_4th_loc_data.length; i++) {\n var greenIcon;\n if (markers_4th_loc_data[i]['part_location'] == \"M/MT/MD105\" || markers_4th_loc_data[i]['part_location'] == \"M/MT/MD106\" || markers_4th_loc_data[i]['part_location'] == \"M/MT/MD107\" || markers_4th_loc_data[i]['part_location'] == \"M/MT/MD108\") {\n //var loc = markers_6th_part_7th_4[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [200, 20],\n\n }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" height=\"20\" width=\"200\" viewBox=\"0 0 200 20\"><text x=\"3\" y=\"10\" fill=\"black\" font-size=\"8\" font-weight=\"700\">' + markers_4th_loc_data[i]['part_location'] + '</text></svg>';\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">'+loc+'</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = \"location\"\n var new_marker = xy(markers_4th_loc_data[i]['x_val'], markers_4th_loc_data[i]['y_val']);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n }\n\n // ----------------------required partloc name render here of 6th block\n var markers_1st_loc_data = given_loc_data_first_part;\n for (var i = 0; i < markers_1st_loc_data.length; i++) {\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [200, 10] }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" height=\"10\" width=\"200\" viewBox=\"0 0 200 10\"><text x=\"3\" y=\"10\" fill=\"black\" font-size=\"6\" font-weight=\"600\">' + markers_1st_loc_data[i]['part_location'] + '</text></svg>';\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">'+loc+'</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = \"location\"\n var new_marker = xy(markers_1st_loc_data[i]['x_val'], markers_1st_loc_data[i]['y_val']);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n // ---------------------------------------------required partloc name render here of 6th block------------------\n var markers_7th_loc_data = given_loc_data_seventh_part;\n for (var i = 0; i < markers_7th_loc_data.length; i++) {\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [200, 10] }\n });\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" height=\"10\" width=\"200\" viewBox=\"0 0 200 10\"><text x=\"3\" y=\"10\" fill=\"black\" font-size=\"6\" font-weight=\"600\">' + markers_7th_loc_data[i]['part_location'] + '</text></svg>';\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">'+loc+'</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = \"location\"\n var new_marker = xy(markers_7th_loc_data[i]['x_val'], markers_7th_loc_data[i]['y_val']);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n // ---------------------------------partloc render end here of 6th block\n //--------------------------------end 6th block--------------------------------------\n\n //-----------------------------------------filling 3rd block m/mt/md105-----------------------------------------\n var markers_3rd_part_1st_1 = given_data_third_part_1st_1;\n\n for (var i = 0; i < markers_3rd_part_1st_1.length; i++) {\n if (markers_3rd_part_1st_1[i]['Location'] == \"M/MT/MD105D1\" || markers_3rd_part_1st_1[i]['Location'] == \"M/MT/MD105D2\" || markers_3rd_part_1st_1[i]['Location'] == \"M/MT/MD105D3\" || markers_3rd_part_1st_1[i]['Location'] == \"M/MT/MD105D4\") {\n var loc = markers_3rd_part_1st_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_1st_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_1st_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_3rd_part_1st_2 = given_data_third_part_1st_2;\n\n for (var i = 0; i < markers_3rd_part_1st_2.length; i++) {\n if (markers_3rd_part_1st_2[i]['Location'] == \"M/MT/MD105C1\" || markers_3rd_part_1st_2[i]['Location'] == \"M/MT/MD105C2\" || markers_3rd_part_1st_2[i]['Location'] == \"M/MT/MD105C3\" || markers_3rd_part_1st_2[i]['Location'] == \"M/MT/MD105C4\") {\n var loc = markers_3rd_part_1st_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_1st_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_1st_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n }\n\n\n\n var markers_3rd_part_1st_3 = given_data_third_part_1st_3;\n for (var i = 0; i < markers_3rd_part_1st_3.length; i++) {\n var greenIcon;\n if (markers_3rd_part_1st_3[i]['Location'] == \"M/MT/MD105B1\" || markers_3rd_part_1st_3[i]['Location'] == \"M/MT/MD105B2\" || markers_3rd_part_1st_3[i]['Location'] == \"M/MT/MD105B3\" || markers_3rd_part_1st_3[i]['Location'] == \"M/MT/MD105B4\") {\n var loc = markers_3rd_part_1st_3[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_1st_3[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_1st_3[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n }\n\n var markers_3rd_part_1st_4 = given_data_third_part_1st_4;\n for (var i = 0; i < markers_3rd_part_1st_4.length; i++) {\n var greenIcon;\n if (markers_3rd_part_1st_4[i]['Location'] == \"M/MT/MD105A1\" || markers_3rd_part_1st_4[i]['Location'] == \"M/MT/MD105A2\" || markers_3rd_part_1st_4[i]['Location'] == \"M/MT/MD105A3\" || markers_3rd_part_1st_4[i]['Location'] == \"M/MT/MD105A4\") {\n var loc = markers_3rd_part_1st_4[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_1st_4[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_1st_4[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n }\n //-----------------------------------------end m/mt/md105--------------------------------------------------------------\n\n\n //-----------------------------------------filling 3rd block m/mt/md106-----------------------------------------\n var markers_3rd_part_2nd_1 = given_data_third_part_2nd_1;\n\n for (var i = 0; i < markers_3rd_part_2nd_1.length; i++) {\n if (markers_3rd_part_2nd_1[i]['Location'] == \"M/MT/MD106D1\" || markers_3rd_part_2nd_1[i]['Location'] == \"M/MT/MD106D2\" || markers_3rd_part_2nd_1[i]['Location'] == \"M/MT/MD106D3\" || markers_3rd_part_2nd_1[i]['Location'] == \"M/MT/MD106D4\") {\n var loc = markers_3rd_part_2nd_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_2nd_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_2nd_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_3rd_part_2nd_2 = given_data_third_part_2nd_2;\n\n for (var i = 0; i < markers_3rd_part_2nd_2.length; i++) {\n if (markers_3rd_part_2nd_2[i]['Location'] == \"M/MT/MD106C1\" || markers_3rd_part_2nd_2[i]['Location'] == \"M/MT/MD106C2\" || markers_3rd_part_2nd_2[i]['Location'] == \"M/MT/MD106C3\" || markers_3rd_part_2nd_2[i]['Location'] == \"M/MT/MD106C4\") {\n var loc = markers_3rd_part_2nd_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_2nd_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_2nd_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n }\n\n\n\n var markers_3rd_part_2nd_3 = given_data_third_part_2nd_3;\n for (var i = 0; i < markers_3rd_part_2nd_3.length; i++) {\n var greenIcon;\n if (markers_3rd_part_2nd_3[i]['Location'] == \"M/MT/MD106B1\" || markers_3rd_part_2nd_3[i]['Location'] == \"M/MT/MD106B2\" || markers_3rd_part_2nd_3[i]['Location'] == \"M/MT/MD106B3\" || markers_3rd_part_2nd_3[i]['Location'] == \"M/MT/MD106B4\") {\n var loc = markers_3rd_part_2nd_3[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_2nd_3[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_2nd_3[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n }\n\n var markers_3rd_part_2nd_4 = given_data_third_part_2nd_4;\n for (var i = 0; i < markers_3rd_part_2nd_4.length; i++) {\n var greenIcon;\n if (markers_3rd_part_2nd_4[i]['Location'] == \"M/MT/MD106A1\" || markers_3rd_part_2nd_4[i]['Location'] == \"M/MT/MD106A2\" || markers_3rd_part_2nd_4[i]['Location'] == \"M/MT/MD106A3\" || markers_3rd_part_2nd_4[i]['Location'] == \"M/MT/MD106A4\") {\n var loc = markers_3rd_part_2nd_4[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_2nd_4[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_2nd_4[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n }\n\n\n\n //-----------------------------------------end m/mt/md106--------------------------------------------------------------\n\n\n //-----------------------------------------filling 3rd block m/mt/md107-----------------------------------------\n var markers_3rd_part_3rd_1 = given_data_third_part_3rd_1;\n\n for (var i = 0; i < markers_3rd_part_3rd_1.length; i++) {\n if (markers_3rd_part_3rd_1[i]['Location'] == \"M/MT/MD107D1\" || markers_3rd_part_3rd_1[i]['Location'] == \"M/MT/MD107D2\" || markers_3rd_part_3rd_1[i]['Location'] == \"M/MT/MD107D3\" || markers_3rd_part_3rd_1[i]['Location'] == \"M/MT/MD107D4\") {\n var loc = markers_3rd_part_3rd_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_3rd_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_3rd_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_3rd_part_3rd_2 = given_data_third_part_3rd_2;\n\n for (var i = 0; i < markers_3rd_part_3rd_2.length; i++) {\n if (markers_3rd_part_3rd_2[i]['Location'] == \"M/MT/MD107C1\" || markers_3rd_part_3rd_2[i]['Location'] == \"M/MT/MD107C2\" || markers_3rd_part_3rd_2[i]['Location'] == \"M/MT/MD107C3\" || markers_3rd_part_3rd_2[i]['Location'] == \"M/MT/MD107C4\") {\n var loc = markers_3rd_part_3rd_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_3rd_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_3rd_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n }\n\n\n\n var markers_3rd_part_3rd_3 = given_data_third_part_3rd_3;\n for (var i = 0; i < markers_3rd_part_3rd_3.length; i++) {\n if (markers_3rd_part_3rd_3[i]['Location'] == \"M/MT/MD107B1\" || markers_3rd_part_3rd_3[i]['Location'] == \"M/MT/MD107B2\" || markers_3rd_part_3rd_3[i]['Location'] == \"M/MT/MD107B3\" || markers_3rd_part_3rd_3[i]['Location'] == \"M/MT/MD107B4\") {\n var loc = markers_3rd_part_3rd_3[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_3rd_3[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_3rd_3[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n }\n\n var markers_3rd_part_3rd_4 = given_data_third_part_3rd_4;\n for (var i = 0; i < markers_3rd_part_3rd_4.length; i++) {\n if (markers_3rd_part_3rd_4[i]['Location'] == \"M/MT/MD107A1\" || markers_3rd_part_3rd_4[i]['Location'] == \"M/MT/MD107A2\" || markers_3rd_part_3rd_4[i]['Location'] == \"M/MT/MD107A3\" || markers_3rd_part_3rd_4[i]['Location'] == \"M/MT/MD107A4\") {\n var loc = markers_3rd_part_3rd_4[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_3rd_4[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_3rd_4[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n }\n\n\n\n //-----------------------------------------end m/mt/md107--------------------------------------------------------------\n\n\n //-----------------------------------------filling 3rd block m/mt/md108-----------------------------------------\n var markers_3rd_part_4th_1 = given_data_third_part_4th_1;\n\n\n for (var i = 0; i < markers_3rd_part_4th_1.length; i++) {\n if (markers_3rd_part_4th_1[i]['Location'] == \"M/MT/MD108D1\" || markers_3rd_part_4th_1[i]['Location'] == \"M/MT/MD108D2\" || markers_3rd_part_4th_1[i]['Location'] == \"M/MT/MD108D3\" || markers_3rd_part_4th_1[i]['Location'] == \"M/MT/MD108D4\") {\n var loc = markers_3rd_part_4th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_4th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_4th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_3rd_part_4th_2 = given_data_third_part_4th_2;\n\n for (var i = 0; i < markers_3rd_part_4th_2.length; i++) {\n if (markers_3rd_part_4th_2[i]['Location'] == \"M/MT/MD108C1\" || markers_3rd_part_4th_2[i]['Location'] == \"M/MT/MD108C2\" || markers_3rd_part_4th_2[i]['Location'] == \"M/MT/MD108C3\" || markers_3rd_part_4th_2[i]['Location'] == \"M/MT/MD108C4\") {\n var loc = markers_3rd_part_4th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_4th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_4th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n }\n\n\n\n var markers_3rd_part_4th_3 = given_data_third_part_4th_3;\n for (var i = 0; i < markers_3rd_part_4th_3.length; i++) {\n if (markers_3rd_part_4th_3[i]['Location'] == \"M/MT/MD108B1\" || markers_3rd_part_4th_3[i]['Location'] == \"M/MT/MD108B2\" || markers_3rd_part_4th_3[i]['Location'] == \"M/MT/MD108B3\" || markers_3rd_part_4th_3[i]['Location'] == \"M/MT/MD108B4\") {\n var loc = markers_3rd_part_4th_3[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_4th_3[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_4th_3[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n }\n\n var markers_3rd_part_4th_4 = given_data_third_part_4th_4;\n for (var i = 0; i < markers_3rd_part_4th_4.length; i++) {\n if (markers_3rd_part_4th_4[i]['Location'] == \"M/MT/MD108A1\" || markers_3rd_part_4th_4[i]['Location'] == \"M/MT/MD108A2\" || markers_3rd_part_4th_4[i]['Location'] == \"M/MT/MD108A3\" || markers_3rd_part_4th_4[i]['Location'] == \"M/MT/MD108A4\") {\n var loc = markers_3rd_part_4th_4[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 13],\n\n }\n });\n x_val = markers_3rd_part_4th_4[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"13\" style=\"fill:#0853bf\" viewBox=\"0 0 13 13\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"10\" fill=\"white\" font-size=\"7\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_3rd_part_4th_4[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n\n\n\n\n }\n\n\n\n //-----------------------------------------end m/mt/md107--------------------------------------------------------------\n\n\n //given_data_first_part_1st_1\n //-------------------------------------------filling 1st block--------------------------------------------------\n var markers_1st_part_1st_1 = given_data_first_part_1st_1;\n\n\n for (var i = 0; i < markers_1st_part_1st_1.length; i++) {\n if (markers_1st_part_1st_1[i]['Location'] == \"M/MT/FR064D2\" || markers_1st_part_1st_1[i]['Location'] == \"M/MT/FR064C2\" || markers_1st_part_1st_1[i]['Location'] == \"M/MT/FR064B2\" || markers_1st_part_1st_1[i]['Location'] == \"M/MT/FR064A2\") {\n var loc = markers_1st_part_1st_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_1st_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_1st_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_1st_2 = given_data_first_part_1st_2;\n\n\n for (var i = 0; i < markers_1st_part_1st_2.length; i++) {\n if (markers_1st_part_1st_2[i]['Location'] == \"M/MT/FR064D1\" || markers_1st_part_1st_2[i]['Location'] == \"M/MT/FR064C1\" || markers_1st_part_1st_2[i]['Location'] == \"M/MT/FR064B1\" || markers_1st_part_1st_2[i]['Location'] == \"M/MT/FR064A1\") {\n var loc = markers_1st_part_1st_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n }\n });\n x_val = markers_1st_part_1st_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_1st_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //---------------------------------------------1st part 2nd block------------------------------------------\n var markers_1st_part_2nd_1 = given_data_first_part_2nd_1;\n for (var i = 0; i < markers_1st_part_2nd_1.length; i++) {\n if (markers_1st_part_2nd_1[i]['Location'] == \"M/MT/FR063D2\" || markers_1st_part_2nd_1[i]['Location'] == \"M/MT/FR063C2\" || markers_1st_part_2nd_1[i]['Location'] == \"M/MT/FR063B2\" || markers_1st_part_2nd_1[i]['Location'] == \"M/MT/FR063A2\") {\n var loc = markers_1st_part_2nd_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_2nd_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_2nd_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_2nd_2 = given_data_first_part_2nd_2;\n\n\n for (var i = 0; i < markers_1st_part_2nd_2.length; i++) {\n if (markers_1st_part_2nd_2[i]['Location'] == \"M/MT/FR063D1\" || markers_1st_part_2nd_2[i]['Location'] == \"M/MT/FR063C1\" || markers_1st_part_2nd_2[i]['Location'] == \"M/MT/FR063B1\" || markers_1st_part_2nd_2[i]['Location'] == \"M/MT/FR063A1\") {\n var loc = markers_1st_part_2nd_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_2nd_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_2nd_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n //----------------------------------3rd part of first block----------------------------------------------\n var markers_1st_part_3rd_1 = given_data_first_part_3rd_1;\n for (var i = 0; i < markers_1st_part_3rd_1.length; i++) {\n if (markers_1st_part_3rd_1[i]['Location'] == \"M/MT/FR062D2\" || markers_1st_part_3rd_1[i]['Location'] == \"M/MT/FR062C2\" || markers_1st_part_3rd_1[i]['Location'] == \"M/MT/FR062B2\" || markers_1st_part_3rd_1[i]['Location'] == \"M/MT/FR062A2\") {\n var loc = markers_1st_part_3rd_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_3rd_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_3rd_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_3rd_2 = given_data_first_part_3rd_2;\n\n\n for (var i = 0; i < markers_1st_part_3rd_2.length; i++) {\n if (markers_1st_part_3rd_2[i]['Location'] == \"M/MT/FR062D1\" || markers_1st_part_3rd_2[i]['Location'] == \"M/MT/FR062C1\" || markers_1st_part_3rd_2[i]['Location'] == \"M/MT/FR062B1\" || markers_1st_part_3rd_2[i]['Location'] == \"M/MT/FR062A1\") {\n var loc = markers_1st_part_3rd_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_3rd_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_3rd_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n //----------------------------------4th part of first block----------------------------------------------\n var markers_1st_part_4th_1 = given_data_first_part_4th_1;\n\n //console.log(\"check sonath\");\n //console.log(markers_1st_part_4th_1);\n for (var i = 0; i < markers_1st_part_4th_1.length; i++) {\n\n\n if (markers_1st_part_4th_1[i]['Location'] == \"M/MT/FR061D2\" || markers_1st_part_4th_1[i]['Location'] == \"M/MT/FR061C2\" || markers_1st_part_4th_1[i]['Location'] == \"M/MT/FR061B2\" || markers_1st_part_4th_1[i]['Location'] == \"M/MT/FR061A2\") {\n var loc = markers_1st_part_4th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_4th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_4th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n\n }\n }\n\n\n var markers_1st_part_4th_2 = given_data_first_part_4th_2;\n\n\n for (var i = 0; i < markers_1st_part_4th_2.length; i++) {\n if (markers_1st_part_4th_2[i]['Location'] == \"M/MT/FR061D1\" || markers_1st_part_4th_2[i]['Location'] == \"M/MT/FR061C1\" || markers_1st_part_4th_2[i]['Location'] == \"M/MT/FR061B1\" || markers_1st_part_4th_2[i]['Location'] == \"M/MT/FR061A1\") {\n var loc = markers_1st_part_4th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_4th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_4th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n\n //----------------------------------5th part of first block----------------------------------------------\n var markers_1st_part_5th_1 = given_data_first_part_5th_1;\n for (var i = 0; i < markers_1st_part_5th_1.length; i++) {\n if (markers_1st_part_5th_1[i]['Location'] == \"M/MT/FR060D2\" || markers_1st_part_5th_1[i]['Location'] == \"M/MT/FR060C2\" || markers_1st_part_5th_1[i]['Location'] == \"M/MT/FR060B2\" || markers_1st_part_5th_1[i]['Location'] == \"M/MT/FR060A2\") {\n var loc = markers_1st_part_5th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_5th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_5th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_5th_2 = given_data_first_part_5th_2;\n\n\n for (var i = 0; i < markers_1st_part_5th_2.length; i++) {\n if (markers_1st_part_5th_2[i]['Location'] == \"M/MT/FR060D1\" || markers_1st_part_5th_2[i]['Location'] == \"M/MT/FR060C1\" || markers_1st_part_5th_2[i]['Location'] == \"M/MT/FR060B1\" || markers_1st_part_5th_2[i]['Location'] == \"M/MT/FR060A1\") {\n var loc = markers_1st_part_5th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_5th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_5th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------6th part of first block----------------------------------------------\n var markers_1st_part_6th_1 = given_data_first_part_6th_1;\n for (var i = 0; i < markers_1st_part_6th_1.length; i++) {\n if (markers_1st_part_6th_1[i]['Location'] == \"M/MT/FR059D2\" || markers_1st_part_6th_1[i]['Location'] == \"M/MT/FR059C2\" || markers_1st_part_6th_1[i]['Location'] == \"M/MT/FR059B2\" || markers_1st_part_6th_1[i]['Location'] == \"M/MT/FR059A2\") {\n var loc = markers_1st_part_6th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_6th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_6th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_6th_2 = given_data_first_part_6th_2;\n\n\n for (var i = 0; i < markers_1st_part_6th_2.length; i++) {\n if (markers_1st_part_6th_2[i]['Location'] == \"M/MT/FR059D1\" || markers_1st_part_6th_2[i]['Location'] == \"M/MT/FR059C1\" || markers_1st_part_6th_2[i]['Location'] == \"M/MT/FR059B1\" || markers_1st_part_6th_2[i]['Location'] == \"M/MT/FR059A1\") {\n var loc = markers_1st_part_6th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_6th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_6th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //----------------------------------7th part of first block----------------------------------------------\n var markers_1st_part_7th_1 = given_data_first_part_7th_1;\n for (var i = 0; i < markers_1st_part_7th_1.length; i++) {\n if (markers_1st_part_7th_1[i]['Location'] == \"M/MT/FR058D2\" || markers_1st_part_7th_1[i]['Location'] == \"M/MT/FR058C2\" || markers_1st_part_7th_1[i]['Location'] == \"M/MT/FR058B2\" || markers_1st_part_7th_1[i]['Location'] == \"M/MT/FR058A2\") {\n var loc = markers_1st_part_7th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_7th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_7th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_7th_2 = given_data_first_part_7th_2;\n\n\n for (var i = 0; i < markers_1st_part_7th_2.length; i++) {\n if (markers_1st_part_7th_2[i]['Location'] == \"M/MT/FR058D1\" || markers_1st_part_7th_2[i]['Location'] == \"M/MT/FR058C1\" || markers_1st_part_7th_2[i]['Location'] == \"M/MT/FR058B1\" || markers_1st_part_7th_2[i]['Location'] == \"M/MT/FR058A1\") {\n var loc = markers_1st_part_7th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_7th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_7th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //----------------------------------8th part of first block----------------------------------------------\n var markers_1st_part_8th_1 = given_data_first_part_8th_1;\n for (var i = 0; i < markers_1st_part_8th_1.length; i++) {\n if (markers_1st_part_8th_1[i]['Location'] == \"M/MT/FR057D2\" || markers_1st_part_8th_1[i]['Location'] == \"M/MT/FR057C2\" || markers_1st_part_8th_1[i]['Location'] == \"M/MT/FR057B2\" || markers_1st_part_8th_1[i]['Location'] == \"M/MT/FR057A2\") {\n var loc = markers_1st_part_8th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_8th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_8th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_8th_2 = given_data_first_part_8th_2;\n for (var i = 0; i < markers_1st_part_8th_2.length; i++) {\n if (markers_1st_part_8th_2[i]['Location'] == \"M/MT/FR057D1\" || markers_1st_part_8th_2[i]['Location'] == \"M/MT/FR057C1\" || markers_1st_part_8th_2[i]['Location'] == \"M/MT/FR057B1\" || markers_1st_part_8th_2[i]['Location'] == \"M/MT/FR057A1\") {\n var loc = markers_1st_part_8th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_8th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_8th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------9th part of first block----------------------------------------------\n var markers_1st_part_9th_1 = given_data_first_part_9th_1;\n for (var i = 0; i < markers_1st_part_9th_1.length; i++) {\n if (markers_1st_part_9th_1[i]['Location'] == \"M/MT/FR056D2\" || markers_1st_part_9th_1[i]['Location'] == \"M/MT/FR056C2\" || markers_1st_part_9th_1[i]['Location'] == \"M/MT/FR056B2\" || markers_1st_part_9th_1[i]['Location'] == \"M/MT/FR056A2\") {\n var loc = markers_1st_part_9th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_9th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_9th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_9th_2 = given_data_first_part_9th_2;\n for (var i = 0; i < markers_1st_part_9th_2.length; i++) {\n if (markers_1st_part_9th_2[i]['Location'] == \"M/MT/FR056D1\" || markers_1st_part_9th_2[i]['Location'] == \"M/MT/FR056C1\" || markers_1st_part_9th_2[i]['Location'] == \"M/MT/FR056B1\" || markers_1st_part_9th_2[i]['Location'] == \"M/MT/FR056A1\") {\n var loc = markers_1st_part_9th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_9th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_9th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //----------------------------------10th part of first block----------------------------------------------\n var markers_1st_part_10th_1 = given_data_first_part_10th_1;\n for (var i = 0; i < markers_1st_part_10th_1.length; i++) {\n if (markers_1st_part_10th_1[i]['Location'] == \"M/MT/FR055D2\" || markers_1st_part_10th_1[i]['Location'] == \"M/MT/FR055C2\" || markers_1st_part_10th_1[i]['Location'] == \"M/MT/FR055B2\" || markers_1st_part_10th_1[i]['Location'] == \"M/MT/FR055A2\") {\n var loc = markers_1st_part_10th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_10th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_10th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_10th_2 = given_data_first_part_10th_2;\n for (var i = 0; i < markers_1st_part_10th_2.length; i++) {\n if (markers_1st_part_10th_2[i]['Location'] == \"M/MT/FR055D1\" || markers_1st_part_10th_2[i]['Location'] == \"M/MT/FR055C1\" || markers_1st_part_10th_2[i]['Location'] == \"M/MT/FR055B1\" || markers_1st_part_10th_2[i]['Location'] == \"M/MT/FR055A1\") {\n var loc = markers_1st_part_10th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_10th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_10th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------11th part of first block----------------------------------------------\n var markers_1st_part_11th_1 = given_data_first_part_11th_1;\n for (var i = 0; i < markers_1st_part_11th_1.length; i++) {\n if (markers_1st_part_11th_1[i]['Location'] == \"M/MT/FR054D2\" || markers_1st_part_11th_1[i]['Location'] == \"M/MT/FR054C2\" || markers_1st_part_11th_1[i]['Location'] == \"M/MT/FR054B2\" || markers_1st_part_11th_1[i]['Location'] == \"M/MT/FR054A2\") {\n var loc = markers_1st_part_11th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_11th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_11th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_11th_2 = given_data_first_part_11th_2;\n for (var i = 0; i < markers_1st_part_11th_2.length; i++) {\n if (markers_1st_part_11th_2[i]['Location'] == \"M/MT/FR054D1\" || markers_1st_part_11th_2[i]['Location'] == \"M/MT/FR054C1\" || markers_1st_part_11th_2[i]['Location'] == \"M/MT/FR054B1\" || markers_1st_part_11th_2[i]['Location'] == \"M/MT/FR054A1\") {\n var loc = markers_1st_part_11th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_11th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_11th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------12th part of first block----------------------------------------------\n var markers_1st_part_12th_1 = given_data_first_part_12th_1;\n for (var i = 0; i < markers_1st_part_12th_1.length; i++) {\n if (markers_1st_part_12th_1[i]['Location'] == \"M/MT/FR053D2\" || markers_1st_part_12th_1[i]['Location'] == \"M/MT/FR053C2\" || markers_1st_part_12th_1[i]['Location'] == \"M/MT/FR053B2\" || markers_1st_part_12th_1[i]['Location'] == \"M/MT/FR053A2\") {\n var loc = markers_1st_part_12th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_12th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_12th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_12th_2 = given_data_first_part_12th_2;\n for (var i = 0; i < markers_1st_part_12th_2.length; i++) {\n if (markers_1st_part_12th_2[i]['Location'] == \"M/MT/FR053D1\" || markers_1st_part_12th_2[i]['Location'] == \"M/MT/FR053C1\" || markers_1st_part_12th_2[i]['Location'] == \"M/MT/FR053B1\" || markers_1st_part_12th_2[i]['Location'] == \"M/MT/FR053A1\") {\n var loc = markers_1st_part_12th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_12th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_12th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n\n //----------------------------------13th part of first block----------------------------------------------\n var markers_1st_part_13th_1 = given_data_first_part_13th_1;\n for (var i = 0; i < markers_1st_part_13th_1.length; i++) {\n if (markers_1st_part_13th_1[i]['Location'] == \"M/MT/FR052D2\" || markers_1st_part_13th_1[i]['Location'] == \"M/MT/FR052C2\" || markers_1st_part_13th_1[i]['Location'] == \"M/MT/FR052B2\" || markers_1st_part_13th_1[i]['Location'] == \"M/MT/FR052A2\") {\n var loc = markers_1st_part_13th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_13th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_13th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_13th_2 = given_data_first_part_13th_2;\n for (var i = 0; i < markers_1st_part_13th_2.length; i++) {\n if (markers_1st_part_13th_2[i]['Location'] == \"M/MT/FR052D1\" || markers_1st_part_13th_2[i]['Location'] == \"M/MT/FR052C1\" || markers_1st_part_13th_2[i]['Location'] == \"M/MT/FR052B1\" || markers_1st_part_13th_2[i]['Location'] == \"M/MT/FR052A1\") {\n var loc = markers_1st_part_13th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_13th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_13th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------14th part of first block----------------------------------------------\n var markers_1st_part_14th_1 = given_data_first_part_14th_1;\n for (var i = 0; i < markers_1st_part_14th_1.length; i++) {\n if (markers_1st_part_14th_1[i]['Location'] == \"M/MT/FR051D2\" || markers_1st_part_14th_1[i]['Location'] == \"M/MT/FR051C2\" || markers_1st_part_14th_1[i]['Location'] == \"M/MT/FR051B2\" || markers_1st_part_14th_1[i]['Location'] == \"M/MT/FR051A2\") {\n var loc = markers_1st_part_14th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_14th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_14th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_14th_2 = given_data_first_part_14th_2;\n for (var i = 0; i < markers_1st_part_14th_2.length; i++) {\n if (markers_1st_part_14th_2[i]['Location'] == \"M/MT/FR051D1\" || markers_1st_part_14th_2[i]['Location'] == \"M/MT/FR051C1\" || markers_1st_part_14th_2[i]['Location'] == \"M/MT/FR051B1\" || markers_1st_part_14th_2[i]['Location'] == \"M/MT/FR051A1\") {\n var loc = markers_1st_part_14th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_14th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_14th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //----------------------------------15th part of first block----------------------------------------------\n var markers_1st_part_15th_1 = given_data_first_part_15th_1;\n\n for (var i = 0; i < markers_1st_part_15th_1.length; i++) {\n if (markers_1st_part_15th_1[i]['Location'] == \"M/MT/FR050D2\" || markers_1st_part_15th_1[i]['Location'] == \"M/MT/FR050C2\" || markers_1st_part_15th_1[i]['Location'] == \"M/MT/FR050B2\" || markers_1st_part_15th_1[i]['Location'] == \"M/MT/FR050A2\") {\n var loc = markers_1st_part_15th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_15th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_15th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_15th_2 = given_data_first_part_15th_2;\n for (var i = 0; i < markers_1st_part_15th_2.length; i++) {\n if (markers_1st_part_15th_2[i]['Location'] == \"M/MT/FR050D1\" || markers_1st_part_15th_2[i]['Location'] == \"M/MT/FR050C1\" || markers_1st_part_15th_2[i]['Location'] == \"M/MT/FR050B1\" || markers_1st_part_15th_2[i]['Location'] == \"M/MT/FR050A1\") {\n var loc = markers_1st_part_15th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_15th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_15th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //----------------------------------16th part of first block----------------------------------------------\n var markers_1st_part_16th_1 = given_data_first_part_16th_1;\n\n for (var i = 0; i < markers_1st_part_16th_1.length; i++) {\n if (markers_1st_part_16th_1[i]['Location'] == \"M/MT/FR049D2\" || markers_1st_part_16th_1[i]['Location'] == \"M/MT/FR049C2\" || markers_1st_part_16th_1[i]['Location'] == \"M/MT/FR049B2\" || markers_1st_part_16th_1[i]['Location'] == \"M/MT/FR049A2\") {\n var loc = markers_1st_part_16th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_16th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_16th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_16th_2 = given_data_first_part_16th_2;\n for (var i = 0; i < markers_1st_part_16th_2.length; i++) {\n if (markers_1st_part_16th_2[i]['Location'] == \"M/MT/FR049D1\" || markers_1st_part_16th_2[i]['Location'] == \"M/MT/FR049C1\" || markers_1st_part_16th_2[i]['Location'] == \"M/MT/FR049B1\" || markers_1st_part_16th_2[i]['Location'] == \"M/MT/FR049A1\") {\n var loc = markers_1st_part_16th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_16th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_16th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------17th part of first block----------------------------------------------\n var markers_1st_part_17th_1 = given_data_first_part_17th_1;\n\n for (var i = 0; i < markers_1st_part_17th_1.length; i++) {\n if (markers_1st_part_17th_1[i]['Location'] == \"M/MT/FR048D2\" || markers_1st_part_17th_1[i]['Location'] == \"M/MT/FR048C2\" || markers_1st_part_17th_1[i]['Location'] == \"M/MT/FR048B2\" || markers_1st_part_17th_1[i]['Location'] == \"M/MT/FR048A2\") {\n var loc = markers_1st_part_17th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_17th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_17th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_17th_2 = given_data_first_part_17th_2;\n for (var i = 0; i < markers_1st_part_17th_2.length; i++) {\n if (markers_1st_part_17th_2[i]['Location'] == \"M/MT/FR048D1\" || markers_1st_part_17th_2[i]['Location'] == \"M/MT/FR048C1\" || markers_1st_part_17th_2[i]['Location'] == \"M/MT/FR048B1\" || markers_1st_part_17th_2[i]['Location'] == \"M/MT/FR048A1\") {\n var loc = markers_1st_part_17th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_17th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_17th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------18th part of first block----------------------------------------------\n var markers_1st_part_18th_1 = given_data_first_part_18th_1;\n\n for (var i = 0; i < markers_1st_part_18th_1.length; i++) {\n if (markers_1st_part_18th_1[i]['Location'] == \"M/MT/FR047D2\" || markers_1st_part_18th_1[i]['Location'] == \"M/MT/FR047C2\" || markers_1st_part_18th_1[i]['Location'] == \"M/MT/FR047B2\" || markers_1st_part_18th_1[i]['Location'] == \"M/MT/FR047A2\") {\n var loc = markers_1st_part_18th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_18th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_18th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_18th_2 = given_data_first_part_18th_2;\n for (var i = 0; i < markers_1st_part_18th_2.length; i++) {\n if (markers_1st_part_18th_2[i]['Location'] == \"M/MT/FR047D1\" || markers_1st_part_18th_2[i]['Location'] == \"M/MT/FR047C1\" || markers_1st_part_18th_2[i]['Location'] == \"M/MT/FR047B1\" || markers_1st_part_18th_2[i]['Location'] == \"M/MT/FR047A1\") {\n var loc = markers_1st_part_18th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_18th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_18th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------19th part of first block----------------------------------------------\n var markers_1st_part_19th_1 = given_data_first_part_19th_1;\n\n for (var i = 0; i < markers_1st_part_19th_1.length; i++) {\n if (markers_1st_part_19th_1[i]['Location'] == \"M/MT/FR046D2\" || markers_1st_part_19th_1[i]['Location'] == \"M/MT/FR046C2\" || markers_1st_part_19th_1[i]['Location'] == \"M/MT/FR046B2\" || markers_1st_part_19th_1[i]['Location'] == \"M/MT/FR046A2\") {\n var loc = markers_1st_part_19th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_19th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_19th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_19th_2 = given_data_first_part_19th_2;\n for (var i = 0; i < markers_1st_part_19th_2.length; i++) {\n if (markers_1st_part_19th_2[i]['Location'] == \"M/MT/FR046D1\" || markers_1st_part_19th_2[i]['Location'] == \"M/MT/FR046C1\" || markers_1st_part_19th_2[i]['Location'] == \"M/MT/FR046B1\" || markers_1st_part_19th_2[i]['Location'] == \"M/MT/FR046A1\") {\n var loc = markers_1st_part_19th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_19th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_19th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------20th part of first block----------------------------------------------\n var markers_1st_part_20th_1 = given_data_first_part_20th_1;\n\n for (var i = 0; i < markers_1st_part_20th_1.length; i++) {\n if (markers_1st_part_20th_1[i]['Location'] == \"M/MT/FR045D2\" || markers_1st_part_20th_1[i]['Location'] == \"M/MT/FR045C2\" || markers_1st_part_20th_1[i]['Location'] == \"M/MT/FR045B2\" || markers_1st_part_20th_1[i]['Location'] == \"M/MT/FR045A2\") {\n var loc = markers_1st_part_20th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_20th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_20th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_20th_2 = given_data_first_part_20th_2;\n for (var i = 0; i < markers_1st_part_20th_2.length; i++) {\n\n if (markers_1st_part_20th_2[i]['Location'] == \"M/MT/FR045D1\" || markers_1st_part_20th_2[i]['Location'] == \"M/MT/FR045C1\" || markers_1st_part_20th_2[i]['Location'] == \"M/MT/FR045B1\" || markers_1st_part_20th_2[i]['Location'] == \"M/MT/FR045A1\") {\n var loc = markers_1st_part_20th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_20th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_20th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //----------------------------------21th part of first block----------------------------------------------\n var markers_1st_part_21th_1 = given_data_first_part_21th_1;\n\n for (var i = 0; i < markers_1st_part_21th_1.length; i++) {\n if (markers_1st_part_21th_1[i]['Location'] == \"M/MT/FR044D2\" || markers_1st_part_21th_1[i]['Location'] == \"M/MT/FR044C2\" || markers_1st_part_21th_1[i]['Location'] == \"M/MT/FR044B2\" || markers_1st_part_21th_1[i]['Location'] == \"M/MT/FR044A2\") {\n var loc = markers_1st_part_21th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_21th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_21th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_21th_2 = given_data_first_part_21th_2;\n for (var i = 0; i < markers_1st_part_21th_2.length; i++) {\n\n if (markers_1st_part_21th_2[i]['Location'] == \"M/MT/FR044D1\" || markers_1st_part_21th_2[i]['Location'] == \"M/MT/FR044C1\" || markers_1st_part_21th_2[i]['Location'] == \"M/MT/FR044B1\" || markers_1st_part_21th_2[i]['Location'] == \"M/MT/FR044A1\") {\n var loc = markers_1st_part_21th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_21th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_21th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------22th part of first block----------------------------------------------\n var markers_1st_part_22th_1 = given_data_first_part_22th_1;\n\n for (var i = 0; i < markers_1st_part_22th_1.length; i++) {\n if (markers_1st_part_22th_1[i]['Location'] == \"M/MT/FR043D2\" || markers_1st_part_22th_1[i]['Location'] == \"M/MT/FR043C2\" || markers_1st_part_22th_1[i]['Location'] == \"M/MT/FR043B2\" || markers_1st_part_22th_1[i]['Location'] == \"M/MT/FR043A2\") {\n var loc = markers_1st_part_22th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_22th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_22th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_22th_2 = given_data_first_part_22th_2;\n for (var i = 0; i < markers_1st_part_22th_2.length; i++) {\n\n if (markers_1st_part_22th_2[i]['Location'] == \"M/MT/FR043D1\" || markers_1st_part_22th_2[i]['Location'] == \"M/MT/FR043C1\" || markers_1st_part_22th_2[i]['Location'] == \"M/MT/FR043B1\" || markers_1st_part_22th_2[i]['Location'] == \"M/MT/FR043A1\") {\n var loc = markers_1st_part_22th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_22th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_22th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //----------------------------------23th part of first block----------------------------------------------\n var markers_1st_part_23th_1 = given_data_first_part_23th_1;\n\n for (var i = 0; i < markers_1st_part_23th_1.length; i++) {\n if (markers_1st_part_23th_1[i]['Location'] == \"M/MT/FR042D2\" || markers_1st_part_23th_1[i]['Location'] == \"M/MT/FR042C2\" || markers_1st_part_23th_1[i]['Location'] == \"M/MT/FR042B2\" || markers_1st_part_23th_1[i]['Location'] == \"M/MT/FR042A2\") {\n var loc = markers_1st_part_23th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_23th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_23th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_23th_2 = given_data_first_part_23th_2;\n for (var i = 0; i < markers_1st_part_23th_2.length; i++) {\n\n if (markers_1st_part_23th_2[i]['Location'] == \"M/MT/FR042D1\" || markers_1st_part_23th_2[i]['Location'] == \"M/MT/FR042C1\" || markers_1st_part_23th_2[i]['Location'] == \"M/MT/FR042B1\" || markers_1st_part_23th_2[i]['Location'] == \"M/MT/FR042A1\") {\n var loc = markers_1st_part_23th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_23th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_23th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------24th part of first block----------------------------------------------\n var markers_1st_part_24th_1 = given_data_first_part_24th_1;\n\n for (var i = 0; i < markers_1st_part_24th_1.length; i++) {\n if (markers_1st_part_24th_1[i]['Location'] == \"M/MT/FR041D2\" || markers_1st_part_24th_1[i]['Location'] == \"M/MT/FR041C2\" || markers_1st_part_24th_1[i]['Location'] == \"M/MT/FR041B2\" || markers_1st_part_24th_1[i]['Location'] == \"M/MT/FR041A2\") {\n var loc = markers_1st_part_24th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_24th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_24th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_24th_2 = given_data_first_part_24th_2;\n for (var i = 0; i < markers_1st_part_24th_2.length; i++) {\n\n if (markers_1st_part_24th_2[i]['Location'] == \"M/MT/FR041D1\" || markers_1st_part_24th_2[i]['Location'] == \"M/MT/FR041C1\" || markers_1st_part_24th_2[i]['Location'] == \"M/MT/FR041B1\" || markers_1st_part_24th_2[i]['Location'] == \"M/MT/FR041A1\") {\n var loc = markers_1st_part_24th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_24th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_24th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //----------------------------------25th part of first block----------------------------------------------\n var markers_1st_part_25th_1 = given_data_first_part_25th_1;\n\n for (var i = 0; i < markers_1st_part_25th_1.length; i++) {\n if (markers_1st_part_25th_1[i]['Location'] == \"M/MT/FR040D2\" || markers_1st_part_25th_1[i]['Location'] == \"M/MT/FR040C2\" || markers_1st_part_25th_1[i]['Location'] == \"M/MT/FR040B2\" || markers_1st_part_25th_1[i]['Location'] == \"M/MT/FR040A2\") {\n var loc = markers_1st_part_25th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_25th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_25th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_25th_2 = given_data_first_part_25th_2;\n for (var i = 0; i < markers_1st_part_25th_2.length; i++) {\n\n if (markers_1st_part_25th_2[i]['Location'] == \"M/MT/FR040D1\" || markers_1st_part_25th_2[i]['Location'] == \"M/MT/FR040C1\" || markers_1st_part_25th_2[i]['Location'] == \"M/MT/FR040B1\" || markers_1st_part_25th_2[i]['Location'] == \"M/MT/FR040A1\") {\n var loc = markers_1st_part_25th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_25th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_25th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n //----------------------------------26th part of first block----------------------------------------------\n var markers_1st_part_26th_1 = given_data_first_part_26th_1;\n\n for (var i = 0; i < markers_1st_part_26th_1.length; i++) {\n if (markers_1st_part_26th_1[i]['Location'] == \"M/MT/FR039D2\" || markers_1st_part_26th_1[i]['Location'] == \"M/MT/FR039C2\" || markers_1st_part_26th_1[i]['Location'] == \"M/MT/FR039B2\" || markers_1st_part_26th_1[i]['Location'] == \"M/MT/FR039A2\") {\n var loc = markers_1st_part_26th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_26th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_26th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_26th_2 = given_data_first_part_26th_2;\n for (var i = 0; i < markers_1st_part_26th_2.length; i++) {\n\n if (markers_1st_part_26th_2[i]['Location'] == \"M/MT/FR039D1\" || markers_1st_part_26th_2[i]['Location'] == \"M/MT/FR039C1\" || markers_1st_part_26th_2[i]['Location'] == \"M/MT/FR039B1\" || markers_1st_part_26th_2[i]['Location'] == \"M/MT/FR039A1\") {\n var loc = markers_1st_part_26th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_26th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_26th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //----------------------------------27th part of first block----------------------------------------------\n var markers_1st_part_27th_1 = given_data_first_part_27th_1;\n\n for (var i = 0; i < markers_1st_part_27th_1.length; i++) {\n if (markers_1st_part_27th_1[i]['Location'] == \"M/MT/FR038D2\" || markers_1st_part_27th_1[i]['Location'] == \"M/MT/FR038C2\" || markers_1st_part_27th_1[i]['Location'] == \"M/MT/FR038B2\" || markers_1st_part_27th_1[i]['Location'] == \"M/MT/FR038A2\") {\n var loc = markers_1st_part_27th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_27th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_27th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_27th_2 = given_data_first_part_27th_2;\n for (var i = 0; i < markers_1st_part_27th_2.length; i++) {\n\n if (markers_1st_part_27th_2[i]['Location'] == \"M/MT/FR038D1\" || markers_1st_part_27th_2[i]['Location'] == \"M/MT/FR038C1\" || markers_1st_part_27th_2[i]['Location'] == \"M/MT/FR038B1\" || markers_1st_part_27th_2[i]['Location'] == \"M/MT/FR038A1\") {\n var loc = markers_1st_part_27th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_27th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_27th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------28th part of first block----------------------------------------------\n var markers_1st_part_28th_1 = given_data_first_part_28th_1;\n\n for (var i = 0; i < markers_1st_part_28th_1.length; i++) {\n if (markers_1st_part_28th_1[i]['Location'] == \"M/MT/FR037D2\" || markers_1st_part_28th_1[i]['Location'] == \"M/MT/FR037C2\" || markers_1st_part_28th_1[i]['Location'] == \"M/MT/FR037B2\" || markers_1st_part_28th_1[i]['Location'] == \"M/MT/FR037A2\") {\n var loc = markers_1st_part_28th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_28th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_28th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_28th_2 = given_data_first_part_28th_2;\n for (var i = 0; i < markers_1st_part_28th_2.length; i++) {\n\n if (markers_1st_part_28th_2[i]['Location'] == \"M/MT/FR037D1\" || markers_1st_part_28th_2[i]['Location'] == \"M/MT/FR037C1\" || markers_1st_part_28th_2[i]['Location'] == \"M/MT/FR037B1\" || markers_1st_part_28th_2[i]['Location'] == \"M/MT/FR037A1\") {\n var loc = markers_1st_part_28th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_28th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_28th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //----------------------------------29th part of first block----------------------------------------------\n var markers_1st_part_29th_1 = given_data_first_part_29th_1;\n\n for (var i = 0; i < markers_1st_part_29th_1.length; i++) {\n if (markers_1st_part_29th_1[i]['Location'] == \"M/MT/FR036D2\" || markers_1st_part_29th_1[i]['Location'] == \"M/MT/FR036C2\" || markers_1st_part_29th_1[i]['Location'] == \"M/MT/FR036B2\" || markers_1st_part_29th_1[i]['Location'] == \"M/MT/FR036A2\") {\n var loc = markers_1st_part_29th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_29th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_29th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_29th_2 = given_data_first_part_29th_2;\n for (var i = 0; i < markers_1st_part_29th_2.length; i++) {\n\n if (markers_1st_part_29th_2[i]['Location'] == \"M/MT/FR036D1\" || markers_1st_part_29th_2[i]['Location'] == \"M/MT/FR036C1\" || markers_1st_part_29th_2[i]['Location'] == \"M/MT/FR036B1\" || markers_1st_part_29th_2[i]['Location'] == \"M/MT/FR036A1\") {\n var loc = markers_1st_part_29th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_29th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_29th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------30th part of first block----------------------------------------------\n var markers_1st_part_30th_1 = given_data_first_part_30th_1;\n\n for (var i = 0; i < markers_1st_part_30th_1.length; i++) {\n if (markers_1st_part_30th_1[i]['Location'] == \"M/MT/FR035D2\" || markers_1st_part_30th_1[i]['Location'] == \"M/MT/FR035C2\" || markers_1st_part_30th_1[i]['Location'] == \"M/MT/FR035B2\" || markers_1st_part_30th_1[i]['Location'] == \"M/MT/FR035A2\") {\n var loc = markers_1st_part_30th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_30th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_30th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_30th_2 = given_data_first_part_30th_2;\n for (var i = 0; i < markers_1st_part_30th_2.length; i++) {\n\n if (markers_1st_part_30th_2[i]['Location'] == \"M/MT/FR035D1\" || markers_1st_part_30th_2[i]['Location'] == \"M/MT/FR035C1\" || markers_1st_part_30th_2[i]['Location'] == \"M/MT/FR035B1\" || markers_1st_part_30th_2[i]['Location'] == \"M/MT/FR035A1\") {\n var loc = markers_1st_part_30th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_30th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_30th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n //----------------------------------31th part of first block----------------------------------------------\n var markers_1st_part_31th_1 = given_data_first_part_31th_1;\n\n for (var i = 0; i < markers_1st_part_31th_1.length; i++) {\n if (markers_1st_part_31th_1[i]['Location'] == \"M/MT/FR034D2\" || markers_1st_part_31th_1[i]['Location'] == \"M/MT/FR034C2\" || markers_1st_part_31th_1[i]['Location'] == \"M/MT/FR034B2\" || markers_1st_part_31th_1[i]['Location'] == \"M/MT/FR034A2\") {\n var loc = markers_1st_part_31th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_31th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_31th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_31th_2 = given_data_first_part_31th_2;\n for (var i = 0; i < markers_1st_part_31th_2.length; i++) {\n\n if (markers_1st_part_31th_2[i]['Location'] == \"M/MT/FR034D1\" || markers_1st_part_31th_2[i]['Location'] == \"M/MT/FR034C1\" || markers_1st_part_31th_2[i]['Location'] == \"M/MT/FR034B1\" || markers_1st_part_31th_2[i]['Location'] == \"M/MT/FR034A1\") {\n var loc = markers_1st_part_31th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_31th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_31th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n //----------------------------------32th part of first block----------------------------------------------\n var markers_1st_part_32th_1 = given_data_first_part_32th_1;\n\n for (var i = 0; i < markers_1st_part_32th_1.length; i++) {\n if (markers_1st_part_32th_1[i]['Location'] == \"M/MT/FR033D2\" || markers_1st_part_32th_1[i]['Location'] == \"M/MT/FR033C2\" || markers_1st_part_32th_1[i]['Location'] == \"M/MT/FR033B2\" || markers_1st_part_32th_1[i]['Location'] == \"M/MT/FR033A2\") {\n var loc = markers_1st_part_32th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_32th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_32th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_32th_2 = given_data_first_part_32th_2;\n for (var i = 0; i < markers_1st_part_32th_2.length; i++) {\n\n if (markers_1st_part_32th_2[i]['Location'] == \"M/MT/FR033D1\" || markers_1st_part_32th_2[i]['Location'] == \"M/MT/FR033C1\" || markers_1st_part_32th_2[i]['Location'] == \"M/MT/FR033B1\" || markers_1st_part_32th_2[i]['Location'] == \"M/MT/FR033A1\") {\n var loc = markers_1st_part_32th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_32th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_32th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n\n //----------------------------------33th part of first block----------------------------------------------\n var markers_1st_part_33th_1 = given_data_first_part_33th_1;\n\n for (var i = 0; i < markers_1st_part_33th_1.length; i++) {\n if (markers_1st_part_33th_1[i]['Location'] == \"M/MT/FR032D2\" || markers_1st_part_33th_1[i]['Location'] == \"M/MT/FR032C2\" || markers_1st_part_33th_1[i]['Location'] == \"M/MT/FR032B2\" || markers_1st_part_33th_1[i]['Location'] == \"M/MT/FR032A2\") {\n var loc = markers_1st_part_33th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_33th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_33th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_1st_part_33th_2 = given_data_first_part_33th_2;\n for (var i = 0; i < markers_1st_part_33th_2.length; i++) {\n\n if (markers_1st_part_33th_2[i]['Location'] == \"M/MT/FR032D1\" || markers_1st_part_33th_2[i]['Location'] == \"M/MT/FR032C1\" || markers_1st_part_33th_2[i]['Location'] == \"M/MT/FR032B1\" || markers_1st_part_33th_2[i]['Location'] == \"M/MT/FR032A1\") {\n var loc = markers_1st_part_33th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_1st_part_33th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_1st_part_33th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n\n //----------------------------------filling 7th block small boxes-----------------------------------\n //----------------------------------1th part of 7th block----------------------------------------------\n var markers_7th_part_1st_1 = given_data_seventh_part_1st_1;\n\n for (var i = 0; i < markers_7th_part_1st_1.length; i++) {\n if (markers_7th_part_1st_1[i]['Location'] == \"M/MT/FR029D2\" || markers_7th_part_1st_1[i]['Location'] == \"M/MT/FR029C2\" || markers_7th_part_1st_1[i]['Location'] == \"M/MT/FR029B2\" || markers_7th_part_1st_1[i]['Location'] == \"M/MT/FR029A2\") {\n var loc = markers_7th_part_1st_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_7th_part_1st_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_1st_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_7th_part_1st_2 = given_data_seventh_part_1st_2;\n for (var i = 0; i < markers_7th_part_1st_2.length; i++) {\n\n if (markers_7th_part_1st_2[i]['Location'] == \"M/MT/FR029D1\" || markers_7th_part_1st_2[i]['Location'] == \"M/MT/FR029C1\" || markers_7th_part_1st_2[i]['Location'] == \"M/MT/FR029B1\" || markers_7th_part_1st_2[i]['Location'] == \"M/MT/FR029A1\") {\n var loc = markers_7th_part_1st_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_7th_part_1st_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_1st_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n\n //----------------------------------2nd part of 7th block----------------------------------------------\n var markers_7th_part_2nd_1 = given_data_seventh_part_2nd_1;\n\n for (var i = 0; i < markers_7th_part_2nd_1.length; i++) {\n if (markers_7th_part_2nd_1[i]['Location'] == \"M/MT/FR028D2\" || markers_7th_part_2nd_1[i]['Location'] == \"M/MT/FR028C2\" || markers_7th_part_2nd_1[i]['Location'] == \"M/MT/FR028B2\" || markers_7th_part_2nd_1[i]['Location'] == \"M/MT/FR028A2\") {\n var loc = markers_7th_part_1st_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_7th_part_2nd_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_2nd_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_7th_part_2nd_2 = given_data_seventh_part_2nd_2;\n for (var i = 0; i < markers_7th_part_2nd_2.length; i++) {\n\n if (markers_7th_part_2nd_2[i]['Location'] == \"M/MT/FR028D1\" || markers_7th_part_2nd_2[i]['Location'] == \"M/MT/FR028C1\" || markers_7th_part_2nd_2[i]['Location'] == \"M/MT/FR028B1\" || markers_7th_part_2nd_2[i]['Location'] == \"M/MT/FR028A1\") {\n var loc = markers_7th_part_2nd_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_7th_part_2nd_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_2nd_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n //----------------------------------3rd part of 7th block----------------------------------------------\n var markers_7th_part_3rd_1 = given_data_seventh_part_3rd_1;\n\n for (var i = 0; i < markers_7th_part_3rd_1.length; i++) {\n if (markers_7th_part_3rd_1[i]['Location'] == \"M/MT/FR027D2\" || markers_7th_part_3rd_1[i]['Location'] == \"M/MT/FR027C2\" || markers_7th_part_3rd_1[i]['Location'] == \"M/MT/FR027B2\" || markers_7th_part_3rd_1[i]['Location'] == \"M/MT/FR027A2\") {\n var loc = markers_7th_part_3rd_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_7th_part_3rd_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_3rd_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_7th_part_3rd_2 = given_data_seventh_part_3rd_2;\n for (var i = 0; i < markers_7th_part_3rd_2.length; i++) {\n\n if (markers_7th_part_3rd_2[i]['Location'] == \"M/MT/FR027D1\" || markers_7th_part_3rd_2[i]['Location'] == \"M/MT/FR027C1\" || markers_7th_part_3rd_2[i]['Location'] == \"M/MT/FR027B1\" || markers_7th_part_3rd_2[i]['Location'] == \"M/MT/FR027A1\") {\n var loc = markers_7th_part_3rd_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_7th_part_3rd_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_3rd_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n\n\n //----------------------------------4th part of 7th block----------------------------------------------\n var markers_7th_part_4th_1 = given_data_seventh_part_4th_1;\n\n for (var i = 0; i < markers_7th_part_4th_1.length; i++) {\n if (markers_7th_part_4th_1[i]['Location'] == \"M/MT/FR026D2\" || markers_7th_part_4th_1[i]['Location'] == \"M/MT/FR026C2\" || markers_7th_part_4th_1[i]['Location'] == \"M/MT/FR026B2\" || markers_7th_part_4th_1[i]['Location'] == \"M/MT/FR026A2\") {\n var loc = markers_7th_part_4th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_7th_part_4th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_4th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_7th_part_4th_2 = given_data_seventh_part_4th_2;\n for (var i = 0; i < markers_7th_part_4th_2.length; i++) {\n\n if (markers_7th_part_4th_2[i]['Location'] == \"M/MT/FR026D1\" || markers_7th_part_4th_2[i]['Location'] == \"M/MT/FR026C1\" || markers_7th_part_4th_2[i]['Location'] == \"M/MT/FR026B1\" || markers_7th_part_4th_2[i]['Location'] == \"M/MT/FR026A1\") {\n var loc = markers_7th_part_4th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_7th_part_4th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_4th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n //----------------------------------5th part of 7th block----------------------------------------------\n var markers_7th_part_5th_1 = given_data_seventh_part_5th_1;\n\n for (var i = 0; i < markers_7th_part_5th_1.length; i++) {\n if (markers_7th_part_5th_1[i]['Location'] == \"M/MT/FR025D2\" || markers_7th_part_5th_1[i]['Location'] == \"M/MT/FR025C2\" || markers_7th_part_5th_1[i]['Location'] == \"M/MT/FR025B2\" || markers_7th_part_5th_1[i]['Location'] == \"M/MT/FR025A2\") {\n var loc = markers_7th_part_5th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_7th_part_5th_1[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_5th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n var markers_7th_part_5th_2 = given_data_seventh_part_5th_2;\n for (var i = 0; i < markers_7th_part_5th_2.length; i++) {\n\n if (markers_7th_part_5th_2[i]['Location'] == \"M/MT/FR025D1\" || markers_7th_part_5th_2[i]['Location'] == \"M/MT/FR025C1\" || markers_7th_part_5th_2[i]['Location'] == \"M/MT/FR025B1\" || markers_7th_part_5th_2[i]['Location'] == \"M/MT/FR025A1\") {\n var loc = markers_7th_part_5th_2[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [13, 6],\n\n }\n });\n x_val = markers_7th_part_5th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_5th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n\n\n }\n }\n\n\n\n //----------------------------------6th part of 7th block----------------------------------------------\n var markers_7th_part_6th_1 = given_data_seventh_part_6th_1;\n for (var i = 0; i < markers_7th_part_6th_1.length; i++) {\n if (markers_7th_part_6th_1[i]['Location'] == \"M/MT/FR024D2\" || markers_7th_part_6th_1[i]['Location'] == \"M/MT/FR024C2\" || markers_7th_part_6th_1[i]['Location'] == \"M/MT/FR024B2\" || markers_7th_part_6th_1[i]['Location'] == \"M/MT/FR024A2\") {\n var loc = markers_7th_part_6th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_6th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_6th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_6th_2 = given_data_seventh_part_6th_2;\n for (var i = 0; i < markers_7th_part_6th_2.length; i++) {\n if (markers_7th_part_6th_2[i]['Location'] == \"M/MT/FR024D1\" || markers_7th_part_6th_2[i]['Location'] == \"M/MT/FR024C1\" || markers_7th_part_6th_2[i]['Location'] == \"M/MT/FR024B1\" || markers_7th_part_6th_2[i]['Location'] == \"M/MT/FR024A1\") {\n var loc = markers_7th_part_5th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n x_val = markers_7th_part_6th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_6th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n\n //----------------------------------7th part of 7th block----------------------------------------------\n var markers_7th_part_7th_1 = given_data_seventh_part_7th_1;\n for (var i = 0; i < markers_7th_part_7th_1.length; i++) {\n if (markers_7th_part_7th_1[i]['Location'] == \"M/MT/FR023D2\" || markers_7th_part_7th_1[i]['Location'] == \"M/MT/FR023C2\" || markers_7th_part_7th_1[i]['Location'] == \"M/MT/FR023B2\" || markers_7th_part_7th_1[i]['Location'] == \"M/MT/FR023A2\") {\n var loc = markers_7th_part_7th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_7th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_7th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_7th_2 = given_data_seventh_part_7th_2;\n for (var i = 0; i < markers_7th_part_7th_2.length; i++) {\n if (markers_7th_part_7th_2[i]['Location'] == \"M/MT/FR023D1\" || markers_7th_part_7th_2[i]['Location'] == \"M/MT/FR023C1\" || markers_7th_part_7th_2[i]['Location'] == \"M/MT/FR023B1\" || markers_7th_part_7th_2[i]['Location'] == \"M/MT/FR023A1\") {\n var loc = markers_7th_part_7th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n x_val = markers_7th_part_7th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_7th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------------------8th part of 7th block----------------------------------------------\n var markers_7th_part_8th_1 = given_data_seventh_part_8th_1;\n for (var i = 0; i < markers_7th_part_8th_1.length; i++) {\n if (markers_7th_part_8th_1[i]['Location'] == \"M/MT/FR022D2\" || markers_7th_part_8th_1[i]['Location'] == \"M/MT/FR022C2\" || markers_7th_part_8th_1[i]['Location'] == \"M/MT/FR022B2\" || markers_7th_part_8th_1[i]['Location'] == \"M/MT/FR022A2\") {\n var loc = markers_7th_part_8th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_8th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_8th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_8th_2 = given_data_seventh_part_8th_2;\n for (var i = 0; i < markers_7th_part_8th_2.length; i++) {\n if (markers_7th_part_8th_2[i]['Location'] == \"M/MT/FR022D1\" || markers_7th_part_8th_2[i]['Location'] == \"M/MT/FR022C1\" || markers_7th_part_8th_2[i]['Location'] == \"M/MT/FR022B1\" || markers_7th_part_8th_2[i]['Location'] == \"M/MT/FR022A1\") {\n var loc = markers_7th_part_8th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n x_val = markers_7th_part_8th_2[i][\"marker_position\"];\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_8th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------------------9th part of 7th block----------------------------------------------\n var markers_7th_part_9th_1 = given_data_seventh_part_9th_1;\n for (var i = 0; i < markers_7th_part_9th_1.length; i++) {\n if (markers_7th_part_9th_1[i]['Location'] == \"M/MT/FR021D2\" || markers_7th_part_9th_1[i]['Location'] == \"M/MT/FR021C2\" || markers_7th_part_9th_1[i]['Location'] == \"M/MT/FR021B2\" || markers_7th_part_9th_1[i]['Location'] == \"M/MT/FR021A2\") {\n var loc = markers_7th_part_9th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_9th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_9th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_9th_2 = given_data_seventh_part_9th_2;\n for (var i = 0; i < markers_7th_part_9th_2.length; i++) {\n if (markers_7th_part_9th_2[i]['Location'] == \"M/MT/FR021D1\" || markers_7th_part_9th_2[i]['Location'] == \"M/MT/FR021C1\" || markers_7th_part_9th_2[i]['Location'] == \"M/MT/FR021B1\" || markers_7th_part_9th_2[i]['Location'] == \"M/MT/FR021A1\") {\n var loc = markers_7th_part_9th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_9th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_9th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n\n //----------------------------------10th part of 7th block----------------------------------------------\n var markers_7th_part_10th_1 = given_data_seventh_part_10th_1;\n for (var i = 0; i < markers_7th_part_10th_1.length; i++) {\n if (markers_7th_part_10th_1[i]['Location'] == \"M/MT/FR020D2\" || markers_7th_part_10th_1[i]['Location'] == \"M/MT/FR020C2\" || markers_7th_part_10th_1[i]['Location'] == \"M/MT/FR020B2\" || markers_7th_part_10th_1[i]['Location'] == \"M/MT/FR020A2\") {\n var loc = markers_7th_part_10th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_10th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_10th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_10th_2 = given_data_seventh_part_10th_2;\n for (var i = 0; i < markers_7th_part_10th_2.length; i++) {\n if (markers_7th_part_10th_2[i]['Location'] == \"M/MT/FR020D1\" || markers_7th_part_10th_2[i]['Location'] == \"M/MT/FR020C1\" || markers_7th_part_10th_2[i]['Location'] == \"M/MT/FR020B1\" || markers_7th_part_10th_2[i]['Location'] == \"M/MT/FR020A1\") {\n var loc = markers_7th_part_10th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_10th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_10th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n\n //----------------------------------11th part of 7th block----------------------------------------------\n var markers_7th_part_11th_1 = given_data_seventh_part_11th_1;\n for (var i = 0; i < markers_7th_part_11th_1.length; i++) {\n if (markers_7th_part_11th_1[i]['Location'] == \"M/MT/FR019D2\" || markers_7th_part_11th_1[i]['Location'] == \"M/MT/FR019C2\" || markers_7th_part_11th_1[i]['Location'] == \"M/MT/FR019B2\" || markers_7th_part_11th_1[i]['Location'] == \"M/MT/FR019A2\") {\n var loc = markers_7th_part_11th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_11th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_11th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_11th_2 = given_data_seventh_part_11th_2;\n for (var i = 0; i < markers_7th_part_11th_2.length; i++) {\n if (markers_7th_part_11th_2[i]['Location'] == \"M/MT/FR019D1\" || markers_7th_part_11th_2[i]['Location'] == \"M/MT/FR019C1\" || markers_7th_part_11th_2[i]['Location'] == \"M/MT/FR019B1\" || markers_7th_part_11th_2[i]['Location'] == \"M/MT/FR019A1\") {\n var loc = markers_7th_part_11th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_11th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_11th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------------------12th part of 7th block----------------------------------------------\n var markers_7th_part_12th_1 = given_data_seventh_part_12th_1;\n for (var i = 0; i < markers_7th_part_12th_1.length; i++) {\n if (markers_7th_part_12th_1[i]['Location'] == \"M/MT/FR018D2\" || markers_7th_part_12th_1[i]['Location'] == \"M/MT/FR018C2\" || markers_7th_part_12th_1[i]['Location'] == \"M/MT/FR018B2\" || markers_7th_part_12th_1[i]['Location'] == \"M/MT/FR018A2\") {\n var loc = markers_7th_part_11th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_12th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_12th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_12th_2 = given_data_seventh_part_12th_2;\n for (var i = 0; i < markers_7th_part_12th_2.length; i++) {\n if (markers_7th_part_12th_2[i]['Location'] == \"M/MT/FR018D1\" || markers_7th_part_12th_2[i]['Location'] == \"M/MT/FR018C1\" || markers_7th_part_12th_2[i]['Location'] == \"M/MT/FR018B1\" || markers_7th_part_12th_2[i]['Location'] == \"M/MT/FR018A1\") {\n var loc = markers_7th_part_12th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_12th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_12th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------------------13th part of 7th block----------------------------------------------\n var markers_7th_part_13th_1 = given_data_seventh_part_13th_1;\n for (var i = 0; i < markers_7th_part_13th_1.length; i++) {\n if (markers_7th_part_13th_1[i]['Location'] == \"M/MT/FR017D2\" || markers_7th_part_13th_1[i]['Location'] == \"M/MT/FR017C2\" || markers_7th_part_13th_1[i]['Location'] == \"M/MT/FR017B2\" || markers_7th_part_13th_1[i]['Location'] == \"M/MT/FR017A2\") {\n var loc = markers_7th_part_13th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_13th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_13th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_13th_2 = given_data_seventh_part_13th_2;\n for (var i = 0; i < markers_7th_part_13th_2.length; i++) {\n if (markers_7th_part_13th_2[i]['Location'] == \"M/MT/FR017D1\" || markers_7th_part_13th_2[i]['Location'] == \"M/MT/FR017C1\" || markers_7th_part_13th_2[i]['Location'] == \"M/MT/FR017B1\" || markers_7th_part_13th_2[i]['Location'] == \"M/MT/FR017A1\") {\n var loc = markers_7th_part_13th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_13th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_13th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n\n //----------------------------------14th part of 7th block----------------------------------------------\n var markers_7th_part_14th_1 = given_data_seventh_part_14th_1;\n for (var i = 0; i < markers_7th_part_14th_1.length; i++) {\n if (markers_7th_part_14th_1[i]['Location'] == \"M/MT/FR016D2\" || markers_7th_part_14th_1[i]['Location'] == \"M/MT/FR016C2\" || markers_7th_part_14th_1[i]['Location'] == \"M/MT/FR016B2\" || markers_7th_part_14th_1[i]['Location'] == \"M/MT/FR016A2\") {\n var loc = markers_7th_part_14th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_14th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_14th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_14th_2 = given_data_seventh_part_14th_2;\n for (var i = 0; i < markers_7th_part_14th_2.length; i++) {\n if (markers_7th_part_14th_2[i]['Location'] == \"M/MT/FR016D1\" || markers_7th_part_14th_2[i]['Location'] == \"M/MT/FR016C1\" || markers_7th_part_14th_2[i]['Location'] == \"M/MT/FR016B1\" || markers_7th_part_14th_2[i]['Location'] == \"M/MT/FR016A1\") {\n var loc = markers_7th_part_14th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_14th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_14th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n\n //----------------------------------15th part of 7th block----------------------------------------------\n var markers_7th_part_15th_1 = given_data_seventh_part_15th_1;\n for (var i = 0; i < markers_7th_part_15th_1.length; i++) {\n if (markers_7th_part_15th_1[i]['Location'] == \"M/MT/FR015D2\" || markers_7th_part_15th_1[i]['Location'] == \"M/MT/FR015C2\" || markers_7th_part_15th_1[i]['Location'] == \"M/MT/FR015B2\" || markers_7th_part_15th_1[i]['Location'] == \"M/MT/FR015A2\") {\n var loc = markers_7th_part_15th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_15th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_15th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_15th_2 = given_data_seventh_part_15th_2;\n for (var i = 0; i < markers_7th_part_15th_2.length; i++) {\n if (markers_7th_part_15th_2[i]['Location'] == \"M/MT/FR015D1\" || markers_7th_part_15th_2[i]['Location'] == \"M/MT/FR015C1\" || markers_7th_part_15th_2[i]['Location'] == \"M/MT/FR015B1\" || markers_7th_part_15th_2[i]['Location'] == \"M/MT/FR015A1\") {\n var loc = markers_7th_part_15th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_15th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_15th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------------------16th part of 7th block----------------------------------------------\n var markers_7th_part_16th_1 = given_data_seventh_part_16th_1;\n for (var i = 0; i < markers_7th_part_16th_1.length; i++) {\n if (markers_7th_part_16th_1[i]['Location'] == \"M/MT/FR014D2\" || markers_7th_part_16th_1[i]['Location'] == \"M/MT/FR014C2\" || markers_7th_part_16th_1[i]['Location'] == \"M/MT/FR014B2\" || markers_7th_part_16th_1[i]['Location'] == \"M/MT/FR014A2\") {\n var loc = markers_7th_part_16th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_16th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_16th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_16th_2 = given_data_seventh_part_16th_2;\n for (var i = 0; i < markers_7th_part_16th_2.length; i++) {\n if (markers_7th_part_16th_2[i]['Location'] == \"M/MT/FR014D1\" || markers_7th_part_16th_2[i]['Location'] == \"M/MT/FR014C1\" || markers_7th_part_16th_2[i]['Location'] == \"M/MT/FR014B1\" || markers_7th_part_16th_2[i]['Location'] == \"M/MT/FR014A1\") {\n var loc = markers_7th_part_16th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_16th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_16th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------------------17th part of 7th block----------------------------------------------\n var markers_7th_part_17th_1 = given_data_seventh_part_17th_1;\n for (var i = 0; i < markers_7th_part_17th_1.length; i++) {\n if (markers_7th_part_17th_1[i]['Location'] == \"M/MT/FR013D2\" || markers_7th_part_17th_1[i]['Location'] == \"M/MT/FR013C2\" || markers_7th_part_17th_1[i]['Location'] == \"M/MT/FR013B2\" || markers_7th_part_17th_1[i]['Location'] == \"M/MT/FR013A2\") {\n var loc = markers_7th_part_17th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_17th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_17th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_17th_2 = given_data_seventh_part_17th_2;\n for (var i = 0; i < markers_7th_part_17th_2.length; i++) {\n if (markers_7th_part_17th_2[i]['Location'] == \"M/MT/FR013D1\" || markers_7th_part_17th_2[i]['Location'] == \"M/MT/FR013C1\" || markers_7th_part_17th_2[i]['Location'] == \"M/MT/FR013B1\" || markers_7th_part_17th_2[i]['Location'] == \"M/MT/FR013A1\") {\n var loc = markers_7th_part_17th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_17th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_17th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n //----------------------------------18th part of 7th block----------------------------------------------\n var markers_7th_part_18th_1 = given_data_seventh_part_18th_1;\n for (var i = 0; i < markers_7th_part_18th_1.length; i++) {\n if (markers_7th_part_18th_1[i]['Location'] == \"M/MT/FR012D2\" || markers_7th_part_18th_1[i]['Location'] == \"M/MT/FR012C2\" || markers_7th_part_18th_1[i]['Location'] == \"M/MT/FR012B2\" || markers_7th_part_18th_1[i]['Location'] == \"M/MT/FR012A2\") {\n var loc = markers_7th_part_18th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_18th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_18th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_18th_2 = given_data_seventh_part_18th_2;\n for (var i = 0; i < markers_7th_part_18th_2.length; i++) {\n if (markers_7th_part_18th_2[i]['Location'] == \"M/MT/FR012D1\" || markers_7th_part_18th_2[i]['Location'] == \"M/MT/FR012C1\" || markers_7th_part_18th_2[i]['Location'] == \"M/MT/FR012B1\" || markers_7th_part_18th_2[i]['Location'] == \"M/MT/FR012A1\") {\n var loc = markers_7th_part_18th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_18th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_18th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------------------19th part of 7th block----------------------------------------------\n var markers_7th_part_19th_1 = given_data_seventh_part_19th_1;\n for (var i = 0; i < markers_7th_part_19th_1.length; i++) {\n if (markers_7th_part_19th_1[i]['Location'] == \"M/MT/FR011D2\" || markers_7th_part_19th_1[i]['Location'] == \"M/MT/FR011C2\" || markers_7th_part_19th_1[i]['Location'] == \"M/MT/FR011B2\" || markers_7th_part_19th_1[i]['Location'] == \"M/MT/FR011A2\") {\n var loc = markers_7th_part_19th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_19th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_19th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_19th_2 = given_data_seventh_part_19th_2;\n for (var i = 0; i < markers_7th_part_19th_2.length; i++) {\n if (markers_7th_part_19th_2[i]['Location'] == \"M/MT/FR011D1\" || markers_7th_part_19th_2[i]['Location'] == \"M/MT/FR011C1\" || markers_7th_part_19th_2[i]['Location'] == \"M/MT/FR011B1\" || markers_7th_part_19th_2[i]['Location'] == \"M/MT/FR011A1\") {\n var loc = markers_7th_part_19th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_19th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_19th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------------------20th part of 7th block----------------------------------------------\n var markers_7th_part_20th_1 = given_data_seventh_part_20th_1;\n for (var i = 0; i < markers_7th_part_20th_1.length; i++) {\n if (markers_7th_part_20th_1[i]['Location'] == \"M/MT/FR010D2\" || markers_7th_part_20th_1[i]['Location'] == \"M/MT/FR010C2\" || markers_7th_part_20th_1[i]['Location'] == \"M/MT/FR010B2\" || markers_7th_part_20th_1[i]['Location'] == \"M/MT/FR010A2\") {\n var loc = markers_7th_part_20th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_20th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_20th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_20th_2 = given_data_seventh_part_20th_2;\n for (var i = 0; i < markers_7th_part_20th_2.length; i++) {\n if (markers_7th_part_20th_2[i]['Location'] == \"M/MT/FR010D1\" || markers_7th_part_20th_2[i]['Location'] == \"M/MT/FR010C1\" || markers_7th_part_20th_2[i]['Location'] == \"M/MT/FR010B1\" || markers_7th_part_20th_2[i]['Location'] == \"M/MT/FR010A1\") {\n var loc = markers_7th_part_20th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_20th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_20th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n\n //----------------------------------21th part of 7th block----------------------------------------------\n var markers_7th_part_21th_1 = given_data_seventh_part_21th_1;\n for (var i = 0; i < markers_7th_part_21th_1.length; i++) {\n if (markers_7th_part_21th_1[i]['Location'] == \"M/MT/FR009D2\" || markers_7th_part_21th_1[i]['Location'] == \"M/MT/FR009C2\" || markers_7th_part_21th_1[i]['Location'] == \"M/MT/FR009B2\" || markers_7th_part_21th_1[i]['Location'] == \"M/MT/FR009A2\") {\n var loc = markers_7th_part_21th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_21th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_21th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_21th_2 = given_data_seventh_part_21th_2;\n for (var i = 0; i < markers_7th_part_21th_2.length; i++) {\n if (markers_7th_part_21th_2[i]['Location'] == \"M/MT/FR009D1\" || markers_7th_part_21th_2[i]['Location'] == \"M/MT/FR009C1\" || markers_7th_part_21th_2[i]['Location'] == \"M/MT/FR009B1\" || markers_7th_part_21th_2[i]['Location'] == \"M/MT/FR009A1\") {\n var loc = markers_7th_part_21th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_21th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_21th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n\n\n //----------------------------------22th part of 7th block----------------------------------------------\n var markers_7th_part_22th_1 = given_data_seventh_part_22th_1;\n for (var i = 0; i < markers_7th_part_22th_1.length; i++) {\n if (markers_7th_part_22th_1[i]['Location'] == \"M/MT/FR008D2\" || markers_7th_part_22th_1[i]['Location'] == \"M/MT/FR008C2\" || markers_7th_part_22th_1[i]['Location'] == \"M/MT/FR008B2\" || markers_7th_part_22th_1[i]['Location'] == \"M/MT/FR008A2\") {\n var loc = markers_7th_part_22th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_22th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_22th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_22th_2 = given_data_seventh_part_22th_2;\n for (var i = 0; i < markers_7th_part_22th_2.length; i++) {\n if (markers_7th_part_22th_2[i]['Location'] == \"M/MT/FR008D1\" || markers_7th_part_22th_2[i]['Location'] == \"M/MT/FR008C1\" || markers_7th_part_22th_2[i]['Location'] == \"M/MT/FR008B1\" || markers_7th_part_22th_2[i]['Location'] == \"M/MT/FR008A1\") {\n var loc = markers_7th_part_22th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_22th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_22th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------------------23th part of 7th block----------------------------------------------\n var markers_7th_part_23th_1 = given_data_seventh_part_23th_1;\n for (var i = 0; i < markers_7th_part_23th_1.length; i++) {\n if (markers_7th_part_23th_1[i]['Location'] == \"M/MT/FR007D2\" || markers_7th_part_23th_1[i]['Location'] == \"M/MT/FR007C2\" || markers_7th_part_23th_1[i]['Location'] == \"M/MT/FR007B2\" || markers_7th_part_23th_1[i]['Location'] == \"M/MT/FR007A2\") {\n var loc = markers_7th_part_23th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_23th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_23th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_23th_2 = given_data_seventh_part_23th_2;\n for (var i = 0; i < markers_7th_part_23th_2.length; i++) {\n if (markers_7th_part_23th_2[i]['Location'] == \"M/MT/FR007D1\" || markers_7th_part_23th_2[i]['Location'] == \"M/MT/FR007C1\" || markers_7th_part_23th_2[i]['Location'] == \"M/MT/FR007B1\" || markers_7th_part_23th_2[i]['Location'] == \"M/MT/FR007A1\") {\n var loc = markers_7th_part_23th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_23th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_23th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n\n //----------------------------------24th part of 7th block----------------------------------------------\n var markers_7th_part_24th_1 = given_data_seventh_part_24th_1;\n for (var i = 0; i < markers_7th_part_24th_1.length; i++) {\n if (markers_7th_part_24th_1[i]['Location'] == \"M/MT/FR006D2\" || markers_7th_part_24th_1[i]['Location'] == \"M/MT/FR006C2\" || markers_7th_part_24th_1[i]['Location'] == \"M/MT/FR006B2\" || markers_7th_part_24th_1[i]['Location'] == \"M/MT/FR006A2\") {\n var loc = markers_7th_part_24th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_24th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_24th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_24th_2 = given_data_seventh_part_24th_2;\n for (var i = 0; i < markers_7th_part_24th_2.length; i++) {\n if (markers_7th_part_24th_2[i]['Location'] == \"M/MT/FR006D1\" || markers_7th_part_24th_2[i]['Location'] == \"M/MT/FR006C1\" || markers_7th_part_24th_2[i]['Location'] == \"M/MT/FR006B1\" || markers_7th_part_24th_2[i]['Location'] == \"M/MT/FR006A1\") {\n var loc = markers_7th_part_24th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_24th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_24th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------------------25th part of 7th block----------------------------------------------\n var markers_7th_part_25th_1 = given_data_seventh_part_25th_1;\n for (var i = 0; i < markers_7th_part_25th_1.length; i++) {\n if (markers_7th_part_25th_1[i]['Location'] == \"M/MT/FR005D2\" || markers_7th_part_25th_1[i]['Location'] == \"M/MT/FR005C2\" || markers_7th_part_25th_1[i]['Location'] == \"M/MT/FR005B2\" || markers_7th_part_25th_1[i]['Location'] == \"M/MT/FR005A2\") {\n var loc = markers_7th_part_25th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_25th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_25th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_25th_2 = given_data_seventh_part_25th_2;\n for (var i = 0; i < markers_7th_part_25th_2.length; i++) {\n if (markers_7th_part_25th_2[i]['Location'] == \"M/MT/FR005D1\" || markers_7th_part_25th_2[i]['Location'] == \"M/MT/FR005C1\" || markers_7th_part_25th_2[i]['Location'] == \"M/MT/FR005B1\" || markers_7th_part_25th_2[i]['Location'] == \"M/MT/FR005A1\") {\n var loc = markers_7th_part_25th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_25th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_25th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n //----------------------------------26th part of 7th block----------------------------------------------\n var markers_7th_part_26th_1 = given_data_seventh_part_26th_1;\n for (var i = 0; i < markers_7th_part_26th_1.length; i++) {\n if (markers_7th_part_26th_1[i]['Location'] == \"M/MT/FR004D2\" || markers_7th_part_26th_1[i]['Location'] == \"M/MT/FR004C2\" || markers_7th_part_26th_1[i]['Location'] == \"M/MT/FR004B2\" || markers_7th_part_26th_1[i]['Location'] == \"M/MT/FR004A2\") {\n var loc = markers_7th_part_26th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_26th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_26th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_26th_2 = given_data_seventh_part_26th_2;\n for (var i = 0; i < markers_7th_part_26th_2.length; i++) {\n if (markers_7th_part_26th_2[i]['Location'] == \"M/MT/FR004D1\" || markers_7th_part_26th_2[i]['Location'] == \"M/MT/FR004C1\" || markers_7th_part_26th_2[i]['Location'] == \"M/MT/FR004B1\" || markers_7th_part_26th_2[i]['Location'] == \"M/MT/FR004A1\") {\n var loc = markers_7th_part_26th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_26th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_26th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n //----------------------------------27th part of 7th block----------------------------------------------\n var markers_7th_part_27th_1 = given_data_seventh_part_27th_1;\n for (var i = 0; i < markers_7th_part_27th_1.length; i++) {\n if (markers_7th_part_27th_1[i]['Location'] == \"M/MT/FR003D2\" || markers_7th_part_27th_1[i]['Location'] == \"M/MT/FR003C2\" || markers_7th_part_27th_1[i]['Location'] == \"M/MT/FR003B2\" || markers_7th_part_27th_1[i]['Location'] == \"M/MT/FR003A2\") {\n var loc = markers_7th_part_27th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_27th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_27th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_27th_2 = given_data_seventh_part_27th_2;\n for (var i = 0; i < markers_7th_part_27th_2.length; i++) {\n if (markers_7th_part_27th_2[i]['Location'] == \"M/MT/FR003D1\" || markers_7th_part_27th_2[i]['Location'] == \"M/MT/FR003C1\" || markers_7th_part_27th_2[i]['Location'] == \"M/MT/FR003B1\" || markers_7th_part_27th_2[i]['Location'] == \"M/MT/FR003A1\") {\n var loc = markers_7th_part_27th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_27th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_27th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n\n //----------------------------------28th part of 7th block----------------------------------------------\n var markers_7th_part_28th_1 = given_data_seventh_part_28th_1;\n for (var i = 0; i < markers_7th_part_28th_1.length; i++) {\n if (markers_7th_part_28th_1[i]['Location'] == \"M/MT/FR002D2\" || markers_7th_part_28th_1[i]['Location'] == \"M/MT/FR002C2\" || markers_7th_part_28th_1[i]['Location'] == \"M/MT/FR002B2\" || markers_7th_part_28th_1[i]['Location'] == \"M/MT/FR002A2\") {\n var loc = markers_7th_part_28th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_28th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_28th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_28th_2 = given_data_seventh_part_28th_2;\n for (var i = 0; i < markers_7th_part_28th_2.length; i++) {\n if (markers_7th_part_28th_2[i]['Location'] == \"M/MT/FR002D1\" || markers_7th_part_28th_2[i]['Location'] == \"M/MT/FR002C1\" || markers_7th_part_28th_2[i]['Location'] == \"M/MT/FR002B1\" || markers_7th_part_28th_2[i]['Location'] == \"M/MT/FR002A1\") {\n var loc = markers_7th_part_28th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_28th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_28th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n\n //----------------------------------29th part of 7th block----------------------------------------------\n var markers_7th_part_29th_1 = given_data_seventh_part_29th_1;\n for (var i = 0; i < markers_7th_part_29th_1.length; i++) {\n if (markers_7th_part_29th_1[i]['Location'] == \"M/MT/FR001D2\" || markers_7th_part_29th_1[i]['Location'] == \"M/MT/FR001C2\" || markers_7th_part_29th_1[i]['Location'] == \"M/MT/FR001B2\" || markers_7th_part_29th_1[i]['Location'] == \"M/MT/FR001A2\") {\n var loc = markers_7th_part_29th_1[i]['Location'].slice(-2);\n\n var LeafIcon = L.Icon.extend({\n options: { iconSize: [13, 6] }\n });\n x_val = markers_7th_part_29th_1[i][\"marker_position\"];\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_29th_1[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n var markers_7th_part_29th_2 = given_data_seventh_part_29th_2;\n for (var i = 0; i < markers_7th_part_29th_2.length; i++) {\n if (markers_7th_part_29th_2[i]['Location'] == \"M/MT/FR001D1\" || markers_7th_part_29th_2[i]['Location'] == \"M/MT/FR001C1\" || markers_7th_part_29th_2[i]['Location'] == \"M/MT/FR001B1\" || markers_7th_part_29th_2[i]['Location'] == \"M/MT/FR001A1\") {\n var loc = markers_7th_part_29th_2[i]['Location'].slice(-2);\n var LeafIcon = L.Icon.extend({ options: { iconSize: [13, 6] } });\n\n x_val = markers_7th_part_29th_2[i][\"marker_position\"];\n\n\n var svg = '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"13\" height=\"6\" style=\"fill:#0853bf\" viewBox=\"0 0 13 6\"><rect width=\"13\" height=\"13\" style=\"\" /><text x=\"3\" y=\"5\" fill=\"white\" font-size=\"5\" font-weight=\"700\">' + loc + '</text></svg>'\n // var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 15 15\" width=\"15\" height=\"15\"><defs><path d=\"M0 0L50 0L50 18L0 18L0 0Z\" id=\"a1au4DcYqa\"></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\">'+loc+'</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#a1au4DcYqa\" opacity=\"1\" fill=\"#0853bf\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"#edJQPl1YZ\" opacity=\"1\" fill=\"#ffffff\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], { type: 'image/svg+xml' });\n const svg_url = URL.createObjectURL(blob);\n var greenIcon1 = new LeafIcon({ iconUrl: svg_url });\n test = markers_7th_part_29th_2[i][\"SV ID\"];\n var new_marker = xy(x_val[0], x_val[1]);\n var given_marker = L.marker(new_marker, { icon: greenIcon1 })\n given_marker.addTo(myFeatureGroup)\n given_marker.test = test;\n }\n }\n\n\n\n\n\n\n\n\n\n // given_loc_data_sixth_part=given_object[\"required_part_location_6th_block\"];\n\n //------------------------------------------extra code-------------------------\n // code for render road\n //image size height 3300 and width 1800\n // intial 3 points are:-1=[80,50],2=[700,50],3=[1450,50]\n /* var LeafIcon = L.Icon.extend({\n options: {\n iconSize: [50, 30],\n }\n });\n \n var svg='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 50 30\" width=\"50\" height=\"30\" id=\"\" fill=\"red\"><defs><path d=\"M0 0L50 0L50 36L0 36L0 0Z\" id=\"d1HwhFdh0a\" ></path><text id=\"edJQPl1YZ\" x=\"3.19\" y=\"1.83\" font-size=\"5\" font-family=\"Open Sans\" font-weight=\"700\" font-style=\"normal\" letter-spacing=\"0\" alignment-baseline=\"before-edge\" transform=\"matrix(1 0 0 1 -1.7462686567164205 -1.335820895522378)\" style=\"line-height:100%\" xml:space=\"preserve\" dominant-baseline=\"text-before-edge\"><tspan x=\"3.19\" dy=\"0em\" alignment-baseline=\"before-edge\" dominant-baseline=\"text-before-edge\" text-anchor=\"start\" id=\"t_span\">road</tspan></text><style id=\"opensans700normal\"></style></defs><g><g><g><g></g><use xlink:href=\"#d1HwhFdh0a\" opacity=\"1\" fill-opacity=\"1\"></use></g><g id=\"bv4yYAEIG\"><use xlink:href=\"red\" opacity=\"1\" fill=\"red\" fill-opacity=\"1\"></use></g></g></g></svg>'\n const blob = new Blob([svg], {type: 'image/svg+xml'});\n const svg_url = URL.createObjectURL(blob);\n var greenIcon2 = new LeafIcon({ iconUrl: svg_url});\n //var greenIcon2 = new LeafIcon({ iconUrl: \"{{ url_for('static', filename='1.svg')}}\"});\n test = \"cover_Id=\";\n \n \n x_val_1=[50,50];\n x_val_1_end=[50,3100];\n x_val_2=[1100,50];\n x_val_2_end=[1100,3100];\n x_val_3=[1950,50];\n x_val_3_end=[1950,3100];\n \n \n \n\n\n var new_marker_1 = xy(x_val_1[0], x_val_1[1]);\n var new_marker_2= xy(x_val_2[0], x_val_2[1]);\n var new_marker_3= xy(x_val_3[0], x_val_3[1]);\n var new_marker_1_end = xy(x_val_1_end[0], x_val_1_end[1]);\n var new_marker_3_end = xy(x_val_3_end[0], x_val_3_end[1]);\n var new_marker_2_end= xy(x_val_2_end[0], x_val_2_end[1]);\n\n\n\n\n var given_marker1 = L.marker(new_marker_1, { icon: greenIcon2 })\n var given_marker2 = L.marker(new_marker_2, { icon: greenIcon2 })\n var given_marker3 = L.marker(new_marker_3, { icon: greenIcon2 })\n var given_marker1_end = L.marker(new_marker_1_end, { icon: greenIcon2 })\n var given_marker3_end = L.marker(new_marker_3_end, { icon: greenIcon2 })\n var given_marker2_end = L.marker(new_marker_2_end, { icon: greenIcon2 })\n\n\n\n\n given_marker1.addTo(myFeatureGroup)\n given_marker2.addTo(myFeatureGroup)\n given_marker3.addTo(myFeatureGroup)\n given_marker1_end.addTo(myFeatureGroup)\n given_marker3_end.addTo(myFeatureGroup)\n given_marker2_end.addTo(myFeatureGroup)*/\n\n\n\n\n //given_marker.test = test;\n\n\n\n\n\n\n\n\n\n\n\n //------------------------------------------onclick function here--------------------------------------\n\n\n}", "function MapaParaLista(mapa) {\n var lista = [];\n for (var chave in mapa) {\n lista.push(chave);\n }\n return lista;\n}", "function level2map(level) {\n map = []\n var newtile;\n var newrow = [];\n for (j=0; j<MAP_HEIGHT; j++) {\n for (i=0; i<MAP_WIDTH; i++) {\n var type = level['types'][j][i];\n var dir = level['dirs'][j][i];\n newtile = {x: i, y: j,\n type: type,\n dir: dir,\n move: TILES[type]['move'],\n rot: TILES[type]['rot'],\n slide:TILES[type]['slide'],\n barriers: TILES[type]['barriers'],\n newx: i, newy: j, tweenx: 0, tweeny: 0,\n angle: (dir * 90) % 360, newangle: (dir * 90) % 360, tweenrot: 0};\n // add the tile to the row of tiles\n newrow.push(newtile);\n }\n // add the row the the map, then start a new row\n map.push(newrow);\n newrow = [];\n }\n map['startx'] = level['startx'];\n map['starty'] = level['starty'];\n map['endx'] = level['endx'];\n map['endy'] = level['endy'];\n set_player_loc(map['startx'], map['starty']);\n}", "function nodeChildrenAsMap(node){var map$$1={};if(node){node.children.forEach(function(child){return map$$1[child.value.outlet]=child;});}return map$$1;}", "function reshapeMapData(data) {\n var a = Array.from(data), out = [];\n for(let i=0; i<a.length; i+=dcmFeatureLength) {\n out.push(a.slice(i, i + dcmFeatureLength));\n }\n return out;\n}", "function ConvertMaptoArray(hashmap){\n var newArray=[];\n hashmap.forEach(function(item){\n newArray.push(item);\n });\n return newArray;\n}", "flattenByID(addonMap, hideLocation) {\n let map = new Map();\n\n for (let installLocation of XPIProvider.installLocations) {\n if (installLocation.name == hideLocation)\n continue;\n\n let locationMap = addonMap.get(installLocation.name);\n if (!locationMap)\n continue;\n\n for (let [id, addon] of locationMap) {\n if (!map.has(id))\n map.set(id, addon);\n }\n }\n\n return map;\n }", "_updateMap() {\n const options = get(this, '_options');\n get(this, 'map').setOptions(options);\n }", "function nest() {\n\n\t var keysFunction = [];\n\t var sortKeysFunction = [];\n\n\t /**\n\t * map an Array into the mapObject.\n\t * @param {Array} array\n\t * @param {number} depth\n\t */\n\t function map(array, depth) {\n\t if (depth >= keysFunction.length) {\n\t return array;\n\t }\n\t var i = -1;\n\t var n = array.length;\n\t var keyFunction = keysFunction[depth++];\n\t var mapObject = {};\n\t var valuesByKey = {};\n\n\t while (++i < n) {\n\t var keyValue = keyFunction(array[i]);\n\t var values = valuesByKey[keyValue];\n\n\t if (values) {\n\t values.push(array[i]);\n\t } else {\n\t valuesByKey[keyValue] = [array[i]];\n\t }\n\t }\n\n\t zrUtil.each(valuesByKey, function (value, key) {\n\t mapObject[key] = map(value, depth);\n\t });\n\n\t return mapObject;\n\t }\n\n\t /**\n\t * transform the Map Object to multidimensional Array\n\t * @param {Object} map\n\t * @param {number} depth\n\t */\n\t function entriesMap(mapObject, depth) {\n\t if (depth >= keysFunction.length) {\n\t return mapObject;\n\t }\n\t var array = [];\n\t var sortKeyFunction = sortKeysFunction[depth++];\n\n\t zrUtil.each(mapObject, function (value, key) {\n\t array.push({\n\t key: key, values: entriesMap(value, depth)\n\t });\n\t });\n\n\t if (sortKeyFunction) {\n\t return array.sort(function (a, b) {\n\t return sortKeyFunction(a.key, b.key);\n\t });\n\t } else {\n\t return array;\n\t }\n\t }\n\n\t return {\n\t /**\n\t * specified the key to groupby the arrays.\n\t * users can specified one more keys.\n\t * @param {Function} d\n\t */\n\t key: function key(d) {\n\t keysFunction.push(d);\n\t return this;\n\t },\n\n\t /**\n\t * specified the comparator to sort the keys\n\t * @param {Function} order\n\t */\n\t sortKeys: function sortKeys(order) {\n\t sortKeysFunction[keysFunction.length - 1] = order;\n\t return this;\n\t },\n\n\t /**\n\t * the array to be grouped by.\n\t * @param {Array} array\n\t */\n\t entries: function entries(array) {\n\t return entriesMap(map(array, 0), 0);\n\t }\n\t };\n\t}", "function mapSubFlagData(subFlags) {\r\n\tif (!subFlags) return '';\r\n\tvar subData = new Array();\r\n\tif (subFlags & 1) subData.push(\"karaoke subbed\");\r\n\tif (subFlags & 2) subData.push(\"signs translated\");\r\n\tif (subFlags & 4) subData.push(\"additional explanations\");\r\n\tif (subFlags & 8) subData.push(\"dubsubbed\");\r\n\tif (subFlags & 16) subData.push(\"hearing impaired subs\");\r\n\tif (subFlags & 32) subData.push(\"subs for commentary audio stream\");\r\n\tif (subFlags & 64) subData.push(\"styled subs (ASS/SSA)\");\r\n\tif (subFlags & 128) subData.push(\"image subs (VOBSUB)\");\r\n\tif (subFlags & 256) subData.push(\"unstyled subs (SRT)\");\r\n\treturn subData.join(', ');\r\n}", "function createTileMapArray()\n{\n delete fullMapArray;\n\n fullMapArray = [];\n for (var y = 0; y < MAP_TILE_HEIGHT; y++)\n {\n var rowArray = [];\n for (var x = 0; x < MAP_TILE_WIDTH; x++)\n {\n var tile = map.getTile(x, y, layer_map);\n \n if(tile != null)\n {\n var index = tile.index;\n rowArray.push(index);\n }\n }\n fullMapArray.push(rowArray);\n delete rowArray;\n }\n}", "static toList(groupEstimateMap) {\n function* g1() {\n for (let ge of groupEstimateMap.values()) {\n yield ge.toObject()\n }\n }\n console.log([...g1()])\n let unsorted = [...g1()];\n let sorted = unsorted.sort(function (a, z) {\n console.log(a.added.getTime());\n return z.added.getTime() - a.added.getTime()\n });\n console.log(\"Sorted\");\n console.dir(sorted);\n return sorted;\n }", "function scaleMap() {\r\n var xs=[];\r\n var ys=[];\r\n for(i = 0; i<x.length; i++){\r\n xs[i] = x[i];\r\n ys[i] = y[i];\r\n }\r\n\r\n var minX = getMin(xs);\r\n var minY = getMin(ys);\r\n\r\n var scale = mapScale;\r\n\r\n //assigns map values\r\n for (i = 0; i < xs.length; i++) {\r\n //turn everything positive\r\n if(minX < 0){\r\n xs[i]+=Math.abs(minX);\r\n }\r\n if(minY < 0){\r\n ys[i]+=Math.abs(minY);\r\n }\r\n xs[i] *= scale;\r\n ys[i] *= scale;\r\n map[i][0] = xs[i];\r\n map[i][1] = 800 - ys[i];\r\n }\r\n\r\n //shifts the graph up/down\r\n minX = getMin(xs);\r\n var maxX = getMax(xs);\r\n\r\n minY = getMin(ys);\r\n var maxY = getMax(ys);\r\n\r\n xShift = (800 - (maxX - minX) )/2;\r\n yShift = (800 - (maxY - minY) )/2;\r\n\r\n for(i = 0; i<x.length; i++){\r\n map[i][0] += xShift;\r\n map[i][1] -= yShift;\r\n }\r\n}", "function get_input_map(nodes) {\n\n var in_map = new Map();\n for (var node_id of nodes.keys()) {\n for (var value_id of nodes.get(node_id).children.keys()) {\n if (value_id in in_map) {\n in_map[value_id].push(node_id);\n } else {\n in_map[value_id] = [];\n in_map[value_id].push(node_id);\n }\n }\n }\n //sort node ids (left edges have lower order in argument list than right edges)\n for (var key in in_map)\n in_map[key].sort(function (a, b) {\n return b - a\n });\n console.log(\"in map: \", in_map);\n return in_map;\n}", "function Map2(data) {\n this.map = new Map;\n this.size = 0;\n if (data) {\n for (var i = 0; i < data.length; i++) {\n var d = data[i];\n this.set(d[0], d[1], d[2]);\n }\n }\n}", "function generateProductsMap(products){\n //TODO\n}", "function mapToArray(map) {\n var map_split = map.split(/\\r\\n|\\r|\\n/)\n\n var width = map_split[0].length\n var height = map_split.length\n\n var array = new Array(height);\n for (let i = 0; i < height; i++) {\n array[i] = new Array(width);\n }\n\n for (let i = 0; i < height; i++) {\n for (let j = 0; j < width; j++) {\n if (map_split[i][j] === 'T') {\n var pos = {\n \"i\": i,\n \"j\": j\n };\n array[i][j] = ' ';\n } else {\n array[i][j] = map_split[i][j];\n }\n }\n }\n\n return {\n \"width\": width,\n \"height\": height,\n \"map\": array,\n \"pos\": pos\n }\n}", "_segregateLocations() {\n this.locations.map = {};\n this.locations.grouped = [\n [], // Campuses\n [], // Buildings\n [], // Rooms\n ]\n\n for (const id in this.locations.all) {\n // To chuck it to its parent\n let parent = this.locations.all[id].parent_id;\n if (this.locations.all[id].parent_id === null || this.locations.all[id].parent_id === 0) {\n parent = 0;\n }\n\n // Create a new parent or add it to an existing parent\n if (!this.locations.map.hasOwnProperty(parent)) {\n this.locations.map[parent] = [];\n }\n \n this.locations.map[parent].push(id);\n\n // To segregate by type\n this.locations.grouped[this.locations.all[id].type].push(this.locations.all[id])\n }\n }", "function nest() {\n var keysFunction = [];\n var sortKeysFunction = [];\n /**\n * map an Array into the mapObject.\n * @param {Array} array\n * @param {number} depth\n */\n\n function map(array, depth) {\n if (depth >= keysFunction.length) {\n return array;\n }\n\n var i = -1;\n var n = array.length;\n var keyFunction = keysFunction[depth++];\n var mapObject = {};\n var valuesByKey = {};\n\n while (++i < n) {\n var keyValue = keyFunction(array[i]);\n var values = valuesByKey[keyValue];\n\n if (values) {\n values.push(array[i]);\n } else {\n valuesByKey[keyValue] = [array[i]];\n }\n }\n\n zrUtil.each(valuesByKey, function (value, key) {\n mapObject[key] = map(value, depth);\n });\n return mapObject;\n }\n /**\n * transform the Map Object to multidimensional Array\n * @param {Object} map\n * @param {number} depth\n */\n\n\n function entriesMap(mapObject, depth) {\n if (depth >= keysFunction.length) {\n return mapObject;\n }\n\n var array = [];\n var sortKeyFunction = sortKeysFunction[depth++];\n zrUtil.each(mapObject, function (value, key) {\n array.push({\n key: key,\n values: entriesMap(value, depth)\n });\n });\n\n if (sortKeyFunction) {\n return array.sort(function (a, b) {\n return sortKeyFunction(a.key, b.key);\n });\n } else {\n return array;\n }\n }\n\n return {\n /**\n * specified the key to groupby the arrays.\n * users can specified one more keys.\n * @param {Function} d\n */\n key: function (d) {\n keysFunction.push(d);\n return this;\n },\n\n /**\n * specified the comparator to sort the keys\n * @param {Function} order\n */\n sortKeys: function (order) {\n sortKeysFunction[keysFunction.length - 1] = order;\n return this;\n },\n\n /**\n * the array to be grouped by.\n * @param {Array} array\n */\n entries: function (array) {\n return entriesMap(map(array, 0), 0);\n }\n };\n}", "function nest() {\n var keysFunction = [];\n var sortKeysFunction = [];\n /**\n * map an Array into the mapObject.\n * @param {Array} array\n * @param {number} depth\n */\n\n function map(array, depth) {\n if (depth >= keysFunction.length) {\n return array;\n }\n\n var i = -1;\n var n = array.length;\n var keyFunction = keysFunction[depth++];\n var mapObject = {};\n var valuesByKey = {};\n\n while (++i < n) {\n var keyValue = keyFunction(array[i]);\n var values = valuesByKey[keyValue];\n\n if (values) {\n values.push(array[i]);\n } else {\n valuesByKey[keyValue] = [array[i]];\n }\n }\n\n zrUtil.each(valuesByKey, function (value, key) {\n mapObject[key] = map(value, depth);\n });\n return mapObject;\n }\n /**\n * transform the Map Object to multidimensional Array\n * @param {Object} map\n * @param {number} depth\n */\n\n\n function entriesMap(mapObject, depth) {\n if (depth >= keysFunction.length) {\n return mapObject;\n }\n\n var array = [];\n var sortKeyFunction = sortKeysFunction[depth++];\n zrUtil.each(mapObject, function (value, key) {\n array.push({\n key: key,\n values: entriesMap(value, depth)\n });\n });\n\n if (sortKeyFunction) {\n return array.sort(function (a, b) {\n return sortKeyFunction(a.key, b.key);\n });\n } else {\n return array;\n }\n }\n\n return {\n /**\n * specified the key to groupby the arrays.\n * users can specified one more keys.\n * @param {Function} d\n */\n key: function (d) {\n keysFunction.push(d);\n return this;\n },\n\n /**\n * specified the comparator to sort the keys\n * @param {Function} order\n */\n sortKeys: function (order) {\n sortKeysFunction[keysFunction.length - 1] = order;\n return this;\n },\n\n /**\n * the array to be grouped by.\n * @param {Array} array\n */\n entries: function (array) {\n return entriesMap(map(array, 0), 0);\n }\n };\n}", "function nest() {\n var keysFunction = [];\n var sortKeysFunction = [];\n /**\n * map an Array into the mapObject.\n * @param {Array} array\n * @param {number} depth\n */\n\n function map(array, depth) {\n if (depth >= keysFunction.length) {\n return array;\n }\n\n var i = -1;\n var n = array.length;\n var keyFunction = keysFunction[depth++];\n var mapObject = {};\n var valuesByKey = {};\n\n while (++i < n) {\n var keyValue = keyFunction(array[i]);\n var values = valuesByKey[keyValue];\n\n if (values) {\n values.push(array[i]);\n } else {\n valuesByKey[keyValue] = [array[i]];\n }\n }\n\n zrUtil.each(valuesByKey, function (value, key) {\n mapObject[key] = map(value, depth);\n });\n return mapObject;\n }\n /**\n * transform the Map Object to multidimensional Array\n * @param {Object} map\n * @param {number} depth\n */\n\n\n function entriesMap(mapObject, depth) {\n if (depth >= keysFunction.length) {\n return mapObject;\n }\n\n var array = [];\n var sortKeyFunction = sortKeysFunction[depth++];\n zrUtil.each(mapObject, function (value, key) {\n array.push({\n key: key,\n values: entriesMap(value, depth)\n });\n });\n\n if (sortKeyFunction) {\n return array.sort(function (a, b) {\n return sortKeyFunction(a.key, b.key);\n });\n } else {\n return array;\n }\n }\n\n return {\n /**\n * specified the key to groupby the arrays.\n * users can specified one more keys.\n * @param {Function} d\n */\n key: function (d) {\n keysFunction.push(d);\n return this;\n },\n\n /**\n * specified the comparator to sort the keys\n * @param {Function} order\n */\n sortKeys: function (order) {\n sortKeysFunction[keysFunction.length - 1] = order;\n return this;\n },\n\n /**\n * the array to be grouped by.\n * @param {Array} array\n */\n entries: function (array) {\n return entriesMap(map(array, 0), 0);\n }\n };\n}", "function processSubProperties(boundFieldName) {\n var array = [],\n subPropertyName,\n parts = boundFieldName.split(\"/\"),\n dataItemKey = parts[1];\n\n $.each(cache[boundFieldName], function (index, $elements) {\n $.each($elements.data(\"repeater\"), function (dataItemId, arrayOfInputDefs) {\n var obj = {};\n\n $.each(arrayOfInputDefs, function () {\n var inputDef = this;\n var $elementDataBind = inputDef[\"el\"];\n subPropertyName = inputDef[\"prop\"];\n\n if (subPropertyName == dataItemKey) {\n // First checks if is selected before adding it.\n if (!($elementDataBind.is(\":checked\") || $elementDataBind.is(\":selected\"))) {\n // Don't save anything.\n obj = null;\n return false;\n }\n }\n\n if ($elementDataBind.is(\"input:radio\") || $elementDataBind.is(\"input:checkbox\")) {\n if ($elementDataBind.is(\":checked\"))\n createInnerObject(subPropertyName, $elementDataBind.val(), obj);\n }\n else\n createInnerObject(subPropertyName, $elementDataBind.val(), obj);\n });\n\n // Finally, add the key property\n if (obj) {\n createInnerObject(dataItemKey, dataItemId, obj);\n array.push(obj);\n }\n });\n });\n return array;\n }", "swapBasemap(toAdd) {\n this.currentSources = []\n this.currentLayers = []\n\n // First record which layers are currently on the map\n Object.keys(mapStyle.sources).forEach(source => {\n let isPresent = this.map.getSource(source)\n if (isPresent) {\n this.currentSources.push({\n id: source,\n config: mapStyle.sources[source],\n data: isPresent._data || null\n })\n }\n })\n\n mapStyle.layers.forEach(layer => {\n let isPresent = this.map.getLayer(layer.id)\n if (isPresent) {\n this.currentLayers.push({\n layer: layer,\n filters: this.map.getFilter(layer.id)\n })\n }\n })\n\n // Set the style. `style.load` will be fired after to readd other layers\n this.map.setStyle(toAdd)\n }", "function getsubpaths(data) {\n var i, out = [];\n\n duh = collapse(d3.nest().key(function(d) {\n return d.cell_id;\n }).key(function(d) {\n return d.sub_id;\n }).entries(data.cones));\n\n duh.forEach(function(d) {\n out.push(groupPath(d));\n })\n data.subPaths = out;\n\n return data\n}", "function step2(map) {\n\tconst root = { name: '/', nodes: [] };\n\treturn (function next(map, parent, level) {\n\t\tObject.keys(map).forEach(key => {\n\t\t\tlet val = map[key];\n\t\t\tlet node = { name: key };\n\t\t\tif (typeof val === 'object') {\n\t\t\t\tnode.nodes = [];\n\t\t\t\tnode.open = level < 1;\n\t\t\t\tnext(val, node, level + 1);\n\t\t\t} else {\n\t\t\t\tnode.src = val;\n\t\t\t}\n\t\t\tparent.nodes.push(node);\n\t\t});\n\t\treturn parent;\n\t})(map, root, 0);\n}", "function multiMapAdd(map, key, value) {\n const values = map.get(key);\n if (option_1.exists(values)) {\n values.push(value);\n return values;\n }\n else {\n const newValues = [value];\n map.set(key, newValues);\n return newValues;\n }\n}", "flatten(){\n\n let scope = this;\n\n const result = new Map();\n const appliedValves = new Map();\n\n for(const [key, value] of scope._dataList){\n result.set(key, value);\n }\n\n while(scope = scope._parent){\n\n const dataList = scope._dataList;\n const valves = scope._valves;\n const mirrors = scope._mirrors;\n\n if(!dataList.size)\n continue;\n\n // further restrict valves with each new scope\n\n if(valves.size){\n if(appliedValves.size) {\n for (const key of appliedValves.keys()) {\n if(!valves.has(key))\n appliedValves.delete(key);\n }\n } else {\n for (const [key, value] of valves.entries()) {\n appliedValves.set(key, value);\n }\n }\n }\n\n const possibles = appliedValves.size ? appliedValves : dataList;\n\n for(const key of possibles.keys()) {\n if (!result.has(key)) {\n\n const data = mirrors.get(key) || dataList.get(key);\n if (data)\n result.set(key, data);\n }\n }\n\n }\n\n return result;\n\n }", "function convertMapData(map) {\n\tmap.nodes = map.nodes ? Object.values(map.nodes) : [];\n\tmap.layers = map.layers ? Object.values(map.layers) : [];\n\n\tmap.layers.sort(sortByProperty(\"sort\"));\n\n\treturn map;\n}", "function copyMapAddGoal(departure){\n\tlet specialMap = new Map();\n\t//then re-point the nodes.\n\tfor(let city of cityMap){\n\n\t\tlet name = city[0];\n\t\t//if we don't call new, we'll mutate the master copy of cityMap!\n\t\tlet neighbors = new Map(city[1]);\n\n\t\tspecialMap.set(name, neighbors);\n\n\t\tfor(let n of neighbors){\n\t\t\tlet nbrName = n[0];\n\t\t\tlet nbrDist = n[1];\n\t\t\tif(nbrName == departure){\n\t\t\t\tneighbors.delete(nbrName);\n\t\t\t\tneighbors.set('$', nbrDist);\n\t\t\t}\n\t\t}\n\t}\n\n\tspecialMap.set('$', new Map());\n\treturn specialMap;\n}", "function mapChildren(box) {\n if (!map[box.level]) {\n map[box.level] = new Set()\n }\n map[box.level].add(box.id);\n if (box.children.length > 0) {\n box.children.forEach(item => mapChildren(file.data.find(samp => samp.id === item)))\n }\n }", "map(changes) {\n if (changes.empty || this.isEmpty)\n return this;\n let chunks = [], chunkPos = [], maxPoint = -1;\n for (let i = 0; i < this.chunk.length; i++) {\n let start = this.chunkPos[i], chunk = this.chunk[i];\n let touch = changes.touchesRange(start, start + chunk.length);\n if (touch === false) {\n maxPoint = Math.max(maxPoint, chunk.maxPoint);\n chunks.push(chunk);\n chunkPos.push(changes.mapPos(start));\n }\n else if (touch === true) {\n let { mapped, pos } = chunk.map(start, changes);\n if (mapped) {\n maxPoint = Math.max(maxPoint, mapped.maxPoint);\n chunks.push(mapped);\n chunkPos.push(pos);\n }\n }\n }\n let next = this.nextLayer.map(changes);\n return chunks.length == 0 ? next : new RangeSet(chunkPos, chunks, next || RangeSet.empty, maxPoint);\n }", "appendMapping(mapping) {\n for (let i = 0, startSize = this.maps.length; i < mapping.maps.length; i++) {\n let mirr = mapping.getMirror(i);\n this.appendMap(mapping.maps[i], mirr != null && mirr < i ? startSize + mirr : void 0);\n }\n }", "function unionWithRewrite(map1, map2) {\n var unionMap = clone(map1);\n var map2Keys = Object.keys(map2);\n for (var i in map2Keys) {\n var map2Key = map2Keys[i];\n unionMap[map2Key] = map2[map2Key]; // re-write map1 param value with param value from map2\n }\n\n return unionMap;\n }", "function batchMap(change) {\n var op = {\n type: change.action === \"delete\" ? \"del\" : \"put\",\n key: change.id,\n value: {}\n };\n if (change.action !== \"create\" && change.version) {\n op.links = change.version.split(/\\s*,\\s*/).filter(Boolean);\n }\n Object.keys(change).forEach(function(prop) {\n if (SKIP_PROPS.indexOf(prop) > -1) return;\n op.value[prop === \"nodes\" ? \"refs\" : prop] = change[prop];\n });\n op.value.timestamp = op.value.timestamp || new Date().toISOString();\n\n var key = idToP2pId[change.id];\n (change.nodes || []).forEach(function(id, idx) {\n op.value.refs[idx] = idToP2pId[id];\n // console.log('fixed ref mapping', id, 'to', op.value.refs[idx])\n });\n (change.members || []).forEach(function(ref, idx) {\n ref.ref = idToP2pId[ref.ref];\n op.value.members[idx] = ref;\n // console.log('fixed member mapping', ref.ref, 'to', op.value.members[idx])\n });\n\n // filter out nulls\n if (op.value.refs)\n op.value.refs = op.value.refs.filter(function(id) {\n return !!id;\n });\n if (op.value.members)\n op.value.members = op.value.members.filter(function(ref) {\n return !!ref.ref;\n });\n\n return {\n k: key,\n v: op.value\n };\n }", "newMap(){\n\t\tthis.idIterator = 1;\n\n\t\tthis.currentFeature = new Feature(this.assignId());\n\n\t\tthis.geo = {};\n\t\tthis.geo.type = \"FeatureCollection\";\n\t\tthis.geo.features = [];\n\t}", "initCellMaps() {\n this.cellGroupIndexMap = {\n \"cell_0_0\":[0,3,6],\n \"cell_1_0\":[0,4],\n \"cell_2_0\":[0,5,7],\n \"cell_0_1\":[1,3],\n \"cell_1_1\":[1,4,6,7],\n \"cell_2_1\":[1,5],\n \"cell_0_2\":[2,3,7],\n \"cell_1_2\":[2,4],\n \"cell_2_2\":[2,5,6]\n };\n \n this.cellMap = [\n {\"id\":\"cell_0_0\", \"cellX\":0, \"cellY\":0},\n {\"id\":\"cell_1_0\", \"cellX\":1, \"cellY\":0},\n {\"id\":\"cell_2_0\", \"cellX\":2, \"cellY\":0},\n {\"id\":\"cell_0_1\", \"cellX\":0, \"cellY\":1},\n {\"id\":\"cell_1_1\", \"cellX\":1, \"cellY\":1},\n {\"id\":\"cell_2_1\", \"cellX\":2, \"cellY\":1},\n {\"id\":\"cell_0_2\", \"cellX\":0, \"cellY\":2},\n {\"id\":\"cell_1_2\", \"cellX\":1, \"cellY\":2},\n {\"id\":\"cell_2_2\", \"cellX\":2, \"cellY\":2}\n ];\n }", "function toArray(children){var result=[];mapIntoWithKeyPrefixInternal(children,result,null,emptyFunction.thatReturnsArgument);return result;}", "function toArray(children){var result=[];mapIntoWithKeyPrefixInternal(children,result,null,emptyFunction.thatReturnsArgument);return result;}", "function toArray(children){var result=[];mapIntoWithKeyPrefixInternal(children,result,null,emptyFunction.thatReturnsArgument);return result;}", "function map(obj) {\n\n\n obj.forEach(function(el) {\n for (key in el) {\n var k = mapObj[key]\n if (k) {\n\n el[k] = el[key];\n\n }\n }\n\n })\n\n }", "function sub(a, b) {\n var m = {};\n var d = [];\n a.forEach(function(al){m[al]=al;});\n b.forEach(function(bl){delete m[bl];});\n for (var key in m) {\n d.push(key);\n }\n return d;\n}", "function nest(){var keysFunction=[];var sortKeysFunction=[]; /**\n \t * map an Array into the mapObject.\n \t * @param {Array} array\n \t * @param {number} depth\n \t */function map(array,depth){if(depth >= keysFunction.length){return array;}var i=-1;var n=array.length;var keyFunction=keysFunction[depth++];var mapObject={};var valuesByKey={};while(++i < n) {var keyValue=keyFunction(array[i]);var values=valuesByKey[keyValue];if(values){values.push(array[i]);}else {valuesByKey[keyValue] = [array[i]];}}zrUtil.each(valuesByKey,function(value,key){mapObject[key] = map(value,depth);});return mapObject;} /**\n \t * transform the Map Object to multidimensional Array\n \t * @param {Object} map\n \t * @param {number} depth\n \t */function entriesMap(mapObject,depth){if(depth >= keysFunction.length){return mapObject;}var array=[];var sortKeyFunction=sortKeysFunction[depth++];zrUtil.each(mapObject,function(value,key){array.push({key:key,values:entriesMap(value,depth)});});if(sortKeyFunction){return array.sort(function(a,b){return sortKeyFunction(a.key,b.key);});}else {return array;}}return { /**\n \t * specified the key to groupby the arrays.\n \t * users can specified one more keys.\n \t * @param {Function} d\n \t */key:function key(d){keysFunction.push(d);return this;}, /**\n \t * specified the comparator to sort the keys\n \t * @param {Function} order\n \t */sortKeys:function sortKeys(order){sortKeysFunction[keysFunction.length - 1] = order;return this;}, /**\n \t * the array to be grouped by.\n \t * @param {Array} array\n \t */entries:function entries(array){return entriesMap(map(array,0),0);}};}", "function refresh_map() {\n var ly_id = 1\n var ly_parts = [\n \"1235\", \"2475\", \"2455\", \"1110\", \"1240\", \"2460\", \"2470\", \"1120\",\n \"1101\", \"2465\", \"1125\", \"1350\", \"1230\", \"1105\", \"1115\", \"1345\"\n ]\n var ly_values = [141, 140, 155, 147, 132, 146, 151, 137, 146,\n 136, 145, 141, 149, 151, 138, 164]\n var ly_type = 1 // Palestine\n var ly_label = ''\n var ly_color = 'rgb(255,0,0)'\n map.add_layer(1,ly_id,ly_label,ly_color,ly_type,ly_parts,ly_values)\n\n var ly_id = 1345\n var ly_parts = [\n 13452415\n ]\n var ly_values = [1041]\n var ly_type = 2 // localities\n var ly_label = 'Econmics'\n var ly_color = 'rgb(0,0,255)'\n map.add_layer(2,ly_id,ly_label,ly_color,ly_type,ly_parts,ly_values)\n}", "function linksForFilteredMovies() {\n let newMap = new Map();\n // for each person\n mapCrewMovie.forEach(function (value, key, map) {\n let newSet = new Set();\n // for each movie linked to one person\n value.forEach(function (d) {\n // if the movie is in the list of filtered movie, keep the movie\n if (mapMovie_filtered.get(d.id_movie)) newSet.add(d);\n })\n // if there is movies for this person, add it to it\n if (newSet.size > 0) newMap.set(key, newSet)\n });\n // return the list of person only with filtered movies\n return newMap;\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 initMap() {\n var centre = {lat: lat, lng: long};\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 11,\n center: centre\n });\n // iterate over response again to populate map with suburbs\n _.each(response, function(suburb) {\n var lat = Number(suburb.lat)\n var lng = Number(suburb.long)\n var test = suburb.suburb_coords\n var test_parsed = JSON.parse(test)\n\n var polygCoords = function(suburbCoordSet){\n suburbHash = [];\n for(i=0;i<suburbCoordSet.length;i++){\n hashTemp = {}\n var lat = suburbCoordSet[i][1];\n var lng = suburbCoordSet[i][0];\n hashTemp['lat'] = lat;\n hashTemp['lng'] = lng;\n suburbHash.push(hashTemp)\n }\n return suburbHash\n }\n\n var newCoords = polygCoords(test_parsed)\n\n var newArea = new google.maps.Polygon({\n paths: newCoords,\n strokeColor: '#FF0000',\n strokeOpacity: 0.8,\n strokeWeight: 2,\n fillColor: '#FF0000',\n fillOpacity: 0.35\n });\n\n\n newArea.setMap(map)\n\n // google.maps.event.addListener(newArea, 'click', function (event) {\n // alert(this.indexID);\n // });\n\n\n var marker = new google.maps.Marker({\n position: { lat: lat, lng: lng },\n map: map,\n title: suburb.suburbName\n });\n\n marker.setVisible(false)\n // instantiate marker on map\n var infoWindow = new google.maps.InfoWindow(\n {content: suburb.suburbName + '<br>' + 'Median house price: ' + suburb.housePrice + '<br>' + 'Median unit price: ' + suburb.unitPrice}\n );\n newArea.addListener('click', function() {\n infoWindow.open(map, marker);\n\n\n\n });\n\n\n\n });\n//copy of response\n\n\n }", "function nest() {\n\n var keysFunction = [];\n var sortKeysFunction = [];\n\n /**\n * map an Array into the mapObject.\n * @param {Array} array\n * @param {number} depth\n */\n function map(array, depth) {\n if (depth >= keysFunction.length) {\n return array;\n }\n var i = -1;\n var n = array.length;\n var keyFunction = keysFunction[depth++];\n var mapObject = {};\n var valuesByKey = {};\n\n while (++i < n) {\n var keyValue = keyFunction(array[i]);\n var values = valuesByKey[keyValue];\n\n if (values) {\n values.push(array[i]);\n }\n else {\n valuesByKey[keyValue] = [array[i]];\n }\n }\n\n zrUtil.each(valuesByKey, function (value, key) {\n mapObject[key] = map(value, depth);\n });\n\n return mapObject;\n }\n\n /**\n * transform the Map Object to multidimensional Array\n * @param {Object} map\n * @param {number} depth\n */\n function entriesMap(mapObject, depth) {\n if (depth >= keysFunction.length) {\n return mapObject;\n }\n var array = [];\n var sortKeyFunction = sortKeysFunction[depth++];\n\n zrUtil.each(mapObject, function (value, key) {\n array.push({\n key: key, values: entriesMap(value, depth)\n });\n });\n\n if (sortKeyFunction) {\n return array.sort(function (a, b) {\n return sortKeyFunction(a.key, b.key);\n });\n }\n else {\n return array;\n }\n }\n\n return {\n /**\n * specified the key to groupby the arrays.\n * users can specified one more keys.\n * @param {Function} d\n */\n key: function (d) {\n keysFunction.push(d);\n return this;\n },\n\n /**\n * specified the comparator to sort the keys\n * @param {Function} order\n */\n sortKeys: function (order) {\n sortKeysFunction[keysFunction.length - 1] = order;\n return this;\n },\n\n /**\n * the array to be grouped by.\n * @param {Array} array\n */\n entries: function (array) {\n return entriesMap(map(array, 0), 0);\n }\n };\n }", "function populateSectionMap() {\n sections.forEach(section => sectionMap.set(section.id, section))\n}", "appendMappingInverted(mapping) {\n for (let i = mapping.maps.length - 1, totalSize = this.maps.length + mapping.maps.length; i >= 0; i--) {\n let mirr = mapping.getMirror(i);\n this.appendMap(mapping.maps[i].invert(), mirr != null && mirr > i ? totalSize - mirr - 1 : void 0);\n }\n }", "function setMapOnAll(map) {\n\tfor (var i = 0; i < recList.length; i++) {\n\t\trecMarkerList[i].setMap(map);\n\t}\n}", "function setAllMap(map)\n{\n for (var i = 0; i < markers.length; i++)\n {\n markers[i].setMap(map);\n }\n poly.setMap(map);\n}", "function mapToArray(map) {\n const result = [];\n // converting map to result array\n map.forEach(value => result.push(value));\n return result;\n}", "function createMap( entries ){\n\tvar map = new Map();\n\n\tfor (var i = 0;i < entries.length;i++)\n\t\tmap.set(entries[i][0], entries[i][1]);\n\n\treturn map;\n}", "function demo009(){\n var obj = { a: { b: { c: 10 } } } ;\n const originMap = Immutable.fromJS(obj) ;\n var newData = originMap.updateIn(['a','b','c'],val=>val*2) ;\n // { a: { b: { c: 20 } } }\n}", "function updateIndexMap(pipelineBrowser, parentId, childrenList) {\n var indexObject = pipelineBrowser.data('proxyIndexMaps'), proxy, idx;\n if(indexObject === null || indexObject === undefined) {\n indexObject = {\n 'ProxyIdToProxy': {},\n 'ProxyIdToParentId': {}\n };\n pipelineBrowser.data('proxyIndexMaps', indexObject);\n }\n\n // Create fake root node that has the children\n if(parentId === 0) {\n indexObject.ProxyIdToProxy['0'] = {\n 'children': childrenList\n };\n }\n\n // Fill maps\n for(idx in childrenList) {\n proxy = childrenList[idx];\n indexObject.ProxyIdToProxy[proxy.proxy_id.toString()] = proxy;\n indexObject.ProxyIdToParentId[proxy.proxy_id.toString()] = parentId;\n if(proxy.hasOwnProperty(\"children\")) {\n updateIndexMap(pipelineBrowser, proxy.proxy_id, proxy.children);\n }\n }\n }" ]
[ "0.5581962", "0.5565545", "0.5322298", "0.53130573", "0.5299694", "0.520975", "0.51403564", "0.50976515", "0.50889266", "0.5065186", "0.5063049", "0.5063049", "0.5063049", "0.5063049", "0.5063049", "0.5055614", "0.50455725", "0.5003599", "0.50008327", "0.49989545", "0.49857882", "0.49398547", "0.4938279", "0.49173927", "0.49122345", "0.4909435", "0.49058756", "0.48876363", "0.4880237", "0.48790023", "0.48773548", "0.48773548", "0.48735598", "0.48716575", "0.4844311", "0.4837112", "0.4837112", "0.4831633", "0.4830484", "0.4817593", "0.48114046", "0.48091495", "0.47948492", "0.47948492", "0.47876453", "0.47847673", "0.47769544", "0.4769833", "0.47669968", "0.47468674", "0.47412044", "0.47381118", "0.4734414", "0.47247207", "0.47245857", "0.47182095", "0.47144926", "0.47144723", "0.47115257", "0.47079262", "0.4706629", "0.46998906", "0.4692589", "0.46746433", "0.46746433", "0.46746433", "0.46728203", "0.46665934", "0.46659482", "0.4663955", "0.4659224", "0.46482295", "0.46443087", "0.46403703", "0.462359", "0.46171704", "0.4610003", "0.46048307", "0.46016902", "0.45936143", "0.45922425", "0.45900255", "0.45900255", "0.45900255", "0.4587318", "0.45792204", "0.45766297", "0.45765242", "0.45764706", "0.45759737", "0.45759544", "0.45694628", "0.45692667", "0.45658287", "0.4565524", "0.45645547", "0.45595443", "0.4547927", "0.45477143", "0.45473552" ]
0.5777071
0
The actual plugin constructor
function Plugin( element ) { this.element = element; this.jqElement = $(element); this.isScaleActive = false; this._defaults = defaults; this._name = pluginName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n super();\n this._init();\n }", "constructor() {\n\t\t// ...\n\t}", "consructor() {\n }", "constructor() {\r\n super()\r\n this.init()\r\n }", "init() {\n }", "constructor()\n {\n this.init();\n }", "function contruct() {\n\n if ( !$[pluginName] ) {\n $.loading = function( opts ) {\n $( \"body\" ).loading( opts );\n };\n }\n }", "function _construct()\n\t\t{;\n\t\t}", "constructor() {\n this.init();\n }", "constructor() {\n super()\n self = this\n self.init()\n }", "init() { }", "init() { }", "init() { }", "init() { }", "init() { }", "init () {\n }", "constructor() {\n super();\n this.log = log;\n this.plugins = [];\n this.extensions = [];\n this.registerPlugin(require('./core-plugin'));\n }", "constructor() {\n\n /**\n * @type {Array<Plugin>} the list of plugins which this object manages.\n */\n this.pluginList = [];\n }", "init () {}", "init () {}", "constructor() {\r\n // ohne Inhalt\r\n }", "initialize() {\n //\n }", "function Plugin( element, options ) {\n this.ele = element; \n this.$ele = $(element); \n this.options = $.extend( {}, defaults, options) ; \n \n this._defaults = defaults; \n this._name = pgn; \n\n this.init(); \n }", "init() {\n }", "init() {\n }", "init() {\n }", "constructur() {}", "constructor() {\n this._initialize();\n }", "constructor() {\n\n\t}", "init(){}", "function _ctor() {\n\t}", "constructor() {\n }", "function Constructor() {\n // All construction is actually done in the init method\n if ( this.initialize )\n this.initialize.apply(this, arguments);\n }", "constructor(){\r\n\t}", "constructor() {\n\t}", "constructor() {\n\t}", "init() {\n\n }", "init() {\n\n }", "constructor() {\n this.init();\n }", "constructor() {\n this.init();\n }", "init() {\n //todo: other init stuff here\n }", "constructor() {\n this._Initialize();\n }", "initialize()\n {\n }", "init () {\n }", "constructor(args) {\n super(args);\n }", "constructor(args) {\n super(args);\n }", "init () {\n\n }", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "function Plugin ( element, options ) { \n this.element = element;\n this.settings = $.extend( {}, defaults, options );\n this._defaults = defaults;\n this._name = pluginName;\n this.currentDate = new Date();\n this.events = options.events;\n this.init();\n }", "constructor () { super() }", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "function init() {\n var _this = this;\n\n this._get('options').plugins.forEach(function (plugin) {\n // check if plugin definition is string or object\n var Plugin = undefined;\n var pluginName = undefined;\n var pluginOptions = {};\n if (typeof plugin === 'string') {\n pluginName = plugin;\n } else if ((typeof plugin === 'undefined' ? 'undefined' : babelHelpers.typeof(plugin)) === 'object') {\n pluginName = plugin.name;\n pluginOptions = plugin.options || {};\n }\n\n Plugin = find(pluginName);\n _this._get('plugins')[plugin] = new Plugin(_this, pluginOptions);\n\n addClass(_this._get('$container'), pluginClass(pluginName));\n });\n }", "function Plugin(element, options) {\n this.element = element;\n this.$element = $(element);\n this.options = $.extend({}, defaults, options);\n this._defaults = defaults;\n this._name = pluginName;\n this.dataTemple = dataTemple;\n this.init();\n }", "constructor() {\r\n }", "init() {\n }", "init() {\n }", "constructor(opts) {\n super(opts);\n }", "function Plugin ( element, options ) {\n this.element = element;\n\t\t\t this.options = $.extend( {}, defaults, options) ;\n this._defaults = defaults;\n this._name = pluginName;\n this.init();\n }", "_initialize() {\n\n }", "constructor(config){ super(config) }", "constructor(config){ super(config) }", "function Plugin( element, options ) {\n\t\tthis.$element = $(element);\n this.element = element;\n this.options = $.extend( {}, defaults, options) ;\n this._defaults = defaults;\n this._name = pluginName;\n \n this.init();\n }", "init(){\n \n }", "constructor () {\r\n\t\t\r\n\t}", "constructor() { super() }", "init() {\n\n }", "init() {\n\n }", "function Plugin ( element, options ) {\n\t\t\t\tthis.element = element;\n\t\t\t\t// jQuery has an extend method which merges the contents of two or\n\t\t\t\t// more objects, storing the result in the first object. The first object\n\t\t\t\t// is generally empty as we don't want to alter the default options for\n\t\t\t\t// future instances of the plugin\n\t\t\t\tthis.settings = $.extend( {}, defaults, options );\n\t\t\t\tthis._defaults = defaults;\n\t\t\t\tthis._name = pluginName;\n\t\t\t\tthis.init();\n this.info = \"\";\n this.className = \"\";\n\t\t}", "constructor(){\n this.init();\n }", "_defaultConstructor() {\r\n this.settings = new Settings();\r\n this.callbackFunction = null;\r\n this.timeTicker = 0;\r\n return this;\r\n }", "constructor() {\n this.init();\n\n }", "function Plugin( element, options ) {\n\t\tthis.element = element;\n\n\t\tthis.options = $.extend( {}, defaults, options) ;\n\n\t\tthis._defaults = defaults;\n\t\tthis._name = pluginName;\n\t\tthis.spa_space = tiddlyweb.status.space.name;\n\n\t\tthis.init();\n\t}", "function Plugin( element, options ) {\n this.element = element;\n \n // jQuery has an extend method that merges the \n // contents of two or more objects, storing the \n // result in the first object. The first object \n // is generally empty because we don't want to alter \n // the default options for future instances of the plugin\n this.options = $.extend( {}, defaults, options) ;\n \n this._defaults = defaults;\n this._name = pluginName;\n this._auth = {}\n this._publishButtonCss = publishButtonCss;\n this.init();\n }", "initialise () {}", "constructor(){\r\n }", "constructor( ) {}", "constructor() {\n this.plugins = [];\n this.plugins_by_events = [];\n this.callbacks_by_events = [];\n \n window.custom_plugins.concrete = {}; // this is where loaded plugins are stored\n }", "function Plugin($element, $options) \n\t{\n\t\tthis.element \t\t\t\t\t= $element;\n\t\tthis.settings \t\t\t\t\t= $.extend({}, $defaults, $options);\n\t\tthis._defaults \t\t\t\t\t= $defaults;\n\t\tthis._name \t\t\t\t\t\t= $contextplate;\n\n\t\t// Initilize plugin\n\t\tthis.init();\n\t}", "constructor (){}", "init() {\n this._super(...arguments);\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }" ]
[ "0.7422684", "0.7349132", "0.7314277", "0.73003334", "0.7299704", "0.7292701", "0.72775894", "0.72354233", "0.7233936", "0.7181569", "0.71798736", "0.71798736", "0.71798736", "0.71798736", "0.71798736", "0.71761876", "0.7157667", "0.71499527", "0.71496284", "0.71496284", "0.7133179", "0.71217424", "0.71137017", "0.70976347", "0.70976347", "0.70976347", "0.70873505", "0.7083413", "0.7060589", "0.70310766", "0.7030667", "0.7028249", "0.70018446", "0.6967266", "0.6959452", "0.6959452", "0.69561327", "0.69561327", "0.6949666", "0.6949666", "0.6949206", "0.6940036", "0.69265145", "0.6899142", "0.6875689", "0.6875689", "0.6874179", "0.6868699", "0.6868699", "0.6868699", "0.6868699", "0.6868699", "0.6868699", "0.6868699", "0.6868699", "0.6868699", "0.6868699", "0.6868699", "0.6868699", "0.6868699", "0.6858165", "0.6838205", "0.6831462", "0.6831462", "0.6831462", "0.6831462", "0.6831462", "0.6831462", "0.6829787", "0.6822745", "0.681917", "0.6817545", "0.6817545", "0.6815173", "0.6812903", "0.68119335", "0.68021107", "0.68021107", "0.68016434", "0.6798402", "0.67792374", "0.6775999", "0.6775207", "0.6775207", "0.6771675", "0.6771331", "0.6764109", "0.67639893", "0.67638606", "0.67625934", "0.6756738", "0.6748797", "0.6746674", "0.67441636", "0.674013", "0.67356247", "0.6728111", "0.6727763", "0.6727763", "0.6727763", "0.6727763" ]
0.0
-1
II. handle the gateway proxy response (called in http.request and https.request for proxy_clientReq request in I. above) define the gateway proxy_clientReq's responsehandler callback method Note: proxy_Res parameter is an instance of type http.IncomingMessage
function processRes(proxy_Res) { logger.trace(req.transactionId+'-Handling proxy response received, for proxy request sent with options: ', options); var proxyResponseStatusCode = proxy_Res.statusCode; logger.trace(req.transactionId+'-Proxy client request returned proxy response statusCode: ', proxyResponseStatusCode); var responseAttachmentAudit; var isResAuditInitialized = false; // get the file size from the http 'Content-Length' header received in proxy client response var uploadedSize = 0; var fileSizeStr = proxy_Res.headers['content-length']; var fileSize = 0; if (!_.isUndefined(fileSizeStr)) { fileSize = parseInt(fileSizeStr); } // if file buffering set for this configured route if (route.buffer) { try { // create write stream named 'tmpFile' to the temporary file in tmpdir // fs.createWriteStream() returns a new stream.Writable object var tmpFile = fs.createWriteStream(tmpPath); // where 'tmpFile' is a 'stream.Writable' instance, // if a tmpFile.write(chunk) call returns false, then the 'drain' event then emitted // will indicate when it is appropriate to begin writing more data to the stream. tmpFile.on('drain', function () { // begin writing more data to the stream proxy_Res.resume(); }); } catch (e) { logger.error(req.transactionId+'-tmpFile write stream creation section threw an error..., re-throwing...'); throw e; } } // handle proxy client response body when present proxy_Res.on('data', function (chunk) { logger.trace(req.transactionId+'-Response data is being written to proxy client, where chunk length (in bytes): ', chunk.length); //logger.trace('Data:', chunk.toString('utf8')); // first time - initialize and perform unstructured audit logging of the proxy response body file if config set if (!isResAuditInitialized && route.audit && route.audit.unstructured && route.audit.unstructured.auditResponse) { var key = req.transactionId + '-RES'; res.key = key; logger.trace('Unstructured response auditing with transactionId-based key: ', key); // initialize and write the first text logger.trace(req.transactionId+'-Initializing unstructured response body audit'); responseAttachmentAudit = initializeAudit(key, route.audit.unstructured.options); var type = getContentType(proxy_Res); var ext = getExtension(type); var beforeAttachmentText = getBeforeAttachment(key, key + '.' + ext, type); logger.trace(req.transactionId+'-Writing unstructured response before attachment text');//: ", beforeAttachmentText); responseAttachmentAudit.write(beforeAttachmentText, 'binary'); isResAuditInitialized = true; } else { logger.trace(req.transactionId+'-There is NO unstructured response auditing for this response'); } // continue the current unstructured audit logging of the proxy response body file if (!_.isUndefined(responseAttachmentAudit)) { logger.trace(req.transactionId+'-Writing unstructured response audit chunk... '); responseAttachmentAudit.write(chunk, 'binary'); } // keep track of the actual file size in bytes received for both // the optional file size verification and optional file // stream buffering when configured uploadedSize += chunk.length; // if file buffering set for this configured route if (route.buffer) { uploadProgress = (uploadedSize / fileSize) * 100; logger.trace(req.transactionId+'- '+Math.round(uploadProgress) + "%" + " downloaded\n"); // write some data (i.e. 'chunk') to the underlying system // the return value 'bufferStore' indicates if you // should continue writing right now or not: if the data had // to be buffered internally, then 'tmpFile.write()' will return false, else true. // Note: this return value is strictly advisory: it MAY continue // to write, even if it returns false; however, writes will be buffered // in memory, so it is best not to do this excessively. Instead, wait // for the 'drain' event (defined above) before writing more data. logger.trace(req.transactionId+'-Writing proxy response stream received to buffer... '); var bufferStore = tmpFile.write(chunk); if (bufferStore == false) { // pause writing to the stream to wait for internal memory buffering, // until the 'drain' event is emmitted to resume writing to the stream logger.trace(req.transactionId+'-Proxy response stream\'s buffer writing paused to wait for internal memory buffering... '); proxy_Res.pause(); } } else { // write the binary chunk of the received file without buffering, i.e. directly // to the gateway response logger.trace(req.transactionId+'-Proxy response stream writing directly... '); res.write(chunk, 'binary'); } }); // end handling of proxy client response body (when present) proxy_Res.on('end', function (data) { // stop unstructured audit logging of proxy response body if happening (if initialized) if (isResAuditInitialized && !_.isUndefined(responseAttachmentAudit)) { var endAttachmentText = getEndAttachment(res.key); logger.trace(req.transactionId+'-End unstructured response chunk write to Audit');//:', endAttachmentText); responseAttachmentAudit.end(endAttachmentText); } logger.trace(req.transactionId+'-End response chunk write to client, returning gateway response from proxy client'); var errState = false; // if file length verification is set for this configured route if (route.strictLength) { logger.trace(req.transactionId+'-Received file length comparison : Received HTTP header Content-Length value:' + fileSize + ' bytes, received actual file UploadedSize:' + uploadedSize + ' bytes'); // if HTTP header Content-Length value does not match the actual file size received if (fileSize != uploadedSize) { // return an error gateway response, set errState to true logger.error(req.transactionId+'-HTTP Header Content-Length does not match received file size, Content-Length:' + fileSize + ' bytes; Uploaded Size: ' + uploadedSize + ' bytes'); var resBodyTxt = 'HTTP 1.1 500/Internal Server Error: HTTP Header Content-Length value does not match received file size.'; var resLength = resBodyTxt.length; res.writeHead(500, 'HTTP Header Content-Length does not match received file size, Content-Length:' + fileSize + ' bytes; Uploaded Size: ' + uploadedSize + ' bytes', { 'Content-Type' : 'text/plain', 'Content-Length' : resLength }); res.end(resBodyTxt); resDateTime = moment().format(); errState = true; } } // if file buffering set for this configured route if (route.buffer) { if (!errState) { // write the buffered file received to the gateway response stream, // now that buffering has completed without error, and // pass through the proxy response headers received logger.trace(req.transactionId+'-Writing gateway response stream from buffer... '); res.writeHead(proxy_Res.statusCode, proxy_Res.headers); try { fs.createReadStream(tmpPath).pipe(res); } catch (e) { logger.error(req.transactionId+'-fs.createReadStream call threw an error..., re-throwing...'); throw e; } } // release the tmp file in the tmp directory fs.unlink(tmpPath, function (err) { if(err) { logger.error(req.transactionId+'-Could not unlink file:' + tmpPath + ", where error:",err, err.stack); } }); } else { // no file buffering // if no errors occurred if (!errState) { // mark the gateway response as complete logger.trace(req.transactionId+'-Marking gateway response as finished.'); res.end(); resDateTime = moment().format(); } } // perform gateway request, gateway response, proxy response structured audit logging if config set if (route.audit && route.audit.structured && route.audit.structured.auditRequestResponse) { logger.trace(req.transactionId+'-Structured auditing gateway request and response (and proxy client\'s proxy_Res)');//, req, res); audit(route.audit.structured.options, req, res, proxy_Res, reqDateTime, resDateTime, '', function(auditRes) {}); } }); // handle error experienced when processing proxy client response body (when present) proxy_Res.on('error', function (err) { logger.error(req.transactionId+'-Error emitted from proxy client response processing, where error: ', err, err.stack); logger.trace(req.transactionId+'-Returning 500/Internal Server Error gateway response due to proxy client response processing error'); var resBodyTxt = 'HTTP 1.1 500/Internal Server Error'; var resLength = resBodyTxt.length; res.writeHead(500, 'Internal Server Error', { 'Content-Type' : 'text/plain', 'Content-Length' : resLength }); res.end(resBodyTxt); resDateTime = moment().format(); // stop unstructured audit logging of proxy response attachment received if occurring if (isResAuditInitialized && !_.isUndefined(responseAttachmentAudit)) { logger.trace(req.transactionId+'-End unstructured response chunk write to audit service, where error:', err); //logger.trace('End response chunk write to Audit');//: ', endAttachmentText); var endAttachmentText = getEndAttachment(res.key); responseAttachmentAudit.end(endAttachmentText); } // perform gateway request, gateway response, proxy response, and proxy response processing error structured audit logging if config set if (route.audit && route.audit.structured && route.audit.structured.auditRequestResponse) { logger.trace(req.transactionId+'-Structured auditing gateway request and response (and proxy client\'s proxy_Res, and proxy client\'s response processing error)');//, req, res); audit(route.audit.structured.options, req, res, proxy_Res, reqDateTime, resDateTime, err, function(auditRes) {}); } // if file buffering set for this configured route if (route.buffer) { // release the tmp file in the tmp directory fs.unlink(tmpPath, function (er) { if(er) { logger.error(req.transactionId+'-Could not unlink file:' + tmpPath + ', where error: ',er, er.stack); } }); } }); // if file buffering set for this configured route if (route.buffer) { // Allow empty config } else { // no file buffering // write the gateway response headers using the proxy response headers logger.trace(req.transactionId+'-Writing gateway response (no-response-file-buffering) headers...'); if (!res.headersSent) { res.writeHead(proxy_Res.statusCode, proxy_Res.headers); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function proxy_reply(res, code, headers, ret) {\n\t\tif (headers) {\n\t\t\tres.set(t.deployer.copy_headers(headers));\t\t\t\t\t// copy headers for our response\n\t\t}\n\t\tif (!ret) {\n\t\t\treturn res.status(code).send();\n\t\t} else {\n\t\t\treturn res.status(code).send(ret);\n\t\t}\n\t}", "function Proxy () {\n log.info('Proxy constructor');\n var self = this;\n\n this.proxy = httpProxy.createProxyServer({});\n this.proxy.on('error', function (err, req/*, proxiedRes */) {\n var res = req.res;\n var logData = {\n tx: true,\n err: err,\n req: req\n };\n log.error(logData, 'proxy.on error');\n /**\n * we need to keep the didError logic. sometimes (not sure why) but we try to proxy the same\n * request twice (in some network cases) and navi will crash saying you can't send on a request\n * that is already ended\n */\n if (!req.didError) {\n req.didError = true;\n var errorUrl = errorPage.generateErrorUrl('unresponsive', {\n shortHash: req.shortHash,\n elasticUrl: req.elasticUrl\n });\n var targetHost = getHostAndAugmentReq(req, errorUrl);\n log.trace(put({\n targetHost: targetHost,\n errorUrl: errorUrl\n }, logData), 'proxy.on error !req.didError');\n self.proxy.web(req, res, { target: targetHost });\n } else {\n log.trace(logData, 'proxy.on error req.didError');\n }\n });\n\n /**\n * Listen to proxy events for timing logs\n */\n this.proxy.on('proxyReq', function () {\n log.trace({\n tx: true\n }, 'proxy.on proxyReq');\n });\n\n this.proxy.on('proxyRes', function (proxyRes, req, proxiedRes) {\n var res = req.res;\n var targetInstanceName = keypather.get(req, 'targetInstance.attrs.name');\n log.trace({\n tx: true,\n targetInstanceName: targetInstanceName,\n res: res\n }, 'proxy.on proxyRes');\n self._addHeadersToRes(req, proxyRes, targetInstanceName);\n self._streamRes(proxyRes, proxiedRes, res, keypather.get(req, 'naviEntry.redirectEnabled'));\n });\n}", "_responseStrategy(data) {\n var _a, _b, _c, _d, _e;\n try {\n const documentElement = this._parser.parseFromString((0, iconv_lite_1.decode)(data, dbgp_1.ENCODING), 'application/xml').documentElement;\n const isSuccessful = documentElement.getAttribute('success') === '1';\n const error = documentElement.firstChild;\n if (isSuccessful && documentElement.nodeName === 'proxyinit') {\n this._isRegistered = true;\n this.emit('log_response', this.msgs.registerSuccess);\n (_a = this._resolveFn) === null || _a === void 0 ? void 0 : _a.call(this);\n }\n else if (isSuccessful && documentElement.nodeName === 'proxystop') {\n this._isRegistered = false;\n this.emit('log_response', this.msgs.deregisterSuccess);\n (_b = this._resolveFn) === null || _b === void 0 ? void 0 : _b.call(this);\n }\n else if (error && error.nodeName === 'error' && error.firstChild && error.firstChild.textContent) {\n this._socket.emit('error', error.firstChild.textContent);\n (_c = this._rejectFn) === null || _c === void 0 ? void 0 : _c.call(this, new Error(error.firstChild.textContent));\n }\n else {\n this._socket.emit('error', this.msgs.defaultError);\n (_d = this._rejectFn) === null || _d === void 0 ? void 0 : _d.call(this, new Error(this.msgs.defaultError));\n }\n }\n catch (error) {\n (_e = this._rejectFn) === null || _e === void 0 ? void 0 : _e.call(this, new Error(`Proxy read error ${error}`));\n }\n }", "function proxy(client_req, client_res) {\n client_res.setHeader('Access-Control-Allow-Origin', '*') // Avoid CORS issues\n const options = {\n hostname: CONFIG.FES_HOST,\n port: CONFIG.FES_PORT,\n path: client_req.url,\n method: client_req.method,\n headers: client_req.headers\n }\n console.log(`Proxy: ${options.hostname}:${options.port}${options.path}`)\n const proxy = http.request(options, (res) => {\n client_res.writeHead(res.statusCode, res.headers)\n res.pipe(client_res, {\n end: true\n })\n })\n client_req.pipe(proxy, {\n end: true\n })\n client_req.on('error', (error) => {\n console.log(`ERROR: ${client_req.url}: ${error.message}`)\n })\n proxy.on('error', (error) => {\n console.log(`ERROR: ${client_req.url}: ${error.message}`)\n })\n proxy.on('finish', () => {\n console.log(`End: ${client_req.url}`);\n })\n}", "function respond (next) {\n return function sendResult (error, proxyObj) {\n if (error) { return next(error); }\n\n // TESTING HELPER ONLY\n if (proxyObj.options.shortCircuit) {\n return proxyObj.res.send({\n result: 'proxy-express set to short circuit. If this is not expected, please check your config'\n });\n }\n\n let proxyError = proxyObjErrors(proxyObj);\n if (proxyError) {\n return next(new Error(proxyError));\n } else if (!(proxyObj.result && proxyObj.result.response)) {\n return next(new Error('Proxy to ' + proxyObj.reqOpts.url + ' failed for an unkown reason'));\n } else {\n proxyObj.res.status(proxyObj.result.response.statusCode || 400).send(proxyObj.result.body);\n }\n };\n}", "function pepResponse(req, res) {\n const headers = req.headers;\n headers['x-forwarded-for'] = getClientIp(req);\n\n got(PROXY_URL + req.url, {\n method: req.method,\n headers,\n body: req.body,\n allowGetBody: true,\n throwHttpErrors: false,\n retry: 0\n })\n .then((response) => {\n debug(req.user ? 'Permitted.' : 'Public path.');\n res.statusCode = response.statusCode;\n res.headers = response.headers;\n if (response.headers['content-type']){\n res.type(response.headers['content-type'])\n }\n return response.body ? res.send(response.body) : res.send();\n })\n .catch((error) => {\n return internalError(res, error, 'Proxy');\n });\n}", "function handleResponse(apiResponse) {\n // Copy the status code and headers from our proxy response.\n res.statusCode = apiResponse.statusCode;\n for (let i = 0; i < apiResponse.rawHeaders.length; i += 2) {\n res.setHeader(apiResponse.rawHeaders[i], apiResponse.rawHeaders[i + 1]);\n }\n\n // Send the body to our actual response.\n apiResponse.pipe(res);\n }", "function onRequest(c_req, c_res) {\n \n var parsedURL = url.parse(c_req.url);\n //console.log(\"parsed\")\n var reqOptions = {\n host: options.server,\n path: parsedURL.path,\n port: options.port,\n localport: options.local_port,\n //header: {}\n };\n console.log('Method used: ' + c_req.method);\n \n if (c_req.method == 'GET') { // When the request method is 'GET'\n \n console.log('Path used: ' + reqOptions.path);\n\n var webProxyServer = http.request(reqOptions, function (res) { // A proxy to send a request to the target server\n console.log('Requesting from: ' + reqOptions.host + reqOptions.path);\n \n if (res.statusCode >= 300 && res.statusCode <= 399) { \n console.log('300 Level Status Code.');\n c_res.end('Redirect error: ' + res.statusCode); \n } else { \n console.log('Returning response: ' + res.statusCode); // Pipe the whole server response to the client response\n res.pipe(c_res, { end: true }); \n }\n });\n // pipe the proxy to the client request\n c_req.pipe(webProxyServer, { end: true });\n console.log('Piping content...');\n } else {\n // Any request method other than 'GET' will be rejected\n c_res.end('Not \\'GET\\' method.');\n console.log('Not \\'GET\\' method requested.');\n }\n}", "function responseHandler(srcResponse, numer)\n{\n camz[numer].headers = srcResponse.headers;\n srcResponse.on('data', function(chunk) {dataHandler(chunk, numer)});\n}", "function proxy(req, res) {\n var queryString = req.originalUrl.split('?')[1];\n var path = '/v1' + req.path + (queryString ? '?' + queryString : '');\n console.log(\n req.method + ' ' + req.path + ' proxied to ' +\n options.mlHost + ':' + options.mlHttpPort + path);\n var mlReq = http.request({\n hostname: options.mlHost,\n port: options.mlHttpPort,\n method: req.method,\n path: path,\n headers: req.headers,\n auth: getAuth(options, req.session)\n }, function(response) {\n\n res.statusCode = response.statusCode;\n\n // [GJo] (#67) forward all headers from MarkLogic\n for (var header in response.headers) {\n res.header(header, response.headers[header]);\n }\n\n response.on('data', function(chunk) {\n res.write(chunk);\n });\n response.on('end', function() {\n res.end();\n });\n });\n\n if (req.body !== undefined) {\n mlReq.write(JSON.stringify(req.body));\n mlReq.end();\n }\n\n mlReq.on('error', function(e) {\n console.log('Problem with request: ' + e.message);\n });\n}", "function messageHandler(req, res) {\n let agent = new WebhookClient({'request': req, 'response': res});\n console.log(\"ORIGINAL REQUEST: \" + agent.originalRequest);\n agent.handleRequest(intentMap);\n}", "onRequest(request, reply) {\n const { events } = this;\n\n events.emit('onRequest', request, reply);\n\n reply.from(request.url, {\n onResponse: (request, reply, res) => {\n events.emit('onProxyResponse', request, reply, res);\n reply.send(res);\n },\n });\n }", "function do_proxy(req, res) {\n\t\treq.path2use = req.path2use.replace(/\\$iid/gi, (ev.CRN.instance_id || 'iid-not-set'));\t// replace placeholder iid with the real iid\n\t\tlogger.info('[deployer apis] - attempting a deployer proxy request', req.method, t.misc.get_host(ev.DEPLOYER_URL), req.path2use);\n\n\t\tconst opts = {\n\t\t\tmethod: req.method,\n\t\t\tbaseUrl: encodeURI(t.misc.format_url(ev.DEPLOYER_URL)),\t\t\t\t\t\t\t\t// url to deployer\n\t\t\turl: encodeURI(req.path2use),\n\t\t\tbody: req.body ? JSON.stringify(req.body) : null,\t\t\t\t\t\t\t\t\t// body for deployer\n\t\t\theaders: t.deployer.copy_headers(req.headers),\n\t\t\ttimeout: ev.DEPLOYER_TIMEOUT\n\t\t};\n\n\t\tt.request(opts, (err, resp) => {\n\t\t\tlet ret = resp ? resp.body : null;\n\t\t\tlet dep_resp_headers = resp ? resp.headers : null;\n\t\t\tlet code = t.ot_misc.get_code(resp);\n\t\t\tif (err) {\n\t\t\t\tlogger.error('[deployer apis] - [2] unable to contact deployer', err);\n\t\t\t\tif (err.toString().indexOf('TIMEDOUT') >= 0) {\n\t\t\t\t\tcode = 408;\n\t\t\t\t\tlogger.error('[deployer apis] - [1] timeout was:', opts.timeout);\n\t\t\t\t}\n\t\t\t\treturn proxy_reply(res, code, dep_resp_headers, err);\n\t\t\t} else {\n\t\t\t\tif (t.ot_misc.is_error_code(code)) {\n\t\t\t\t\tlogger.error('[deployer apis] - [2] deployer responded with error code', code, ret);\n\t\t\t\t\treturn proxy_reply(res, code, dep_resp_headers, ret);\n\t\t\t\t} else {\n\t\t\t\t\tlogger.info('[deployer apis] - [2] successful deployer response', code);\n\n\t\t\t\t\t// running the deployer response through parse/stringify will decode unicode characters\n\t\t\t\t\t// (seen in the ldap.URL field of a \"/type/ca\" response)\n\t\t\t\t\ttry {\n\t\t\t\t\t\tret = JSON.stringify(JSON.parse(ret));\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t// ignore parsing errors\n\t\t\t\t\t}\n\n\t\t\t\t\t// redact CA enroll id/secret data if not a manager\n\t\t\t\t\tconst lc_authorized_actions = t.middleware.getActions(req);\n\t\t\t\t\tif (req.path.includes('/type/ca/') && (!lc_authorized_actions || !lc_authorized_actions.includes(ev.STR.C_MANAGE_ACTION))) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst obj = JSON.parse(ret);\n\t\t\t\t\t\t\t// only redact the inner registry fields, else other (non-sensitive) fields will get redacted\n\t\t\t\t\t\t\tobj.configs.ca.registry = t.comp_fmt.redact_enroll_details(obj.configs.ca.registry);\n\t\t\t\t\t\t\tobj.configs.tlsca.registry = t.comp_fmt.redact_enroll_details(obj.configs.tlsca.registry);\n\t\t\t\t\t\t\tret = JSON.stringify(obj);\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t// ignore parsing or dot nav errors\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// store response in cache\n\t\t\t\t\tif (ev.PROXY_CACHE_ENABLED === true && req._cache_this_req === true) {\n\t\t\t\t\t\tconst data2cache = {\n\t\t\t\t\t\t\tcode: code,\n\t\t\t\t\t\t\theaders: dep_resp_headers,\n\t\t\t\t\t\t\tdata: ret,\n\t\t\t\t\t\t\tkey_src: req._key_src,\n\t\t\t\t\t\t\tcached_ts: Date.now(),\n\t\t\t\t\t\t};\n\t\t\t\t\t\tt.proxy_cache.set(req._key, data2cache, 10 * 60);\t// expiration is in sec\n\t\t\t\t\t}\n\t\t\t\t\treturn proxy_reply(res, code, dep_resp_headers, ret);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "function warehouse_proxy(req, reply){\n //logger.request(req);\n\n reception.emit('digger:warehouse', req, reply);\n }", "function onResponse(ctx, callback)\n{\n const resp_headers = ctx.serverToProxyResponse.headers;\n const req_headers = ctx.clientToProxyRequest.headers;\n\n // !!!! todo: for now we remove the csp header\n // delete resp_headers['content-security-policy'];\n\n /* The Expect-CT header allows sites to opt in to reporting\n * and/or enforcement of Certificate Transparency\n * requirements, which prevents the use of misissued\n * certificates for that site from going unnoticed.\n */\n delete resp_headers['expect-ct'];\n\n\n // note: headers converted to lowercase by nodejs\n const is_html = 'content-type' in resp_headers &&\n resp_headers['content-type'].startsWith('text/html');\n const is_xhr = ('x-requested-with' in req_headers);\n const is_cors = ('origin' in req_headers);\n\n ctx.must_inject = (ENABLE_INJECTION && is_html && !ctx.no_inject &&\n !is_xhr && !is_cors);\n\n\n if (ctx.must_inject)\n {\n delete resp_headers['content-length'];\n const csp = resp_headers['content-security-policy'];\n const default_csp = csp;\n\n delete resp_headers['etag'];\n delete resp_headers['last-modified'];\n\n if (csp){\n const policy = new Policy(csp);\n const script_src = policy.get('script-src');\n const frm_src = policy.get('frame-src');\n const default_src = policy.get('default-src');\n\n // inject script as inline content\n if (SHARED_STORE_IFRAME_URL.length){\n const ifr_url = new URL(SHARED_STORE_IFRAME_URL);\n\n if (!frm_src && default_src){\n policy.set('frame-src', default_src);\n }\n policy.add('frame-src', ifr_url.origin);\n }\n\n let script_inject_data;\n if (INJECTION_METHOD === 'url'){\n const url = new URL(INJECTED_SCRIPT_URL);\n script_inject_data = url.origin;\n }else{\n //\n const sha256 = getInjectedHash();\n script_inject_data = \"'\"+sha256+\"'\";\n }\n\n\n if (!script_src && default_src){\n policy.set('script-src', default_src);\n }\n policy.add('script-src', script_inject_data);\n\n let modified_csp = policy.toString();\n console.log(\"\\n\\n### orig csp: %s\", default_csp);\n console.log(\"### modified csp: %s\", modified_csp);\n resp_headers['content-security-policy'] = modified_csp;\n }//end if csp\n }// end if must_inject\n return callback();\n}", "function proxyError(res, message){\n\tres.send(\"Proxy error \" + (message || ''),500);\n}", "userResDecorator(proxyRes, proxyResData, userReq, userRes) {\n // console.log(userRes);\n // return proxyResData;\n try {\n // get, parse, and transform the data if possible\n\n const dataString = proxyResData.toString('utf8');\n let data;\n try {\n // try for json data\n data = JSON.parse(proxyResData.toString('utf8'));\n } catch {\n console.log(\"couldn't parse data\");\n // otherwise just use the stringified data\n data = proxyResData.toString('utf8');\n }\n const modified = interceptor(data, userReq, userRes);\n // return transformed data to client\n return JSON.stringify(modified);\n } catch (e) {\n console.log(\"couldn't parse data, again! recieved error\", e);\n // on error, pass the data forward\n return proxyResData;\n }\n }", "handleSocks4FinalHandshakeResponse() {\n const data = this._receiveBuffer.get(8);\n if (data[1] !== constants_1.Socks4Response.Granted) {\n this._closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedConnection} - (${constants_1.Socks4Response[data[1]]})`);\n }\n else {\n // Bind response\n if (constants_1.SocksCommand[this._options.command] === constants_1.SocksCommand.bind) {\n const buff = smart_buffer_1.SmartBuffer.fromBuffer(data);\n buff.readOffset = 2;\n const remoteHost = {\n port: buff.readUInt16BE(),\n host: ip.fromLong(buff.readUInt32BE())\n };\n // If host is 0.0.0.0, set to proxy host.\n if (remoteHost.host === '0.0.0.0') {\n remoteHost.host = this._options.proxy.ipaddress;\n }\n this.state = constants_1.SocksClientState.BoundWaitingForConnection;\n this.emit('bound', { socket: this._socket, remoteHost });\n // Connect response\n }\n else {\n this.state = constants_1.SocksClientState.Established;\n this.removeInternalSocketHandlers();\n this.emit('established', { socket: this._socket });\n }\n }\n }", "static handleRequest(virtualRequest, request, response, loggingFunction, fallbackResponder) {\n return __awaiter(this, void 0, void 0, function* () {\n const proxy = yield this.getProxy(virtualRequest, request, loggingFunction, fallbackResponder);\n if (!(proxy instanceof OutgoingRequestHandler)) {\n throw new Error('unable to handle request: no matching handler found');\n }\n return proxy.handleRequestConcrete(virtualRequest, request, response);\n });\n }", "responseHandler(data) {\n if(this.build) {\n if(data.length + this.curResponse.accumulated > this.curResponse.size) {\n throw new Error('Ending response length did match reported size');\n } else {\n this.curResponse.data = Buffer.concat([this.curResponse.data, data]);\n this.curResponse.accumulated += data.length;\n }\n\n if(this.curResponse.accumulated === this.curResponse.size) {\n this.build = false;\n let correlationMethod = this.getCorrelation(this.curResponse.header.correlationId);\n correlationMethod(null, this.curResponse.data);\n }\n return;\n }\n\n var header, offset, size;\n\n [size, offset] = types.decodeInt32(data, 0);\n\n [header, offset] = parser.decode(Header.response, data, offset);\n\n if(this.requestCount < header.correlationId) {\n return this.onError(new Error('Unknown correlation id received from broker'));\n }\n\n let bufLength = data.length - types.INT32_SIZE;\n if(size !== bufLength) {\n this.build = true;\n this.curResponse = {\n header: header,\n size: size,\n accumulated: bufLength,\n data: data.slice(offset)\n };\n } else {\n this.build = false;\n let correlationMethod = this.getCorrelation(header.correlationId);\n correlationMethod(null, data.slice(offset));\n }\n }", "on_REPLY (e, callback) {\n\n\t\tif (e.target.status >= 200 && e.target.status < 400) {\n\t\t\t\n\t\t\tvar response = e.target.response;\n\n\t\t\t// convert to object if request is a JSON string\n\t\t\tif (typeof response === 'string') {\n\t\t\t\tresponse = JSON.parse(e.target.response);\n\t\t\t}\n\n\t\t\t// Go ahead and pass the response to the caller\n\t\t\tcallback(response);\n\n\t\t} else {\n\t\t\t\n\t\t\tconsole.log('Error: There was an error loading the JSON. -- Status:', e.target.status);\n\t\t}\n\t}", "function onresponse (res) {\n var code = res.statusCode;\n\n // assign a Date to this response for the \"Cache-Control\" delta calculation\n res.date = new Date();\n res.parsed = parsed;\n\n debug('got %o response status code', code);\n\n // any 2xx response is a \"success\" code\n var type = (code / 100 | 0);\n\n // check for a 3xx \"redirect\" status code\n var location = res.headers.location;\n if (3 == type && location) {\n if (!opts.redirects) opts.redirects = [];\n var redirects = opts.redirects;\n\n if (redirects.length < maxRedirects) {\n debug('got a \"redirect\" status code with Location: %o', location);\n\n // flush this response - we're not going to use it\n res.resume();\n\n // hang on to this Response object for the \"redirects\" Array\n redirects.push(res);\n\n var newUri = url.resolve(parsed, location);\n debug('resolved redirect URL: %o', newUri);\n\n var left = maxRedirects - redirects.length;\n debug('%o more redirects allowed after this one', left);\n\n // check if redirecting to a different protocol\n var parsedUrl = url.parse(newUri);\n if (parsedUrl.protocol !== parsed.protocol) {\n opts.http = parsedUrl.protocol === 'https:' ? https : undefined;\n }\n\n return get(parsedUrl, opts, fn);\n }\n }\n\n // if we didn't get a 2xx \"success\" status code, then create an Error object\n if (2 != type) {\n var err;\n if (304 == code) {\n err = new NotModifiedError();\n } else if (404 == code) {\n err = new NotFoundError();\n } else {\n // other HTTP-level error\n var message = http.STATUS_CODES[code];\n err = new Error(message);\n err.statusCode = code;\n err.code = code;\n }\n\n res.resume();\n return fn(err);\n }\n\n if (opts.redirects) {\n // store a reference to the \"redirects\" Array on the Response object so that\n // they can be inspected during a subsequent call to GET the same URI\n res.redirects = opts.redirects;\n }\n\n fn(null, res);\n }", "function requestRemote(requestOptions, req, res, proxy) {\n\n var headers;\n var body;\n var remoteRequest = http.request(requestOptions, function(remoteResponse) {\n remoteResponse.headers['proxy-agent'] = 'Proxy Agent';\n headers = res._header;\n // write out headers to handle redirects\n res.writeHead(remoteResponse.statusCode, '', remoteResponse.headers);\n // change resonse here\n remoteResponse.pipe(res);\n // send the connection\n res.pipe(remoteResponse);\n });\n remoteRequest.on('error', function(e) {\n console.log('error in request: failed to fetch');\n res.writeHead(502, 'Proxy fetch failed');\n res.end();\n remoteRequest.end();\n });\n\n req.pipe(remoteRequest);// to the server.\n res.on('close', function() {\n remoteRequest.abort();\n });\n\n }", "callback(req, opts) {\n return __awaiter(this, void 0, void 0, function* () {\n const { proxy, secureProxy } = this;\n // Create a socket connection to the proxy server.\n let socket;\n if (secureProxy) {\n debug('Creating `tls.Socket`: %o', proxy);\n socket = tls_1.default.connect(proxy);\n }\n else {\n debug('Creating `net.Socket`: %o', proxy);\n socket = net_1.default.connect(proxy);\n }\n const headers = Object.assign({}, proxy.headers);\n const hostname = `${opts.host}:${opts.port}`;\n let payload = `CONNECT ${hostname} HTTP/1.1\\r\\n`;\n // Inject the `Proxy-Authorization` header if necessary.\n if (proxy.auth) {\n headers['Proxy-Authorization'] = `Basic ${Buffer.from(proxy.auth).toString('base64')}`;\n }\n // The `Host` header should only include the port\n // number when it is not the default port.\n let { host, port, secureEndpoint } = opts;\n if (!isDefaultPort(port, secureEndpoint)) {\n host += `:${port}`;\n }\n headers.Host = host;\n headers.Connection = 'close';\n for (const name of Object.keys(headers)) {\n payload += `${name}: ${headers[name]}\\r\\n`;\n }\n const proxyResponsePromise = parse_proxy_response_1.default(socket);\n socket.write(`${payload}\\r\\n`);\n const { statusCode, buffered } = yield proxyResponsePromise;\n if (statusCode === 200) {\n req.once('socket', resume);\n if (opts.secureEndpoint) {\n // The proxy is connecting to a TLS server, so upgrade\n // this socket connection to a TLS connection.\n debug('Upgrading socket connection to TLS');\n const servername = opts.servername || opts.host;\n return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket,\n servername }));\n }\n return socket;\n }\n // Some other status code that's not 200... need to re-play the HTTP\n // header \"data\" events onto the socket once the HTTP machinery is\n // attached so that the node core `http` can parse and handle the\n // error status code.\n // Close the original socket, and a new \"fake\" socket is returned\n // instead, so that the proxy doesn't get the HTTP request\n // written to it (which may contain `Authorization` headers or other\n // sensitive data).\n //\n // See: https://hackerone.com/reports/541502\n socket.destroy();\n const fakeSocket = new net_1.default.Socket({ writable: false });\n fakeSocket.readable = true;\n // Need to wait for the \"socket\" event to re-play the \"data\" events.\n req.once('socket', (s) => {\n debug('replaying proxy buffer for failed request');\n assert_1.default(s.listenerCount('data') > 0);\n // Replay the \"buffered\" Buffer onto the fake `socket`, since at\n // this point the HTTP module machinery has been hooked up for\n // the user.\n s.push(buffered);\n s.push(null);\n });\n return fakeSocket;\n });\n }", "callback(req, opts) {\n return __awaiter(this, void 0, void 0, function* () {\n const { proxy, secureProxy } = this;\n // Create a socket connection to the proxy server.\n let socket;\n if (secureProxy) {\n debug('Creating `tls.Socket`: %o', proxy);\n socket = tls_1.default.connect(proxy);\n }\n else {\n debug('Creating `net.Socket`: %o', proxy);\n socket = net_1.default.connect(proxy);\n }\n const headers = Object.assign({}, proxy.headers);\n const hostname = `${opts.host}:${opts.port}`;\n let payload = `CONNECT ${hostname} HTTP/1.1\\r\\n`;\n // Inject the `Proxy-Authorization` header if necessary.\n if (proxy.auth) {\n headers['Proxy-Authorization'] = `Basic ${Buffer.from(proxy.auth).toString('base64')}`;\n }\n // The `Host` header should only include the port\n // number when it is not the default port.\n let { host, port, secureEndpoint } = opts;\n if (!isDefaultPort(port, secureEndpoint)) {\n host += `:${port}`;\n }\n headers.Host = host;\n headers.Connection = 'close';\n for (const name of Object.keys(headers)) {\n payload += `${name}: ${headers[name]}\\r\\n`;\n }\n const proxyResponsePromise = parse_proxy_response_1.default(socket);\n socket.write(`${payload}\\r\\n`);\n const { statusCode, buffered } = yield proxyResponsePromise;\n if (statusCode === 200) {\n req.once('socket', resume);\n if (opts.secureEndpoint) {\n // The proxy is connecting to a TLS server, so upgrade\n // this socket connection to a TLS connection.\n debug('Upgrading socket connection to TLS');\n const servername = opts.servername || opts.host;\n return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket,\n servername }));\n }\n return socket;\n }\n // Some other status code that's not 200... need to re-play the HTTP\n // header \"data\" events onto the socket once the HTTP machinery is\n // attached so that the node core `http` can parse and handle the\n // error status code.\n // Close the original socket, and a new \"fake\" socket is returned\n // instead, so that the proxy doesn't get the HTTP request\n // written to it (which may contain `Authorization` headers or other\n // sensitive data).\n //\n // See: https://hackerone.com/reports/541502\n socket.destroy();\n const fakeSocket = new net_1.default.Socket({ writable: false });\n fakeSocket.readable = true;\n // Need to wait for the \"socket\" event to re-play the \"data\" events.\n req.once('socket', (s) => {\n debug('replaying proxy buffer for failed request');\n assert_1.default(s.listenerCount('data') > 0);\n // Replay the \"buffered\" Buffer onto the fake `socket`, since at\n // this point the HTTP module machinery has been hooked up for\n // the user.\n s.push(buffered);\n s.push(null);\n });\n return fakeSocket;\n });\n }", "function proxyReq (proxyObj, callback) {\n let proxyError = proxyObjErrors(proxyObj);\n if (proxyError) { return callback(new Error(proxyError)); }\n\n if (proxyObj.options.log) { logReqOpts(proxyObj.reqOpts); }\n\n // TESTING HELPER ONLY\n if (proxyObj.options.shortCircuit) { return callback(null, proxyObj); }\n\n // unless explicitly set, ignore encoding\n // THIS IS A HACK THAT MAY CAUSE ISSUES. I DON'T\n // KNOW OF AN IMMEDIATE WORKAROUND TO FIX IT.\n if (!proxyObj.options['accept-encoding']) {\n delete proxyObj.reqOpts.headers['accept-encoding'];\n }\n\n // Check for Form Post Parameters\n if (proxyObj.req.body && (proxyObj.reqOpts.method === 'POST' || proxyObj.reqOpts.method === 'PUT')) {\n proxyObj.reqOpts.form = proxyObj.req.body;\n }\n\n // make request\n request(proxyObj.reqOpts, function (error, response, body) {\n if (proxyObj.options.log) { logResponse(response, body); }\n\n // transfer result to resulting o\n proxyObj.res.set(helpers.defaultHeaders(proxyObj.options.response.headers, response ? response.headers : {}));\n\n proxyObj.result = {\n response : response,\n body : body\n };\n\n return callback(error, proxyObj);\n });\n}", "callback(req, opts) {\n return __awaiter(this, void 0, void 0, function* () {\n const { proxy, secureProxy } = this;\n // Create a socket connection to the proxy server.\n let socket;\n if (secureProxy) {\n debug('Creating `tls.Socket`: %o', proxy);\n socket = tls_1.default.connect(proxy);\n }\n else {\n debug('Creating `net.Socket`: %o', proxy);\n socket = net_1.default.connect(proxy);\n }\n const headers = Object.assign({}, proxy.headers);\n const hostname = `${opts.host}:${opts.port}`;\n let payload = `CONNECT ${hostname} HTTP/1.1\\r\\n`;\n // Inject the `Proxy-Authorization` header if necessary.\n if (proxy.auth) {\n headers['Proxy-Authorization'] = `Basic ${Buffer.from(proxy.auth).toString('base64')}`;\n }\n // The `Host` header should only include the port\n // number when it is not the default port.\n let { host, port, secureEndpoint } = opts;\n if (!isDefaultPort(port, secureEndpoint)) {\n host += `:${port}`;\n }\n headers.Host = host;\n headers.Connection = 'close';\n for (const name of Object.keys(headers)) {\n payload += `${name}: ${headers[name]}\\r\\n`;\n }\n const proxyResponsePromise = parse_proxy_response_1.default(socket);\n socket.write(`${payload}\\r\\n`);\n const { statusCode, buffered } = yield proxyResponsePromise;\n if (statusCode === 200) {\n req.once('socket', resume);\n if (opts.secureEndpoint) {\n const servername = opts.servername || opts.host;\n if (!servername) {\n throw new Error('Could not determine \"servername\"');\n }\n // The proxy is connecting to a TLS server, so upgrade\n // this socket connection to a TLS connection.\n debug('Upgrading socket connection to TLS');\n return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket,\n servername }));\n }\n return socket;\n }\n // Some other status code that's not 200... need to re-play the HTTP\n // header \"data\" events onto the socket once the HTTP machinery is\n // attached so that the node core `http` can parse and handle the\n // error status code.\n // Close the original socket, and a new \"fake\" socket is returned\n // instead, so that the proxy doesn't get the HTTP request\n // written to it (which may contain `Authorization` headers or other\n // sensitive data).\n //\n // See: https://hackerone.com/reports/541502\n socket.destroy();\n const fakeSocket = new net_1.default.Socket();\n fakeSocket.readable = true;\n // Need to wait for the \"socket\" event to re-play the \"data\" events.\n req.once('socket', (s) => {\n debug('replaying proxy buffer for failed request');\n assert_1.default(s.listenerCount('data') > 0);\n // Replay the \"buffered\" Buffer onto the fake `socket`, since at\n // this point the HTTP module machinery has been hooked up for\n // the user.\n s.push(buffered);\n s.push(null);\n });\n return fakeSocket;\n });\n }", "callback(req, opts) {\n return __awaiter(this, void 0, void 0, function* () {\n const { proxy, secureProxy } = this;\n // Create a socket connection to the proxy server.\n let socket;\n if (secureProxy) {\n debug('Creating `tls.Socket`: %o', proxy);\n socket = tls_1.default.connect(proxy);\n }\n else {\n debug('Creating `net.Socket`: %o', proxy);\n socket = net_1.default.connect(proxy);\n }\n const headers = Object.assign({}, proxy.headers);\n const hostname = `${opts.host}:${opts.port}`;\n let payload = `CONNECT ${hostname} HTTP/1.1\\r\\n`;\n // Inject the `Proxy-Authorization` header if necessary.\n if (proxy.auth) {\n headers['Proxy-Authorization'] = `Basic ${Buffer.from(proxy.auth).toString('base64')}`;\n }\n // The `Host` header should only include the port\n // number when it is not the default port.\n let { host, port, secureEndpoint } = opts;\n if (!isDefaultPort(port, secureEndpoint)) {\n host += `:${port}`;\n }\n headers.Host = host;\n headers.Connection = 'close';\n for (const name of Object.keys(headers)) {\n payload += `${name}: ${headers[name]}\\r\\n`;\n }\n const proxyResponsePromise = parse_proxy_response_1.default(socket);\n socket.write(`${payload}\\r\\n`);\n const { statusCode, buffered } = yield proxyResponsePromise;\n if (statusCode === 200) {\n req.once('socket', resume);\n if (opts.secureEndpoint) {\n const servername = opts.servername || opts.host;\n if (!servername) {\n throw new Error('Could not determine \"servername\"');\n }\n // The proxy is connecting to a TLS server, so upgrade\n // this socket connection to a TLS connection.\n debug('Upgrading socket connection to TLS');\n return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket,\n servername }));\n }\n return socket;\n }\n // Some other status code that's not 200... need to re-play the HTTP\n // header \"data\" events onto the socket once the HTTP machinery is\n // attached so that the node core `http` can parse and handle the\n // error status code.\n // Close the original socket, and a new \"fake\" socket is returned\n // instead, so that the proxy doesn't get the HTTP request\n // written to it (which may contain `Authorization` headers or other\n // sensitive data).\n //\n // See: https://hackerone.com/reports/541502\n socket.destroy();\n const fakeSocket = new net_1.default.Socket();\n fakeSocket.readable = true;\n // Need to wait for the \"socket\" event to re-play the \"data\" events.\n req.once('socket', (s) => {\n debug('replaying proxy buffer for failed request');\n assert_1.default(s.listenerCount('data') > 0);\n // Replay the \"buffered\" Buffer onto the fake `socket`, since at\n // this point the HTTP module machinery has been hooked up for\n // the user.\n s.push(buffered);\n s.push(null);\n });\n return fakeSocket;\n });\n }", "callback(req, opts) {\n return __awaiter(this, void 0, void 0, function* () {\n const { proxy, secureProxy } = this;\n // Create a socket connection to the proxy server.\n let socket;\n if (secureProxy) {\n debug('Creating `tls.Socket`: %o', proxy);\n socket = tls_1.default.connect(proxy);\n }\n else {\n debug('Creating `net.Socket`: %o', proxy);\n socket = net_1.default.connect(proxy);\n }\n const headers = Object.assign({}, proxy.headers);\n const hostname = `${opts.host}:${opts.port}`;\n let payload = `CONNECT ${hostname} HTTP/1.1\\r\\n`;\n // Inject the `Proxy-Authorization` header if necessary.\n if (proxy.auth) {\n headers['Proxy-Authorization'] = `Basic ${Buffer.from(proxy.auth).toString('base64')}`;\n }\n // The `Host` header should only include the port\n // number when it is not the default port.\n let { host, port, secureEndpoint } = opts;\n if (!isDefaultPort(port, secureEndpoint)) {\n host += `:${port}`;\n }\n headers.Host = host;\n headers.Connection = 'close';\n for (const name of Object.keys(headers)) {\n payload += `${name}: ${headers[name]}\\r\\n`;\n }\n const proxyResponsePromise = parse_proxy_response_1.default(socket);\n socket.write(`${payload}\\r\\n`);\n const { statusCode, buffered } = yield proxyResponsePromise;\n if (statusCode === 200) {\n req.once('socket', resume);\n if (opts.secureEndpoint) {\n const servername = opts.servername || opts.host;\n if (!servername) {\n throw new Error('Could not determine \"servername\"');\n }\n // The proxy is connecting to a TLS server, so upgrade\n // this socket connection to a TLS connection.\n debug('Upgrading socket connection to TLS');\n return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket,\n servername }));\n }\n return socket;\n }\n // Some other status code that's not 200... need to re-play the HTTP\n // header \"data\" events onto the socket once the HTTP machinery is\n // attached so that the node core `http` can parse and handle the\n // error status code.\n // Close the original socket, and a new \"fake\" socket is returned\n // instead, so that the proxy doesn't get the HTTP request\n // written to it (which may contain `Authorization` headers or other\n // sensitive data).\n //\n // See: https://hackerone.com/reports/541502\n socket.destroy();\n const fakeSocket = new net_1.default.Socket();\n fakeSocket.readable = true;\n // Need to wait for the \"socket\" event to re-play the \"data\" events.\n req.once('socket', (s) => {\n debug('replaying proxy buffer for failed request');\n assert_1.default(s.listenerCount('data') > 0);\n // Replay the \"buffered\" Buffer onto the fake `socket`, since at\n // this point the HTTP module machinery has been hooked up for\n // the user.\n s.push(buffered);\n s.push(null);\n });\n return fakeSocket;\n });\n }", "function relayResponse(request, handler){\n\tif(request.readyState == 4){\n\t\tif(request.status == 200){\n\t\t\tvar responseText = request.responseText;\n\t\t\t\n\t\t\t// ugly hack for international pages adding extra HTML\n\t\t\tvar index = responseText.indexOf(\"<!DOCTYPE\");\n\t\t\tif(index != -1){\n\t\t\t\tresponseText = responseText.substring(0, index);\n\t\t\t}\n\t\t\t\n\t\t\t// success, give response text to handler function\n\t\t\thandler(true, responseText);\n\t\t}\n\t\telse{\n\t\t\t// page returned error code (such as 404)\n\t\t\thandler(false, 'Ajax page returned error code ' + request.status + '.');\n\t\t}\n\t}\n}", "function handleResponse(req, cmd)\n\t{\n\t\treturn function()\n\t\t{\n\t\t\ttry \n\t\t {\n\t\t if (req.readyState === XMLHttpRequest.DONE) \n\t\t {\n\t\t if (req.status === 200) \n\t\t { \n\t\t var result = req.responseText;\n\t\t result = result.trim();\n\t\t \n\t\t if(result === \"Success\")\n\t\t { //Update the mode content\n\t\t \t updateContent(cmd);\n\t\t \t \n\t\t }\n\t\t else if(result.startsWith(\"SuccessCapture:\"))\n\t\t { //Update the mode content to capture with capture ip\n\t\t \t updateCaptureContent(cmd, result);\n\t\t }\n\t\t else if(result.startsWith(\"Error\"))\n\t\t {\n\t\t \t showMsg(result) ;\n\t\t }\n\t\t else\n\t\t {\n\t\t \t//Some other content such as redirection back to main login \n\t\t\t //when session expires\n\t\t\t window.location.reload(true);\n\t\t \t \n\t\t }\n\t\t } \n\t\t else \n\t\t {\n\t\t \tshowMsg(\"Error sending request to server \") ;\n\t\t }\n\t\t }\n\t\t }\n\t\t catch( e ) \n\t\t {\n\t\t \t showMsg(\"Error sending request to server \") ;\n\t\t }\n\t\t\t\n\t\t \n\t\t};\n\t\t\n\t}", "_onResponse(msg) {\n let _this = this;\n\n let event = {\n type: msg.type,\n url: msg.body.source,\n code: msg.body.code\n };\n\n if (_this._onResponseHandler) {\n _this._onResponseHandler(event);\n }\n }", "function proxy(resp, headers) {\n if (!defaults.proxyURL) {\n return abort404(resp, 'Request Timeout');\n }\n request(defaults.proxyURL, headers, defaults.proxyTimeout, function(err, proxyResp) {\n if (err) {\n return abort404(resp, 'Proxy failed: ' + err.message);\n }\n if (proxyResp.statusCode === 200) {\n return success(resp, proxyResp);\n }\n return abort404(resp, 'Proxy with: ' + proxyResp.statusCode);\n });\n}", "async handleResponse () {\n\t\tif (this.gotError) {\n\t\t\treturn super.handleResponse();\n\t\t}\n\n\t\t// return customized response data to New Relic\n\t\tthis.responseData = {\n\t\t\tpost: Utils.ToNewRelic(this.codeError, this.post, this.users)\n\t\t};\n\t\treturn super.handleResponse();\n\t}", "handleResponse(response) {\n let reqId = response.request_id;\n if (this.responseListeners.hasOwnProperty(reqId)) { // if there is a registered response listener\n this.responseListeners[reqId](response); // call the function\n delete this.responseListeners[reqId]; // then delete the listener\n };\n }", "function handleResponse(request,\n responseHandler) {\n if ((request.readyState == 4) &&\n (request.status == 200)) {\n responseHandler(request);\n }\n}", "function handleResponse(request,\n responseHandler) {\n if ((request.readyState == 4) &&\n (request.status == 200)) {\n responseHandler(request);\n }\n}", "callback(req, opts) {\n const { proxy, secureProxy } = this;\n const parsed = url_1.default.parse(req.path);\n if (!parsed.protocol) {\n parsed.protocol = 'http:';\n }\n if (!parsed.hostname) {\n parsed.hostname = opts.hostname || opts.host || null;\n }\n if (parsed.port == null && typeof opts.port) {\n parsed.port = String(opts.port);\n }\n if (parsed.port === '80') {\n // if port is 80, then we can remove the port so that the\n // \":80\" portion is not on the produced URL\n delete parsed.port;\n }\n // Change the `http.ClientRequest` instance's \"path\" field\n // to the absolute path of the URL that will be requested.\n req.path = url_1.default.format(parsed);\n // Inject the `Proxy-Authorization` header if necessary.\n if (proxy.auth) {\n req.setHeader('Proxy-Authorization', `Basic ${Buffer.from(proxy.auth).toString('base64')}`);\n }\n // create a socket connection to the proxy server\n let socket;\n if (secureProxy) {\n debug('Creating `tls.Socket`: %o', proxy);\n socket = tls_1.default.connect(proxy);\n }\n else {\n debug('Creating `net.Socket`: %o', proxy);\n socket = net_1.default.connect(proxy);\n }\n // At this point, the http ClientRequest's internal `_header` field\n // might have already been set. If this is the case then we'll need\n // to re-generate the string since we just changed the `req.path`.\n if (req._header) {\n let first;\n let endOfHeaders;\n debug('Regenerating stored HTTP header string for request');\n req._header = null;\n req._implicitHeader();\n if (req.output && req.output.length > 0) {\n // Node < 12\n debug('Patching connection write() output buffer with updated header');\n first = req.output[0];\n endOfHeaders = first.indexOf('\\r\\n\\r\\n') + 4;\n req.output[0] = req._header + first.substring(endOfHeaders);\n debug('Output buffer: %o', req.output);\n }\n else if (req.outputData && req.outputData.length > 0) {\n // Node >= 12\n debug('Patching connection write() output buffer with updated header');\n first = req.outputData[0].data;\n endOfHeaders = first.indexOf('\\r\\n\\r\\n') + 4;\n req.outputData[0].data =\n req._header + first.substring(endOfHeaders);\n debug('Output buffer: %o', req.outputData[0].data);\n }\n }\n return socket;\n }", "function run_request(req, reply){\n if(router){\n router(req, function(error, answer){\n if(error){\n logger.error(error);\n }\n reply(error, answer);\n }, function(){\n process.nextTick(function(){\n warehouse_proxy(req, reply); \n })\n })\n }\n else{\n process.nextTick(function(){\n warehouse_proxy(req, reply);\n })\n }\n }", "async _fileProxyHandler(serviceName, fileName, token) {\n let url\n try {\n // grab original service info\n let service = await this._gateway._waitForService(serviceName)\n\n let protocol = service.httpServer.https ? 'https://' : 'http://'\n\n url = protocol + service.httpServer.host +\n ':' + service.httpServer.port + '/' + fileName\n\n let response = await axios({\n url: url,\n method: 'get',\n responseType: 'arraybuffer'\n })\n\n this._io.emit('service:proxy:' + token, response.data)\n } catch (err) {\n this._io.emit('service:proxy:' + token, { err: 'failed to fetch file' })\n this.logger.warn('failed to fetch file at url %s', url)\n this.logger.info(err, 'failed to fetch file at url %s', url)\n }\n }", "function handleProxyRequest(requestInfo) {\n\tconst url = new URL(requestInfo.url);\n\tconst hostname = url.hostname\n\t\t.replace('www.', '')\n\t\t.replace(/(http(s?))\\:\\/\\//g, '')\n\t\t.replace('/', '');\n\n\tif (blockedHosts.indexOf(hostname) != -1) {\n\t\tconst proxyHost = proxyAddress.split(':')[0];\n\t\tconst proxyPort = proxyAddress.split(':')[1];\n\t\treturn { type: 'http', host: proxyHost, port: proxyPort };\n\t}\n\n\treturn { type: 'direct' };\n}", "handleSocks4IncomingConnectionResponse() {\n const data = this._receiveBuffer.get(8);\n if (data[1] !== constants_1.Socks4Response.Granted) {\n this._closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${constants_1.Socks4Response[data[1]]})`);\n }\n else {\n const buff = smart_buffer_1.SmartBuffer.fromBuffer(data);\n buff.readOffset = 2;\n const remoteHost = {\n port: buff.readUInt16BE(),\n host: ip.fromLong(buff.readUInt32BE())\n };\n this.state = constants_1.SocksClientState.Established;\n this.removeInternalSocketHandlers();\n this.emit('established', { socket: this._socket, remoteHost });\n }\n }", "function handleResponse(response) {\n\n var str = '';\n response.on('data', function (chunk) {\n // Add data as it returns.\n str += chunk;\n });\n\n response.on('end', function () {\n res.setHeader('Content-Type', 'application/json');\n res.setHeader('Access-Control-Allow-Origin', '*');\n res.end(str);\n\n });\n }", "get response() {\n return this.responseHandler.bind(this);\n }", "function handleResponse(response) {\n\n var str = '';\n response.on('data', function (chunk) {\n // Add data as it returns.\n str += chunk;\n });\n\n response.on('end', function () {\n res.setHeader('Content-Type', 'application/json');\n res.setHeader('Access-Control-Allow-Origin', '*');\n\n res.end(str);\n\n });\n }", "createResponse(name, handler) { throw new Error('Server is not configured use responses.'); }", "function httpUserRequest(userRequest, userResponse) {\n\n\tprintHeaderRequestHttp(userRequest);\n\tvar hostport = getHostPortFromString(userRequest.headers['host'], 80);\n\n\tFindProxyForURL(userRequest.url, hostport[0], function(err, res) {\n\t\tif (err)\n\t\t\tconsole.log(err);\n\n\t\t// → \"DIRECT\"\n\t\tif (res == 'DIRECT') {\n\t\t\tvar hostport = getHostPortFromString(userRequest.headers['host'], 80);\n\n\t\t\t// have to extract the path from the requested URL\n\t\t\tvar path = userRequest.url;\n\n\t\t\tresult = /^[a-zA-Z]+:\\/\\/[^\\/]+(\\/.*)?$/.exec(userRequest.url);\n\t\t\tif (result) {\n\t\t\t\tif (result[1].length > 0) {\n\t\t\t\t\tpath = result[1];\n\t\t\t\t} else {\n\t\t\t\t\tpath = \"/\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tdelete userRequest.headers[\"Proxy-Authorization\"];\n\t\t\tvar options = {\n\t\t\t 'host' : hostport[0],\n\t\t\t 'port' : hostport[1],\n\t\t\t 'method' : userRequest.method,\n\t\t\t 'path' : path,\n\t\t\t 'agent' : userRequest.agent,\n\t\t\t 'auth' : userRequest.auth,\n\t\t\t 'headers' : userRequest.headers\n\t\t\t};\n\t\t} else {\n\n\t\t\tvar overHeader = userRequest.headers;\n\t\t\toverHeader[\"Proxy-Authorization\"] = auth;\n\t\t\tvar hostport = getHostPortFromString(getUrlHeader(res), 80);\n\t\t\tvar options = {\n\t\t\t 'host' : hostport[0],\n\t\t\t 'port' : hostport[1],\n\t\t\t path : userRequest.url,\n\t\t\t headers : overHeader\n\t\t\t};\n\t\t}\n\n\t\tvar proxyRequest = http.request(options, function(proxyResponse) {\n\t\t\tprintHeaderResponsetHttp(proxyResponse);\n\t\t\tuserResponse.writeHead(proxyResponse.statusCode, proxyResponse.headers);\n\n\t\t\tproxyResponse.on('data', function(chunk) {\n\t\t\t\tif (debugging) {\n\t\t\t\t\tconsole.log(' < ' + chunk);\n\t\t\t\t}\n\t\t\t\tuserResponse.write(chunk);\n\t\t\t});\n\n\t\t\tproxyResponse.on('end', function() {\n\t\t\t\tif (debugging) {\n\t\t\t\t\tconsole.log(' < END');\n\t\t\t\t}\n\t\t\t\tuserResponse.end();\n\t\t\t});\n\t\t});\n\n\t\tproxyRequest.on('error', function(error) {\n\t\t\tuserResponse.writeHead(500);\n\t\t\tuserResponse.write(\"<h1>500 Error</h1>\\r\\n\" + \"<p>Error was <pre>\" + error + \"</pre></p>\\r\\n\" + \"</body></html>\\r\\n\");\n\t\t\tuserResponse.end();\n\t\t});\n\n\t\tuserRequest.on('data', function(chunk) {\n\t\t\tif (debugging) {\n\t\t\t\tconsole.log(' > ' + chunk);\n\t\t\t}\n\t\t\tproxyRequest.write(chunk);\n\t\t});\n\n\t\tuserRequest.on('end', function() {\n\t\t\tproxyRequest.end();\n\t\t});\n\t});\n}", "function Proxy(proxy_options) {\n this.options = process_options(proxy_options);\n //this.processor_class = processor_class ? new Processor(processor_class) : null;\n\n var that = this;\n\n var https_opts = {\n key: fs.readFileSync('www.github.com.key'),\n cert: fs.readFileSync('www.github.com.crt'),\n ca: fs.readFileSync('ca.crt'),\n SNICallback: getCredentialsContext\n };\n\n\n // HTTPS Virtual Server.\n\n var virtual_server_https = https.createServer(https_opts, function (request, response) {\n sys.log(\"http message to be handled.\")\n handle_request(that, request, response, \"https\");\n });\n\n virtual_server_https.addListener('error', function(err) {\n sys.log(\"error on virtual_server_https\");\n sys.log(err);\n });\n virtual_server_https.listen(this.options.virtual_server_https_port);\n if(this.options.verbose) console.log('https virtual server'.blue + ' started '.green.bold + 'on port '.blue + (\"\"+this.options.virtual_server_https_port).yellow);\n\n\n // HTTP Virtual Server\n var virtual_server_http = http.createServer(function(request, response) {\n sys.log(\"http message to be handled.\")\n handle_request(that, request, response, \"http\");\n });\n virtual_server_http.addListener('error', function(err) {\n sys.log(\"error on virutal_server_http\");\n sys.log(err);\n });\n\n // Handle connect request (for https), the client is attempting to upgrade to a https connection.\n virtual_server_http.addListener('upgrade', function(req, socket, upgradeHead) {\n sys.log(\"attempting to upgrade the connection.\")\n var proxy = net.createConnection(that.options.virtual_server_https_port, 'localhost');\n\n proxy.on('connect', function() {\n socket.write( \"HTTP/1.0 200 Connection established\\r\\nProxy-agent: Netscape-Proxy/1.1\\r\\n\\r\\n\");\n });\n\n // connect pipes\n proxy.on( 'data', function(d) { socket.write(d) });\n socket.on('data', function(d) { try { proxy.write(d) } catch(err) {}});\n\n proxy.on( 'end', function() { socket.end(); });\n socket.on('end', function() { proxy.end(); });\n\n proxy.on( 'close',function() { socket.end(); });\n socket.on('close',function() { proxy.end(); });\n\n proxy.on( 'error',function() { socket.end(); });\n socket.on('error',function() { proxy.end(); });\n });\n\n\n virtual_server_http.listen(this.options.virtual_server_http_port);\n if(this.options.verbose) console.log('http virtual server '.blue + 'started '.green.bold + 'on port '.blue + (\"\"+this.options.virtual_server_http_port).yellow);\n}", "function forward(){\n return function forward(req, res, next){\n var url = utils.processUrl(req);\n var options = {\n url: url,\n method: req.method,\n headers: req.headers\n }\n var buffers = [];\n var cachedResponse, cacheFile;\n\n req.__reqData = null;\n\n function checkIfCached() {\n cacheFile = _getCachedResponseFilePath( req );\n if ( ( cachedResponse = _getCachedResponse( req ) ) ) {\n log.info( 'cache hit: ' + cacheFile );\n res.statusCode = cachedResponse.statusCode;\n delete cachedResponse.headers[ 'Date' ];\n delete cachedResponse.headers[ 'date' ];\n cachedResponse.headers[ 'Date' ]\n = new Date().toGMTString();\n res.writeHead(\n cachedResponse.statusCode\n , cachedResponse.headers\n );\n res.write( cachedResponse.body );\n res.end();\n return true;\n }\n return false;\n }\n\n log.debug('forward: ' + url);\n \n if(utils.isContainBodyData(req.method)){\n req.on('data', function(chunk){\n buffers.push(chunk);\n });\n\n req.on('end', function(){\n options.data = Buffer.concat(buffers);\n req.__reqData = options.data;\n if ( checkIfCached() ) {\n return;\n }\n utils.request(options, function(err, data, proxyRes){\n _forwardHandler(err, data, proxyRes, req, res);\n });\n });\n }else{\n if ( checkIfCached() ) {\n return;\n }\n utils.request(options, function(err, data, proxyRes){\n _forwardHandler(err, data, proxyRes, req, res)\n }); \n }\n };\n}", "onProxyDeliver(data) {\n this.debug(`Proxy received ${inspect(data)}`);\n\n // Stops listening for events and removes the timeout\n this.removeHandlers();\n\n this.proxy = new ProxyLink(this, data);\n this.proxy.once(CLIENT_PROXY_LINK_TIMEOUT, this.onProxyLinkTimeout);\n\n this.pubsub.onceMessage(NETWORK_PROXY_DOWN, this.onProxyLinkDown);\n\n this.emit(USER_PROXY_READY, this.proxy);\n }", "function responseHandler(response, config) {\n if (!response.ok) {\n var err = new Error(response.statusText);\n err.config = config;\n return upgradeResponse(response, err).then(function (e) {\n throw e;\n });\n }\n\n return upgradeResponse(response, { config: config });\n}", "function http_server_cb(request, response) {\n\t// get the assertUrl from request\n\tvar reqUrl\t= require('url').parse(request.url)\n\tvar urlVars\t= require('querystring').parse(reqUrl.query)\n\tvar assetUrl\t= urlVars.url;\n\n\tvar assetPath\t= require('url').parse(assetUrl).pathname;\n\tvar assetBasename=require('path').basename(assetPath);\n\n\t// normal http proxying\n\tvar hostField\t\t= require('url').parse(assetUrl).host.split(':');\n\tvar proxy\t\t= http.createClient(hostField[1] || 80, hostField[0])\n\tvar proxyRequest\t= proxy.request(request.method, assetUrl, request.headers);\n\tproxyRequest.addListener('response', function(proxy_response) {\n\t\tproxy_response.addListener('data', function(chunk) {\n\t\t\tresponse.write(chunk, 'binary');\n\t\t});\n\t\tproxy_response.addListener('end', function() {\n\t\t\tresponse.end();\n\t\t});\n\n\t\t// modify the header to force the download of the asset\t\n\t\tproxy_response.headers['Content-Disposition']\t= \"attachment; filename=\"+assetBasename;\n\t\n\t\tresponse.writeHead(proxy_response.statusCode, proxy_response.headers);\n\t});\n\trequest.addListener('data', function(chunk) {\n\t\tproxyRequest.write(chunk, 'binary');\n\t});\n\trequest.addListener('end', function() {\n\t\tproxyRequest.end();\n\t});\n}", "function completeHandler(e) {\n console.log(\"received \" + e.responseCode + \" code\");\n var serverResponse = e.response;\n}", "function process_response(webservice_response, trip, callback) {\n// console.log('running process_response');\n var webservice_data = \"\";\n webservice_response.on('error', function (e) {\n console.log(e.message);\n callback('Error: ' + e.message);\n });\n webservice_response.on('data', function (chunk) {\n webservice_data += chunk;\n });\n\n webservice_response.on('end', function () {\n flight_data = JSON.parse(webservice_data);\n callback();\n });\n }", "function processResponse(){\n //\n }", "handleResponse(res) {\n if (res instanceof HttpResponse || res instanceof HttpErrorResponse) {\n if (this.tokenService.tokenOptions.apiBase === null || (res.url && res.url.match(this.tokenService.tokenOptions.apiBase))) {\n this.tokenService.getAuthHeadersFromResponse(res);\n }\n }\n }", "onProxyLinkDown() {\n this.debug('provider droped proxy, getting a new one');\n this.emit(USER_PROXY_DOWN, CLIENT_PROXY_LINK_DROP);\n this.proxy.stop();\n this.proxy = null;\n this.removeHandlers();\n this.getProxy();\n }", "function proxyNormalRequest(apiUrl, req, res) {\n getAccessToken(apiUrl, req, (error, accessToken, newAccessToken) => {\n // If our request failed then handle the error...\n if (error) {\n handleError(res, error);\n return;\n }\n\n if (newAccessToken && accessToken !== undefined) {\n // Set our cookie with the updated access token. This way we won’t\n // need to generate an access token for every request. We can use\n // this one for the next hour or so.\n res.setHeader(\n \"Set-Cookie\",\n cookie.serialize(\"access_token\", accessToken, cookieSettings),\n );\n }\n\n // Construct the actual HTTP request...\n const isHTTPS = apiUrl.protocol === \"https:\";\n const apiRequest = (isHTTPS ? https : http).request({\n protocol: apiUrl.protocol,\n hostname: apiUrl.hostname,\n port: apiUrl.port,\n agent: isHTTPS ? apiProxyAgent.https : apiProxyAgent.http,\n method: req.method,\n path: req.url,\n });\n\n apiRequest.on(\"error\", error => {\n handleError(res, error);\n });\n\n apiRequest.on(\"response\", handleResponse);\n\n // Copy headers we’re ok with proxying to our request options.\n for (let i = 0; i < req.rawHeaders.length; i += 2) {\n const header = req.rawHeaders[i];\n if (apiProxyHeaders.has(header.toLowerCase())) {\n apiRequest.setHeader(header, req.rawHeaders[i + 1]);\n }\n }\n\n // Add an authorization header with our access token (from a cookie) to the\n // API request.\n if (accessToken !== undefined) {\n apiRequest.setHeader(\"Authorization\", `Bearer ${accessToken}`);\n }\n\n // Add the `Forwarded` header to our request so the API server knows who\n // the request was originally from.\n apiRequest.setHeader(\"Forwarded\", getForwardedHeader(req));\n\n // Pipe the body we received into the proxy request body.\n req.pipe(apiRequest);\n\n // When we get a response pipe it to our actual HTTP response so our browser\n // can use it.\n function handleResponse(apiResponse) {\n // Copy the status code and headers from our proxy response.\n res.statusCode = apiResponse.statusCode;\n for (let i = 0; i < apiResponse.rawHeaders.length; i += 2) {\n res.setHeader(apiResponse.rawHeaders[i], apiResponse.rawHeaders[i + 1]);\n }\n\n // Send the body to our actual response.\n apiResponse.pipe(res);\n }\n });\n}", "attachTo(proxy) {\n proxy.on('proxyRes', (proxyRes, req) => {\n if (req.method !== 'POST' || req.path !== '/api/v1/plugins/') {\n return;\n }\n if (proxyRes.statusCode !== 201 || proxyRes.statusMessage !== 'Created') {\n print(colors.bold(colors.red('Store upload failed: '\n + `${proxyRes.statusCode} ${proxyRes.statusMessage}`)));\n return;\n }\n const buffer = [];\n proxyRes.on('data', chunk => buffer.push(chunk));\n proxyRes.on('end', () => {\n const body = JSON.parse(Buffer.concat(buffer).toString());\n this.registerAndRun(body);\n });\n });\n }", "function emitResponse(responseObserver, req, resOptions) {\n resOptions.url = resOptions.url || req.url; // make sure url is set\n resOptions = setStatusText(resOptions);\n var res = new _angular_http.Response(resOptions);\n if (isSuccess(res.status)) {\n responseObserver.next(res);\n responseObserver.complete();\n }\n else {\n responseObserver.error(res);\n }\n}", "callback(req, opts) {\n return __awaiter(this, void 0, void 0, function* () {\n const { secureEndpoint } = opts;\n // First, get a generated `FindProxyForURL()` function,\n // either cached or retrieved from the source\n const resolver = yield this.getResolver();\n // Calculate the `url` parameter\n const defaultPort = secureEndpoint ? 443 : 80;\n let path = req.path;\n let search = null;\n const firstQuestion = path.indexOf('?');\n if (firstQuestion !== -1) {\n search = path.substring(firstQuestion);\n path = path.substring(0, firstQuestion);\n }\n const urlOpts = Object.assign(Object.assign({}, opts), { protocol: secureEndpoint ? 'https:' : 'http:', pathname: path, search, \n // need to use `hostname` instead of `host` otherwise `port` is ignored\n hostname: opts.host, host: null, href: null, \n // set `port` to null when it is the protocol default port (80 / 443)\n port: defaultPort === opts.port ? null : opts.port });\n const url = url_1.format(urlOpts);\n debug('url: %o', url);\n let result = yield resolver(url);\n // Default to \"DIRECT\" if a falsey value was returned (or nothing)\n if (!result) {\n result = 'DIRECT';\n }\n const proxies = String(result)\n .trim()\n .split(/\\s*;\\s*/g)\n .filter(Boolean);\n if (this.opts.fallbackToDirect && !proxies.includes('DIRECT')) {\n proxies.push('DIRECT');\n }\n for (const proxy of proxies) {\n let agent = null;\n let socket = null;\n const [type, target] = proxy.split(/\\s+/);\n debug('Attempting to use proxy: %o', proxy);\n if (type === 'DIRECT') {\n // Direct connection to the destination endpoint\n socket = secureEndpoint ? tls_1.default.connect(opts) : net_1.default.connect(opts);\n }\n else if (type === 'SOCKS' || type === 'SOCKS5') {\n // Use a SOCKSv5h proxy\n agent = new socks_proxy_agent_1.SocksProxyAgent(`socks://${target}`);\n }\n else if (type === 'SOCKS4') {\n // Use a SOCKSv4a proxy\n agent = new socks_proxy_agent_1.SocksProxyAgent(`socks4a://${target}`);\n }\n else if (type === 'PROXY' ||\n type === 'HTTP' ||\n type === 'HTTPS') {\n // Use an HTTP or HTTPS proxy\n // http://dev.chromium.org/developers/design-documents/secure-web-proxy\n const proxyURL = `${type === 'HTTPS' ? 'https' : 'http'}://${target}`;\n const proxyOpts = Object.assign(Object.assign({}, this.opts), url_1.parse(proxyURL));\n if (secureEndpoint) {\n agent = new https_proxy_agent_1.HttpsProxyAgent(proxyOpts);\n }\n else {\n agent = new http_proxy_agent_1.HttpProxyAgent(proxyOpts);\n }\n }\n try {\n if (socket) {\n // \"DIRECT\" connection, wait for connection confirmation\n yield once_1.default(socket, 'connect');\n req.emit('proxy', { proxy, socket });\n return socket;\n }\n if (agent) {\n const s = yield agent.callback(req, opts);\n req.emit('proxy', { proxy, socket: s });\n return s;\n }\n throw new Error(`Could not determine proxy type for: ${proxy}`);\n }\n catch (err) {\n debug('Got error for proxy %o: %o', proxy, err);\n req.emit('proxy', { proxy, error: err });\n }\n }\n throw new Error(`Failed to establish a socket connection to proxies: ${JSON.stringify(proxies)}`);\n });\n }", "function callResponseMiddleware(err, res1, res2) {\n i -= 1;\n if (i >= 0) {\n var next = self.middlewares[i].response;\n if (typeof next === 'function') {\n next(req, err, res1, res2, callResponseMiddleware);\n } else {\n // skip this middleware if it doesn't implement response\n callResponseMiddleware(err, res1, res2);\n }\n } else {\n callback(req, err, res1, res2);\n }\n }", "function onRequest(ctx, callback)\n{\n if (/[\\?\\&]x-fp-bp-xhr$/.test(ctx.clientToProxyRequest.url)){\n const param_len=\"x-fp-bp-xhr\".length +1;\n ctx.clientToProxyRequest.url =\n ctx.clientToProxyRequest.url.slice(0, -param_len);\n console.log(\"sliced url=%s\", ctx.clientToProxyRequest.url);\n ctx.no_inject = true;\n }\n\n const headers = ctx.clientToProxyRequest.headers;\n const host = headers[\"host\"];\n const fullUrl = '//' + host + ctx.clientToProxyRequest.url;\n\n\n const isFakeServer = fullUrl.startsWith(\"//www.example.com\");\n\n if (isFakeServer || fullUrl.startsWith(\"//www.forcepoint.com/blockpage_poc\")){\n const url = ctx.clientToProxyRequest.url;\n const ext = url.split('.').pop();\n const fname = url.split('/').pop();\n const mimeType = mime.getType(ext);\n\n const headers = {\n 'Content-Type': mimeType,\n 'Access-Control-Allow-Origin': '*'\n };\n\n\n let responseCode = 200;\n let content = \"\";\n try{\n console.log(\"reading file '%s'\", fname);\n content = fs.readFileSync(fname);\n } catch (err) {\n responseCode = 404;\n content=`error 404 ${fname} not found`;\n }\n\n if (isFakeServer){\n // const INJECTED_URL_DATA2 =\n // '<!DOCTYPE html><meta http-equiv=\"Content-Security-Policy\" content=\"script-src https://www.forcepoint.com\"/><script src=\"https://www.forcepoint.com/blockpage_poc/clientpoc.js\"></script>\\n';\n\n headers[\"Content-Security-Policy\"] = [\"script-src 'self' https://code.jquery.com 'sha256-GoCTp92A/44wB06emgkrv9wmZJA7kgX/VK3D+9jr/Pw='\", \"script-src https://www.forcepoint.com\"];\n\n }\n\n ctx.proxyToClientResponse.writeHead(responseCode, headers);\n ctx.proxyToClientResponse.end(content);\n return null;\n }\n\n if (ENABLE_COMPRESSION){\n ctx.use(Proxy.gunzip);\n }else{\n ctx.proxyToServerRequestOptions.headers['accept-encoding'] = 'identity';\n }\n return callback();\n}", "function onResponse (connection, message) {\n let key = message.key\n\n // Only the hub routes responses\n if (message.channel && connection._cluster) {\n // Get channel from message\n let channel = message.channel\n delete message.channel\n\n // Get worker (id) for channel\n let worker = connection._workers[channel]\n\n // Be verbose when needed.\n debug('Forwarding response for %s to Channel %s', key, channel)\n\n // Forward message to the worker\n connection._cluster.workers[worker].send(message)\n // Only if we have a callback do we proceed.\n } else if (connection._worker && connection._callbacks[key]) {\n // Get fn from available callbacks\n let fn = connection._callbacks[key]\n delete connection._callbacks[key]\n\n // Check (only) begining of load for an error object\n message.load[0] = checkForError(message.load[0])\n\n // NOTE: Maybe implement a response object bound to `this` in callback?\n\n debug('Opening response for %s on Channel %s', key, connection.channel)\n\n // Fire callback next\n process.nextTick(fn.bind.apply(fn, [fn].concat(message.load)))\n // Lost responses (while debugging)\n } else {\n debug('Lost response for request %s', key)\n }\n}", "function handleResponse(res) {\n // Handle errors\n if (res.error) {\n // Log if not cancellation\n if (!Crisp.isCancel(res.error)) {\n // TODO\n console.error(res.error);\n }\n return;\n }\n\n // Handle payload\n showProducts(res.payload);\n }", "_passToHandler(response) {\n if (this._task) {\n this._task.responseHandler(response, this._task.resolver);\n }\n // Errors other than FTPError always close the client. If there isn't an active task to handle the error,\n // the next one submitted will receive it using `_closingError`.\n // There is only one edge-case: If there is an FTPError while no task is active, the error will be dropped.\n // But that means that the user sent an FTP command with no intention of handling the result. So why should the\n // error be handled? Maybe log it at least? Debug logging will already do that and the client stays useable after\n // FTPError. So maybe no need to do anything here.\n }", "function handlerResponse(request, responseHandler, isJsonResponse) {\n if ((request.readyState == 4) && (request.status == 200)) {\n\n // Default to isJsonResponse = true\n if (isJsonResponse == undefined) {\n isJsonResponse = true;\n }\n if (isJsonResponse) {\n responseHandler(JSON.parse(request.responseText));\n } else {\n responseHandler(request.responseText);\n }\n }\n }", "function proxyHandler(args, handler) {\n console.log(\"proxy(\" + args[1] + \",\" + args[2] + \")\");\n }", "function Handler(res, client, clientCookie, Command) {\n\n // Send request to WinCC Unified RunTime \n // \n client.write(Command);\n\n console.log('Already send the ReadTag command. ' + (new Date()));\n console.log(\"CilentCookie: \" + clientCookie);\n\n const rl = readline.createInterface({\n input: client,\n crlfDelay: Infinity\n });\n\n // Listen for event \"line\"\n // \n rl.on('line', (line) => {\n\n // Convert the WinCC Unified Runtime response to JSON Format\n // Send to the Cilent\n // \n let obj = JSON.parse(line); \n res.send(obj);\n \n var endDateTime = GetCurrentTime();\n console.log(\"The result is sent to the client \" + endDateTime + \"\\r\\n\" + 'Listening on port 4000...' + \"\\r\\n\");\n\n res.end();\n });\n}", "function proxyServer(req,res){\n\tclient.rpoplpush(\"vistedSites\",\"redirectports\",function(error,value){\n\t\tconsole.log(\" redirected to port :\" + value)\n\t\tres.redirect(\"http://localhost:\"+value+req.url);\n\t});\n\tclient.rpoplpush(\"redirectports\",\"vistedSites\")\n}", "process(res) {\n if (res.params.skip && res.params.skip.some(item => item === res.data.resCode)) {\n res.ok = true;\n } else if (this[res.data.resCode]) {\n res.ok = this[res.data.resCode](res);\n } else if (res.data.res === eid.err.type) {\n // Unknown error\n res.ok = false;\n logger.error(res);\n this.eUnknown();\n } else if (res.data.res === eid.warn.type) {\n // Unknown warn\n res.ok = true;\n logger.warn(res);\n } else {\n res.ok = true;\n logger.info(res.data);\n }\n }", "function proxyRequest(msg) {\n\treturn true\n}", "responseHandler(res, retObj) {\n const outString = JSON.stringify(retObj)\n res.writeHead(retObj.error? 500:200, {\n 'Access-Control-Allow-Origin': this.acao,\n 'Content-Length': Buffer.byteLength(outString, 'utf8'),\n 'Content-Type': 'application/json;charset=utf-8'\n })\n res.end(outString)\n }", "function handleResponse(request, responseHandler, isJsonResponse) {\n\tif ((request.readyState == 4) && (request.status == 200)) {\n \t// Default to isJsonResponse = true\n \tif (isJsonResponse == undefined) {\n \t\tisJsonResponse = true;\n \t}\n\n \tif (isJsonResponse) {\n \t\tresponseHandler(JSON.parse(request.responseText));\n \t} else {\n \t\tresponseHandler(request.responseText);\n \t}\n }\n}", "function cm_engine_xhr_reply(_xid, _cname){\n\t\tvar _nid = _xid;\n\t\tif(typeof(_xid)=='string') _nid = stdlib.importxid(_xid);\n\n//@DEBUG-START\n//DEBUG stdlib.logit(\"Reply start on (\"+_xid+\", \"+_cname+\")\");\n//@DEBUG-END\n\n\t\t// obter componente\n\t\tvar _component = cm_getcomponent(_nid, _cname);\n\t\tif('object' != typeof(_component)) return false;\n\n//DEBUG stdlib.logit(\"cm_engine_xhr_reply(\"+_xid+\", \"+_cname+\") continue 1\");\n\n\t\t// analise de motor zumbi\n\t\tif(!cm_anchored(_component)){\n\t\t\t// para motor\n\t\t\t_component.xstatus = 11;\t// sem ancora\n\t\t\t_component.xhttp.onreadystatechange=false;\n\t\t\tcm_engine_stop(_nid, _cname);\n\n\t\t\t_component.errno = 20001;\n\n//@DEBUG-START\n//DEBUG stdlib.logit(\"cm_engine_xhr_reply(\"+_xid+\"[\"+typeof(_xid)+\"], cname=\"+_cname+\") anchored failure\");\n//@DEBUG-END\n\n\t\t\t// abortar continuacao\n\t\t\treturn false;\n\t\t}\n\n//DEBUG stdlib.logit(\"cm_engine_xhr_reply(\"+_xid+\", \"+_cname+\") continue 2\");\n\n\t\t// motor assassinado previamente\n\t\tif('object'!=typeof(_component.xhttp)){\n\t\t\t_component.xstatus = 12;\t// motor parado em transito\n\n\t\t\t_component.errno = 20002;\n//@DEBUG-START\n//DEBUG stdlib.logit(\"cm_engine_xhr_reply(\"+_xid+\"[\"+typeof(_xid)+\"], cname=\"+_cname+\") engine failure\");\n//@DEBUG-END\n\n\t\t\treturn;\n\t\t}\n\n//DEBUG stdlib.logit(\"cm_engine_xhr_reply(\"+_xid+\", \"+_cname+\") continue 3\");\n\n\t\t// * Iniciar tratamento do retorno\n\t\tvar _rs = _component.xhttp.readyState;\n\t\tvar http_status = 0;\n\t\t_component.xhttp.xstatus = _rs;\n\n\t\t// atualizar ultima resposta do xhttp\n\t\t_component.lastreply = stdlib.microtime();\n\n\t\t// invocar evento de alteracao de status, reposta FALSE do programador aborta a continuacao\n\t\tif(!cm_event(_nid, _cname, 'onstatuschange', true)){\n\t\t\t_component.xhttp.xstatus = 6;\n\t\t\t_component.errno = 20003;\n//@DEBUG-START\n//DEBUG stdlib.logit(\"cm_engine_xhr_reply(\"+_xid+\"[\"+typeof(_xid)+\"], cname=\"+_cname+\") onstatuschange aborted\");\n//@DEBUG-END\n\n\t\t\treturn;\n\t\t}\n\n//DEBUG stdlib.logit(\"cm_engine_xhr_reply(\"+_xid+\", \"+_cname+\") continue 4 FINAL rs=\"+_rs);\n\n\n\t\t// processar resposta\n\t\t// 0 - unset\n\t\t// 1 - prepare\n\t\t// 2 - follow headers\n\t\t// 3 - receive start\n\t\t// 4 - body done\n\t\tswitch(_rs){\n\t\t\tcase 0:\n\t\t\tcase 1:\n\t\t\tcase 2:\n\t\t\tcase 3:\n\t\t\t\treturn;\n\t\t\t\tbreak;\n\t\t\tcase 4:\t// corpo do documento recebido\n\n\n\t\t\t\t// servidor respondeu\n\t\t\t\t_component.stoptime = stdlib.microtime();\n\t\t\t\t_component.ping = _component.stoptime - _component.playtime;\n\n\t\t\t\t// finalizar cronometro de timeout e\n\t\t\t\t// finalizar todos os cronometros\n\t\t\t\tcm_engine_untimer(_nid, _cname);\n\n\n// -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\n// processar protocolo HTTP - status da resposta\n\t\t\t\thttp_status = _component.xhttp.status;\n\t\t\t\t_component.http_status = stdlib.unlink(http_status);\n\n//@DEBUG-START\n//stdlib.logit(\"REPLIED (\"+_xid+\") ping=\"+_component.ping+\" status=\"+http_status);\n//@DEBUG-END\n\n\t\t\t\t// analise de resposta recebida com sucesso\n\t\t\t\tif(http_status==200){\n\t\t\t\t\tvar _process_data = true;\n\t\t\t\t\t\n\t\t\t\t\t// avaliar alteracao de dados\n\t\t\t\t\tif(_component.modified){\n\t\t\t\t\t\t// comparar textos\n\t\t\t\t\t\tif(_component.content==_component.xhttp.responseText)\n\t\t\t\t\t\t\t_process_data = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// destruir dados temporarios\n\t\t\t\t\t_component.tdata = false;\n\n\t\t\t\t\t// contar respostas apenas quando atendidas com sucesso\n\t\t\t\t\t_component.stats.replies++;\n\t\t\t\t\t//cm_engine_globals.stats.replies++;\n\n\t\t\t\t\t// executar processamento dos dados recebidos\n\t\t\t\t\tif(_process_data){\n\t\t\t\t\t\t// analise por tipo de dado desejado\n\t\t\t\t\t\tswitch(_component.datatype){\n\t\t\t\t\t\t\tcase 'json':\n\t\t\t\t\t\t\t\t_component.json = {};\n\t\t\t\t\t\t\t\tif(_component.xhttp.responseText!=''){\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t_component.json = stdlib.json_parser(_component.xhttp.responseText);\n\t\t\t\t\t\t\t\t\t} catch(e){\n\t\t\t\t\t\t\t\t\t\t_component.json = {};\n\t\t\t\t\t\t\t\t\t\t_component.content = _component.xhttp.responseText;\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\t\t\tcase 'xml':\n\t\t\t\t\t\t\t\t_component.xml = _component.xhttp.responseXML;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'integer':\n\t\t\t\t\t\t\t\t_component.integer = stdlib.toint(_component.xhttp.responseText);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'float':\n\t\t\t\t\t\t\t\t_component.float = stdlib.tofloat(_component.xhttp.responseText);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'xhr':\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t// texto html/text\n\t\t\t\t\t\t\t\t_component.datatype = 'html';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// armazenar o texto em modos html e com verificacao de modified\n\t\t\t\t\t\tif(_component.modified ||\n\t\t\t\t\t\t\t_component.datatype == 'html' || _component.datatype == 'xhr' || _component.datatype == 'text')\n\t\t\t\t\t\t\t_component.content = _component.xhttp.responseText;\n\n\t\t\t\t\t\t// evento mestre de recepcao de dados\n\t\t\t\t\t\t// - ANTES DE JRPC:\n\t\t\t\t\t\t// cm_engine_reply(_nid, _cname);\n\t\t\t\t\t}\n\n\t\t\t\t\t// preencher DOMID com o conteudo obtido do site\n\t\t\t\t\tif(_component.inner)\n\t\t\t\t\t\tif(_component.domid!='')\n\t\t\t\t\t\t\tif(_process_data)\n\t\t\t\t\t\t\t\tstdlib.set_html(_component.domid, _component.xhttp.responseText);\n\t\t\t\t\t\t\t//-\n\t\t\t\t\t\t//-\n\t\t\t\t\t//-\n\t\t\t\t\t// codigo RPC javascript\t\t\t\t\n\t\t\t\t\tif(_process_data)\n\t\t\t\t\t\tif(_component.exec)\n\t\t\t\t\t\t\tstdlib.js_run(_component.xhttp.responseText);\n\n\t\t\t\t\t// funcao de reply do componente - apos implementacao de JRPC\n\t\t\t\t\tif(_process_data)\n\t\t\t\t\t\tcm_engine_reply(_nid, _cname);\n\t\t\t\t\t//-\n\n\t\t\t\t\t// status de solicitacao atendida\n\t\t\t\t\t_component.xstatus = 5;\n\t\t\t\t\n\t\t\t\t// if = 200\n\t\t\t\t}else{\n\t\t\t\t\t// resposta invalida no ponto de vista da informacao\n\t\t\t\t\t_component.xstatus = 10;\n\t\t\t\t\t// reportar erro\n\t\t\t\t\tif(stdlib.isfunction(_component.onerror)) _component.onerror(_nid, http_status, 'http_error');\n\t\t\t\t}\n\t\t\t\t// analise de funcoes para tratamento por tipo de resposta\n\t\t\t\tcm_engine_statuscode(_nid, _cname, http_status);\n\n// -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\n\n\t\t\t\t// aniquilar motor encerrado\n\t\t\t\tcm_engine_stop(_nid, _cname);\n\n\t\t\t\t// processamento de interval\n\t\t\t\tcm_engine_interval(_nid, _cname);\n\n\t\t\t\tbreak;\n\t\t}\n\t}", "function doProxy(self, args, callback)\n{\n if(!args || !args.path ||!args.hashname) return callback(\"no path or hashname\");\n self.doLine(args.hashname, function(err){\n if(err) return callback(\"line failed\");\n\n // create stream and handle responses\n var res = {};\n var body = new Buffer(0);\n var stream = doStream(self, args.hashname, function(err, packet, cbStream){\n if(packet.body) body = Buffer.concat([body, packet.body]);\n if(packet.js.res)\n {\n res.statusCode = packet.js.res.s || 500;\n res.headers = packet.js.res.h || {};\n }\n if(packet.js.end) callback(null, res, body);\n cbStream();\n });\n \n // send request, TODO support a streaming interface\n var js = {end:true, req:{}};\n js.req.p = args.path;\n js.req.m = args.method || \"GET\";\n if(args.headers) js.req.h = args.headers;\n stream.send(js, args.body);\n });\n}", "function handleAuthzCallBack(authzResponse){\n if (authzResponse && authzResponse.status === \"success\") {\n hintToShowPage = authzResponse.content.hint;\n if(hintToShowPage === \"SHOW_CONSENT\"){\n authzData = authzResponse.content.oauth2Data;\n }\n else { \t\n authzData = authzResponse.content.data;\n authzData.forEach(function(authzDataObj) {\n if (authzDataObj.type === \"location\") {\n FINAL_REDIRECT = authzDataObj.value;\n }\n });\n } \n }else{\n hintToShowPage = authzResponse.content.hint;\n authzData = authzResponse.content.error;\n //TODO : parse response to get data to show error page : 401, 400, 302 with invalid scope\n }\n showAuthzViewBasedOnHint(hintToShowPage);\n}", "callback(req, opts) {\n return __awaiter(this, void 0, void 0, function* () {\n const { proxy, secureProxy } = this;\n const parsed = url_1.default.parse(req.path);\n if (!parsed.protocol) {\n parsed.protocol = 'http:';\n }\n if (!parsed.hostname) {\n parsed.hostname = opts.hostname || opts.host || null;\n }\n if (parsed.port == null && typeof opts.port) {\n parsed.port = String(opts.port);\n }\n if (parsed.port === '80') {\n // if port is 80, then we can remove the port so that the\n // \":80\" portion is not on the produced URL\n parsed.port = '';\n }\n // Change the `http.ClientRequest` instance's \"path\" field\n // to the absolute path of the URL that will be requested.\n req.path = url_1.default.format(parsed);\n // Inject the `Proxy-Authorization` header if necessary.\n if (proxy.auth) {\n req.setHeader('Proxy-Authorization', `Basic ${Buffer.from(proxy.auth).toString('base64')}`);\n }\n // Create a socket connection to the proxy server.\n let socket;\n if (secureProxy) {\n debug('Creating `tls.Socket`: %o', proxy);\n socket = tls_1.default.connect(proxy);\n }\n else {\n debug('Creating `net.Socket`: %o', proxy);\n socket = net_1.default.connect(proxy);\n }\n // At this point, the http ClientRequest's internal `_header` field\n // might have already been set. If this is the case then we'll need\n // to re-generate the string since we just changed the `req.path`.\n if (req._header) {\n let first;\n let endOfHeaders;\n debug('Regenerating stored HTTP header string for request');\n req._header = null;\n req._implicitHeader();\n if (req.output && req.output.length > 0) {\n // Node < 12\n debug('Patching connection write() output buffer with updated header');\n first = req.output[0];\n endOfHeaders = first.indexOf('\\r\\n\\r\\n') + 4;\n req.output[0] = req._header + first.substring(endOfHeaders);\n debug('Output buffer: %o', req.output);\n }\n else if (req.outputData && req.outputData.length > 0) {\n // Node >= 12\n debug('Patching connection write() output buffer with updated header');\n first = req.outputData[0].data;\n endOfHeaders = first.indexOf('\\r\\n\\r\\n') + 4;\n req.outputData[0].data =\n req._header + first.substring(endOfHeaders);\n debug('Output buffer: %o', req.outputData[0].data);\n }\n }\n // Wait for the socket's `connect` event, so that this `callback()`\n // function throws instead of the `http` request machinery. This is\n // important for i.e. `PacProxyAgent` which determines a failed proxy\n // connection via the `callback()` function throwing.\n yield (0, once_1.default)(socket, 'connect');\n return socket;\n });\n }", "callback(req, opts) {\n return __awaiter(this, void 0, void 0, function* () {\n const { proxy, secureProxy } = this;\n const parsed = url_1.default.parse(req.path);\n if (!parsed.protocol) {\n parsed.protocol = 'http:';\n }\n if (!parsed.hostname) {\n parsed.hostname = opts.hostname || opts.host || null;\n }\n if (parsed.port == null && typeof opts.port) {\n parsed.port = String(opts.port);\n }\n if (parsed.port === '80') {\n // if port is 80, then we can remove the port so that the\n // \":80\" portion is not on the produced URL\n delete parsed.port;\n }\n // Change the `http.ClientRequest` instance's \"path\" field\n // to the absolute path of the URL that will be requested.\n req.path = url_1.default.format(parsed);\n // Inject the `Proxy-Authorization` header if necessary.\n if (proxy.auth) {\n req.setHeader('Proxy-Authorization', `Basic ${Buffer.from(proxy.auth).toString('base64')}`);\n }\n // Create a socket connection to the proxy server.\n let socket;\n if (secureProxy) {\n debug('Creating `tls.Socket`: %o', proxy);\n socket = tls_1.default.connect(proxy);\n }\n else {\n debug('Creating `net.Socket`: %o', proxy);\n socket = net_1.default.connect(proxy);\n }\n // At this point, the http ClientRequest's internal `_header` field\n // might have already been set. If this is the case then we'll need\n // to re-generate the string since we just changed the `req.path`.\n if (req._header) {\n let first;\n let endOfHeaders;\n debug('Regenerating stored HTTP header string for request');\n req._header = null;\n req._implicitHeader();\n if (req.output && req.output.length > 0) {\n // Node < 12\n debug('Patching connection write() output buffer with updated header');\n first = req.output[0];\n endOfHeaders = first.indexOf('\\r\\n\\r\\n') + 4;\n req.output[0] = req._header + first.substring(endOfHeaders);\n debug('Output buffer: %o', req.output);\n }\n else if (req.outputData && req.outputData.length > 0) {\n // Node >= 12\n debug('Patching connection write() output buffer with updated header');\n first = req.outputData[0].data;\n endOfHeaders = first.indexOf('\\r\\n\\r\\n') + 4;\n req.outputData[0].data =\n req._header + first.substring(endOfHeaders);\n debug('Output buffer: %o', req.outputData[0].data);\n }\n }\n // Wait for the socket's `connect` event, so that this `callback()`\n // function throws instead of the `http` request machinery. This is\n // important for i.e. `PacProxyAgent` which determines a failed proxy\n // connection via the `callback()` function throwing.\n yield once_1.default(socket, 'connect');\n return socket;\n });\n }", "function processTransactionResponse(arg0) {\n\n var bc = arg0.badcookie || false,\n ioResponseObj = arg0.resp,\n responseData = arg0.responseData,\n cb = arg0.cb,\n txId = arg0.id,\n status = ioResponseObj.status,\n rd = '',\n r = ERROR,\n responseText,\n contentType;\n\n // TODO: What about 304 (Not changed) ?\n if (status !== 200 && status !== 201 && status !== OK) {\n\n // Y.log('Error response received from server.', 'warn', NAME);\n // this is an error case\n // server failure single '=' just in case we get a '200' string\n if (status === 0) {\n r = (ioResponseObj.statusText === E_TIMEOUT) ?\n E_TIMEOUT :\n E_ABORT;\n } else {\n rd = E_SERVER;\n _errorReporter.error(E_SERVER, 'A server error occurred: ',\n { responseObject: ioResponseObj });\n }\n\n completeRequest.call(this, {\n txId: txId,\n method: FAILURE_CB,\n result: r,\n resultDetail: rd + ' ' + status,\n cb: cb\n });\n } else {\n //not an error\n // Y.log('Valid response received, processing...', 'warn', NAME);\n\n responseText = ioResponseObj.responseText;\n contentType = ioResponseObj.getResponseHeader('Content-Type');\n\n // Test here is faster than regex.\n if (contentType.indexOf('Multipart/Related') !== -1) {\n reportUnsupportedOperation('multi-part response');\n completeRequest.call(this, {\n cb: cb,\n method: FAILURE_CB,\n result: ERROR,\n resultDetail: E_RESULT_BADFORMAT\n });\n return;\n }\n\n _responseProcessor.processResponse(responseData.resps[0],\n { cb: cb }, bc);\n }\n }", "intercept(req, next) {\n if (req.method === 'JSONP') {\n return this.jsonp.handle(req);\n }\n // Fall through for normal HTTP requests.\n return next.handle(req);\n }", "intercept(req, next) {\n if (req.method === 'JSONP') {\n return this.jsonp.handle(req);\n }\n // Fall through for normal HTTP requests.\n return next.handle(req);\n }", "intercept(req, next) {\n if (req.method === 'JSONP') {\n return this.jsonp.handle(req);\n }\n // Fall through for normal HTTP requests.\n return next.handle(req);\n }", "intercept(req, next) {\n if (req.method === 'JSONP') {\n return this.jsonp.handle(req);\n }\n // Fall through for normal HTTP requests.\n return next.handle(req);\n }", "intercept(req, next) {\n if (req.method === 'JSONP') {\n return this.jsonp.handle(req);\n }\n // Fall through for normal HTTP requests.\n return next.handle(req);\n }", "handleResponseInParent(data, element) {\n let that = this;\n let res = data.response;\n if (res.classify === 'success') {\n let closeModal = (typeof res.sets.closePrevModal === 'undefined') ? true : res.sets.closePrevModal;\n let closeDrawer = (typeof res.sets.closePrevDrawer === 'undefined') ? true : res.sets.closePrevDrawer;\n closeModal && that.modalOnCancel();\n closeDrawer && that.drawerOnCancel();\n }\n that.cnf.v.$nextTick(function () {\n that.response(res).then(() => {\n bsw.responseLogic(res);\n }).catch(reason => {\n console.warn(reason);\n });\n });\n }", "handleWorkerResponse (e)\n {\n if (e.data.error)\n {\n // {corrId: i, error: s} where s is is a String, i an int.\n // we just pass errors on.\n this.valueReceivers[ e.data.corrId ]( e.data );\n }\n else if ( e.data.result )\n {\n // {corrId: i, result: s} where s is an Array of String, i an int.\n // pass the result on\n this.valueReceivers[ e.data.corrId ]( e.data );\n }\n // Then we have a category of incoming messages that originate in the service worker itself,\n // often in response to a specific request sent by the proxy.\n else if ( e.data.serviceWorkerMessage )\n {\n // {serviceWorkerMessage: m, <field>: <value>} where m is a string. The object may contain any number of other fields, depending on the type of message (i.e. the value of m).\n switch( e.data.serviceWorkerMessage )\n {\n case \"channelId\":\n // This actually is a response that is not provoked by explicitly asking for it.\n // As soon as the SharedWorker receives a port from this proxy, it will return the channels id.\n // {serviceWorkerMessage: \"channelId\", channelId: i} where i is a multiple of a million.\n // Handle the port identification message that is sent by the service worker.\n this.channelIdResolver( e.data.channelId );\n break;\n case \"isUserLoggedIn\":\n // {serviceWorkerMessage: \"isUserLoggedIn\", isUserLoggedIn: b} where b is a boolean.\n this.valueReceivers.isUserLoggedIn( e.data.isUserLoggedIn );\n break;\n case \"resetAccount\":\n // {serviceWorkerMessage: \"resetAccount\", resetSuccesful: b} where b is a boolean.\n this.valueReceivers.resetAccount( e.data.resetSuccesful );\n break;\n case \"recompileBasicModels\":\n // {serviceWorkerMessage: \"recompileBasicModels\", recompileSuccesful: b} where b is a boolean.\n this.valueReceivers.recompileBasicModels( e.data.recompileSuccesful );\n break;\n case \"removeAccount\":\n // {serviceWorkerMessage: \"removeAccount\", removeSuccesful: b} where b is a boolean.\n this.valueReceivers.removeAccount( e.data.removeSuccesful );\n break;\n case \"runPDR\":\n // {serviceWorkerMessage: \"runPDR\", error: e }\n this.valueReceivers.runPDR( e );\n break;\n case \"createAccount\":\n // {serviceWorkerMessage: \"createAccount\", createSuccesful: b} where b is a boolean.\n this.valueReceivers.createAccount( e.data.createSuccesful );\n break;\n }\n }\n }", "function handleResponse(response) {\n var data = response.data;\n var statusCode = response.status;\n \n /* Set an error message and class on request failure or on receiving invalid data */\n var errorMessage = null;\n var errorClass = undefined;\n if (statusCode < 200 || statusCode >= 400) {\n var serverErrorMessage = data && data[\"error-message\"] || response.statusText;\n if (serverErrorMessage) {\n errorMessage = serverErrorMessage;\n } else {\n errorMessage = \"Network error (status \" + statusCode + \")\";\n errorClass = wrm.core.NetworkError;\n }\n } else {\n if (!data) {\n errorMessage = \"Received malformed response from back-end\";\n } else {\n if (options.validator && !options.validator(data)) {\n errorMessage = \"Received invalid response from back-end\";\n }\n }\n }\n \n /* If there was a problem, return an appropriate error object or throw an appropriate error */\n if (errorMessage || errorClass) {\n var errorResult = errorClass || options.errors && options.errors[statusCode];\n if (errorResult === undefined) {\n errorResult = Error;\n }\n if (typeof errorResult !== \"function\") {\n return errorResult;\n }\n throw new errorResult(errorMessage || \"\");\n }\n \n /* Transform the result data */\n if (options.transformer) {\n data = options.transformer(data, response.headers());\n }\n \n return data;\n }", "function callbackResult(res,data){\n\n\t\tconsole.log(\"final response >>>>>\");\n\t//Preparing error if any error case\n\t//var error = prepareError();\n\t//var result = responseWrapper(data,error);\n\n\tvar result = responseWrapper(data);\n\n\treturn res.json(result);\n\t\n}", "function httpOptions(clientReq, clientRes) {\n var reqUrl = url.parse(clientReq.url);\n console.log('proxy for http request: ' + reqUrl.href);\n\n var options = {\n hostname: reqUrl.hostname,\n port: reqUrl.port,\n path: reqUrl.path,\n method: clientReq.method,\n headers: clientReq.headers\n };\n\n // create socket connection on behalf of client, then pipe the response to client response (pass it on)\n var serverConnection = http.request(options, function (res) {\n clientRes.writeHead(res.statusCode, res.headers)\n res.pipe(clientRes);\n });\n\n clientReq.pipe(serverConnection);\n\n clientReq.on('error', (e) => {\n console.log('client socket error: ' + e);\n });\n\n serverConnection.on('error', (e) => {\n console.log('server connection error: ' + e);\n });\n}", "_handleIncomingRequest(req, res) {\n var reqOptions;\n \n // Assign serial number to the request being processed. Just for logging purposes.\n let reqSerialNo = this._reqiestSerialNumber;\n this._reqiestSerialNumber += 1;\n \n // Parse request target and append absent parts from CONNECT (if one was received) request parameters.\n try {\n let targetURL = urlUtils.parse(req.url);\n if(targetURL === undefined || targetURL === null) {\n throw new Error(\"Invalid URL.\");\n }\n \n var host = targetURL.host;\n var port = targetURL.port;\n var proto = targetURL.protocol;\n if(!host) {\n // Deduce target host:port from incoming request.\n let s = req.socket;\n if(s) {\n host = s._originTargetHost\n if(!port) {\n port = s._originTargetPort;\n }\n if(!proto) {\n proto = s._originTargetProto;\n }\n }\n }\n if(!host) {\n throw new Error(\"Invalid URL.\");\n }\n if(!port) {\n port = 80;\n }\n if(!proto) {\n proto = 'http:';\n }\n var path = targetURL.path;\n if(!path) {\n path = '/';\n }\n \n if(kDebug) {\n debuglog('Incoming request [%d] for: %s//%s:%d%s %s', reqSerialNo, proto, host, port, path, util.inspect(req.headers, {showHidden: false, depth: 1}));\n }\n \n // Compose options for request to the original HTTP server.\n reqOptions = {\n protocol: proto,\n hostname: host,\n port: port,\n path: path,\n method: req.method,\n headers: req.headers\n };\n \n // Let observers alter outgoing request options.\n this.emit('requestOptions', reqOptions, req, res);\n } catch(e) {\n // Something has gone wrong during original request options preparation - report HTTP/400 'Bad request' error to the client.\n debuglog('Failed to prepare original request [%d] options: %s', reqSerialNo, e);\n if(res.socket) {\n this._reportBadRequest(res.socket, e.message);\n return;\n }\n res.destroy(e);\n return;\n }\n \n if(kDebug) {\n debuglog('Outgoing request [%d]: %s', reqSerialNo, util.inspect(reqOptions, {showHidden: false, depth: 1}));\n }\n\n // Submit request to original HTTP server.\n let origResponseHandler = (origResp) => {\n if(kDebug) {\n debuglog('Original response [%d] for %s//%s:%d%s: %d %s', reqSerialNo, reqOptions.protocol, reqOptions.hostname, reqOptions.port, reqOptions.path, origResp.statusCode, util.inspect(origResp.headers, {showHidden: false, depth: 1}));\n }\n \n // Notify observers on a response, received from the original server.\n this.emit('responseHeader', origResp);\n\n // Pass origin response headers through a validator. Node.js validates headers, set for ServerResponse object, though it doesn't validate \"incoming\" header values. As a result, invalid (having non UTF-8 characters, for example) header field, coming from original server, causes client blow up.\n // Collect original server response headers and combine duplicates.\n var key;\n var headers = new Map();\n origResp.rawHeaders.forEach((currentValue, index) => {\n if((index & 1) == 0) {\n key = currentValue;\n return;\n }\n let existingVal = headers.get(key);\n if(existingVal === undefined) {\n headers.set(key, currentValue);\n return;\n }\n if(typeof existingVal == 'string') {\n headers.set(key, [existingVal, currentValue]);\n return;\n }\n existingVal.push(currentValue);\n });\n \n // Push original response headers to the client response.\n headers.forEach((val, key) => {\n // Be optimistic about header value being valid.\n try {\n res.setHeader(key, val);\n } catch(e) {\n debuglog('Failed to set header: %s: %s:\\n%s', key, val, e);\n // Header contains invalid character(s). Escape them.\n var escapedVal;\n if(typeof val == 'string') {\n escapedVal = val.replace(/[^a-zA-Z0-9,.:;=&@\\-+\\/()\\\\[\\] ]+/g, (c) => { return escape(c); });\n } else {\n escapedVal = val.map((v) => {\n return v.replace(/[^a-zA-Z0-9,.:;=&@\\-+\\/()\\\\[\\] ]+/g, (c) => { return escape(c); });\n });\n }\n \n try {\n res.setHeader(key, escapedVal);\n } catch(ee) {\n // Did at most I could. Skip the header.\n debuglog('Skipping invalid header. Failed to set it, even with escaping: %s: %s:\\n%s', key, val, ee);\n }\n }\n });\n \n // Start feeding original server's response to the client.\n res.writeHead(origResp.statusCode, origResp.statusMessage);\n \n // Prepare for data/error propagation from original to client response object.\n origResp.on('data', (d) => {\n debuglog('Got original response [%d] body chunk of length: %d.', reqSerialNo, d.length);\n this.emit('responseData', origResp, d);\n res.write(d);\n })\n .on('error', (e) => {\n this.emit('responseError', origResp, e);\n debuglog('Error in original response [%d]: %s', reqSerialNo, e);\n })\n .on('end', () => {\n debuglog('Original response [%d] processing finished.', reqSerialNo);\n this.emit('responseFinish', origResp);\n res.end();\n });\n };\n \n let requestor = (reqOptions.protocol == 'http:') ? http : https;\n var origReq\n try {\n origReq = requestor.request(reqOptions, origResponseHandler)\n } catch(e) {\n debuglog('Failed to compose request to original server [%d]: %s', reqSerialNo, e);\n if(res.socket) {\n this._reportBadRequest(res.socket, e.message);\n return;\n }\n res.destroy(e);\n return;\n }\n \n origReq.on('error', (e) => {\n debuglog('Error in original request [%d]: %s', reqSerialNo, e);\n this.emit('requestError', origReq, e);\n origReq.removeAllListeners('abort');\n })\n .on('abort', () => {\n debuglog('Original request [%d] aborted.', reqSerialNo);\n this.emit('requestError', origReq, new Error('Aborted.'));\n });\n\n // Capture premature client connection closure and force original request aborted in that case.\n res.once('close', () => {\n debuglog('Premature client response connection closed [%d].', reqSerialNo);\n origReq.abort();\n });\n \n // Propagate client request data/error events to the original request.\n req.on('data', (d) => {\n debuglog('Got client request [%d] body chunk of length: %d.', reqSerialNo, d.length);\n this.emit('requestData', req, d);\n origReq.write(d);\n })\n .on('error', (e) => {\n debuglog('Error in client request [%d]: %s', reqSerialNo, e);\n origRequest.abort();\n })\n .on('end', () => {\n debuglog('Client request [%d] processing finished.', reqSerialNo);\n origReq.end();\n });\n \n req.on('upgrade', (req, socket, head) => {\n this._reportBadRequest(socket, 'Upgrade protocol is not supported yet.');\n origRequest.abort();\n });\n }", "function handleResponse(request,\n responseHandler,\n isJsonResponse) {\n if ((request.readyState == 4) &&\n (request.status == 200)) {\n\n // Default to isJsonResponse = true\n if (isJsonResponse == undefined) {\n isJsonResponse = true;\n }\n\n if (isJsonResponse) {\n responseHandler(JSON.parse(request.responseText));\n } else {\n responseHandler(request.responseText);\n }\n }\n }", "function proxySite(res, url) {\n request({\n url: url\n }, function (error, response, body) {\n response.headers['Access-Control-Allow-Origin'] = '*';\n res.writeHead(response.statusCode, response.headers);\n res.write(body);\n res.end();\n });\n}", "_handleEncResponse(encRes, len) {\n // Decrypt response\n const secret = this._getSharedSecret();\n const encData = encRes.slice(0, ENC_MSG_LEN);\n const res = aes256_decrypt(encData, secret);\n // len does not include a 65-byte pubkey that prefies each encResponse\n len += 65;\n // Validate checksum. It will be the last 4 bytes of the decrypted payload.\n // The length of the decrypted payload will be fixed for each given message type.\n const toCheck = res.slice(0, len);\n const cs = parseInt(`0x${res.slice(len, len+4).toString('hex')}`);\n const csCheck = checksum(toCheck);\n if (cs !== csCheck) return { err: `Checksum mismatch in response from Lattice (calculated ${csCheck}, wanted ${cs})` };\n\n // First 65 bytes is the next ephemeral pubkey\n const pub = res.slice(0, 65).toString('hex');\n try {\n this.ephemeralPub = getP256KeyPairFromPub(pub);\n return { err: null, data: res };\n } catch (e) {\n return { err: `Error handling getAddresses response: ${e.toString()}` };\n }\n }", "function answerReq(rt, res, next, result) {\n\t//res.setHeader('Content-Type', 'application/json');\n\tres.setHeader('Access-Control-Allow-Origin', '*');\n\t//res.setHeader('Access-Control-Allow-Headers', 'origin, X-Requested-With, content-type, accept');\n\tres.setHeader('Access-Control-Allow-Headers', '*');\n\tres.setHeader('Access-Control-Allow-Methods', 'GET, POST');\n\t\n\t// the codes below are mostly useful for url redirect\n\tvar moveOn = true;\n\tif (result._httpCode) {\n\t\tif (result._httpHeaders)\n\t\t\tres.writeHead( result._httpCode, result._httpHeaders );\n\t\telse\n\t\t\tres.writeHead( result._httpCode );\n\n\t\tif (!result._data) {\n\t\t\tmoveOn = false;\n\t\t\tres.end();\n\t\t}\n\t}\n\t\n\tif (moveOn) {\n\t\tvar postFix = rt ? rt.ep.postFix : undefined;\n\t\tif (postFix === 'txt') {\n\t\t\tres.setHeader('content-type', 'text/plain');\n\t\t\tres.end(result.value);\n\t\t}\n\t\telse {\n\t\t\tres.setHeader('content-type', 'application/json');\n\t\t\tres.end( JSON.stringify(result) );\n\t\t}\n\t\t\n\t\t// do loggin\n\t\tif (rt) {\n\t\t\t// we don't log /api/batch...\n\t\t\tvar ep = rt.ep;\n\t\t\tif (ep.app != 'api')\n\t\t\t\tlogging(rt, result);\n\t\t}\n\t}\n\t\n\tnext();\n}", "function response(client, context) {\n return function(status, body) {\n context.res = {\n status: status,\n body: body\n };\n\n client.close();\n context.done();\n };\n}", "function handleReply() {\n // Falure results are discarded, as this is expected to fail of non-dual-stack connections.\n if (this.readyState == 4 && this.status == 200) {\n // This object is defined in Models/IndexModel.\n var otherIpInfo = this.response;\n var prefix = \"<br /><span class='versionLabel'>\" + otherIpType + \": </span>\";\n var addressInnnerHtml = prefix + otherIpInfo.ip + \"<br />\";\n var hostNameInnerHtml = prefix + otherIpInfo.hostName + \"<br />\";\n document.getElementById(\"OtherAddress\").innerHTML = addressInnnerHtml;\n document.getElementById(\"OtherHostname\").innerHTML = hostNameInnerHtml;\n }\n}", "async function onRequest(rawReq, rawRes) {\n const startTime = Date.now()\n const reqURL = getURL(rawReq)\n\n try {\n\n logger.info(logger.cyan(rawReq.method), reqURL)\n\n const req = new Request(rawReq, upstream.getAgent(rawReq))\n const res = { statusCode: 200, headers: {}, body: '' }\n\n for (const { pattern, match, handle } of rules) {\n req.params = match(req)\n if (req.params) {\n logger.debug(logger.yellow(`${req.method}:${pattern}`), reqURL)\n if (await Promise.resolve(handle(req, res)) === false) {\n break\n }\n }\n }\n\n logger.info(logger.green(`${req.method}:responding`), reqURL, logger.green(`[${Date.now() - startTime}ms]`))\n rawRes.writeHead(res.statusCode, res.headers)\n\n if (res.body instanceof stream.Readable) {\n res.body.pipe(rawRes)\n await waitFor(res.body, 'end')\n } else {\n rawRes.end(res.body)\n }\n\n logger.info(logger.green(`${req.method}:${res.statusCode}`), reqURL, logger.green(`[${Date.now() - startTime}ms]`))\n\n } catch (error) {\n\n logger.error(logger.red(rawReq.method), reqURL, logger.red(`[${Date.now() - startTime}ms]`), '\\n', error.stack)\n\n if (rawRes.writable) {\n rawRes.writeHead(500)\n rawRes.end()\n }\n }\n }", "function serverResponseHandler (response) {\n\tresultContainer.className = response.status;\n\n\tif (response.status == \"success\") {\n\t\tresultContainer.innerHTML = \"Success\";\n\t}\n\tif (response.status == \"error\") {\n\t\tresultContainer.innerHTML = response.reason;\n\t}\n\t// warning! can cause recursion\n\tif (response.status == \"progress\") {\n\t\tresultContainer.innerHTML = 'Attempt to connect to server...';\n\n\t\tsetTimeout(function () {\n\t\t\tsendGetRequest(myForm.action, serverResponseHandler);\n\t\t}, response.timeout);\n\n\t}\n}", "HandleResponse(){\n let allPathsArr = this.GetAllPathsArr();\n //Check if the path has been registered as a controller first\n if(this.RegisteredControllersObj[allPathsArr[1]] !== undefined && allPathsArr[2] !== undefined){\n let relavantPathsArr = allPathsArr.slice(2,allPathsArr.length);\n this.RegisteredControllersObj[allPathsArr[1]].HandleResponse(relavantPathsArr);\n }\n\n //Send Response for get requests\n if(this.Request.RequestMethodString === 'get')\n this.HandleGet();\n //Send response for post requests\n else if(this.Request.RequestMethodString === 'post')\n this.HandlePost();\n //Send response for delete requests\n else if(this.Request.RequestMethodString === 'delete')\n this.HandleDelete();\n //All other methods:\n else\n this.SendResponse(404, this.DefaultResponseString);\n }" ]
[ "0.6411474", "0.63302225", "0.6319571", "0.6254568", "0.6204309", "0.60719407", "0.6065553", "0.6017493", "0.5974821", "0.5893247", "0.5864908", "0.5829232", "0.5816578", "0.58152676", "0.5791078", "0.57828575", "0.57771933", "0.5762546", "0.575762", "0.575564", "0.56961447", "0.5693808", "0.5692204", "0.56806797", "0.56806797", "0.56575006", "0.5644568", "0.5644568", "0.5644568", "0.5641088", "0.5618335", "0.55917704", "0.55396163", "0.55288565", "0.5522579", "0.5509733", "0.5509733", "0.54717284", "0.54519093", "0.5412763", "0.5383205", "0.5369699", "0.536484", "0.5363027", "0.5362651", "0.53550166", "0.5346497", "0.5342416", "0.5333495", "0.53230965", "0.530582", "0.52944416", "0.52837956", "0.5270208", "0.52307534", "0.5216959", "0.51958776", "0.51881534", "0.5177704", "0.5167059", "0.5165593", "0.51653683", "0.5164463", "0.5153237", "0.5146844", "0.5140007", "0.51344144", "0.51295054", "0.51162964", "0.5111947", "0.5109426", "0.50991607", "0.50972885", "0.5081064", "0.5075517", "0.50721335", "0.50650746", "0.5058838", "0.5058591", "0.50514936", "0.5050089", "0.5050089", "0.5050089", "0.5050089", "0.5050089", "0.5041863", "0.5040276", "0.50358033", "0.5035213", "0.5021594", "0.50201374", "0.50191265", "0.50174433", "0.50064445", "0.500587", "0.49968392", "0.49890548", "0.4983357", "0.49787527", "0.496988" ]
0.7489599
0
initialize unstructured audit logging
function initializeAudit(key, options) { logger.trace(key+'-Initializing unstructured audit client request for transactionId-based key: ', key); // requestAttachmentAudit is an instance of http.ClientRequest, and implements the stream.Writable interface // auditRes is an instance of http.IncomingMessage // these are the post options requestAttachmentAudit = http.request(getAttachmentAuditOptions(key, options), function(auditRes) { auditRes.on('data', function(chunk) { logger.trace(key+'-Received beginning of unstructured audit data response from audit service, with chunk length (in bytes): ', chunk.length); //logger.trace(key+'-Unstructured audit reponses chunk =',chunk.toString('utf8')); }); auditRes.on('end', function(data) { logger.trace(key+'-Received end of unstructured audit response from audit service'); }); auditRes.on('error', function(e) { logger.error(key+'-Error with unstructured audit service response, where error: ', e, e.stack); }); }); // set the request socket timeout value, after request is assigned to the socket, emitting the 'socket' Event // sets time-out value for socket after request assigned to socket (i.e. no data activity) // 'socket' is an instance of net.Socket requestAttachmentAudit.on('socket', function (socket) { logger.trace(key+'-Unstructured audit request data socket event emitted...'); if(options.timeout) { socket.setTimeout(options.timeout); } // set the request socket time-out event handler socket.removeAllListeners('timeout'); socket.on('timeout', function () { logger.error(key+'-Unstructured audit service client experienced a timeout to remote audit service!'); socket.destroy(); }); socket.on('close', function () { logger.trace(key+'-Unstructured audit service client experienced a socket close event to remote audit service!'); }); }); requestAttachmentAudit.on('finish', function () { logger.trace(key+'-End request attachment unstructured audit write to audit service'); requestAttachmentAudit.end(); }); requestAttachmentAudit.on('error', function (err) { logger.error(key+'-Error with unstructured audit client write request!, where error: ',err,err.stack); }); return requestAttachmentAudit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _initLog(){\n //Push the log header to an array\n currentAction.push(\"Timestamp\");\n currentAction.push(\"User Action\");\n currentAction.push(\"Time needed in s\");\n //Push the single action log to an array containing all action logs\n userActions[0] = currentAction;\n //Reset the sinle action array\n currentAction = [];\n }", "function init(){\n start = new Date().getTime();\n _initLog();\n }", "constructor() { \n \n AuditRecordBean.initialize(this);\n }", "static initialize(obj, loggedDate, text) { \n obj['loggedDate'] = loggedDate;\n obj['text'] = text;\n }", "function loggerInit() {\n\tvar logConfig = {\n\t\tfooterEnabled: false,\n\t\tdraggable: false\n\t}\n\tvar logContainer = null\n\tlogReader = new YAHOO.widget.LogReader(logContainer, logConfig)\n}", "function ActionAuditLogInfo() {\n this.currentMarkSchemeGroupId = 0;\n this.currentEsMarkGroupId = 0;\n this.currentMarkGroupId = 0;\n this.actionLoggedDate = new Date();\n }", "function init() {\n\n var dirs = [logDir, matchesDir, dplaDataDir];\n var logFiles = ['logs/batches.log', 'logs/matches.log', 'logs/keys.log'];\n dirs.map(dir => { mkDir(dir); console.log(`mkdir ${dir}`) });\n logFiles.map(path => { touch(path); console.log(`touch ${path}`) });\n\n function touch(path) {\n fs.closeSync(fs.openSync(path, 'w'));\n }\n\n function mkDir(dir) {\n if (!fs.existsSync(dir)){\n fs.mkdirSync(dir);\n }\n }\n\n // Clear Logs and matches dir\n wipeLocalData(matchesDir);\n}", "function initLog() {\n\n console.log('ticketsStoreCtrl init');\n }", "init() {\n var logger = this.cm.get(\"logger\");\n if (logger === undefined) {\n throw new Error(\"logger component not found\");\n }\n log = logger.create(\"UdsMongoComponent\");\n\n log.debug(\"Starting UdsMongoComponent ...\");\n\n this.tingoInit();\n }", "function initLog() {\n\n console.log('advertisementsDestroyCtrl init');\n }", "function init() {\n var targetEmitter;\n CAL.logger._publishToList.forEach(function (target) {\n if (target.emitter === process &&\n target.topic === TOPIC) {\n targetEmitter = target;\n }\n });\n if (!targetEmitter) {\n CAL.logger._publishToList.push({\n emitter: process,\n topic: TOPIC\n });\n }\n}", "function Audit(audit) {\n /*jshint maxstatements:16 */\n 'use strict';\n // defaults\n this.brand = 'axe';\n this.application = 'axeAPI';\n this.defaultConfig = audit;\n this._init();\n }", "constructor(props = {}) {\n this.logs = props.logs || false\n this.events = {}\n }", "initializeLogHandlers() {\n this.removeAllListeners();\n this[logHandlersSymbol].forEach((handler) => {\n this.on('log', handler);\n });\n }", "function initLog() {\n\n console.log('adminsShowCtrl init');\n }", "function initLog() {\n\n console.log('adminsIndexCtrl init');\n }", "initExternalLogger()\n { \n }", "function init() {\n if (logEndpoints) {\n $http.get(logEndpoints.masterState)\n .then(function (res) {\n var marathonFramework = _.find(res.data.frameworks, {\n name: 'marathon'\n });\n var task = _.find(marathonFramework.tasks, {\n id: $stateParams.instance\n });\n slave = _.find(res.data.slaves, {\n id: task.slave_id\n });\n\n return $http.get(logEndpoints.slaveDebug(slave));\n })\n .then(function (res) {\n $ctrl.canAccessLogs = true;\n\n var logLocation = _.find(_.values(res.data), function (val) {\n return val.indexOf($stateParams.instance) !== -1;\n });\n\n if (logLocation.indexOf('/var') === -1) {\n logLocation = \"/var\" + logLocation;\n }\n\n stdout(slave, logLocation);\n stderr(slave, logLocation);\n });\n }\n }", "constructor(_alogy, logTo = AlogyLogDestination.LOCAL_STORAGE, logGroup = 99) {\n this._alogy = _alogy;\n this.logTo = logTo;\n this.logGroup = logGroup;\n }", "initLogger() {\n this.logger = this.getLogger();\n }", "function initLog() {\n\n console.log('estaticoHomeCtrl init');\n }", "static initialize(obj, changeStatus, committedAt, url, user, version) { \n obj['change_status'] = changeStatus;\n obj['committed_at'] = committedAt;\n obj['url'] = url;\n obj['user'] = user;\n obj['version'] = version;\n }", "function initialize(ctx, next, stdout, stdin, stderr) {\n ctx.headers = {};\n ctx.log = [];\n\n next(null, ctx);\n}", "constructor(name) {\r\n\t\t\t/**\r\n\t\t * Logged actions.\r\n\t\t * @type {Array} \r\n\t\t * @public\r\n\t\t */\r\n\t\tthis.logActions = [];\r\n\t\tthis.setName(name);\r\n\t}", "setupLogging() {\n this.on('error', logger.error);\n\n this.on('rss', (body) => logger.silly(`emitted: ${body.id}`));\n this.on('ws:update:raw', (body) => logger.silly(`emitted raw: ${body.platform}`));\n this.on('ws:update:parsed', (body) => logger.silly(`emitted parsed: ${body.platform} in ${body.language}`));\n this.on('ws:update:event', (body) =>\n logger.silly(`emitted event: ${body.id} ${body.platform} in ${body.language}`)\n );\n this.on('tweet', (body) => logger.silly(`emitted: ${body.id}`));\n }", "constructor() { \n \n WebhookLog.initialize(this);\n }", "_construct() {\r\n\tLog.info('Dtag: Enter Diagnostic Component ')\r\n }", "constructor() { \n \n OrgApacheSlingEngineImplDebugRequestProgressTrackerLogFilterProperties.initialize(this);\n }", "init() {\n module_utils.patchModule(\n 'winston/lib/winston/logger',\n 'write',\n writeWrapper,\n Logger => Logger.prototype\n );\n }", "function initLog() {\n\n console.log('beersDestroyCtrl init');\n }", "function AttActionLog(reference,subReference,logs,editAtt){\n\tthis.reference = reference;\n\tthis.subReference = subReference;\n\tthis.logs = logs;\n\tthis.editAtt = editAtt;\n}", "function initLogs(){\n\tif(!localforage){\n\t\talert('failed to load localforage!');\n\t\treturn;\n\t}\n\n\treturn localforage.getItem('maxLogNumber')\n\t.then((result)=>{\n\t\tif(result)\n\t\t\tmaxLogNumber = result;\n\t})\n\t.then(()=>localforage.getItem('logs'))\n\t.then((logs)=>{\n\t\tpopulateLogs(logs,false);\n\t})\n\t.catch((err)=>{\n\t\tconsole.error(err);\n\t\tconsole.error(\"!!ERROR INSTANTATING LOGS\");\n\t});\n}", "initializing() {\n this.log('initializing');\n }", "function loginit(loglevel) {\n if ( /normal|verbose|veryverbose/.test(loglevel) ) { llog.on(); }\n //if (loglevel ==='verbose' ) { ... } // enable log on child module\n //if (loglevel ==='veryverbose' ) { ... } // enable verbose log on child module\n}", "initialise() {\n cLogger('Initialising data state');\n // listen for socket events\n socketManager.setListener(this);\n // load the users\n this.getAllUsers();\n // load the entries\n this.getAllEntries();\n }", "function Log(info) {\n this.revision_number = info.revision;\n this.author = info.author;\n this.date = info.date;\n this.message = info.msg;\n}", "constructor() {\n this.logger = new Logger();\n }", "static setup() {\r\n if (!Utils.exists(Utils.log)) {\r\n super.setup(C.LOG_SRC.UTILS);\r\n }\r\n }", "function init(cfg, log) {\n config = cfg;\n logger = log;\n}", "function initComponent(parameters) {\n insertLogEventAPI = parameters.endpoint + '/logs/insert';\n }", "constructor(props) {\n super(props)\n\n this.state = {\n logs: [],\n }\n this.addLog = this.addLog.bind(this)\n this.editLog = this.editLog.bind(this)\n this.deleteLog = this.deleteLog.bind(this)\n }", "function init() {\n\n ExtensionUtils.initTranslations();\n\n log(`initializing ${Me.metadata.name} version ${Me.metadata.version}`);\n}", "init() {\n let {\n args,\n flags\n } = this.parse();\n this.flags = flags;\n this.args = args; // sets the log level from verbose, quiet, and silent flags\n\n _logger.default.loglevel('info', flags); // ensure cleanup is always performed\n\n\n let cleanup = () => this.finally(new Error('SIGTERM'));\n\n process.on('SIGHUP', cleanup);\n process.on('SIGINT', cleanup);\n process.on('SIGTERM', cleanup);\n }", "function Log(name, parent, initialMessage) {\n var _this = this;\n /**\n * all log-entries on this logger\n */\n this.entries = new Array();\n this.depth = 0;\n this.callDepths = [];\n /**\n * Maximum amount of entries to add - to prevent memory hoging\n */\n this.maxEntries = 1000;\n /* if we should live-dump, can be selectively activated */\n this.liveDump = liveDump;\n this._parentHasLiveDump = false;\n this.keepData = keepData; //Debug.urlState; // C.Debug.urlState;\n this._parentHasKeepData = false;\n /**\n * Full identifier of this log-object, with full hierarchy\n */\n this.fullIdentifier = function () {\n return \"\" + (_this.parent ? _this.parent.fullIdentifier() : '') + _this.identifier();\n };\n /**\n * link this log to a parent\n * usually happens in constructor, but in rare cases\n * this must be called manually\n */\n this.linkLog = function (parent) {\n _this.parent = parent || _this.parent; // if new parent isn't defined, don't replace\n if (_this.parent) {\n _this._parentHasLiveDump = _this.parent.liveDump || _this.parent._parentHasLiveDump;\n _this._parentHasKeepData = _this.parent.keepData || _this.parent._parentHasKeepData;\n }\n };\n /**\n * scope of this logger - to easily see which ones\n * are about the same topic\n */\n this.scope = 'tdo';\n /**\n * name of this logger\n */\n this.name = 'unknwn';\n /**\n * Unique 2-character ID of this specific log object\n */\n this.id = function () { return _this.idCache || (_this.idCache = _this.randomString(2)); };\n /**\n * Unique identifier of this log object, with name and ID\n */\n this.identifier = function () { return \"\" + _this.scope + _this.name + \"(\" + _this.id() + \")\"; };\n this.rename(name);\n this.linkLog(parent);\n this.startTime = new Date().getTime();\n if (initialMessage != null)\n this.add(initialMessage);\n }", "constructor( ) {\n\t\tthis.FPrint = false; // Imprime a mensagem de log ao incluir no debug\n\t\tthis.FLog = []; // Log\n\t\tvar FOwner = '' // Variável Privada Owner (para agrupamento do log)\n\t\tthis.getPreviousOwner = function() { return this.FOwner; }\n\t\tthis.setPreviousOwner = function( a ) { this.FOwner = a ; }\n\t}", "static initialize(obj, description, documentation, files, healthPercentage, updatedAt) { \n obj['description'] = description;\n obj['documentation'] = documentation;\n obj['files'] = files;\n obj['health_percentage'] = healthPercentage;\n obj['updated_at'] = updatedAt;\n }", "static initialize(obj, eventAt, event) { \n obj['event_at'] = eventAt;\n obj['event'] = event;\n }", "constructor() {\n this.logger = new Logger();\n }", "resetLogHandlers() {\n this[logHandlersSymbol] = [this.defaultLogHandler];\n this.initializeLogHandlers();\n }", "function initiateLogEvent(\n type: string,\n ts: ?Date,\n logLine: MongoLine\n): LogEvent {\n return {\n type: type,\n title: \"FixtureLogEvent\",\n ts: ts,\n messages: [],\n stacktrace: [],\n logLine: logLine,\n };\n}", "getDefaultLogData(context, data) {\n if (!data) {\n data = {};\n }\n data.actor = this.name;\n return data;\n }", "log() {}", "function initialize() {\n const claimEx1 = new Claim('Fix kitchen sink', 'Water fills up in sink and takes a long time to drain', 'Test');\n const claimEx2 = new Claim('Toilet clogged', 'Water fills up in sink and takes a long time to drain', 'Test');\n claimList.push(claimEx1);\n claimList.push(claimEx2);\n claimEx1.claimStatus = 'In-Progress';\n\n addToClaimTableTenant(claimEx1);\n\n const comment1 = new Comment('L', 'This is not a valid request based on section 5 of lease agreement');\n const comment2 = new Comment('T', 'The issue is caused by tenants living upstairs');\n addCommentToSection(comment1);\n addCommentToSection(comment2);\n}", "function initializeLoggers(settings) {\n // We configure our loggers as follows:\n // * our base logger tags all log records with `\"name\":\"app\"`, and sends logs\n // to stderr (including logs of all children)\n // * one child logger adds `\"type\":\"request\"`, and records method/URL for all\n // HTTP requests to the app, and method/URL/response code for all responses\n // * one child logger adds `\"type\":\"jupyter\"`, and records all messages from\n // the jupyter notebook server. These logs are also sent to a file on disk\n // (to assist user debugging).\n //\n // For more about bunyan, see:\n // https://github.com/trentm/node-bunyan/tree/f21007d46c0e64072617380b70d3f542368318a8\n const jupyterLogPath = path.join(settings.datalabRoot, '/var/log/colab-jupyter.log');\n logger = bunyan.createLogger({\n name: 'app',\n streams: [\n { level: 'debug', type: 'stream', stream: process.stderr },\n ]\n });\n requestLogger = logger.child({ type: 'request' });\n jupyterLogger = logger.child({\n type: 'jupyter',\n streams: [{\n level: 'info',\n type: 'stream',\n stream: new RotatingFileStream({\n path: jupyterLogPath,\n rotateExisting: false,\n threshold: '2m',\n totalSize: '20m'\n }),\n }]\n });\n}", "function log (state) {\n\tlet syslog = new SysLog();\n\tif (state)\n\t\tsyslog.shutdown = true;\n\telse syslog.shutdown = false;\n\tsyslog.timestamp = getLocalDate().timestamp;\n\tsyslog.save(function(err){\n\t\tif (err) console.log(err);\n\t});\n}", "async createLogParse() {\n const logParse = new log_parse_1.default();\n logParse.hooks.parseCommit.tapPromise(\"Author Info\", async (commit) => this.attachAuthor(commit));\n logParse.hooks.parseCommit.tapPromise(\"PR Information\", async (commit) => this.addPrInfoToCommit(commit));\n logParse.hooks.parseCommit.tapPromise(\"PR Commits\", async (commit) => {\n const prsSinceLastRelease = await this.getPRsSinceLastRelease();\n return this.getPRForRebasedCommits(commit, prsSinceLastRelease);\n });\n this.hooks.onCreateLogParse.call(logParse);\n return logParse;\n }", "function _logPredictionData() {\n // Record the time spent in the UI, since we only log this data once the UI is closed.\n if (uiStartTime !== null) {\n const uiEndTime = new Date().getTime();\n currLabelLogs.uiTime = uiEndTime - uiStartTime;\n }\n\n // Record everything we care about in this one log for convenience.\n svl.tracker.push('PM_FullPredictionLog', currLabelLogs, null);\n\n // Temporarily log to the console for debugging. Need to do at least a shallow copy since we overwrite it after.\n let copiedLogs = Object.assign({}, currLabelLogs);\n console.log(copiedLogs);\n\n // Reset the logs for the next label.\n currLabel = null;\n uiStartTime = null;\n for (let key in currLabelLogs) {\n currLabelLogs[key] = null;\n }\n }", "constructor(dbi,tableName,metrics,status,yadamuLogger) {\n super(dbi,tableName,metrics,status,yadamuLogger)\n }", "init() {\n module_utils.patchModule(\n 'pino/lib/tools',\n 'asJson',\n logWrapper\n );\n }", "function _____INTERNAL_log_functions_____(){}\t\t//{", "constructor(props) {\n super();\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_ecs_GenericLogDriverProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, GenericLogDriver);\n }\n throw error;\n }\n this.logDriver = props.logDriver;\n this.options = props.options || {};\n this.secretOptions = props.secretOptions;\n }", "function LogFile(id) {\n this.id = id;\n this.knownLoggers = {};\n this._dateBucketsByName = {};\n this._dateBuckets = [];\n this._newBuckets = [];\n}", "initLogger() {\n this.logger = new ConsoleLogger({\n name: this.getServiceName()\n });\n }", "function init () {\n // Here below all inits you need\n }", "function loggerConstructor () { // 'private' properties\n let folderName = 'logs';\n let rootPath = __basedir;\n let maxFileSize = 1 * 1024 * 1024; // 1Mb\n let nFolderPath = path.join(rootPath, folderName);\n let oFolderPath = path.join(nFolderPath, 'past_logs');\n // eslint-disable-next-line no-unused-vars\n let modifiers = [];\n\n let logTypes = {\n debug : chalk.blue,\n log : chalk.green,\n warning : chalk.yellowBright,\n error : chalk.redBright,\n terminal: chalk.magenta\n };\n\n let blueprint = [\n {\n fileName: 'logs.txt',\n logTypes: ['debug', 'log', 'warning', 'error', 'terminal']\n },\n {\n fileName: 'dump.txt',\n logTypes: ['warning', 'error']\n }\n ];\n\n let initFile = function (fileBlueprint) {\n fs.writeFileSync(\n path.join(nFolderPath, fileBlueprint.fileName),\n `[LOG '${fileBlueprint.fileName}' FILE CREATED (${Date.now()})]\\n`\n );\n };\n\n let applyModifiers = function (text) {\n for (let modifier of modifiers) {\n text = chalk[modifier](text);\n }\n\n return text;\n };\n\n let blueprintsFromLogType = function (logType) {\n let blueprints = [];\n\n for (let fileBlueprint of blueprint) {\n if (fileBlueprint.logTypes.includes(logType)) {\n blueprints.push(fileBlueprint);\n }\n }\n\n return blueprints;\n };\n\n let shouldLog = function () {\n return true; // currently not used (but could be in future!)\n };\n\n let store = function (logType, str) {\n if (!logTypes[logType]) {\n throw new Error(`Log type '${logType}' not valid for 'write' function!`);\n }\n\n const blueprints = blueprintsFromLogType(logType);\n\n for (let fileBlueprint of blueprints) {\n let logFilePath = path.join(nFolderPath, fileBlueprint.fileName);\n let stats = fs.statSync(logFilePath);\n\n // File too big! Copy file to old logs and then overwrite it!\n if (stats.size >= maxFileSize) {\n let fstr = (new Date().toJSON().slice(0, 10)) + '_' + fileBlueprint.fileName;\n let numberOfRepeats = 0;\n\n let files = fs.readdirSync(oFolderPath);\n\n for (let file of files) {\n if (file.includes(fstr)) {\n numberOfRepeats++;\n }\n }\n\n // Hack was added here for the old log file name extension - TODO: FIX!\n let oldLogFileName = fstr.substring(0, fstr.length - 4) + (numberOfRepeats + 1) + '.txt';\n let oldLogFilePath = path.join(oFolderPath, oldLogFileName);\n\n fs.copyFileSync(logFilePath, oldLogFilePath);\n initFile(fileBlueprint);\n }\n\n fs.appendFileSync(logFilePath, str + '\\n');\n }\n };\n\n let write = function (logType, ...args) {\n let colorFunc = logTypes[logType];\n\n if (!colorFunc) {\n throw new Error(`Log type '${logType}' not valid for 'write' function!`);\n }\n\n // Convert all arguments to proper strings\n let buffer = [];\n\n for (let arg of args) {\n buffer.push((typeof arg === 'object') ? JSON.stringify(arg) : arg.toString());\n }\n\n let text = applyModifiers(\n colorFunc(\n `(${new Date().toLocaleString()})`\n + `[${logType}] => `\n + buffer.join(' ')\n )\n );\n\n console.log(text);\n store(logType, text);\n };\n\n if (!fs.existsSync(nFolderPath)) {\n fs.mkdirSync(nFolderPath);\n }\n\n if (!fs.existsSync(oFolderPath)) {\n fs.mkdirSync(oFolderPath);\n }\n\n for (let fileBlueprint of blueprint) {\n let filePath = path.join(nFolderPath, fileBlueprint.fileName);\n\n if (!fs.existsSync(filePath)) {\n initFile(fileBlueprint);\n }\n }\n\n return { // 'public' properties\n removeModifier (modID) {\n let index = modifiers.indexOf(modID);\n\n if (index < -1) {\n throw new Error(`Modifier '${modID}' not found in exisiting modifiers!`);\n }\n\n modifiers.splice(index, 1);\n },\n addModifier (modID) {\n modifiers.push(modID);\n this.log(`Modifier added to logger: ${modID}`);\n },\n setModifiers (mods) {\n if (!Array.isArray(mods)) {\n throw new Error('Expected log modifiers in array format!');\n }\n\n modifiers = mods;\n },\n clearModifiers () {\n modifiers = [];\n },\n write: function () { /* eslint-disable-line object-shorthand */ // if not like this it errors because of strict mode??\n if (shouldLog(...arguments)) {\n write(this.write.caller.name, ...arguments);\n }\n },\n plain (text, color = 'white') {\n let colorFunc = chalk[color];\n\n if (!colorFunc) {\n throw new Error(`Invalid color '${color}' for 'logger.plain'!`);\n }\n\n console.log(\n applyModifiers(\n colorFunc(\n text\n )\n )\n );\n },\n // Helper\n debug () { this.write(...arguments); },\n log () { this.write(...arguments); },\n warning () { this.write(...arguments); },\n error () { this.write(...arguments); },\n terminal () { this.write(...arguments); },\n // Alias of helper\n warn () { this.warning(...arguments); },\n err () { this.error(...arguments); }\n };\n }", "function Logging() {\n this.thresholdOfLogLevel = LogLevel.Informational;\n this.verboseTelemetry = false;\n this.http = new Http();\n this.logSet = {\n maxWaitTimeMs: Logging.logMaxWaitTimeMs,\n maxRecordLength: Logging.logMaxRecordLength,\n api: '/api/log'\n };\n this.telemetrySet = {\n maxWaitTimeMs: Logging.telemetryMaxWaitTimeMs,\n maxRecordLength: Logging.telemetryMaxRecordLength,\n api: '/api/telemetry'\n };\n }", "constructor() { \n \n GeoBatchLog.initialize(this);\n }", "constructor(auth, logger) {\n this.auth = auth;\n this.logger = logger;\n this.title = 'my-app';\n this.test = '';\n }", "initLog(logLevel) {\n XPCOMUtils.defineLazyGetter(this, \"log\", () => {\n const ConsoleAPI =\n Cu.import(\"resource://gre/modules/Console.jsm\", {}).ConsoleAPI;\n const consoleOptions = {\n maxLogLevel: logLevel,\n prefix: \"TPStudy\",\n };\n return new ConsoleAPI(consoleOptions);\n });\n }", "function init() {\n setStore();\n handleHistory();\n }", "function initLog(text)\n{\n\tvar oldTab = Ext.getCmp('southRegion').getActiveTab();\n\tExt.getCmp('southRegion').setActiveTab(2);\n\tsetLog(text);\n\tExt.getCmp('southRegion').setActiveTab(oldTab);\t\n}", "initialize () {\n if (this.index) {\n console.log('atom-notes: loading...')\n this.loaded = true\n this.index = elasticlunr.Index.load(this.index)\n } else {\n console.log('atom-notes: indexing...')\n this.loaded = false\n this.index = elasticlunr(function () {\n this.addField('title')\n this.addField('body')\n this.addField('keywords')\n this.addField('abstract')\n })\n }\n\n this.watcher = setupFileWatcher.bind(this)(this.directoryPath)\n this.emit('ready')\n }", "function initialization() {\n $log.info('default component initialized');\n }", "setup(consoleMinLogLevel, _logFilePath, prependTimestamp = true) {\n const logFilePath = typeof _logFilePath === 'string' ?\n _logFilePath :\n (_logFilePath && this._logFilePathFromInit);\n if (this._currentLogger) {\n const options = {\n consoleMinLogLevel,\n logFilePath,\n prependTimestamp\n };\n this._currentLogger.setup(options).then(() => {\n // Now that we have a minimum logLevel, we can clear out the queue of pending messages\n if (this._pendingLogQ) {\n const logQ = this._pendingLogQ;\n this._pendingLogQ = null;\n logQ.forEach(item => this._write(item.msg, item.level));\n }\n });\n }\n }", "constructor() { \n \n ResponseCallLogObjectAllOf.initialize(this);\n }", "constructor(logger) {\n super(logger, 'rating');\n this.logger = logger;\n }", "static initialize(obj, title, createdBy, isLocked, tagsAsCsv) { \n obj['title'] = title;\n obj['createdBy'] = createdBy;\n obj['isLocked'] = isLocked;\n obj['tagsAsCsv'] = tagsAsCsv;\n }", "_init(events, chat) {\n\t\treturn this.#streamlabs.init({\n\t\t\treceiveEvents: events,\n\t\t\ttwitchChat: chat\n\t\t}).then((data) => {\n\t\t\tthis.#profiles = data.profiles\n\t\t\tthis.#assets = data.assets\n\t\t\tthis.#settings = data.settings\n\t\t})\n\t}", "function LoggerBase(){\n\n\t}", "function init() {\n\t\t\tconsole.log(\"init()\");\n\t\t\tresetData();\n\t\t\trefreshTotalCount();\n\t\t\taddAdbRow();\n\t\t\tconsole.log(\"done init()\");\n\t\t}", "constructor() {\r\n super();\r\n /**\r\n * Stores the actions of the Workflow.\r\n */\r\n this._actions = [];\r\n /**\r\n * Stores the permanent state values of the actions.\r\n */\r\n this._actionStates = [];\r\n /**\r\n * Stores the number of workflow execution.\r\n */\r\n this._executions = 0;\r\n /**\r\n * Stores the loggers.\r\n */\r\n this._loggers = [];\r\n /**\r\n * Stores the minimal log level.\r\n */\r\n this._logLevel = exports.DefaultLogLevel;\r\n /**\r\n * Stores the current state value.\r\n */\r\n this._state = exports.DefaultState;\r\n let defLoggers = exports.DefaultLoggers;\r\n if (defLoggers) {\r\n defLoggers.forEach(l => this.addLogger(l));\r\n }\r\n }", "function Logger() {\n this._logHandler = new NullLogHandler();\n }", "function init() {\n fetchDetails();\n setEvents();\n }", "applyAudit() {\n super.applyAudit();\n this.log.debug('This is only another custom messagem from your custom server :)');\n }", "constructor() { \n \n AuditSearchRequest.initialize(this);\n }", "function init()\r\n\t{\r\n\t\ttry{\r\n\t\t\t\r\n\t\t\t\tdb = openDatabase('callogs', '1.0', 'Call Log Database', 2 * 1024 * 1024);\r\n\t\t\t\tdb.transaction(function (transaction) \r\n\t\t\t\t{\r\n\t\t\t\t\ttransaction.executeSql('CREATE TABLE IF NOT EXISTS logs (id INTEGER PRIMARY KEY, number TEXT, duration NUMERIC)');\r\n\t\t\t\t\t\r\n\t\t\t\t\t//transaction.executeSql(\"INSERT INTO logs (number, duration) VALUES ('12345', 4000)\"); \r\n\t\t\t\t});\r\n\t\t}\r\n\t\tcatch(err) {\r\n\t\t\t\twebSqlOK = false;\r\n\t\t\t\talert(\"Error: this browser may not support Web SQL database: \\n Database functions may not work on this browser.\");\r\n\t\t}\r\n\t\r\n\t\tdoListeners();\r\n\t}", "constructor(host, log) {\n super();\n this.log = log || console.log;\n \n // Construct an ioLogik API\n this.host = host;\n this.iologik = new IoLogik(host, log);\n\n // Read and log the ioLogic system information\n this.logDeviceInfo();\n\n // Start polling the door state\n this.currentState = 'closed';\n this.targetState = 'closed';\n this.pollDoorPosition();\n\n // Assume that the light is initially off\n this.lightState = false;\n }", "constructor(scope, id, props) {\n super(scope, id, { type: CfnTrail.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_cloudtrail_CfnTrailProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnTrail);\n }\n throw error;\n }\n cdk.requireProperty(props, 'isLogging', this);\n cdk.requireProperty(props, 's3BucketName', this);\n this.attrArn = cdk.Token.asString(this.getAtt('Arn', cdk.ResolutionTypeHint.STRING));\n this.attrSnsTopicArn = cdk.Token.asString(this.getAtt('SnsTopicArn', cdk.ResolutionTypeHint.STRING));\n this.isLogging = props.isLogging;\n this.s3BucketName = props.s3BucketName;\n this.cloudWatchLogsLogGroupArn = props.cloudWatchLogsLogGroupArn;\n this.cloudWatchLogsRoleArn = props.cloudWatchLogsRoleArn;\n this.enableLogFileValidation = props.enableLogFileValidation;\n this.eventSelectors = props.eventSelectors;\n this.includeGlobalServiceEvents = props.includeGlobalServiceEvents;\n this.insightSelectors = props.insightSelectors;\n this.isMultiRegionTrail = props.isMultiRegionTrail;\n this.isOrganizationTrail = props.isOrganizationTrail;\n this.kmsKeyId = props.kmsKeyId;\n this.s3KeyPrefix = props.s3KeyPrefix;\n this.snsTopicName = props.snsTopicName;\n this.tags = new cdk.TagManager(cdk.TagType.STANDARD, \"AWS::CloudTrail::Trail\", props.tags, { tagPropertyName: 'tags' });\n this.trailName = props.trailName;\n }", "static initialize(obj, buildNumber, branchName, commitHash, commitMessage, authorName, status) {\n obj['buildNumber'] = buildNumber;\n obj['branchName'] = branchName;\n obj['commitHash'] = commitHash;\n obj['commitMessage'] = commitMessage;\n obj['authorName'] = authorName;\n obj['status'] = status;\n }", "_init() {\n\t\tthis.life.init();\n\t\tthis.render.init();\n\n\t\tthis.emission.init();\n\t\tthis.trail.init(this.node);\n\n\t\tthis.color.init();\n\t}", "static initialize(obj, session, profile, event) { \n obj['session'] = session;\n obj['profile'] = profile;\n obj['event'] = event;\n }", "parseLog(log) {\n let fragment = this.getEvent(log.topics[0]);\n if (!fragment || fragment.anonymous) {\n return null;\n }\n // @TODO: If anonymous, and the only method, and the input count matches, should we parse?\n // Probably not, because just because it is the only event in the ABI does\n // not mean we have the full ABI; maybe jsut a fragment?\n return new LogDescription({\n eventFragment: fragment,\n name: fragment.name,\n signature: fragment.format(),\n topic: this.getEventTopic(fragment),\n args: this.decodeEventLog(fragment, log.data, log.topics)\n });\n }", "parseLog(log) {\n let fragment = this.getEvent(log.topics[0]);\n if (!fragment || fragment.anonymous) {\n return null;\n }\n // @TODO: If anonymous, and the only method, and the input count matches, should we parse?\n // Probably not, because just because it is the only event in the ABI does\n // not mean we have the full ABI; maybe jsut a fragment?\n return new LogDescription({\n eventFragment: fragment,\n name: fragment.name,\n signature: fragment.format(),\n topic: this.getEventTopic(fragment),\n args: this.decodeEventLog(fragment, log.data, log.topics)\n });\n }", "constructor(logger) {\n super(logger, 'users');\n this.logger = logger;\n }", "constructor(logger) {\n super(logger, 'users');\n this.logger = logger;\n }", "function loadLogs()\n\t{\n\t\tvar counters = {\n\t\t\tgeneral : {g: $(\"[data-rel=log-counter]\")},\n\t\t\ttype : {},\n\t\t\tverbosity : {}\n\t\t};\n\n\t\tvar addCounter = function(cat, type, dom) {\n\t\t\t\tcounters[cat][type] = dom;\n\t\t};\n\n\t\tvar incrCounter = function(cat, type, step) {\n\t\t\t\tvar node = counters[cat][type];\n\t\t\t\tnode.html(parseInteger(node.html()) + step);\n\n\t\t};\n\n\t\tvar decrCounter = function(cat, type, step) {\n\t\t\t\tvar node = counters[cat][type];\n\t\t\t\tvar count = parseInteger(node.html());\n\t\t\t\tif (count - step >= 0)\n\t\t\t\t{\n\t\t\t\t\tnode.html(count - step);\n\t\t\t\t\tfireEffect(node, \"highlight\");\n\t\t\t\t}\n\t\t};\n\n\t\t// Update counters, by passing a list of nodes to be removed\n\t\tvar updateCounters = function(nodeList)\n\t\t{\n\n\t\t\tnodeList.each(function(){\n\n\t\t\t\tvar v = $(this);\n\n\t\t\t\tdecrCounter(\"type\", v.data(\"type\"), 1);\n\t\t\t\tdecrCounter(\"verbosity\", v.data(\"verbosity\"), 1);\n\t\t\t\tdecrCounter(\"general\", \"g\", 1);\n\n\t\t\t});\n\t\t};\n\n\t\tvar resetCounters = function()\n\t\t{\n\t\t\tfor(var cat in counters) {\n\t\t\t\tif (counters.hasOwnProperty(cat)) {\n\t\t\t\t\tfor (var type in counters[cat]) {\n\t\t\t\t\t\tif (counters[cat].hasOwnProperty(type)) {\n\t\t\t\t\t\t\tcounters[cat][type].html(0);\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\n\t\tvar events = {\n\t\t\tsleep\t: {expression: \"sleep\", format: function(data){\n\t\t\t\treturn \"for \" + data.second + \" seconds\";}},\n\t\t\tgot\t\t: {expression: \"got\", format: function(data){\n\t\t\t\treturn \"job <a href=\\\"/jobs/view?job_id=\"+data.args.payload.id+\"\\\" rel=\\\"contents\\\" title=\\\"View job details\\\">#\" + data.args.payload.id + \"</a>\";}},\n\t\t\tprocess : {expression: \"process\", format: function(data){\n\t\t\t\treturn \"job <a href=\\\"/jobs/view?job_id=\"+data.job_id+\"\\\" rel=\\\"contents\\\" title=\\\"View job details\\\">#\" + data.job_id + \"</a>\";}},\n\t\t\tfork\t: {expression: \"fork\", format: function(data){\n\t\t\t\treturn \"job <a href=\\\"/jobs/view?job_id=\"+data.job_id+\"\\\" rel=\\\"contents\\\" title=\\\"View job details\\\">#\" + data.job_id + \"</a>\";}},\n\t\t\tdone\t: {expression: \"done\", format: function(data){\n\t\t\t\treturn \"job <a href=\\\"/jobs/view?job_id=\"+data.job_id+\"\\\" rel=\\\"contents\\\" title=\\\"View job details\\\">#\" + data.job_id + \"</a>\";}},\n\t\t\tfail\t: {expression: \"fail\", format: function(data){\n\t\t\t\treturn \"job <a href=\\\"/jobs/view?job_id=\"+data.job_id+\"\\\" rel=\\\"contents\\\" title=\\\"View job details\\\">#\" + data.job_id + \"</a>\";}},\n\t\t\tstart\t: {expression: \"start\", format: function(data){\n\t\t\t\treturn \"worker #\" + data.worker;}},\n\t\t\tstop\t: {expression: \"shutdown\", format: function(data){\n\t\t\t\treturn \"worker #\" + data.worker;}},\n\t\t\tpause\t: {expression: \"pause\", format: function(data){\n\t\t\t\treturn \"worker #\" + data.worker;}},\n\t\t\tresume\t: {expression: \"resume\", format: function(data){\n\t\t\t\treturn \"worker #\" + data.worker;}},\n\t\t\tprune\t: {expression: \"prune\", format: function(data){\n\t\t\t\treturn \"worker #\" + data.worker;}}\n\t\t};\n\n\t\tfor(var i in events)\n\t\t{\n\t\t\tif (events.hasOwnProperty(i)) {\n\t\t\t\tinit(i);\n\t\t\t}\n\t\t}\n\n\t\tvar level = {\n\t\t\t\t100 : {name: \"debug\",\tclassStyle: \"label-success\"},\n\t\t\t\t200 : {name: \"info\",\tclassStyle: \"label-info\"},\n\t\t\t\t300 : {name: \"warning\", classStyle: \"label-warning\"},\n\t\t\t\t400 : {name: \"error\",\tclassStyle: \"label-important\"},\n\t\t\t\t500 : {name: \"critical\", classStyle: \"label-inverse\"},\n\t\t\t\t550 : {name: \"alert\",\tclassStyle: \"label-inverse\"}\n\t\t};\n\n\t\tvar workers = {};\n\n\t\tvar formatData = function(type, data){\n\t\t\treturn {\n\t\t\t\ttime: data.time,\n\t\t\t\thourTime: moment(data.time).format(\"H:mm:ss\"),\n\t\t\t\taction: type,\n\t\t\t\tlevelName: level[data.data.level].name,\n\t\t\t\tlevelClass: level[data.data.level].classStyle,\n\t\t\t\tdetail: events[type].format(data.data),\n\t\t\t\tworker: data.data.worker,\n\t\t\t\tworkerClass : cleanWorkerName(data.data.worker),\n\t\t\t\tcolor: getColor(data)\n\t\t\t};\n\t\t};\n\n\t\tvar getColor = function(data) {\n\t\t\tif (workers[data.data.worker] === undefined)\n\t\t\t{\n\t\t\t\t\tworkers[data.data.worker] = colors[Object.keys(workers).length];\n\t\t\t}\n\t\t\treturn workers[data.data.worker];\n\t\t};\n\n\n\t\tvar colors = [\"#1f77b4\", \"#aec7e8\", \"#ff7f0e\", \"#ffbb78\", \"#2ca02c\", \"#98df8a\",\n\t\t\"#d62728\", \"#ff9896\", \"#9467bd\", \"#c5b0d5\", \"#8c564b\", \"#c49c94\", \"#e377c2\",\n\t\t\"#f7b6d2\", \"#7f7f7f\", \"#c7c7c7\", \"#bcbd22\", \"#dbdb8d #\", \"17becf\", \"#9edae5\"];\n\n\n\t\t/**\n\t\t * Insert new events in the DOM\n\t\t *\n\t\t */\n\t\tfunction appendLog(type, data)\n\t\t{\n\t\t\tif ($(\"input[data-rel=\"+level[data.data.level].name+\"]\").is(\":checked\"))\n\t\t\t{\n\t\t\t\t$( \"#log-area\" ).append(\n\t\t\t\t\t$(\"#log-template\").render(formatData(type, data))\n\t\t\t\t);\n\n\t\t\t\tif (!counters.verbosity.hasOwnProperty(level[data.data.level].name)) {\n\t\t\t\t\taddCounter(\"verbosity\", level[data.data.level].name, $(\"#log-sweeper-form span[data-rel=\"+level[data.data.level].name+\"]\"));\n\t\t\t\t}\n\n\t\t\t\tif (!counters.type.hasOwnProperty([type])) {\n\t\t\t\t\taddCounter(\"type\", type, $(\"#log-sweeper-form span[data-rel=\"+type+\"]\"));\n\t\t\t\t}\n\n\t\t\t\tincrCounter(\"verbosity\", level[data.data.level].name, 1);\n\t\t\t\tincrCounter(\"type\", type, 1);\n\t\t\t\tincrCounter(\"general\", \"g\", 1);\n\t\t\t}\n\t\t}\n\n\t\tfunction init(e)\n\t\t{\n\t\t\tvar socket = new WebSocket(\"ws://\"+CUBE_URL+\"/1.0/event/get\");\n\n\t\t\tsocket.onopen = function() {\n\t\t\t\tsocket.send(JSON.stringify({\n\t\t\t\t\t\"expression\": events[e].expression,\n\t\t\t\t\t\"start\": formatISO(stop)\n\t\t\t\t}));\n\t\t\t};\n\n\t\t\tsocket.onmessage = function(message) {\n\t\t\t\tappendLog(e, JSON.parse(message.data));\n\t\t\t};\n\t\t}\n\n\t\t$(\"#clear-log-area\").on(\"click\", function(){\n\t\t\t$(\"#log-area\").children().remove();\n\t\t\tresetCounters();\n\t\t});\n\n\t\t$(\"#log-filter-form\").on(\"change\", \"input\", function(e){\n\n\t\t\tvar rel = $(this).data(\"rel\");\n\n\t\t\t$(\"#log-area\").append(\"<li class=\\\"filter-event\\\"><b>\"+ ($(this).is(\":checked\") ? \"Start\" : \"Stop\") +\n\t\t\t\t\"</b> listening to <em>\" + rel + \"</em> events</li>\");\n\n\t\t\tvar mutedLevels = $.cookie(\"ResqueBoard.mutedLevel\", {path: \"/logs\"});\n\t\t\tmutedLevels = mutedLevels.split(\",\");\n\n\t\t\tif ($(this).is(\":checked\")) {\n\t\t\t\tvar index = mutedLevels.indexOf(rel);\n\t\t\t\tif (index !== -1) {\n\t\t\t\t\tmutedLevels.splice(index, 1);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmutedLevels[mutedLevels.length] = rel;\n\t\t\t}\n\t\t\t$.cookie(\"ResqueBoard.mutedLevel\", mutedLevels.join(\",\"), {expires: 365, path : \"/logs\"});\n\n\t\t});\n\n\n\t\t$(\"#log-sweeper-form\").on(\"click\", \"button[data-rel=verbosity]\", function(e){\n\t\t\t\tvar toRemove = $(\"#log-area\").children(\"li[data-verbosity=\"+$(this).data(\"level\")+\"]\");\n\t\t\t\tupdateCounters(toRemove);\n\t\t\t\ttoRemove.remove();\n\n\t\t\treturn false;\n\t\t});\n\n\t\t$(\"#log-sweeper-form\").on(\"click\", \"button[data-rel=type]\", function(e){\n\t\t\tvar toRemove = $(\"#log-area\").children(\"li[data-type=\"+$(this).data(\"type\")+\"]\");\n\t\t\tupdateCounters(toRemove);\n\t\t\ttoRemove.remove();\n\n\t\t\treturn false;\n\t\t});\n\n\n\n\n\t}", "constructor(config) {\r\n if(config == null){\r\n throw new Error;\r\n }else{\r\n this._config = config;\r\n this._state = this._config.initial;\r\n this._history = new Array(this._state);\r\n }\r\n }", "function LLog(){\n var level_name = {\n 0: \"trace\",\n 1: \"debug\",\n 2: \"info\",\n 3: \"warning\",\n 4: \"error\",\n 5: \"fatal\"\n };\n this.log = function(level, o1, o2, o3, o4, o5){\n console.log(\n level_name[level] + \": \", \n o1 ? o1 : \"\",\n o2 ? o2 : \"\",\n o3 ? o3 : \"\",\n o4 ? o4 : \"\",\n o5 ? o5 : \"\"\n );\n };\n \n this.log.trace = function(o1, o2, o3, o4, o5){this(0, o1, o2, o3, o4, o5)};\n this.log.debug = function(o1, o2, o3, o4, o5){this(1, o1, o2, o3, o4, o5)};\n this.log.info = function(o1, o2, o3, o4, o5){this(2, o1, o2, o3, o4, o5)};\n this.log.warning = function(o1, o2, o3, o4, o5){this(3, o1, o2, o3, o4, o5)};\n this.log.error = function(o1, o2, o3, o4, o5){this(4, o1, o2, o3, o4, o5)};\n this.log.fatal = function(o1, o2, o3, o4, o5){this(5, o1, o2, o3, o4, o5)};\n \n return this.log;\n}", "async function initialize() {\n enableLogging = await isLoggingEnabled();\n}", "async componentDidMount() {\n try {\n const log = await this.props.model.detailedLog(this.props.commit.commit);\n this.setState({\n info: log.modified_file_note,\n numFiles: log.modified_files_count,\n insertions: log.number_of_insertions,\n deletions: log.number_of_deletions,\n modifiedFiles: log.modified_files,\n loadingState: 'success'\n });\n }\n catch (err) {\n console.error(`Error while getting detailed log for commit ${this.props.commit.commit} and path ${this.props.model.pathRepository}`, err);\n this.setState({ loadingState: 'error' });\n return;\n }\n }" ]
[ "0.7099939", "0.616929", "0.59051645", "0.5846553", "0.5841246", "0.57970935", "0.5743371", "0.5742514", "0.57094747", "0.56751317", "0.56672806", "0.5659692", "0.56566083", "0.5607742", "0.56006205", "0.5588992", "0.55870265", "0.5572705", "0.5559805", "0.553346", "0.55241406", "0.54711664", "0.5454842", "0.5439872", "0.5419076", "0.5405817", "0.5393852", "0.5389588", "0.5371911", "0.5365136", "0.5357135", "0.5334769", "0.53345317", "0.5324006", "0.52854156", "0.5263425", "0.525459", "0.5248691", "0.52477485", "0.52461135", "0.52457505", "0.52428764", "0.5240585", "0.52328515", "0.5203761", "0.52022564", "0.5198102", "0.5171355", "0.5155612", "0.51364344", "0.51311773", "0.5130695", "0.5114568", "0.51088727", "0.5108785", "0.51067823", "0.5102318", "0.50995314", "0.50920784", "0.50839424", "0.5080876", "0.50732696", "0.506698", "0.50641495", "0.5056975", "0.5052662", "0.50308186", "0.5027365", "0.50234175", "0.50172466", "0.5016571", "0.50069225", "0.50034434", "0.49937803", "0.49859998", "0.49776003", "0.49764195", "0.4970369", "0.4969786", "0.49595043", "0.49589804", "0.49572262", "0.4954435", "0.4952661", "0.4932139", "0.4928663", "0.4925912", "0.49143544", "0.4911576", "0.49094132", "0.49079788", "0.49045134", "0.49045134", "0.49040726", "0.49040726", "0.49027914", "0.48998857", "0.48974514", "0.48962188", "0.48720595" ]
0.5065988
63
'fix' security options in configOptions parameter
function configureOptions(configOptions) { logger.trace("Fixing server SSL options");//, configOptions); var options = {}; options.https = {}; logger.trace("Fixing SSL key: ", JSON.stringify(configOptions.https.key)); if (!_.isUndefined(configOptions.https.key) && _.isString(configOptions.https.key)) { logger.trace("Loading SSL key file: ", configOptions.https.key); options.https.key = fs.readFileSync(configOptions.https.key); } if (!_.isUndefined(configOptions.https.cert) && _.isString(configOptions.https.cert)) { logger.trace("Loading SSL cert file: ", configOptions.https.cert); options.https.cert = fs.readFileSync(configOptions.https.cert); } if (!_.isUndefined(configOptions.https.pfx) && _.isString(configOptions.https.pfx)) { logger.trace("Loading SSL pfx file: ", configOptions.https.pfx); options.https.pfx = fs.readFileSync(configOptions.https.pfx); } options.https.requestCert = configOptions.https.requestCert; options.https.rejectUnauthorized = configOptions.https.rejectUnauthorized; options.https.agent = configOptions.https.agent; if (!_.isUndefined(configOptions.https.ca) && Array.isArray(configOptions.https.ca)) { options.https.ca = []; for (var i = 0; i < configOptions.https.ca.length; i++) { logger.trace("Loading SSL ca file: ", configOptions.https.ca[i]); options.https.ca[i] = fs.readFileSync(configOptions.https.ca[i]); } } options.https.passphrase = configOptions.https.passphrase; return options; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initConfig(ctx) {\n return __awaiter(this, void 0, void 0, function* () {\n const isTrusted = stateUtils_1.getFromWorkspaceState(WORKSPACE_IS_TRUSTED_KEY, false);\n if (isTrusted !== defaultConfig.workspaceIsTrusted()) {\n defaultConfig.toggleWorkspaceIsTrusted();\n }\n ctx.subscriptions.push(vscode.commands.registerCommand('go.workspace.isTrusted.toggle', toggleWorkspaceIsTrusted));\n if (isTrusted) {\n return;\n }\n const ignored = ignoredWorkspaceConfig(vscode.workspace.getConfiguration('go'), SECURITY_SENSITIVE_CONFIG);\n if (ignored.length === 0) {\n return;\n }\n const ignoredSettings = ignored.map((x) => `\"go.${x}\"`).join(',');\n const val = yield vscode.window.showWarningMessage(`Some workspace/folder-level settings (${ignoredSettings}) from the untrusted workspace are disabled ` +\n `by default. If this workspace is trusted, explicitly enable the workspace/folder-level settings ` +\n `by running the \"Go: Toggle Workspace Trust Flag\" command.`, 'OK', 'Trust This Workspace', 'More Info');\n switch (val) {\n case 'Trust This Workspace':\n yield toggleWorkspaceIsTrusted();\n break;\n case 'More Info':\n vscode.env.openExternal(vscode.Uri.parse(`https://github.com/golang/vscode-go/blob/master/docs/settings.md#security`));\n break;\n default:\n break;\n }\n });\n}", "function manipulateOptions(opts) {\n\t opts.blacklist.push(\"regenerator\");\n\t}", "function manipulateOptions(opts) {\n\t opts.blacklist.push(\"regenerator\");\n\t}", "get advancedSecurityOptionsInput() {\n return this._advancedSecurityOptions;\n }", "function safeConfig(config) {\n // access control is shallow references only\n var readOnly = new Set(['httpEndpoint', 'abiCache']);\n var readWrite = new Set(['verbose', 'debug', 'broadcast', 'logger', 'sign']);\n var protectedConfig = {};\n\n Object.keys(config).forEach(function (key) {\n Object.defineProperty(protectedConfig, key, {\n set: function set(value) {\n if (readWrite.has(key)) {\n config[key] = value;\n return;\n }\n throw new Error('Access denied');\n },\n\n get: function get() {\n if (readOnly.has(key) || readWrite.has(key)) {\n return config[key];\n }\n throw new Error('Access denied');\n }\n });\n });\n return protectedConfig;\n}", "function manipulateOptions(opts) {\n opts.blacklist.push(\"regenerator\");\n}", "get configuration () {\n // Always returns a copy of the authentication configuration\n return Object.assign({}, defaultOptions, this.app.get(this.configKey));\n }", "function configureSecurity() {\n app.use(helmet());\n app.use(cookieParser());\n app.use(helmet.noCache());\n app.enable('trust proxy');\n if (!isLocal) {\n app.use(express_enforces_ssl());\n }\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(options, user_options);\n}", "function SecurityConfigurationProvider() {\n\n /**\n * Configuration with defaults.\n */\n var config = {\n\n /**\n * Name of the cache that is used for the authenticated user details. \n */\n cacheName : 'authCache',\n\n /**\n * Name of the cache key under which the authenticated user details are stored.\n */\n userCacheKey : 'user',\n\n /**\n * URL of the web-service for the user authentication resource, this is effectively a\n * \"login\" * when valid credentials are supplied.\n * \n * A GET request is issued to this secured URL end-point to establish the server\n * security context and return authenticated user details.\n */\n authenticationUrl : '/user',\n\n /**\n * URL of the web-service used to logout the currently authenticated user. \n */\n logoutUrl : '/logout',\n\n /**\n * View state to change to when a login is required.\n */\n loginState : '/login',\n\n /**\n * Default view state to change to after a successful login.\n */\n afterLoginState : '/home',\n\n /**\n * Name of the request parameter that is used to set the new view state after a\n * successful login.\n * \n * Use of this parameter enables switching to the originally requested view state after\n * a successful login (e.g. as a result of deep-linking).\n * \n * This configuration parameter is optional, if it is not set then after a login the\n * view-state will always change to the configured 'afterLoginState' value.\n * \n * This request parameter and the target view state value will be visible in the\n * browser address bar while on the login page - this is unavoidable.\n */\n afterLoginParameter: 'then',\n\n /**\n * View state to change to after a successful logout.\n */\n afterLogoutState : '/home',\n\n /**\n * View state to change to when the current user requests a resource that they are not\n * authorised to access.\n */\n notAuthorisedState : '/not-authorised',\n\n /**\n * View state to change to when some other unhandled error response is returned.\n * \n * This is for e.g. 500 errors rather than authorisation errors.\n */\n errorState : '/error' // FIXME maybe a dedicated 404 error page too?\n\n };\n\n this.cacheName = function(value) {\n config.cacheName = value;\n };\n \n this.userCacheKey = function(value) {\n config.userCacheKey = value;\n };\n\n this.authenticationUrl = function(value) {\n config.authenticationUrl = value;\n };\n\n this.logoutUrl = function(value) {\n config.logoutUrl = value;\n };\n\n this.loginState = function(value) {\n config.loginState = value;\n };\n\n this.afterLoginState = function(value) {\n config.afterLoginState = value;\n };\n\n this.afterLoginParameter = function(value) {\n config.afterLoginParameter = value;\n };\n\n this.afterLogoutState = function(value) {\n config.afterLogoutState = value;\n };\n\n this.notAuthorisedState = function(value) {\n config.notAuthorisedState = value;\n };\n\n this.errorState = function(value) {\n config.errorState = value;\n };\n\n this.$get = function configProviderFactory() {\n return config;\n };\n\n}", "function manipulateOptions(opts) {\n opts.blacklist.push(\"react\");\n}", "function configure(user_options) {\n options = inherit$1(options, user_options);\n }", "function manipulateOptions(opts) {\n\t opts.blacklist.push(\"react\");\n\t}", "function manipulateOptions(opts) {\n\t opts.blacklist.push(\"react\");\n\t}", "function configure(user_options) {\n options = inherit(options, user_options);\n }", "normalizeContextOptions(givenContextOptions) {\n\n let cOptions = givenContextOptions || {};\n\n // by default we do not bypass authentication\n cOptions.bypassAuth = u.thisOrThat(cOptions.bypassAuth, false);\n\n // decode html enntities for this call?\n cOptions.decodeHtmlEntities = u.thisOrThat(cOptions.decodeHtmlEntities,\n this._userConfig.decodeHtmlEntities);\n\n // how many attempts left do we have to retry an endpoint?\n\n // use the given retryAttemptsLeft, or the retryAttempts passed in the\n // context options if not specified\n cOptions.retryAttemptsLeft = u.thisOrThat(cOptions.retryAttemptsLeft,\n cOptions.retryAttempts);\n\n // use the given retryAttemptsLeft, or the retryAttempts passed in the\n // user configuration\n cOptions.retryAttemptsLeft = u.thisOrThat(cOptions.retryAttemptsLeft,\n this._userConfig.retryAttempts);\n\n // delay between retrying an endpoint\n cOptions.retryDelay = u.thisOrThat(cOptions.retryDelay,\n this._userConfig.retryDelay);\n\n // milliseconds before a request times out\n cOptions.requestTimeout = u.thisOrThat(cOptions.requestTimeout,\n this._userConfig.requestTimeout);\n\n // how many reauthentication attempts do we have left?\n cOptions.reauthAttemptsLeft = u.thisOrThat(cOptions.reauthAttemptsLeft,\n cOptions.retryAttemptsLeft);\n\n return cOptions;\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 configure(user_options) {\n options = inherit(options, user_options);\n }", "function config(opt) {\n options = Object.assign({}, options, opt);\n }", "validateServerConfig(config) {\n if (!config.cookie || typeof config.cookie !== 'object') {\n throw new utils_1.Exception('Missing \"cookie\" config inside the \"http\" block in \"config/app\" file.');\n }\n if (typeof config.trustProxy !== 'function') {\n throw new utils_1.Exception('Invalid \"trustProxy\" value inside the \"http\" block in \"config/app\" file.');\n }\n }", "static get defaultOptions() {\n return mergeObject(super.defaultOptions, {\n id: \"userPermissionConfig\",\n title: \"Material Deck: \"+game.i18n.localize(\"MaterialDeck.Sett.Permission\"),\n template: \"./modules/MaterialDeck/templates/userPermissionConfig.html\",\n width: 660,\n height: \"auto\",\n scrollY: [\".permissions-list\"],\n });\n }", "get configuration() {\n // Always returns a copy of the authentication configuration\n return Object.assign({}, options_1.default, this.app.get(this.configKey));\n }", "function ExtraOptions() {}", "function ExtraOptions() {}", "function fixConfig() {\n if (typeof Cypress === 'undefined') {\n throw new Error('Please use from within Cypress.io');\n }\n\n if (typeof Cypress.env(CONFIG_KEY) === 'string') {\n Cypress.env(CONFIG_KEY, JSON.parse(Cypress.env(CONFIG_KEY)));\n }\n}", "getConfig({ isAuth }, cancelToken) {\n return new Promise((resolve, reject) => {\n api.get('/config', {\n isAuthorization: isAuth || false,\n cancelToken,\n })\n .then((res) => {\n resolve(res);\n })\n .catch((err) => {\n reject(this.getErrorMessage(err));\n });\n });\n }", "function resolveConfig(currentData, options) {\n var data = _.merge({}, currentData , options);\n\n var optionsKeys = flattenKeys(data);\n\n /* The expected keys that should be present in the config file or in the command line args */\n var requiredKeys = [\"transifex.api\", \"transifex.auth.user\", \"transifex.auth.pass\", \"transifex.projectSlug\",\n \"transifex.langCoordinators\", \"transifex.sourceLanguage\", \"localProject.stringsPath\",\n \"localProject.sourceLangStringsPath\"];\n\n var missingProperties = requiredKeys.filter(function (k) { return !_.contains(optionsKeys, k); });\n if (!_.isEmpty(missingProperties)) {\n grunt.fatal(\"missing option(s): \" + missingProperties.join(\", \"));\n }\n return data;\n }", "static get configurable() {\n return {\n align: {\n value: null,\n $config: {\n merge: 'replace'\n }\n }\n };\n }", "static get configurable() {\n return {\n align: {\n value: null,\n $config: {\n merge: 'replace'\n }\n }\n };\n }", "function fixConfig() {\n if (typeof Cypress.env(CONFIG_KEY) === 'string') {\n Cypress.env(CONFIG_KEY, JSON.parse(Cypress.env(CONFIG_KEY)));\n }\n}", "function fixConfig(ts, config) {\n // Delete options that *should not* be passed through.\n delete config.options.out;\n delete config.options.outFile;\n delete config.options.composite;\n delete config.options.declarationDir;\n delete config.options.declarationMap;\n delete config.options.emitDeclarationOnly;\n delete config.options.tsBuildInfoFile;\n delete config.options.incremental;\n // Target ES5 output by default (instead of ES3).\n if (config.options.target === undefined) {\n config.options.target = ts.ScriptTarget.ES5;\n }\n // Target CommonJS modules by default (instead of magically switching to ES6 when the target is ES6).\n if (config.options.module === undefined) {\n config.options.module = ts.ModuleKind.CommonJS;\n }\n return config;\n}", "optionsToSanitizeHtml(options) {\n return {\n ...sanitizeHtml.defaults,\n allowedTags: self.toolbarToAllowedTags(options),\n allowedAttributes: self.toolbarToAllowedAttributes(options),\n allowedClasses: self.toolbarToAllowedClasses(options),\n allowedStyles: self.toolbarToAllowedStyles(options)\n };\n }", "includeConfigOption(context, prevArgv) {\n const { primaryDriver } = context;\n const configPath = context.findConfigByName(primaryDriver.metadata.configName);\n const argv = [...prevArgv];\n if (configPath && primaryDriver.metadata.configOption) {\n argv.push(primaryDriver.metadata.configOption, configPath.path.path());\n }\n this.debug('Including config option to args');\n return argv;\n }", "function sanitizeAndConfigure(scope, options) {\n var selectEl = element.find('md-select-menu');\n\n if (!options.target) {\n throw new Error($mdUtil.supplant(ERRROR_TARGET_EXPECTED, [options.target]));\n }\n\n angular.extend(options, {\n isRemoved: false,\n target: angular.element(options.target), //make sure it's not a naked dom node\n parent: angular.element(options.parent),\n selectEl: selectEl,\n contentEl: element.find('md-content'),\n optionNodes: selectEl[0].getElementsByTagName('md-option')\n });\n }", "function sanitizeAndConfigure(scope, options) {\n var selectEl = element.find('md-select-menu');\n\n if (!options.target) {\n throw new Error($mdUtil.supplant(ERRROR_TARGET_EXPECTED, [options.target]));\n }\n\n angular.extend(options, {\n isRemoved: false,\n target: angular.element(options.target), //make sure it's not a naked dom node\n parent: angular.element(options.parent),\n selectEl: selectEl,\n contentEl: element.find('md-content'),\n optionNodes: selectEl[0].getElementsByTagName('md-option')\n });\n }", "function buildConfiguration(_a) {\r\n var auth = _a.auth, _b = _a.cache, cache = _b === void 0 ? {} : _b, _c = _a.system, system = _c === void 0 ? {} : _c, _d = _a.framework, framework = _d === void 0 ? {} : _d;\r\n var overlayedConfig = {\r\n auth: __assign({}, DEFAULT_AUTH_OPTIONS, auth),\r\n cache: __assign({}, DEFAULT_CACHE_OPTIONS, cache),\r\n system: __assign({}, DEFAULT_SYSTEM_OPTIONS, system),\r\n framework: __assign({}, DEFAULT_FRAMEWORK_OPTIONS, framework)\r\n };\r\n return overlayedConfig;\r\n }", "function config(options) {\n options = options || {};\n\n if (options.pfxFile) {\n apiConfig.pfxFile = lib.fs.readFileSync(options.pfxFile);\n }\n\n if (options.passphrase) {\n apiConfig.passphrase = options.passphrase;\n }\n\n if (options.failRedirectUrl) {\n apiConfig.failRedirectUrl = options.failRedirectUrl;\n }\n\n if (options.successRedirectUrl) {\n apiConfig.successRedirectUrl = options.successRedirectUrl;\n }\n}", "function dataProvidersConfig(options) {\n options = Object(options);\n\n Object.keys(cfg).forEach(function (key) {\n return changeCfgOption(options, key);\n });\n}", "modifyBlogPluginOptions(blogPluginOptions) {\n return blogPluginOptions\n }", "function sanitizeAndConfigure(scope, options) {\n var selectEl = element.find('md-select-menu');\n\n if (!options.target) {\n throw new Error($mdUtil.supplant(ERROR_TARGET_EXPECTED, [options.target]));\n }\n\n angular.extend(options, {\n isRemoved: false,\n target: angular.element(options.target), //make sure it's not a naked dom node\n parent: angular.element(options.parent),\n selectEl: selectEl,\n contentEl: element.find('md-content'),\n optionNodes: selectEl[0].getElementsByTagName('md-option')\n });\n }", "forceSSL(opt = {}) {\n this.enableForceSSL = opt;\n }", "function ExtraOptions(){}", "function sanitizeAndConfigure(scope, options) {\n var selectEl = element.find('md-select-menu');\n\n if (!options.target) {\n throw new Error($mdUtil.supplant(ERROR_TARGET_EXPECTED, [options.target]));\n }\n\n angular.extend(options, {\n isRemoved: false,\n target: angular.element(options.target), //make sure it's not a naked dom node\n parent: angular.element(options.parent),\n selectEl: selectEl,\n contentEl: element.find('md-content'),\n optionNodes: selectEl[0].getElementsByTagName('md-option')\n });\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 resolveRegionalEndpointsFlag(originalConfig, options) {\n originalConfig = originalConfig || {};\n //validate config value\n var resolved;\n if (originalConfig[options.clientConfig]) {\n resolved = validateRegionalEndpointsFlagValue(originalConfig[options.clientConfig], {\n code: 'InvalidConfiguration',\n message: 'invalid \"' + options.clientConfig + '\" configuration. Expect \"legacy\" ' +\n ' or \"regional\". Got \"' + originalConfig[options.clientConfig] + '\".'\n });\n if (resolved) return resolved;\n }\n if (!AWS.util.isNode()) return resolved;\n //validate environmental variable\n if (Object.prototype.hasOwnProperty.call(process.env, options.env)) {\n var envFlag = process.env[options.env];\n resolved = validateRegionalEndpointsFlagValue(envFlag, {\n code: 'InvalidEnvironmentalVariable',\n message: 'invalid ' + options.env + ' environmental variable. Expect \"legacy\" ' +\n ' or \"regional\". Got \"' + process.env[options.env] + '\".'\n });\n if (resolved) return resolved;\n }\n //validate shared config file\n var profile = {};\n try {\n var profiles = AWS.util.getProfilesFromSharedConfig(AWS.util.iniLoader);\n profile = profiles[process.env.AWS_PROFILE || AWS.util.defaultProfile];\n } catch (e) {};\n if (profile && Object.prototype.hasOwnProperty.call(profile, options.sharedConfig)) {\n var fileFlag = profile[options.sharedConfig];\n resolved = validateRegionalEndpointsFlagValue(fileFlag, {\n code: 'InvalidConfiguration',\n message: 'invalid ' + options.sharedConfig + ' profile config. Expect \"legacy\" ' +\n ' or \"regional\". Got \"' + profile[options.sharedConfig] + '\".'\n });\n if (resolved) return resolved;\n }\n return resolved;\n}", "function sanitizeAndConfigure(scope, options) {\n var selectEl = element.find('md-select-menu');\n\n if (!options.target) {\n throw new Error($mdUtil.supplant(ERROR_TARGET_EXPECTED, [options.target]));\n }\n\n angular.extend(options, {\n isRemoved: false,\n target: angular.element(options.target), // make sure it's not a naked DOM node\n parent: angular.element(options.parent),\n selectEl: selectEl,\n contentEl: element.find('md-content'),\n optionNodes: selectEl[0].getElementsByTagName('md-option')\n });\n }", "async toggleConfig(force) {\n await this._vieux.toggle_config(force);\n }", "function ExtraOptions() { }", "function ExtraOptions() { }", "validateConfig(option) {\n if (typeof option !== \"string\") {\n throw new Error(`Configuration for rule \"${this.name}\" is invalid: Expected string got ${typeof option}`);\n }\n if ([\"tabs\", \"spaces\", \"nonmixed\"].indexOf(option) === -1) {\n throw new Error(`Configuration for rule \"${this.name}\" is invalid: Indent style \"${option}\" is not valid. Valid indent styles are \"tabs\", \"spaces\" and \"nonmixed\"`);\n }\n return option;\n }", "_setAdminFromConfig() {\n\t\tlet admin_key, admin_cert, mspid = null;\n\t\tif (!this._network_config) {\n\t\t\tthrow new Error('No network configuration has been loaded');\n\t\t}\n\n\t\tconst client_config = this._network_config.getClientConfig();\n\t\tif (client_config && client_config.organization) {\n\t\t\tconst organization_config = this._network_config.getOrganization(client_config.organization, true);\n\t\t\tif (organization_config) {\n\t\t\t\tmspid = organization_config.getMspid();\n\t\t\t\tadmin_key = organization_config.getAdminPrivateKey();\n\t\t\t\tadmin_cert = organization_config.getAdminCert();\n\t\t\t}\n\t\t}\n\t\t// if we found all we need then set the admin\n\t\tif (admin_key && admin_cert && mspid) {\n\t\t\tthis.setAdminSigningIdentity(admin_key, admin_cert, mspid);\n\t\t}\n\t}", "removeConfig(payload, option) {\n this._dirty = true;\n // In the scales case we need to remove the uuid related to the scale object\n if (option === ATTRIBUTE_CARTESIAN_AXES) {\n Object.keys(this._config[option])\n .filter((scale) => this._config[option][scale])\n .forEach((scale) => {\n this._config[option][scale] = this._config[option][scale].filter(\n (axis) => axis.uuid !== payload[scale][0].uuid\n );\n this._scales[scale] = this._config[option][scale];\n });\n } else {\n // remove the option\n this._config[option] = undefined;\n }\n }", "_configOptions(config) {\n this.options = {\n containerSelector: '#gol-container',\n style: 'canvas',\n cellSize: 20,\n speed: 1,\n\n size: {\n width: 1860,\n height: 930\n }\n };\n \n if(config) {\n Object.assign(this.options, config);\n }\n }", "function setConfigObject (config, prev) {\n Object.keys(config).forEach(function (key) {\n var value = config[key]\n var fullKey = prev ? prev + '.' + key : key\n \n // if the value is an inner object and we have dot-notation\n // enabled, treat inner objects in config the same as\n // heavily nested dot notations (foo.bar.apple).\n if (typeof value === 'object' && !Array.isArray(value) && configuration['dot-notation']) {\n // if the value is an object but not an array, check nested object\n setConfigObject(value, fullKey)\n } else {\n // setting arguments via CLI takes precedence over\n // values within the config file.\n if (!hasKey(argv, fullKey.split('.')) || (flags.defaulted[fullKey])) {\n setArg(fullKey, value)\n }\n }\n })\n }", "function configure(opts) {\n var port = opts && typeof opts.port !== 'undefined' ? opts.port : 8000;\n var editOn = opts && typeof opts.editOn !== 'undefined' ? opts.editOn : 'edit';\n var editOff = opts && typeof opts.editOff !== 'undefined' ? opts.editOff : 'edit_off';\n var config = {\n adminTitle: 'Log in | Django site admin',\n // TODO:\n // - configure languages with djangocms-helper\n // - remove hardcoded host, port, language values\n baseUrl: 'http://localhost:' + port + '/en/',\n editUrl: 'http://localhost:' + port + '/en/?' + editOn,\n editOffUrl: 'http://localhost:' + port + '/en/?edit_off',\n adminUrl: 'http://localhost:' + port + '/en/admin/login/',\n adminLogoutUrl: 'http://localhost:' + port + '/en/admin/logout/',\n adminPagesUrl: 'http://localhost:' + port + '/en/admin/cms/page/',\n adminUsersUrl: 'http://localhost:' + port + '/en/admin/auth/user/',\n credentials: {\n username: 'admin',\n password: 'admin'\n },\n content: {\n page: {\n title: 'First page',\n text: 'First page content'\n }\n },\n user: {\n firstName: 'test-first-name',\n lastName: 'test-last-name',\n userEmail: '[email protected]',\n username: 'test-add-user',\n password: 'test'\n }\n };\n\n return config;\n}", "function sanitizeAndConfigure(scope,options){var selectEl=element.find('md-select-menu');if(!options.target){throw new Error($mdUtil.supplant(ERROR_TARGET_EXPECTED,[options.target]));}angular.extend(options,{isRemoved:false,target:angular.element(options.target),//make sure it's not a naked dom node\n\tparent:angular.element(options.parent),selectEl:selectEl,contentEl:element.find('md-content'),optionNodes:selectEl[0].getElementsByTagName('md-option')});}", "_validateConfig() {\n if (!Array.isArray(this.options.configGroups)) {\n throw new Error('options.configGroups is not an array');\n } else if (!this.options.configGroups.length) {\n throw new Error('options.configGroups must have at least one config object');\n }\n // checking fields which MUST be specified in configGroups. (Only one as of now :D)\n const mustInclude = ['targetXPath'];\n this.options.configGroups.forEach((group) => {\n mustInclude.forEach((field) => {\n // eslint-disable-next-line no-prototype-builtins\n if (!group.hasOwnProperty(field)) {\n throw new Error(`${field} must be specified in all configs in options.configGroups`);\n }\n });\n });\n // type checks for crucial fields\n // expected types for crucial fields in the config\n // may do type checking for all fields in the future but it's just not necessary as of now\n const expectedTypes = {\n targetXPath: 'string',\n renderToPath: 'string',\n urlMatch: 'string',\n };\n this.options.configGroups.forEach((group) => {\n Object.keys(expectedTypes).forEach((key) => {\n // eslint-disable-next-line no-prototype-builtins\n if (group.hasOwnProperty(key) && (typeof group[key] !== typeof expectedTypes[key])) {\n throw new Error(`${key} must be of type ${expectedTypes[key]}`);\n }\n });\n });\n // check correct factorization\n this.options.configGroups.forEach((group) => {\n Object.keys(group).forEach((key) => {\n if (this._propsNotInConfigGroup.indexOf(key) >= 0) {\n throw new Error(`${key} is not a property of a configGroup. Specify this key at the outermost layer`);\n }\n });\n });\n // if control reaches this point, the config is acceptable. It may not be perfect since the checks\n // are pretty loose, but at least the crucial parts of it are OK. May add more checks in the future.\n }", "function restoreOptionsFromFactorySettings() {\n restoreOptions(Object.assign({}, factorySettings));\n}", "configureAuthentication(_properties) {\n let properties = _properties ? JSON.parse(_properties): null;\n if (properties) {\n let auth = properties.api && properties.api.authentication;\n let contextPath = {\n oauth: \"snap-oauth\",\n snap: \"snap-api\",\n flowable: \"flow-api\"\n };\n if (auth === \"Basic Auth\") {\n this.config.enableOauth = false;\n contextPath.flowable = \"flowable-task\";\n }\n this.config.contextPath = contextPath;\n __WEBPACK_IMPORTED_MODULE_0_snapclinical__[\"client\"].enableOauth = this.config.enableOauth;\n __WEBPACK_IMPORTED_MODULE_0_snapclinical__[\"client\"].contextPath = this.config.contextPath;\n }\n }", "mergeConfig(state, config) {\n if (typeof config !== 'object') {\n console.error('config is not an object', config);\n return;\n }\n\n // security: do not accept dynamic parentOrigin\n const parentOrigin = (\n state.config && state.config.ui\n && state.config.ui.parentOrigin\n )\n ? state.config.ui.parentOrigin\n : config.ui.parentOrigin || window.location.origin;\n const configFiltered = {\n ...config,\n ...{ ui: { ...config.ui, parentOrigin } },\n };\n if (state.config && state.config.ui && state.config.ui.parentOrigin\n && config.ui && config.ui.parentOrigin\n && config.ui.parentOrigin !== state.config.ui.parentOrigin\n ) {\n console.warn('ignoring parentOrigin in config: ', config.ui.parentOrigin);\n }\n state.config = mergeConfig(state.config, configFiltered);\n }", "function _getConfigHtmlTagWhitelist() {\n var configHtmlTagWhitelist = jrsConfigs.xssHtmlTagWhiteList;\n configHtmlTagWhitelist = typeof configHtmlTagWhitelist === 'string' ? configHtmlTagWhitelist : \"\";\n configHtmlTagWhitelist = configHtmlTagWhitelist.replace(/\\s/g, ''); //remove the spaces from xss.soft.html.escape.tag.whitelist in security-config.properties\n\n return configHtmlTagWhitelist;\n}", "function securityIssues(settings, security) {\n const results = [];\n\n if (!!settings.data) {\n if (!!settings.data.customJar && security.JarPath !== true) {\n results.push(\"JarPath\");\n }\n\n if (!!settings.data.javaPath && security.JavaPath !== true) {\n results.push(\"JavaPath\");\n }\n }\n\n if (!!settings.parsers\n /* && security.CustomParsers !== true */\n ) {\n /* const names = Object.keys(settings.parsers);\n if (names.length > 0) {\n results.push(\"CustomParsers\");\n } */\n throw new Error(`Custom parsers are not supported for client implementations.\nTo request this feature be enabled, open an issue at https://github.com/Levertion/mcfunction-langserver`);\n }\n\n return results;\n}", "function dismissConfig() {\n angular.extend(vm.configParams, compiler.settings());\n \n vm.isConfiguring = false;\n vm.dialogActive = false;\n }", "_fixConfig(config) {\n \n if (typeof config !== \"object\") {\n\n config = {\n\n parent: document.body,\n\n\n width: 960,\n\n\n height: 720,\n\n\n scaleX: 1,\n\n\n scaleY: 1,\n\n\n smoothingEnabled: true\n\n };\n\n }else {\n if (typeof config.parent !== \"string\") {\n\n config.parent = document.body;\n\n }\n\n\n\n if (typeof config.width !== \"number\") {\n\n config.width = 960;\n\n }\n\n\n\n if (typeof config.height !== \"number\") {\n\n config.height = 720;\n\n }\n\n\n\n if (typeof config.scaleX !== \"number\") {\n\n config.scaleX = 1;\n\n }\n\n\n\n if (typeof config.scaleY !== \"number\") {\n\n config.scaleY = 1;\n\n }\n\n\n\n if (typeof config.smoothingEnabled !== \"boolean\") {\n\n config.smoothingEnabled = true;\n\n }\n\n }\n\n\n\n return config;\n\n }", "applyOptions(options) {\n Object.assign(this[$options], options);\n // Re-evaluates clamping based on potentially new values for min/max\n // polar, azimuth and radius:\n this.setOrbit();\n // Prevent interpolation in the case that any target spherical values\n // changed (preserving OrbitalControls behavior):\n this[$spherical].copy(this[$targetSpherical]);\n }", "function set_https_secure_check(is_enable) {\n if(!is_enable) {\n console.log(\"[INFO] Turn OFF https security checks\");\n\n // disable https security checks to avoid DEPTH_ZERO_SELF_SIGNED_CERT error\n process.env.NODE_TLS_REJECT_UNAUTHORIZED = \"0\";\n } else if(typeof process.env.NODE_TLS_REJECT_UNAUTHORIZED !== 'undefined') {\n console.log(\"[INFO] Turn ON https security checks\");\n\n // enable https security checks\n delete process.env.NODE_TLS_REJECT_UNAUTHORIZED;\n }\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}" ]
[ "0.58123785", "0.5586632", "0.5586632", "0.5542212", "0.554184", "0.55275524", "0.5465999", "0.54581815", "0.5453196", "0.5453196", "0.5453196", "0.5453196", "0.5453196", "0.5434075", "0.54136807", "0.54118866", "0.5411763", "0.5382656", "0.5382656", "0.53799045", "0.53791094", "0.53637844", "0.53637844", "0.53637844", "0.53637844", "0.53637844", "0.53637844", "0.53637844", "0.53637844", "0.53637844", "0.53637844", "0.53637844", "0.53637844", "0.53637844", "0.53637844", "0.53637844", "0.53637844", "0.53637844", "0.53637844", "0.53637844", "0.53637844", "0.53637844", "0.5299777", "0.5299777", "0.52406913", "0.52272004", "0.5203355", "0.5200911", "0.5156949", "0.5156949", "0.5154154", "0.5146472", "0.5142405", "0.51367503", "0.51367503", "0.5130436", "0.5126992", "0.51177466", "0.51049626", "0.5081863", "0.5081863", "0.50699633", "0.5067168", "0.50550646", "0.50350887", "0.5033729", "0.5032421", "0.5026755", "0.5024604", "0.50027585", "0.500064", "0.49898946", "0.49874157", "0.4971911", "0.4971911", "0.4962449", "0.49553758", "0.4953028", "0.4931641", "0.4925426", "0.4920499", "0.49127856", "0.49023858", "0.49007344", "0.48989525", "0.48952702", "0.4882118", "0.48761374", "0.48681092", "0.486227", "0.48544914", "0.4849278", "0.48362255", "0.48362255", "0.48362255", "0.48362255", "0.48362255", "0.48362255", "0.48362255", "0.48362255" ]
0.59409773
0
define the structured audit logging function
function audit(options, req, res, proxyRes, reqDateTime, resDateTime, err, callback) { // auditService is an instance of http.ClientRequest, and implements the stream.Writable interface // auditRes is an instance of http.IncomingMessage var auditService = http.request(options, function(auditRes) { auditRes.on('data', function(chunk) { logger.trace(req.transactionId+'-Writing structured audit data from audit service, with chunk length (in bytes): ', chunk.length); }); auditRes.on('end', function(data) { logger.trace(req.transactionId+'-End of structured audit write response from audit service'); }); auditRes.on('error', function(e) { logger.error(req.transactionId+'-Error with structured audit write response from audit service, where error: ', e, e.stack); }); }); // set the request socket timeout value, after request is assigned to the socket, emitting the 'socket' Event // sets time-out value for socket after request assigned to socket (i.e. no data activity) // 'socket' is an instance of net.Socket auditService.on('socket', function (socket) { logger.trace(req.transactionId+'-Structured audit data socket event emitted...'); if(options.timeout) { socket.setTimeout(options.timeout); } // set the request socket time-out event handler socket.removeAllListeners('timeout'); socket.on('timeout', function () { logger.error(req.transactionId+'-Structured audit service client experienced a timeout to remote audit service!'); socket.destroy(); }); socket.on('close', function () { logger.trace(req.transactionId+'-Structured audit service client experienced a socket close event to remote audit service!'); }); }); // explicitly throw an descriptive error to be logged if auditService request has an Error event, e.g. can't connect to eCRUD Audit Service endpoint, or audit endpoint socket times out auditService.on('error', function (err) { logger.error(req.transactionId+'-Error with structured audit client request!, where error: ', err, err.stack); }); auditService.on('finish', function () { logger.trace(req.transactionId+'-End request structured audit write to audit service'); }); req = req ? req : {}; res = res ? res : {}; proxyRes = proxyRes ? proxyRes : {}; reqDateTime = reqDateTime ? reqDateTime : {}; resDateTime = resDateTime ? resDateTime : {}; // normalize the err into JSON to avoid cyclical // JSON object conversion errors and ecrud audit storage errors error = {}; error.errno = err.errno; error.message = err.message; error.stack = err.stack; var audit = {}; audit.transactionId = req.transactionId; audit.req = {}; audit.req.url = req.url; audit.req.parsedUrl = req.parsedUrl; audit.req.headers = req.headers; audit.req.method = req.method; audit.req.httpVersion = req.httpVersion; audit.req.trailers = req.trailers; audit.req.remoteAddress = req.connection.remoteAddress; audit.req.key = req.key; audit.req.datetime = reqDateTime; audit.res = {}; audit.res.headers = res.headers; if(!audit.res.headers) { audit.res.headers = res._headers; } if(!audit.res.headers) { audit.res.headers = res._header; } audit.res.statusCode = res.statusCode; audit.res.key = res.key; audit.res.datetime = resDateTime; audit.res.err = error; audit.proxyRes = {}; audit.proxyRes.headers = proxyRes.headers; audit.proxyRes.statusCode = proxyRes.statusCode; var auditStr = JSON.stringify(audit); logger.trace(req.transactionId+'-Structured Auditing string: ' + auditStr); auditService.write(auditStr, 'binary'); auditService.end(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _____INTERNAL_log_functions_____(){}\t\t//{", "function logger(event, payload) {\n let timestamp = new Date();\n console.log({ timestamp, event, payload });//considered a destructured object\n }", "function logSomething(log) { log.info('something'); }", "function log() {\n //log here\n }", "log(_args) {\n\n }", "log() {}", "function logPerson(person){\n\n}", "function logger() {}", "applyAudit() {\n super.applyAudit();\n this.log.debug('This is only another custom messagem from your custom server :)');\n }", "function Log() {}", "function log()\n {\n if (my.logFunction == null)\n return\n\n var meta = ['name', 'QuickQWERTY']\n var data = Array.prototype.slice.call(arguments)\n my.logFunction.apply(this, meta.concat(data))\n }", "function logEvent(eventType) {}", "function LogOperator(){}", "log(kind, msg, data){ this.logger(kind, msg, data) }", "function log (level, message) {\r\n\r\n}", "function _log() {\n // logger.trace.apply(logger, arguments)\n}", "function Audit(audit) {\n /*jshint maxstatements:16 */\n 'use strict';\n // defaults\n this.brand = 'axe';\n this.application = 'axeAPI';\n this.defaultConfig = audit;\n this._init();\n }", "displayAspects() { console.log(this.logtags); }", "function logger() {\r\n // if $log fn is called directly, default to \"info\" message\r\n logger.info.apply(logger, arguments);\r\n }", "function logger(object,event){\n\n var ti = new Date();\n // for main logs\n if(event == 'main'){\n\tfs.writeFile('/var/log/raswall/main.log',ti.toUTCString() + ' SQ ' + object.type + ' : ' + object.data + '\\n', options,function(err){\n });\n }\n // for user specfic logs \n else if(event == 'user'){\n fs.writeFile('/var/log/raswall/users/'+object.username ,ti.toUTCString() + ' SQ ' + object.type + ' : ' + object.data + '\\n', options,function(err){\n });\n }\n\n else if(event == 'debug'){\n fs.writeFile('/var/log/raswall/debug.log' ,ti.toUTCString() + ' SQ ' + object.type + ' : ' + object.data + '\\n', options,function(err){\n });\n }\n}", "function log$2() {\n console.log('%s - %s', timestamp(), format.apply(null, arguments));\n}", "function tlog__(msg){console.log(msg);}", "function log(severity, msg, e) {\n\t\tvar dt = Ext.Date.format(e.issuedAt, 'Y-m-d h:i:s ');\n\t\t\n\t\tif(e && e.issuedBy === 'server') {\n\t\t\tExt.log('[' + severity.toUpperCase() + ']\\t' + msg, '\\n',\n\t\t\t'\\tIssued At : ' + dt, '\\n',\n\t\t\t'\\tError : ' + e.msg);\n\t\t} else {\n\t\t\tExt.log('[' + severity.toUpperCase() + ']\\t' + msg, '\\n',\n\t\t\t\t'\\tIssued At : ' + dt, '\\n',\n\t\t\t\t'\\tSource Class : ' + e.source_class, '\\n',\n\t\t\t\t'\\tSource Method : ' + e.source_method, '\\n',\n\t\t\t\t'\\tError : ' + e, '\\n',\n\t\t\t\t(e instanceof Error ? printStackTrace({\n\t\t\t\t\te : e\n\t\t\t\t}).join('\\t\\n') : '\\n')\n\t\t\t);\n\t\t}\n\t}", "log(...params) {\r\n console.log(this.getLogStamp(), ...params);\r\n }", "function Log3(target, name, descriptor) {\n console.log(\"Method decorator\");\n console.log(target); // prototype\n console.log(name); // getPriceWithTax string\n console.log(descriptor); // { value: getPriceWithTax function }\n}", "function audit(durationSelector) {\n\t return function auditOperatorFunction(source) {\n\t return source.lift(new AuditOperator(durationSelector));\n\t };\n\t}", "function touchlog() {\n //log.apply(undefined, arguments);\n}", "function PrintLog(a)\n{\nlogger.info(a);\n}", "function checkLogs(){\n\n}", "function AttActionLog(reference,subReference,logs,editAtt){\n\tthis.reference = reference;\n\tthis.subReference = subReference;\n\tthis.logs = logs;\n\tthis.editAtt = editAtt;\n}", "function Log2(target, name, descriptor) {\n console.log(\"Access decorator\");\n console.log(target); // prototype\n console.log(name); // price\n console.log(descriptor); // oggetto dove abbiamo il set\n}", "function _logWrapper(sev) {\n var fn = function(message, isPublic) {\n return this.log(sev, message, isPublic);\n };\n return fn;\n}", "function l(pvScriptName,pvFunctionName,pvMessage,pvLevel){\n\n // This function can be passed a pre-formatted log string, usually passed back from the balu-parse-server.\n // In this case, just console.log it, without the preceeding or trailing carriage returns\n if(typeof pvFunctionName === 'undefined' &&\n typeof pvMessage === 'undefined' &&\n typeof pvLevel === 'undefined') {\n console.log(pvScriptName.substring(1,pvScriptName.length));\n return '\\n' + pvScriptName.substring(1,pvScriptName.length);\n }\n\n var lvMaxAppNameLength = 22;\n var lvPadding = ' '.substring(0,lvMaxAppNameLength - gvAppName.length + 1);\n var lvLogText = '';\n\n switch(pvLevel) {\n\n case 'ERROR':\n if (gvLogErrors) {\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case 'PROCS':\n // Short for \"process\", these are the ubiquitous logs that\n // track (at the least) the start of every function, as well\n // as other key points\n // On by default\n if (gvLogProcs) {\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case 'ROUTE':\n // Similar to PROCS, but for the web server routes\n // On by default\n if (gvLogRoutes) {\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case ' INFO':\n // Additional to PROCS, these don't just track process, they\n // record information as well. Similar to DEBUG.\n // Off by default\n if (gvLogInfos){\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case 'DEBUG':\n // Useful log points for debugging\n // Off by default\n if (gvLogDebugs){\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case 'INITS':\n // Rather than putting PROCS in init functions (which always fire\n // and, once the app is working reliably, aren't particularly interesting)\n // Off by default\n if (gvLogInits){\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case ' AJAX':\n if (gvLogAJAX){\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case 'LSTNR':\n // Rather than putting PROCS in listeners (which can fire\n // continually in some scenarios), use LSTNR and keep them ...\n // Off by default\n if (gvLogLstnrs){\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case ' TEMP':\n // What it says on the tin. These should not stay in the code for long\n // On by default\n if (gvLogTemps){\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n default:\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + 'UNKWN' + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n return lvLogText; // Set to '' if logging is off for the given level.\n}", "function log(s) {\r\n logFn && logFn(s);\r\n }", "static log(eventMetadata) {\n let typeAction = new LogEventTypeAction({ action: eventMetadata.action });\n return new EventMetadata(Object.assign(eventMetadata, typeAction));\n }", "function insertLogEvent(data) {\n console.warn(\"TO-DO: HIB Implement the log insertion in [\" + insertLogEventAPI + \"] ---> \" + JSON.stringify(data));\n }", "logger() {\n console.log({\n acc: this.acc,\n operator: this.operator,\n leftOperand: this.leftOperand,\n rightOperand: this.rightOperand,\n state: this.state\n })\n }", "function logger(req, res, next) {\n\n}", "function john() {\n $log.debug(\"TODO\");\n }", "function uiLog_log(event, target, id) {\n // creates an entry\n var entry = new Array();\n entry[\"event\"] = event;\n entry[\"target\"] = target;\n entry[\"id\"] = id;\n entry[\"time\"] = (new Date()).getTime();\n\n // adds all extra parameters to the entry\n var paramNumber = arguments.length-3;\n entry[\"paramNumber\"] = paramNumber;\n for(var i = 0; i < paramNumber; i++)\n entry[\"param\"+i] = arguments[i+3];\n\n // add the entry to the log variable\n _uiLog_entries[_uiLog_entries.length] = entry;\n\n // flush log 15 seconds later if no flush has been set\n if(_uiLog_flushSet == null)\n _uiLog_flushSet = setTimeout(\"uiLog_flush()\", 15000);\n}", "function showlog(status) { }", "interceptLogs() {\n const context = {};\n context.console = console;\n\n context.console.log = this._log.bind(this, 'log');\n context.console.warn = this._log.bind(this, 'warn');\n context.console.error = this._log.bind(this, 'error');\n context.console.info = this._log.bind(this, 'info');\n context.console.debug = this._log.bind(this, 'debug');\n context.console.trace = this._log.bind(this, 'trace');\n context.console.dir = this._log.bind(this, 'dir');\n }", "static logEvent(eventName, params, timed) {\n if (!eventName || typeof eventName !== 'string') {\n console.error(`FlurryAnalytics.logEvent: eventName must be a string. Got ${eventName}`);\n return;\n }\n\n if (arguments.length === 1) {\n RNFlurryAnalytics.logEvent(eventName, false);\n }\n\n if (arguments.length === 2) {\n if (typeof arguments[1] === 'boolean') {\n RNFlurryAnalytics.logEvent(eventName, arguments[1]);\n }\n\n if (Object.prototype.toString.call(arguments[1]).includes('Object')) {\n RNFlurryAnalytics.logEventWithParameters(eventName, arguments[1], false);\n }\n }\n\n if (arguments.length === 3) {\n RNFlurryAnalytics.logEventWithParameters(eventName, params, timed);\n }\n }", "function audit(id, name, fn) {\n return {\n id,\n name,\n fn: async () => {\n try {\n await fn();\n return {\n id,\n name,\n status: 'ok',\n };\n }\n catch (err) {\n if (!(err instanceof AuditError)) {\n // anything thrown that is not an assertion error is considered fatal\n throw err;\n }\n return {\n id,\n name,\n status: name.startsWith('MUST')\n ? // failing MUSTs are considered errors\n 'error'\n : name.startsWith('SHOULD')\n ? // recommendations are warnings\n 'warn'\n : // everything else is truly optional\n 'notice',\n reason: err.reason,\n response: err.response,\n };\n }\n },\n };\n}", "function log(event, payload) {\n let time = new Date();\n console.log({ event, time, payload });\n}", "function logger(...params){\n console.log(params);\n}", "function logOld(name , age){\n\t\tconsole.log(\"My name is: \" + name + \" and My age is: \" + age);\n\t}", "function jupyterEventLogger(evt, data) {\n if (evt.type == 'select' || evt.type == 'execute' || evt.type == 'rendered') {\n meta = {id: data.cell.cell_id}\n } else if (evt.type == 'create' || evt.type == 'delete') {\n meta = {id: data.cell.cell_id,\n index: data.index}\n } else {\n meta = {}\n }\n\n console.log(evt.type, meta)\n cell_data = get_cell_data_and_rebind()\n\n logData.push({\n time: Date.now(),\n type: evt.type,\n meta: meta,\n data: cell_data\n }) \n }", "function inner() {\n // Step 1.4: Log arguments\n }", "function log() {\n logger.hit(`${this.req.url} ${this.statusCode} ${this.req.method} ${this.req.body.From} ${this.req.body.Body} ${this[action_symbol]}`, this)\n}", "function LLog(){\n var level_name = {\n 0: \"trace\",\n 1: \"debug\",\n 2: \"info\",\n 3: \"warning\",\n 4: \"error\",\n 5: \"fatal\"\n };\n this.log = function(level, o1, o2, o3, o4, o5){\n console.log(\n level_name[level] + \": \", \n o1 ? o1 : \"\",\n o2 ? o2 : \"\",\n o3 ? o3 : \"\",\n o4 ? o4 : \"\",\n o5 ? o5 : \"\"\n );\n };\n \n this.log.trace = function(o1, o2, o3, o4, o5){this(0, o1, o2, o3, o4, o5)};\n this.log.debug = function(o1, o2, o3, o4, o5){this(1, o1, o2, o3, o4, o5)};\n this.log.info = function(o1, o2, o3, o4, o5){this(2, o1, o2, o3, o4, o5)};\n this.log.warning = function(o1, o2, o3, o4, o5){this(3, o1, o2, o3, o4, o5)};\n this.log.error = function(o1, o2, o3, o4, o5){this(4, o1, o2, o3, o4, o5)};\n this.log.fatal = function(o1, o2, o3, o4, o5){this(5, o1, o2, o3, o4, o5)};\n \n return this.log;\n}", "function logFuncDuration(funcName, args, duration) {\n let str = config.log;\n str = str.replace('${function}', funcName);\n str = str.replace('${arguments}', getArgStr(args));\n str = str.replace('${duration}', getDurationStr(duration));\n str = str.replace('${units}', config.units);\n\n config.logFunction(str);\n}", "function log() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n}", "function setLogFunction(logFunction)\n {\n my.logFunction = logFunction\n }", "function logNew(name , age){\n\t\tconsole.log(`My name is: ${name} and My age is: ${age}`);\n\t}", "function logFunct(_function, _text, _type) {\n\n\tif (trace) {\n\t\tif (_type == INFO) {\n\t\t\tconsole.info(\"%c\" + _function + ': ' + _text, \"color:\" + _type);\n\t\t}\n\t\tif (_type == WARN) {\n\t\t\tconsole.warn(\"%c\" + _function + ': ' + _text, \"color:\" + _type);\n\t\t}\n\t\tif (_type == ERROR) {\n\t\t\tconsole.error(\"%c\" + _function + ': ' + _text, \"color:\" + _type);\n\t\t}\n\t}\n}", "function logData(trigger) {\r\n\t// ajax call to database to store interactions\r\n}", "info(...theArgs) { return this._log('INFO', {}, theArgs); }", "function log() {\n\ttry { \n\t\tconsole.log(\n\t\t\tshowOnly(logjs).forFilter(\n\t\t\t\t{\n\t\t\t\t\tapp: \"opsebf\",\n\t\t\t\t\tdate: \"20180623\",\n\t\t\t\t\tafter: \"1900\",\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\t}\n\tcatch(err) {\n\t\tvar msg = \"opsebf logs only in development stage\";\n\t\tconsole.warn(msg);\n\t}\n}", "do_log(sev, argobj, stacktrace=false) {\n if (!this.severity_enabled(sev)) { return }\n if (this.should_filter(argobj, sev)) { return; }\n let val = this._sev_value(sev);\n for (let hook of this._hooks[val]) {\n let args = [sev, stacktrace].concat(Util.ArgsToArray(argobj));\n hook.apply(hook, args);\n }\n if (stacktrace) {\n Util.PushStackTrimBegin(Math.max(Util.GetStackTrimBegin(), 1));\n switch (val) {\n case LoggerUtility.SEVERITIES.TRACE:\n Util._toConsole(console.log, argobj);\n break;\n case LoggerUtility.SEVERITIES.DEBUG:\n Util._toConsole(console.log, argobj);\n break;\n case LoggerUtility.SEVERITIES.INFO:\n Util._toConsole(console.log, argobj);\n break;\n case LoggerUtility.SEVERITIES.WARN:\n Util._toConsole(console.warn, argobj);\n break;\n case LoggerUtility.SEVERITIES.ERROR:\n Util._toConsole(console.error, argobj);\n break;\n }\n Util.PopStackTrimBegin();\n } else {\n switch (val) {\n case LoggerUtility.SEVERITIES.TRACE:\n console.log.apply(console, argobj);\n break;\n case LoggerUtility.SEVERITIES.DEBUG:\n console.log.apply(console, argobj);\n break;\n case LoggerUtility.SEVERITIES.INFO:\n console.log.apply(console, argobj);\n break;\n case LoggerUtility.SEVERITIES.WARN:\n console.warn.apply(console, argobj);\n break;\n case LoggerUtility.SEVERITIES.ERROR:\n console.error.apply(console, argobj);\n break;\n }\n }\n }", "function logGreeting(fn) {\n fn();\n}", "function log(aktlvl, msg) {\r\n\t\tlogArr[logArr.length] = msg;\r\n\t\t\r\n\t\tif (logLevels.indexOf(aktlvl) <= efConfig.log) { \r\n\t\t\tdisplayMessage(msg);\r\n\t\t}\r\n\t\tif (aktlvl == \"tiddler\"){ \r\n\t\t\tcreateTiddler(logName, {responseText:logArr.join(\"\\n\")})\r\n\t\t}\r\n\t} // function log()", "logger(type, func, text) {\n let color = MAP_COLORS[type];\n console.log(`${type} ${func}: ${text}` [color]);\n }", "function logMe(input) {\n Logger.log(input);\n}", "static audit(eventMetadata) {\n let typeAction = new AuditEventTypeAction({ action: eventMetadata.action });\n let a = (Object.assign(eventMetadata, typeAction));\n return new EventMetadata(a);\n }", "function logEvent(eventName, eventData){\n console.log(\"Event triggered. Event name : \" + eventName + \" , Data : \" + JSON.stringify(eventData));\n}", "log(message) {\n console.log(`[Function/${this.name}] INFO: ${message}`);\n }", "function log(data)\n{\n\tvar str = logComplexObj(data);\n\tfl.trace(str);\n}", "Trace(...args) { this.do_log(\"TRACE\", args, true); }", "function Logger() {\n\n }", "function hook_log(){\n var Log = Java.use(\"android.util.Log\")\n\n var logMethods = ['d', 'e', 'i', 'v', 'w']\n\n logMethods.forEach(function(method, i) {\n Log[method].overload('java.lang.String','java.lang.String').implementation = function(tag, msg) {\n send('Log: ' + tag + '|' + msg);\n var ret = this[method](tag, msg);\n return ret;\n }\n Log[method].overload('java.lang.String','java.lang.String','java.lang.Throwable').implementation = function(tag, msg, th) {\n send('Log: ' + tag + '|' + msg);\n var ret = this[method](tag, msg, th);\n return ret;\n } \n });\n}", "function getAriaEventInfo(event) {\r\n var values = {\r\n 'CorrelationVector': event.vector.toString(),\r\n 'ValidationErrors': event.validationErrors,\r\n 'WebLog_FullName': event.eventName,\r\n 'WebLog_EventType': EventBase_1.ClonedEventType[event.eventType]\r\n };\r\n if (event.eventType === EventBase_1.ClonedEventType.End) {\r\n values.Duration = event.endTime - event.startTime;\r\n }\r\n var names = event.eventName.split(',');\r\n for (var _i = 0, names_1 = names; _i < names_1.length; _i++) {\r\n var name_1 = names_1[_i];\r\n if (name_1) {\r\n values[\"WebLog_Type_\" + name_1] = 1;\r\n }\r\n }\r\n var data = event.data, context = event.context;\r\n if (context) {\r\n for (var key in context) {\r\n if (Object.prototype.hasOwnProperty.call(context, key)) {\r\n var value = context[key];\r\n if (value === undefined || value === null) {\r\n continue;\r\n }\r\n var loggingName = index_1.capitalize(key);\r\n values[loggingName] = value;\r\n }\r\n }\r\n }\r\n if (data) {\r\n for (var field in data) {\r\n if (Object.prototype.hasOwnProperty.call(data, field)) {\r\n var value = data[field];\r\n if (value === undefined || value === null) {\r\n continue;\r\n }\r\n var propertyMetadata = event.metadata[field];\r\n if (propertyMetadata) {\r\n var loggingName = propertyMetadata.isPrefixingDisabled ?\r\n index_1.capitalize(field) :\r\n index_1.capitalize(propertyMetadata.definedInName) + \"_\" + field;\r\n var type = propertyMetadata.type;\r\n if (type === 4 /* Object */) {\r\n for (var subField in value) {\r\n if (Object.prototype.hasOwnProperty.call(value, subField)) {\r\n var subValue = value[subField];\r\n if (subValue !== undefined && subValue !== null && subValue !== '') {\r\n // Do not write values which would serialize as empty since they do not provide meaningful\r\n // information in instrumentation back-ends.\r\n values[loggingName + \"_\" + subField.replace('.', '_')] = subValue;\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n values[loggingName] = type === 6 /* Enum */ ? propertyMetadata.typeRef[value] : value;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return {\r\n name: event.isEventTypePrefixingDisabled ? names[names.length - 2] : \"ev_\" + names[names.length - 2],\r\n values: values\r\n };\r\n}", "function log() {\n\t console.log('%s - %s', timestamp(), format$1.apply(null, arguments));\n\t}", "function log() {\n\t console.log('%s - %s', timestamp(), format$1.apply(null, arguments));\n\t}", "function log() {\n\t console.log('%s - %s', timestamp(), format$1.apply(null, arguments));\n\t}", "function workflowRecordHistory (row) {\n if ( row['DT_INSERTED'] !== null ) {\n ins_time = ellapseTime ( row['DT_INSERTED'] );\n }\n if ( row['DT_UPDATED'] !== null ) {\n upd_time = ellapseTime ( row['DT_UPDATED'] );\n }\n\n if (row['INSERTED_BY'] ) {\n txt = '<span class=\"timelogValue\" title=\"' + JS_CREATED + '\"><i class=\"fas fa-user-plus timelogIcon\"></i> ' + row['INSERTED_BY'] + '</span> ';\n if (ins_time) {\n txt += '<span class=\"timelogValue\" title=\"' + JS_ELAPSED_TIME + '\"><i class=\"fas fa-history timelogIcon quad-left-padding-10\"></i> ' + ins_time + '</span>';\n }\n }\n\n if (row['CHANGED_BY'] ) {\n txt += '<span class=\"visible-xs visible-sm visible-md visible-lg timelogValue timelogChanged\" title=\"' + JS_LAST_CHANGED + '\"><i class=\"fas fa-user-edit timelogIcon\"></i> ' + row['CHANGED_BY'];\n if (upd_time) {\n txt += ' <span title=\"' + JS_ELAPSED_TIME + '\"><i class=\"fas fa-history timelogIcon quad-left-padding-10\"></i> ' + upd_time + '</span>';\n }\n txt += '</span> ';\n }\n return txt;\n}", "function printAuditLog() {\n console.log(\"Audit Log:\");\n for (var i = 0; i < localStorage.length; i++) {\n if (localStorage.key(i) === 'auditLog') {\n console.log(localStorage.getItem(localStorage.key(i)));\n }\n }\n }", "function consoleLogger() {\n\t//This is the function body. All of the code between the {} gets executed when a function is called\n\t//The value of parameter is set when the function is called and it becomes \n\t//a locally scoped variable within the scope of the function\n\tconsole.log(\"I am a log\");\n}", "function log(txt) {\n // commented out for production version\n // IJ.log(txt);\n}", "function logCallback(event) {\n\t\tconsole.log('Callback triggered:', this, event);\n\t\tlog.value = event.detail.action + ' ' +\n\t\t\t(event.type === 'toggle'\n\t\t\t\t? this.node.classList[0]\n\t\t\t\t: this.node.classList[1])\n\t\t\t+ '\\n' + log.value;\n\t}", "function audit(durationSelector) {\n return function auditOperatorFunction(source) {\n return source.lift(new AuditOperator(durationSelector));\n };\n}", "function logger(){\n console.log(\"you logged in\");\n}", "log(...args) {\n return this.getInstance().log(...args);\n }", "function consLog(arg) {\n // if it's an object we need to stringify \n if (typeof arg === 'object') {\n consFunc(JSON.stringify(arg))\n } else if (typeof arg === 'string') {\n consFunc(arg)\n } else {\n consFunc(arg.toString())\n }\n } // end of function consLog", "async audit_trail (id, caller, api, response_type, aggregation_type, aggregated_response, context, options, assigned_oracle, standby_oracle){\n\n\t\tconsole.log(\"request processor, inside audit_trail :\", options.ala_data.oracle_account)\n\t\tconsole.log(\"request processor, inside audit_trail :\", assigned_oracle)\n\t\tconsole.log(\"request processor, inside audit_trail :\", standby_oracle)\n\t\tconsole.log(\"request processor, inside audit_trail :\", (options.ala_data.oracle_contract_name == assigned_oracle))\n\n\n\t\tresponse_type = \"\" + response_type; \n\t\taggregation_type = \"\" + aggregation_type; \n\n\t\tresponse_type = responseJson[response_type]; \n\t\taggregation_type = aggregationJson[aggregation_type]; \n\n\t\tif (options.ala_data.oracle_account == assigned_oracle || options.ala_data.oracle_account == standby_oracle){\n\n\t\t\tcontext.mongo.model('audit_trail').findOne({request_id: id}).then(function (userDataa) {\n\t\t\t\tconsole.log(\"Moment of truth\", userDataa)\n\t\t\t\tif(userDataa == null){\n\t\t\t\t\tcontext.mongo.model('audit_trail').create({ \n\t\t\t\t\t\tcaller: caller, \n\t\t\t\t\t\trequest_id: id, \n\t\t\t\t\t\ttime: moment().format('YYYY-MM-DD hh:mm:ss'),\n\t\t\t\t\t\tapi_set : api,\n\t\t\t\t\t\tresponse_type : response_type,\n\t\t\t\t\t\taggregation_type : aggregation_type,\n\t\t\t\t\t\toracle_account : assigned_oracle, \n\t\t\t\t\t\taggregated_response: aggregated_response\n\t\t\t\t\t\n\t\t\t\t\t}).catch(error => {\n\t\t\t\t\t\tconsole.error('Failed to insert response to mongo3: ', error);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t})\t\t\n\t\t}\n\t\t\n\t}", "static log() {\n console.log(\n\t\t\t`\\n\\n${CustomLog.top_banner}\\\n\t\t\t\\n\\n${CustomLog.Use.SPACE}${arguments[0]}\\\n\t\t\t\\n${CustomLog.Use.INDENT}${CustomLog.Use.SOLID_LINE}\\n\\n`\n\t\t)\n let Args = Array.from(arguments).splice(1)\n Args.forEach( w => { console.log( CustomLog.Use.SPACE + (\n\t\t typeof w.get_custom_log_format === 'undefined' ?\n w : w.get_custom_log_format()\n ))\n })\n console.log(\n `\\n${CustomLog.Use.INDENT}${CustomLog.Use.SOLID_LINE}\\\n \\n${CustomLog.Use.INDENT}${CustomLog.Use.SOLID_LINE}\\n\\n\\n` )\n }", "getClientLog() {\n\n }", "function getAriaEventInfo(event) {\r\n var e_1, _a;\r\n var values = {\r\n 'CorrelationVector': event.vector.toString(),\r\n 'ValidationErrors': event.validationErrors,\r\n 'WebLog_FullName': event.eventName,\r\n 'WebLog_EventType': EventBase_1.ClonedEventType[event.eventType]\r\n };\r\n if (event.eventType === EventBase_1.ClonedEventType.End) {\r\n values.Duration = event.endTime - event.startTime;\r\n }\r\n var names = event.eventName.split(',');\r\n try {\r\n for (var names_1 = tslib_1.__values(names), names_1_1 = names_1.next(); !names_1_1.done; names_1_1 = names_1.next()) {\r\n var name_1 = names_1_1.value;\r\n if (name_1) {\r\n values[\"WebLog_Type_\" + name_1] = 1;\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (names_1_1 && !names_1_1.done && (_a = names_1.return)) _a.call(names_1);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n var data = event.data, context = event.context;\r\n if (context) {\r\n for (var key in context) {\r\n if (Object.prototype.hasOwnProperty.call(context, key)) {\r\n var value = context[key];\r\n if (value === undefined || value === null) {\r\n continue;\r\n }\r\n var loggingName = index_1.capitalize(key);\r\n values[loggingName] = value;\r\n }\r\n }\r\n }\r\n if (data) {\r\n for (var field in data) {\r\n if (Object.prototype.hasOwnProperty.call(data, field)) {\r\n var value = data[field];\r\n if (value === undefined || value === null) {\r\n continue;\r\n }\r\n var propertyMetadata = event.metadata[field];\r\n if (propertyMetadata) {\r\n var loggingName = propertyMetadata.isPrefixingDisabled ?\r\n index_1.capitalize(field) :\r\n index_1.capitalize(propertyMetadata.definedInName) + \"_\" + field;\r\n var type = propertyMetadata.type;\r\n if (type === 4 /* Object */) {\r\n for (var subField in value) {\r\n if (value[subField] !== undefined) {\r\n values[loggingName + \"_\" + subField.replace('.', '_')] = value[subField];\r\n }\r\n }\r\n }\r\n else {\r\n values[loggingName] = type === 6 /* Enum */ ? propertyMetadata.typeRef[value] : value;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return {\r\n name: event.isEventTypePrefixingDisabled ? names[names.length - 2] : \"ev_\" + names[names.length - 2],\r\n values: values\r\n };\r\n}", "function consLog(arg) {\n // console.log('consLog', arg)\n // if it's an object we need to stringify \n if (typeof arg === 'object') {\n consFunc(JSON.stringify(arg))\n } else if (typeof arg === 'string') {\n consFunc(arg)\n } else {\n consFunc(arg.toString())\n }\n } // end of function consLog", "function privateLog() {\n console.log('Private Function');\n}", "error(...params) {\r\n console.error(this.getLogStamp(), ...params);\r\n }", "function log() {\n\t console.log('%s - %s', timestamp(), format.apply(null, arguments));\n\t}", "function $formatter(type, d, {user,sId,ip,ref}) {\n if (!config.log || !config.log.trk[type]) return\n var ident = user != null ? `${user.name||user._id}`.gray : `${sId.substring(0,12)}`.cyan\n\n var jdata = type == 'view'\n ? `${(d.url||'').cyan} ${ref?ref.replace(/https\\:\\/\\/|http\\:\\/\\//g,'<<< ').replace('www.','').blue:''}`\n : JSON.stringify(d.data||{}).replace(/^\\{/,'').replace(/\\}$/,'').replace(/\\\"([^(\\\")\"]+)\\\":/g,\"$1:\".dim).gray\n var label = type\n if (type == 'event') label = d.name\n if (type == 'view') label = `VIEW:${d.type}`\n $logIt(`trk.${type}`\n , label.toUpperCase()\n , `${ip.replace(':ffff','')}`.cyan+`\\t${ident}`\n , jdata\n )\n}", "formatChangeHistory(auditEvent) {\n // when reporting on the change history for \n // a given property, only inclue from the audit:\n // 1. username\n // 2. when\n // 3. type: map to \"event\"\n // 4. event: map to \"change\" [optional]\n const historyEvent = {\n username: auditEvent.username,\n when: auditEvent.when,\n event: auditEvent.type\n };\n if (auditEvent.event) {\n historyEvent.change = auditEvent.event\n }\n\n return historyEvent;\n }", "function log(){\n console.log('logging');\n}", "logEvent( eventType, eventData ) {\n\n\t\tthrow( new Error( \"logEvent() is an abstract method and must be overridden by a concrete class.\" ) );\n\n\t}", "log(data = mandatory(), name = 'global') {\n if (!this.logs.hasOwnProperty(name)) {\n this.logs[name] = []\n }\n\n this.logs[name].push(data)\n }", "function logStats() {\n const tbl = table(config.statTableName, stats.get(), config.units);\n config.logFunction(tbl);\n}", "function classLog() {\n console.log('x' ,x);\n console.log('y' ,y);\n console.log('z' ,z);\n console.log('a' ,a);\n console.log('arg_a' ,arg_a);\n console.log('----');\n }", "function logger() {\n console.log('My name is Jonas');\n}", "function logInternal(severity, content, stack, category) {\r\n var config = LOGGER_CONFIG_MAP[category || ''] || LOGGER_CONFIG_MAP[''];\r\n if (SEVERITY_VALUE[severity] < SEVERITY_VALUE[config.minimalSeverity]) {\r\n return;\r\n }\r\n if (config.logDateTime) {\r\n content = new Date().toISOString() + \"|\" + content;\r\n }\r\n if (config.logSourceLocation) {\r\n // TODO: calculate source location from 'stack'\r\n }\r\n LOGGER_PROVIDER_MAP[config.provider].log(severity, content, category);\r\n}" ]
[ "0.65858924", "0.6513655", "0.65098625", "0.6341113", "0.63210577", "0.6280865", "0.615962", "0.61504555", "0.6079212", "0.6047697", "0.5969082", "0.59559935", "0.59535676", "0.59328073", "0.5886105", "0.5879847", "0.587066", "0.5781276", "0.57782733", "0.5760878", "0.5754734", "0.5738504", "0.5707202", "0.5697805", "0.56670296", "0.56506956", "0.56441885", "0.5625172", "0.56244713", "0.56052685", "0.5604776", "0.5579385", "0.55638474", "0.55488294", "0.55275875", "0.552348", "0.55038184", "0.54733694", "0.54613096", "0.5457016", "0.5454186", "0.5437968", "0.5432607", "0.54323554", "0.54247737", "0.5412936", "0.5412167", "0.5410992", "0.5410315", "0.5379233", "0.5377002", "0.53746885", "0.5364261", "0.536345", "0.5361066", "0.5357366", "0.5356348", "0.53559977", "0.5341812", "0.53387344", "0.53371775", "0.53332394", "0.5328086", "0.53232574", "0.5322183", "0.5319411", "0.5311345", "0.5308155", "0.5297945", "0.52960545", "0.52945554", "0.5289366", "0.5278185", "0.5278185", "0.5278185", "0.5275444", "0.5267523", "0.5258634", "0.525816", "0.5253462", "0.5249669", "0.5244377", "0.52401257", "0.5238265", "0.5231544", "0.5231162", "0.5229035", "0.522536", "0.5219072", "0.52150214", "0.5206137", "0.5205359", "0.51973385", "0.5193153", "0.51930624", "0.51878506", "0.51866907", "0.5184334", "0.5164387", "0.5162689", "0.5159631" ]
0.0
-1
create and set the winston logger instance
function getLogger() { var consoleOptions = {"level": config.log.console.level,"silent": config.log.console.silent,"colorize": config.log.console.colorize,"timestamp": config.log.console.timestamp, "label": config.log.console.label}; var fileOptions = {"level": config.log.file.level,"silent": config.log.file.silent,"colorize": config.log.file.colorize,"timestamp": config.log.file.timestamp,"label": config.log.file.label,"filename": config.log.file.filename, "maxsize": config.log.file.maxSize,"maxFiles": config.log.file.maxFiles,"json": config.log.file.json}; var logger = new (winston.Logger)({ // set the custom log levels levels: config.logger.levels, transports: [ new (winston.transports.Console)(consoleOptions), new (winston.transports.File)(fileOptions) ] }); // set the custom log colors for the levels winston.addColors(config.logger.colors); return logger; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createLogger() {\n var winston = require('winston');\n\n var logger = new (winston.Logger)({\n transports: [\n new (winston.transports.Console)({\n timestamp: true\n }),\n new (winston.transports.File)({\n filename: 'api.log',\n json: true,\n timestamp: true,\n maxFiles: 1,\n maxsize: 1000000\n })\n ]\n });\n return logger;\n}", "init() {\n module_utils.patchModule(\n 'winston/lib/winston/logger',\n 'write',\n writeWrapper,\n Logger => Logger.prototype\n );\n }", "initLogger() {\n this.logger = this.getLogger();\n }", "function setLogger(obj) {\n logger = obj;\n}", "log() {\n return winston.createLogger({\n defaultMeta: {\n requestId: this.requestId,\n // eslint-disable-next-line no-undef\n application: process.env.APP_NAME,\n },\n format: winston.format.combine(\n winston.format.timestamp({\n format: 'DD-MM-YYYY HH:mm:ss',\n }),\n winston.format.prettyPrint(),\n winston.format.json(),\n this.customFormatter(),\n winston.format.printf((info) => {\n const timestamp = info.timestamp.trim();\n const requestId = info.requestId;\n const level = info.level;\n const message = (info.message || '').trim();\n\n const saveFunction = new logsDb({\n timestamp : timestamp,\n level : level,\n message : message,\n //meta : meta,\n //hostname : foundedData.hostname\n });\n\n saveFunction.save((err) => {\n if (err) {\n console.log(\"failed to logs save operation\"); \n }\n\n })\n \n if (_.isNull(requestId) || _.isUndefined(requestId)) {\n return `${timestamp} ${level}: ${message}`;\n } else {\n return `${timestamp} ${level}: processing with requestId [${requestId}]: ${message}`;\n }\n }),\n ),\n transports: [\n new winston.transports.Console({\n level: 'debug',\n handleExceptions: true,\n }), \n // File transport\n new winston.transports.File({\n filename: 'logs/server.log',\n format: winston.format.combine(\n winston.format.colorize(),\n winston.format.timestamp({format: 'MMM-DD-YYYY HH:mm:ss'}),\n winston.format.align(),\n winston.format.json()\n )\n }), \n\n // MongoDB transport\n // new winston.transports.MongoDB({\n // level: 'info',\n // //mongo database connection link\n // db : 'mongodb://localhost:27017/mysale',\n // options: {\n // useUnifiedTopology: true\n // },\n // // A collection to save json formatted logs\n // collection: 'serverlogs',\n // format: winston.format.combine(\n // winston.format.timestamp(),\n // // Convert logs to a json format\n // winston.format.json()),\n // storeHost: true,\n // capped: false,\n // decolorize: false,\n // metaKey: 'meta',\n // }),\n\n ],\n });\n }", "constructor() {\n const funcName = 'Constructor()';\n\n this._isDebugMode = (process.env.NODE_ENV === 'development');\n this.debug(`${logPrefix} ${funcName}. Environment: `, process.env.NODE_ENV);\n\n const winstonLogPath = require('path').join(__dirname, constants.WinstonLogPath)\n this.debug(`${logPrefix} ${funcName}. Winston log path `, winstonLogPath);\n\n winstonLog = winston.createLogger({\n format: winston.format.combine(\n winston.format.splat(),\n winston.format.simple()\n ),\n transports: [\n new winston.transports.Console(),\n new winston.transports.File({ filename: winstonLogPath })\n ]\n });\n }", "function build_logger(log_folder) {\n var logger = winston.createLogger({\n transports: [\n new (winston.transports.Console)({\n handleExceptions: true,\n handleRejections: true\n }),\n new (winston.transports.File)({\n filename: log_folder + '/modbot_' + moment().format('YYYY_MM_DD_HH_mm_ss') + \".log\",\n handleExceptions: true,\n handleRejections: true\n })\n ]\n });\n\n return logger;\n}", "constructor() {\n Winston.emitErrs = true;\n\n /**\n * The storage path for file logs.\n *\n * @type {String}\n */\n this.storage = path.resolve('storage', 'logs');\n\n /**\n * The Winston logger instance.\n *\n * @type {Winston}\n */\n this.winston = new Winston.Logger({\n exitOnError: true,\n colors: {\n info: 'green',\n warn: 'yellow',\n error: 'red',\n debug: 'blue',\n silly: 'blue'\n },\n transports: [\n this.buildDailyRotateTransport('exceptions', 'exception'),\n this.buildDailyRotateTransport('error', 'error'),\n this.buildDailyRotateTransport('console', 'debug'),\n new (Winston.transports.Console)({\n humanReadableUnhandledException: true,\n level: 'verbose',\n colorize: true,\n json: false\n })\n ]\n });\n }", "set logLevel(level) {\n winston.level = level\n winston.debug('Requested log level to to: ' + level)\n winston.debug('Log level is now: ' + winston.level)\n }", "function LoggerUtilService() {\n this.logger = new (winston.Logger)();\n\n //add transports\n _.forEach(config.transports, (function(transport) {\n if (!!winston.transports[transport] && !!config[transport]) {\n this.logger.add(winston.transports[transport], config[transport]);\n }\n }).bind(this));\n}", "function initializeLoggers(settings) {\n // We configure our loggers as follows:\n // * our base logger tags all log records with `\"name\":\"app\"`, and sends logs\n // to stderr (including logs of all children)\n // * one child logger adds `\"type\":\"request\"`, and records method/URL for all\n // HTTP requests to the app, and method/URL/response code for all responses\n // * one child logger adds `\"type\":\"jupyter\"`, and records all messages from\n // the jupyter notebook server. These logs are also sent to a file on disk\n // (to assist user debugging).\n //\n // For more about bunyan, see:\n // https://github.com/trentm/node-bunyan/tree/f21007d46c0e64072617380b70d3f542368318a8\n const jupyterLogPath = path.join(settings.datalabRoot, '/var/log/colab-jupyter.log');\n logger = bunyan.createLogger({\n name: 'app',\n streams: [\n { level: 'debug', type: 'stream', stream: process.stderr },\n ]\n });\n requestLogger = logger.child({ type: 'request' });\n jupyterLogger = logger.child({\n type: 'jupyter',\n streams: [{\n level: 'info',\n type: 'stream',\n stream: new RotatingFileStream({\n path: jupyterLogPath,\n rotateExisting: false,\n threshold: '2m',\n totalSize: '20m'\n }),\n }]\n });\n}", "function setLogger(l){\n\tlogger = l;\n}", "function LogWrapper (isLogging) {\n if (this.constructor.name === 'Function') {\n throw new Error('Missing object context')\n }\n\n if (!isLogging) {\n // stub the logger out\n this.logger = {}\n\n this.logger.info = function () {}\n this.logger.error = function () {}\n this.logger.warn = function () {}\n return\n }\n\n // Else config winston for logging\n const Winston = require('winston')\n\n let winstonTransport = new (Winston.transports.Console)({\n json: false,\n colorize: true\n })\n\n this.logger = new (Winston.Logger)({\n transports: [winstonTransport]\n })\n}", "async prepareLogger() {\n this.logger = await this.addService('logger', new this.LoggerTransport(this.options.logger));\n }", "async prepareLogger() {\n this.logger = await this.addService('logger', new this.LoggerTransport(this.options.logger));\n }", "initLogger() {\n this.logger = new ConsoleLogger({\n name: this.getServiceName()\n });\n }", "constructor() {\n this.logger = new Logger();\n }", "function WinstonLogger(scope) {\n var winston = require('winston');\n\n var self = this;\n self.scope = scope;\n var t = scope.require('localization');\n\n // Obtain transports and their settings from shell settings\n var settings = scope.settings[WinstonLogger.feature] || {\n Console: {}\n };\n var transports = [];\n for (var transportName in settings) {\n var setting = settings[transportName];\n if (typeof(setting) === 'object') {\n transports.push(\n new (winston.transports[transportName])(setting)\n );\n delete settings[transportName];\n }\n }\n settings.transports = transports;\n var logger = self.logger = new (winston.Logger)(settings);\n\n /**\n * Logs a message at the verbose level.\n * The first parameter is localizable.\n * @param {string} msg The message.\n * @param {object} [meta]\n * An object to dump along with the message in order to give more information.\n */\n this.verbose = function() {\n arguments[0] = t(arguments[0]);\n logger.verbose.apply(logger, arguments);\n };\n\n /**\n * Logs a message at the debug level.\n * The first parameter is localizable.\n * @param {string} msg The message.\n * @param {object} [meta]\n * An object to dump along with the message in order to give more information.\n */\n this.debug = function() {\n arguments[0] = t(arguments[0]);\n logger.debug.apply(logger, arguments);\n };\n\n /**\n * Logs a message at the info level.\n * The first parameter is localizable.\n * @param {string} msg The message.\n * @param {object} [meta]\n * An object to dump along with the message in order to give more information.\n */\n this.info = function() {\n arguments[0] = t(arguments[0]);\n logger.info.apply(logger, arguments);\n };\n\n /**\n * Logs a message at the warn level.\n * The first parameter is localizable.\n * @param {string} msg The message.\n * @param {object} [meta]\n * An object to dump along with the message in order to give more information.\n */\n this.warn = function() {\n arguments[0] = t(arguments[0]);\n logger.warn.apply(logger, arguments);\n };\n\n /**\n * Logs a message at the error level.\n * The first parameter is localizable.\n * @param {string} msg The message.\n * @param {object} [meta]\n * An object to dump along with the message in order to give more information.\n */\n this.error = function() {\n arguments[0] = t(arguments[0]);\n logger.error.apply(logger, arguments);\n };\n\n /**\n * Logs a message.\n * @param {string} level\n * The level of the message, chosen between verbose, debug, info, warn, and error.\n * @param {string} msg The message.\n * @param {object} [meta]\n * An object to dump along with the message in order to give more information.\n * @param {Function} [callback] An optional callback.\n */\n this.log = function(level, msg, meta, callback) {\n arguments[1] = t(msg);\n logger[level].apply(logger, arguments);\n };\n\n /**\n * A simple profiling mechanism, functioning like a stopwatch.\n * Call it once to start the timer, and call it a second time with the same\n * id to stop the watch and log the time between the two calls.\n * @param {string} id The watch id.\n * @param {object} [metadata] Metadata to log along with the time taken.\n */\n this.profile = function() {\n logger.profile.apply(logger, arguments);\n };\n}", "constructor() {\n this.logger = new Logger();\n }", "log(name) {\n name = name || 'default';\n let log = this._loggers.get(name);\n if (!log) {\n log = new Logger(\n name,\n this._configurer.level(name),\n this._format,\n this._out\n );\n this._loggers.set(name, log);\n }\n return log;\n }", "function getLogger() {\n var loggerName = (debugging) ? 'debug' : 'standard';\n var logger = winston.loggers.get(loggerName);\n logger.cli();\n return logger;\n}", "initLogger(name = '') {\n let path = this.logPath;\n name = name.length > 0 ? name : this.logFileName;\n this.logFileName = name;\n\n // Create the directory if not exists.\n if (!fs.existsSync(path)) fs.mkdirSync(path);\n\n // Add the file name to the path.\n path += `/${name}.log`;\n\n // Remove the old log file if exists.\n if (fs.existsSync(path)) fs.unlinkSync(path);\n\n // Open the write stream.\n this.logger = fs.createWriteStream(path, {flags: 'a'});\n this.write(`Started at: ${new Date()}`, true, 'success');\n }", "setLogger (logger) {\n this._logger = logger\n }", "function logger() {}", "function initLogModule (logFilename, logLevel, fileMaxsize, fileMaxfiles, needConsoleLog, needFileLog, callback)\n{\n\twinston.remove(winston.transports.Console) ; // Be default it is ON\n\tif (needConsoleLog)\n\t{\n\t\twinston.add(winston.transports.Console, {level: logLevel });\n\t}\n\tif (needFileLog)\n\t{\n\t\twinston.add(winston.transports.File, { filename: logFilename, level: logLevel, maxsize: fileMaxsize, maxFiles: fileMaxfiles, json: false });\n\t}\n\tdefine.winston = winston ;\n\n\tcallback (0) ; // return Success\n}", "init() {\n utils.debugLog('hooking winston-cloudwatch');\n requireInTheMiddle(['winston-cloudwatch'], onWinstonCloudwatchRequire);\n utils.debugLog('hooked winston-cloudwatch');\n }", "setupLogging() {\n this.on('error', logger.error);\n\n this.on('rss', (body) => logger.silly(`emitted: ${body.id}`));\n this.on('ws:update:raw', (body) => logger.silly(`emitted raw: ${body.platform}`));\n this.on('ws:update:parsed', (body) => logger.silly(`emitted parsed: ${body.platform} in ${body.language}`));\n this.on('ws:update:event', (body) =>\n logger.silly(`emitted event: ${body.id} ${body.platform} in ${body.language}`)\n );\n this.on('tweet', (body) => logger.silly(`emitted: ${body.id}`));\n }", "initExternalLogger()\n { \n }", "constructor() {\n // Implementing singleton pattern\n if (!Logger.exists) {\n this.provider = this.createLogger()\n this.stream = this.buildStream()\n this.levels = this.buildLoggingLevels()\n Logger.instance = this\n Logger.exists = true\n }\n return Logger.instance\n }", "setLogger(logger) {\n this.logger = logger;\n }", "function setLogger(customLogger) {\n Object.keys(loggers).forEach(logger => {\n loggers[logger] = customLogger(logger);\n });\n}", "function getLogger() {\n if (logger) {\n return logger;\n }\n\n logger = fh_logger.createLogger({\n name: 'default-logger',\n streams: [\n {\n \"type\": \"stream\",\n \"level\": \"error\",\n \"stream\": \"process.stdout\"\n }\n ]\n });\n return logger;\n}", "get log() {\n if (!this._log) {\n const instanceName = `${this.constructor.name}@${node.getObjectId(this).substring(0, 4)}`;\n this._log = logger.getLogger(instanceName);\n }\n return this._log;\n }", "function Logger (confOrLogger, args) {\n if (confOrLogger.constructor !== Logger) {\n // Create a new root logger\n var conf = this._processConf(confOrLogger);\n this._logger = bunyan.createLogger(conf);\n var level = conf && conf.level || 'warn';\n this._levelMatcher = this._levelToMatcher(level);\n\n // Set up handlers for uncaught extensions\n this._setupRootHandlers();\n } else {\n this._logger = confOrLogger._logger;\n this._levelMatcher = confOrLogger._levelMatcher;\n }\n this.args = args;\n}", "function getLogger() {\n return logger;\n}", "function NodeLogger() {}", "function NodeLogger() {}", "function NodeLogger() {}", "function Logger () {\r\n this.loggingLevel = DEFAULT_LOG_LEVEL;\r\n}", "setup(consoleMinLogLevel, _logFilePath, prependTimestamp = true) {\n const logFilePath = typeof _logFilePath === 'string' ?\n _logFilePath :\n (_logFilePath && this._logFilePathFromInit);\n if (this._currentLogger) {\n const options = {\n consoleMinLogLevel,\n logFilePath,\n prependTimestamp\n };\n this._currentLogger.setup(options).then(() => {\n // Now that we have a minimum logLevel, we can clear out the queue of pending messages\n if (this._pendingLogQ) {\n const logQ = this._pendingLogQ;\n this._pendingLogQ = null;\n logQ.forEach(item => this._write(item.msg, item.level));\n }\n });\n }\n }", "constructor() {\n this.logger = console;\n }", "function NodeLogger() { }", "function NodeLogger() { }", "function logger() {\r\n // if $log fn is called directly, default to \"info\" message\r\n logger.info.apply(logger, arguments);\r\n }", "get logLevel() {\n return winston.level\n }", "init() {\n var logger = this.cm.get(\"logger\");\n if (logger === undefined) {\n throw new Error(\"logger component not found\");\n }\n log = logger.create(\"UdsMongoComponent\");\n\n log.debug(\"Starting UdsMongoComponent ...\");\n\n this.tingoInit();\n }", "constructor(){\n if(!Singleton.instance){\n Singleton.instance = new Logger();\n }\n }", "static get(lgr = \"anon\", maxLog = \"default\", force = \"default\") {\nvar i, len, lg, ref, ref1, ref2, ref3, stat, theLogger;\ntheLogger = null;\nref = Logger._loggers;\nfor (i = 0, len = ref.length; i < len; i++) {\nlg = ref[i];\nif (lg.modName === lgr) {\nif (theLogger == null) {\ntheLogger = lg;\n}\n}\n}\nstat = theLogger != null ? \"Updated\" : \"Created\";\nif (theLogger != null) {\nif (maxLog === \"default\") {\nmaxLog = theLogger.maxLog;\n}\nif (force === \"default\") {\nforce = theLogger.force;\n}\nif ((ref1 = Logger._modLogger) != null) {\nif (typeof ref1.trace === \"function\") {\nref1.trace(`get: Updating ${theLogger.modName} Logger. MaxLog ${theLogger.maxLog} -> ${maxLog}`);\n}\n}\ntheLogger._setLoggers(maxLog, force);\n} else {\nif (maxLog === \"default\") {\nmaxLog = Logger._defaultMaxLog;\n}\nif (force === \"default\") {\nforce = \"noforce\";\n}\nif ((ref2 = Logger._modLogger) != null) {\nif (typeof ref2.trace === \"function\") {\nref2.trace(`get: Create ${lgr} logger`);\n}\n}\ntheLogger = new Logger(lgr, maxLog, force);\n}\nif ((ref3 = Logger._modLogger) != null) {\nif (typeof ref3.debug === \"function\") {\nref3.debug(`${theLogger.modName} ${stat}: ${theLogger.maxLog} (${theLogger.maxLogLev}) ${theLogger.force}`);\n}\n}\nreturn theLogger;\n}", "function NodeLogger(){}", "constructor(name) {\r\n this.name = name;\r\n /**\r\n * The log level of the given Logger instance.\r\n */\r\n this._logLevel = defaultLogLevel;\r\n /**\r\n * The main (internal) log handler for the Logger instance.\r\n * Can be set to a new function in internal package code but not by user.\r\n */\r\n this._logHandler = defaultLogHandler;\r\n /**\r\n * The optional, additional, user-defined log handler for the Logger instance.\r\n */\r\n this._userLogHandler = null;\r\n /**\r\n * Capture the current instance for later use\r\n */\r\n instances.push(this);\r\n }", "function onModuleLoaded(logger){\n $.config.logging.logger = logger;\n }", "__configureLoggerHandler (logger) {\n\n\t\tconst handlerId = logger.getHandlerId();\n\n\t\t// Doesn't make sense to allow the same logger to be configured more than once.\n\t\tif (this.loggers[handlerId]) {\n\t\t\tthrow new Error(`You have already configured the \"${handlerId}\" logger.`);\n\t\t}\n\n\t\tthis.loggers[handlerId] = logger;\n\n\t\t// Make the logger available to all other modules by taking advantage of Node's module caching.\n\t\tsharedLogger.add(logger);\n\n\t}", "function Logging() {\n this.thresholdOfLogLevel = LogLevel.Informational;\n this.verboseTelemetry = false;\n this.http = new Http();\n this.logSet = {\n maxWaitTimeMs: Logging.logMaxWaitTimeMs,\n maxRecordLength: Logging.logMaxRecordLength,\n api: '/api/log'\n };\n this.telemetrySet = {\n maxWaitTimeMs: Logging.telemetryMaxWaitTimeMs,\n maxRecordLength: Logging.telemetryMaxRecordLength,\n api: '/api/telemetry'\n };\n }", "function Logger(confOrLogger, args) {\n var self = this;\n if (confOrLogger.constructor !== Logger) {\n // Create a new root logger\n var conf = this._processConf(confOrLogger);\n self._sampled_levels = conf.sampled_levels || {};\n delete conf.sampled_levels;\n self._logger = bunyan.createLogger(conf);\n self._levelMatcher = this._levelToMatcher(conf.level);\n\n // For each specially logged component we need to create\n // a child logger that accepts everything regardless of the level\n self._componentLoggers = {};\n Object.keys(self._sampled_levels).forEach(function(component) {\n self._componentLoggers[component] = self._logger.child({\n component: component,\n level: bunyan.TRACE\n });\n });\n\n self._traceLogger = self._logger.child({\n level: bunyan.TRACE\n });\n // Set up handlers for uncaught extensions\n self._setupRootHandlers();\n } else {\n self._sampled_levels = confOrLogger._sampled_levels;\n self._logger = confOrLogger._logger;\n self._levelMatcher = confOrLogger._levelMatcher;\n self._componentLoggers = confOrLogger._componentLoggers;\n self._traceLogger = confOrLogger._traceLogger;\n }\n this.args = args;\n}", "function installTestLogger() {\n testLogger = new importer.TestLogger();\n importer.getLogger = () => {\n return testLogger;\n };\n}", "function Logger() {\n this._logHandler = new NullLogHandler();\n }", "function configLogger(module) {\n\tvar errorModule = 'error-'+module;\n\tvar allModule = 'all-'+module;\n\tlog4js.loadAppender('file');\n\tlog4js.addAppender(log4js.appenders.file('logs/all-'+module+'.log'), allModule);\n\tlog4js.addAppender(log4js.appenders.file('logs/error-'+module+'.log'), errorModule);\n\tvar errorlogger = log4js.getLogger(errorModule);\n\tvar alllogger = log4js.getLogger(allModule);\n\terrorlogger.setLevel('INFO');\n\talllogger.setLevel('ERROR');\n\tmoduleLoggers[module] = {};\n\tmoduleLoggers[module]['em'] = errorlogger;\n\tmoduleLoggers[module]['am'] = alllogger;\n}", "function setLogLevel(level) {\r\n instances.forEach(function (inst) {\r\n inst.logLevel = level;\r\n });\r\n}", "function Logger() {\n\tthis._currentLogLevel = Logger.ALL;\n\tthis._timestamps = true;\n}", "function createInstanceLogger(element)\r\n\t{\r\n\t\tvar elementName = element.attr('name');\r\n\r\n\t\treturn function(message)\r\n\t\t{\r\n\t\t console.log('Neo4jControls(' + (elementName === undefined ? \"\" : elementName) + '):' + message);\r\n\t\t};\r\n\t}", "initLog(logLevel) {\n XPCOMUtils.defineLazyGetter(this, \"log\", () => {\n const ConsoleAPI =\n Cu.import(\"resource://gre/modules/Console.jsm\", {}).ConsoleAPI;\n const consoleOptions = {\n maxLogLevel: logLevel,\n prefix: \"TPStudy\",\n };\n return new ConsoleAPI(consoleOptions);\n });\n }", "function loggerInit() {\n\tvar logConfig = {\n\t\tfooterEnabled: false,\n\t\tdraggable: false\n\t}\n\tvar logContainer = null\n\tlogReader = new YAHOO.widget.LogReader(logContainer, logConfig)\n}", "function Logger(config) {\n if (config == void 0)\n config = {};\n _.defaultsDeep(config, defaultConfig);\n config.isEnabled = config.namespace != void 0 && process.env.DEBUG != \"*\" && (process.env.DEBUG || \"\").match(config.namespace) == void 0 ? false : true;\n config.lastLogged = moment.utc();\n this.config = config;\n this.buffer = [];\n this.bufferMode = false;\n this.children = [];\n this.parent = null;\n}", "static getInstance() {\n if (!instance) instance = new LogWriter();\n return instance;\n }", "function Logger() {\n this.buffer = [];\n this.plugins = {};\n\n this.url = _DEFAULTS.url;\n this.flushInterval = _DEFAULTS.flushInterval;\n this.collectMetrics = _DEFAULTS.collectMetrics;\n this.logLevels = _DEFAULTS.logLevels;\n this.maxAttempts = _DEFAULTS.maxAttempts;\n}", "setLogger(logger) {\n this._logger = logger;\n }", "function setLogLevel(level) {\n instances.forEach(function (inst) {\n inst.logLevel = level;\n });\n}", "function setLogLevel(level) {\n instances.forEach(function (inst) {\n inst.logLevel = level;\n });\n}", "function setLogLevel(level) {\n instances.forEach(function (inst) {\n inst.logLevel = level;\n });\n}", "function init() {\n var targetEmitter;\n CAL.logger._publishToList.forEach(function (target) {\n if (target.emitter === process &&\n target.topic === TOPIC) {\n targetEmitter = target;\n }\n });\n if (!targetEmitter) {\n CAL.logger._publishToList.push({\n emitter: process,\n topic: TOPIC\n });\n }\n}", "function getConsoleLogger(module) {\n\n let path = module.filename.split('/').slice(-2).join('/');\n\n return new winston.Logger({\n transports: [\n new winston.transports.Console({\n colorize: true,\n level: (ENV == 'development') ? 'debug' : 'debug',\n label: path\n }),\n new winston.transports.File({\n filename: config.get('logPath'),\n level: (ENV == 'development') ? 'debug' : 'error',\n label: path\n })\n ]\n });\n}", "_subscribeForLogging() {\n const oThis = this;\n\n oThis.client.on('log', function(level, className, message, furtherInfo) {\n const msg = `cassandra log event: ${level} -- ${message}`;\n\n switch (level) {\n case 'info': {\n break;\n }\n case 'warning': {\n logger.warn('l_cw_2', msg);\n break;\n }\n case 'error': {\n logger.error('l_cw_3', msg);\n const errorObject = responseHelper.error({\n internal_error_identifier: 'l_cw_3',\n api_error_identifier: 'something_went_wrong',\n debug_options: {\n message: message,\n className: className,\n furtherInfo: furtherInfo\n }\n });\n\n createErrorLogsEntry.perform(errorObject, errorLogsConstants.highSeverity);\n break;\n }\n case 'verbose': {\n break;\n }\n default: {\n logger.log(`Current level: ${level}.--${msg}`);\n break;\n }\n }\n });\n }", "function getAPILogger() {\n return apiLogger;\n}", "function set(logger) {\n current = logger;\n return current;\n}", "function Logger() {\n return new require( './real-logger-private' ).Logger();\n}", "setLog(log) {\n module.exports.log = typeof log === 'function' ? log : null;\n }", "get log() {\n return this.config.log.logger\n }", "requestLogger(options = defaultLoggerOptions) {\n let logger = null;\n try {\n // make logger avail in requests;\n logger = buildLogger(options, this.loggingConf);\n } catch (e) {\n // so using console as last resort\n console.error('Error when creating logger', e); // eslint-disable-line no-console\n }\n\n return (req, res, next) => {\n if (!req.logger) {\n req.logger = logger;\n }\n\n try {\n req.logger.info({ req });\n } catch (e) {\n console.error('Error while logging request', e); // eslint-disable-line no-console\n } finally {\n next();\n }\n };\n }", "function LoggingDecorator(logger){\n this.logger = Object.seal(logger);\n }", "function Logger() {\n\n }", "logError(message, meta) {\n this.winstonLogger.log('error', message, meta);\n }", "function initConfig(cfg){\r\n logManager.initConfig(cfg)\r\n \r\n rootLogger = logManager.getLogger('')\r\n}", "function Logger(str, httpReq) {\n var t;\n var formattedDate;\n function setup(str, httpReq) {\n t = new Date();\n formattedDate = t.getFullYear() + '/' + (t.getMonth() + 1) + '/' + t.getDate() + '/' + t.toLocaleTimeString() + ' (remote: ' + (httpReq ? httpReq.socket.remoteAddress : '') + '): ';\n }\n this.debug = function(str, httpReq) {\n setup(str, httpReq);\n console.log('[DEBUG]: ' + formattedDate + str);\n }\n this.warn = function(str, httpReq) {\n setup(str, httpReq);\n console.warn('[WARN]: ' + formattedDate + str);\n }\n this.error = function(str, httpReq) {\n setup(str, httpReq);\n console.error('[ERROR]: ' + formattedDate + str);\n }\n}", "function logger() {\n console.log('logger');\n\n}", "function Logger(name) {\n this.name = name;\n /**\r\n * The log level of the given Logger instance.\r\n */\n\n this._logLevel = defaultLogLevel;\n /**\r\n * The log handler for the Logger instance.\r\n */\n\n this._logHandler = defaultLogHandler;\n /**\r\n * Capture the current instance for later use\r\n */\n\n instances.push(this);\n }", "function getLogger() {\n const logger = createLogger({\n exitOnError: false,\n format: format.json(),\n });\n\n logger.add(\n new transports.Console({\n format: format.simple(),\n }),\n );\n\n return logger;\n}", "static setup() {\r\n if (!Utils.exists(Utils.log)) {\r\n super.setup(C.LOG_SRC.UTILS);\r\n }\r\n }", "function Logger(name) {\n this.name = name;\n /**\r\n * The log level of the given Logger instance.\r\n */\n\n this._logLevel = defaultLogLevel;\n /**\r\n * The log handler for the Logger instance.\r\n */\n\n this._logHandler = defaultLogHandler;\n /**\r\n * Capture the current instance for later use\r\n */\n\n instances.push(this);\n }", "function logConfig() {\n // Microservice Name\n logger.info('');\n logger.info('--------------------------------------------------------------');\n logger.info('++ ++');\n logger.info('++ ZeroInbox Api-Gateway ++');\n logger.info('++ ++');\n logger.info('--------------------------------------------------------------');\n\n // init env vars\n logger.info('');\n logger.info('********INIT ENV VARS********');\n Object.keys(initEnvVars).forEach((envVar) => {\n logger.info(envVar + ': ' + initEnvVars[envVar]);\n });\n // authentication env vars\n logger.info('');\n logger.info('********AUTH ENV VARS********');\n Object.keys(authEnvVars).forEach((envVar) => {\n logger.info(envVar + ': ' + authEnvVars[envVar]);\n });\n\n logger.info('');\n logger.info('********RABBIT CONNECTION********');\n if (RABBIT_URL) {\n logger.info('RABBIT_URL: ' + RABBIT_URL);\n } else if (RABBIT_CONNECTION) {\n Object.keys(RABBIT_CONNECTION).forEach((key) => {\n logger.info(key + ': ' + RABBIT_CONNECTION[key]);\n });\n }\n logger.info('Rabbit Topology: ' + rabbitTopJSON.toString());\n\n logger.info('');\n}", "function setup(format) {\n const regex = /:(\\w+)/g;\n\n // Specific call for starting server\n if (format.match(regex).includes(':start')) {\n const port = format.match(/:port=(\\d+)/).slice(1);\n serverlog(magenta, green, 'Server up and running on port ' + port);\n\n } else {\n // Return logger middleware that allows configurable methods of the request\n // object to be passed and thus logged\n return function logger(req, res, next) {\n const str = format.replace(regex, function(match, property) {\n return req[property];\n });\n serverlog(yellow, green, str);\n next();\n }\n }\n}", "function getLogger() {\n if (logger) return logger;\n var ccLogger = ccHandler(serializer);\n logger = new logger$1.Logger('@firebase/performance/cc');\n logger.logHandler = ccLogger;\n return logger;\n}", "function Logger(name) {\n this._prefix = name + ':';\n}", "function startLogger() {\n if (process.env.NODE_ENV === \"development\") {\n return createLogger({\n collapsed: (getState, action, logEntry) => !logEntry.error\n });\n }\n}", "function getLogger() {\r\n if (logger) {\r\n return logger;\r\n }\r\n var ccLogger = ccHandler(serializer);\r\n logger = new logger$1.Logger('@firebase/performance/cc');\r\n logger.logHandler = ccLogger;\r\n return logger;\r\n}", "function initializeMicroGatewayLogging(config,options) {\n // gateway from require\n gateway.Logging.init(config,options);\n}", "sendLogs() {\n this.log.info('logging from tests');\n }", "function Logger(name) {\n this.name = name;\n /**\r\n * The log level of the given Logger instance.\r\n */\n this._logLevel = defaultLogLevel;\n /**\r\n * The log handler for the Logger instance.\r\n */\n this._logHandler = defaultLogHandler;\n /**\r\n * Capture the current instance for later use\r\n */\n instances.push(this);\n }", "function Logger(name) {\n this.name = name;\n /**\r\n * The log level of the given Logger instance.\r\n */\n this._logLevel = defaultLogLevel;\n /**\r\n * The log handler for the Logger instance.\r\n */\n this._logHandler = defaultLogHandler;\n /**\r\n * Capture the current instance for later use\r\n */\n instances.push(this);\n }", "function LoggerSettings() {\n NullHandler.call(this);\n\n this._handlers = [];\n}", "getLogger() {\n return this.logger;\n }" ]
[ "0.7129485", "0.7122858", "0.6987306", "0.66949475", "0.66879934", "0.66537815", "0.662654", "0.6579134", "0.65747696", "0.65742296", "0.65371025", "0.6516548", "0.6446863", "0.6426438", "0.6426438", "0.6367178", "0.6347217", "0.6325583", "0.6295159", "0.6168651", "0.61472315", "0.6131333", "0.6087193", "0.6082152", "0.60421556", "0.6040257", "0.6024612", "0.60145825", "0.6014493", "0.5980263", "0.5977171", "0.5948915", "0.5926145", "0.5920236", "0.5908439", "0.5883231", "0.5883231", "0.5883231", "0.58320487", "0.58281326", "0.5792499", "0.5779635", "0.5779635", "0.57794636", "0.5769849", "0.57596534", "0.5754012", "0.57429165", "0.5708037", "0.5702087", "0.56938255", "0.56720096", "0.5659353", "0.5657635", "0.5657011", "0.56516826", "0.56349325", "0.5632696", "0.56282276", "0.5625472", "0.56122255", "0.5609429", "0.55897313", "0.5582428", "0.55770457", "0.55685335", "0.55679536", "0.55679536", "0.55679536", "0.5564069", "0.55223054", "0.54977417", "0.5496866", "0.549512", "0.54661614", "0.54569477", "0.5449777", "0.5449221", "0.5438939", "0.54325545", "0.5419475", "0.541911", "0.54132396", "0.5406461", "0.5385282", "0.53812665", "0.53779364", "0.5362014", "0.53603303", "0.53487784", "0.53386515", "0.5335139", "0.5326962", "0.5324192", "0.5305469", "0.5303632", "0.53029025", "0.53029025", "0.5286577", "0.5284784" ]
0.69782764
3
TODO rotear o update e o destroy.
async update(req, res){ const id = req.params.id; const {name, bio, techs, latitude, longitude} = req.body; const location ={ type: 'Point', coordinates: [longitude, latitude] } const techsArray = parseStringAsArray(techs); let devUpdate = await Dev.findById(id); if(!devUpdate){ res.json({message: "Não foi encontrado usuário com o id requisitado"}); } devUpdate = await Dev.findByIdAndUpdate(id, { name, bio, techs:techsArray, location }, {new:true}); return res.json(devUpdate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update(){}", "update(){}", "update(){}", "update() {\n //Apply changes\n super.update()\n //Remove if expired\n if (this.cycle <= 0) {\n this.destroy()\n }\n }", "destroy() {\n return this.update();\n }", "destroy() {\n //TODO this.\n }", "delete() {\n this.deleted = true;\n }", "delete() {\n\t\tthis.data.delete();\n\t}", "updated() {}", "doDestroy() {\n const me = this;\n\n me.activeRequests.load && me.cancelRequest(me.activeRequests.load.desc);\n me.activeRequests.sync && me.cancelRequest(me.activeRequests.sync.desc);\n\n while (me.crudStores.length > 0) {\n me.removeCrudStore(me.crudStores[0]);\n }\n\n clearTimeout(me.autoSyncTimerId);\n\n me.destroyed = true;\n }", "removed(vrobject){}", "updateTags() {\n let tags = this.get('tags');\n let oldTags = tags.filterBy('id', null);\n\n tags.removeObjects(oldTags);\n oldTags.invoke('deleteRecord');\n }", "async destroy(req, resp) {\n try {\n const { id } = req.params;\n\n let del = await Dev.findByIdAndRemove(req.params.id);\n\n if (!del) {\n return resp.status(404).json(`ID ${id} não encontrado na base`);\n } else {\n return resp.status(200).json(`Deletado com sucesso o id ${id}`);\n }\n } catch (err) {\n return resp.status(500).json(err);\n }\n }", "async destroy ({ params, request, response }) {\n }", "async destroy ({ params, request, response }) {\n }", "async destroy ({ params, request, response }) {\n }", "async destroy ({ params, request, response }) {\n }", "async destroy ({ params, request, response }) {\n }", "async destroy ({ params, request, response }) {\n }", "async destroy ({ params, request, response }) {\n }", "async destroy ({ params, request, response }) {\n }", "restore() {\r\n this.deleted = false;\r\n }", "update()\n\t{ \n\t\tthrow new Error(\"update() method not implemented\");\n\t}", "handleDestroyClick () {\n TodoActions.destroy(this.props.todo.id);\n }", "update(id) {\n\n }", "function destroy(){}", "destroy() {\n CommonUtils.callback('onDelete', this);\n }", "async destroy() {\n const { ctx, service } = this;\n const params = getParams(ctx, 'body');\n const condition = Object.assign({}, params);\n const res = await service.user.crud({\n type: 'deleteOne',\n condition,\n });\n ctx.body = res;\n }", "update() {\n throw new Error(\"Not Implemented\");\n }", "remove(){\n //\n }", "remove(){\n\n }", "doDestroy() {\n const me = this,\n {\n load,\n sync\n } = me.activeRequests;\n load && me.cancelRequest(load.desc, load.reject);\n sync && me.cancelRequest(sync.desc, sync.reject);\n\n while (me.crudStores.length > 0) {\n me.removeCrudStore(me.crudStores[0]);\n }\n\n clearTimeout(me.autoSyncTimerId);\n me.destroyed = true;\n super.doDestroy && super.doDestroy();\n }", "removeUpdate() {\n\n this.setState({\n updatePending: false,\n dataHasChanged: false,\n project_id: this.props.project.project_id,\n project_token: this.props.project.token,\n project_name: this.props.project.name,\n project_description: this.props.project.description,\n project_status: this.props.project.status_id\n })\n }", "onReturnUpdate(id, data) {\n let toRemove = data.REMOVE;\n for (let id of toRemove) {\n this.pack.REMOVE.push(id);\n delete this.foods[id];\n delete this.bullets[id];\n delete this.obsticals[id];\n }\n if (this.players.has(id)) {\n this.players.set(id, data.PLAYER);\n }\n\n if (data.BULLET != null || data.BULLET != undefined) {\n this.bullets[data.BULLET.id] = data.BULLET;\n this.pack.ADD.BULLETS.push(data.BULLET);\n }\n\n if (data.OBSTICAL != null || data.OBSTICAL != undefined) {\n this.pack.OBSTICALS.push(data.OBSTICAL);\n }\n }", "async update() {\n try {\n await this.message.edit(this.getEmbed());\n } catch (e) {\n this.remove();\n }\n }", "remove() {\n\n }", "willDestroy() {\n this._super(...arguments);\n\n // clean up object holding onto old references\n let oldDidUpdateAttrsValues = this.get('_oldDidUpdateAttrsValues') || {};\n Object.keys(oldDidUpdateAttrsValues).forEach(key => {\n delete oldDidUpdateAttrsValues[key].callback;\n delete oldDidUpdateAttrsValues[key].triggerOnValue;\n delete oldDidUpdateAttrsValues[key].value;\n delete oldDidUpdateAttrsValues[key];\n });\n this.set('_oldDidUpdateAttrsValues', null);\n }", "async destroy({view, auth, request, response,params}) {\n // const x = await auth.user.recipe().fetch().rows[params].id\n // console.log(x.rows[0].id)\n const recipeDataBase = await Recipe.findOrFail(params.id)\n await recipeDataBase.delete() \n }", "delete() {\n this.items().then(instances => {\n instances.forEach(instance => {\n instance.delete();\n })\n }).catch(error => {\n debugger;\n throw error;\n })\n }", "onRemove() {}", "update() {\n this.dataChanged = true;\n this.persons.all = undefined;\n this.jobTitles.all = undefined;\n this.updateFiltered();\n this.updateTimed();\n }", "static delete(table_name, attributes, where, response, cb) {\n\t\ttable_name\n\t\t\t.update(attributes, { where })\n\t\t\t.then((updated) => {\n\t\t\t\tif (updated[0]) {\n\t\t\t\t\tif (typeof cb === 'function') {\n\t\t\t\t\t\tcb({\n\t\t\t\t\t\t\tcode: 200,\n\t\t\t\t\t\t\ttitle: 'Success',\n\t\t\t\t\t\t\tmessage: 'Data is deleted',\n\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\tdata: updated\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresponse.status(200).json({\n\t\t\t\t\t\t\tcode: 200,\n\t\t\t\t\t\t\ttitle: 'Success',\n\t\t\t\t\t\t\tmessage: 'Data is deleted',\n\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\tdata: updated\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (typeof cb === 'function') {\n\t\t\t\t\t\tcb({\n\t\t\t\t\t\t\tcode: 400,\n\t\t\t\t\t\t\ttitle: 'Warning',\n\t\t\t\t\t\t\tmessage: 'Unable to deleted',\n\t\t\t\t\t\t\ttype: 'warning',\n\t\t\t\t\t\t\tdata: []\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresponse.status(200).json({\n\t\t\t\t\t\t\tcode: 400,\n\t\t\t\t\t\t\ttitle: 'Warning',\n\t\t\t\t\t\t\tmessage: 'Unable to deleted',\n\t\t\t\t\t\t\ttype: 'warning',\n\t\t\t\t\t\t\tdata: []\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tif (typeof cb === 'function') {\n\t\t\t\t\tcb({\n\t\t\t\t\t\tcode: 400,\n\t\t\t\t\t\ttitle: 'Failed',\n\t\t\t\t\t\tmessage: error.message,\n\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\ttrace: {\n\t\t\t\t\t\t\taddress: 'delete : Function model.update()',\n\t\t\t\t\t\t\terror: JSON.stringify(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tresponse.status(400).json({\n\t\t\t\t\t\tcode: 400,\n\t\t\t\t\t\ttitle: 'Failed',\n\t\t\t\t\t\tmessage: error.message,\n\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\ttrace: {\n\t\t\t\t\t\t\taddress: 'delete : Function model.update()',\n\t\t\t\t\t\t\terror: JSON.stringify(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t}", "function destroy(){\n\t\t// TODO\n\t}", "destroy() {\n }", "async destroy({ params, request, response }) {\n }", "destroy () {\n this._cache = undefined;\n }", "onDeleteSoftware(indexNo) {\n const { softwareTrait } = this.state;\n const newSoftwareTrait = { ...softwareTrait };\n newSoftwareTrait.traits.data.splice(indexNo, 1);\n this.setState({\n softwareTrait: newSoftwareTrait,\n });\n\n const {\n handle,\n tokenV3,\n updateUserTrait,\n deleteUserTrait,\n } = this.props;\n\n if (newSoftwareTrait.traits.data.length > 0) {\n updateUserTrait(handle, 'software', newSoftwareTrait.traits.data, tokenV3);\n } else {\n deleteUserTrait(handle, 'software', tokenV3);\n }\n this.setState({\n showConfirmation: false,\n indexNo: null,\n isSubmit: false,\n isEdit: false,\n formInvalid: false,\n });\n }", "update(cache, { data }) {\n console.log(data);\n const existingcocktails = cache.readQuery({ query: GET_COCKTAILS });\n const updatedCocktails = existingcocktails.cocktails.filter(\n (cocktail) => cocktail.id !== data.deleteCocktail.id\n );\n cache.writeQuery({\n query: GET_COCKTAILS,\n data: {\n cocktails: updatedCocktails,\n },\n });\n }", "get Delete() {}", "function apagaLivro(id) {\n if (id) {\n var transaction = dbLivros.transaction([\"eLivros\"], \"readwrite\");\n var objectStore = transaction.objectStore('eLivros');\n var request = objectStore.delete(id);\n request.onerror = function (event) {\n msgErro(\"Não foi possivel remover esse livro....\");\n };\n request.onsuccess = function (event) {\n msgDebug(\"Livro removido com sucesso! \");\n listaLivros();\n };\n } else {\n msgErro(\"Id do livro não foi especificado\");\n }\n}", "updated(_changedProperties) { }", "if (!userData.id) {\n delete userData.id;\n }", "function destroy () {\n\t\t// TODO\n\t}", "static async destroy(req, res, next) {\n try {\n const data = await ToDo.findByPk(+req.params.id)\n if (data) {\n await ToDo.destroy({\n where: {\n id: +req.params.id,\n UserId: +req.decoded.id,\n },\n })\n // res.status(200).json({ data })\n res.status(200).json({\n msg: `ToDo success to delete`,\n })\n } else {\n throw { status: 404 }\n }\n } catch (err) {\n next(err)\n }\n }", "destroyStats(context) {\n context.commit('destroyStats')\n }", "refreshUpdateStatus() {}", "doDestroy() {}", "_destroy() {}", "allDelete(){\n\n}", "function update() {\n // Don't delete this function!\n}", "remove() { this.doRemove = true; }", "destroy() {\n\t\tthis.dispatch('destroy-todo');\n\t}", "handleUpdate(evt) {\n evt.preventDefault();\n this.setState({ isEditing: false });\n // props here - like delete!\n this.props.editTodo(this.state.editTodoText, this.props.id);\n }", "destroy() { }", "destroy() { }", "destroy() { }", "destroy(request, response) {\n Resttask.remove(request.params)\n .then(result => response.json(result))\n .catch(error => response.json(error));\n }", "async destroy({ params, request, response }) {\n }", "remove () {\n // cleanup\n }", "handleDelete(e) {\n e.preventDefault();\n fetch('/delete', {\n method: \"DELETE\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ reg: this.state.delId })\n }).then(res => res.json())\n .then((error) => {\n throw error.message;\n })\n\n window.location.reload(); // fetch data once more to show update\n }", "async destroy ({ params, response }) {\n // retrieve the data by given id\n const product = await Product.find(params.id)\n if (product) {\n response.status(200).json({\n success: 'Deleted Record',\n data: product\n })\n await product.delete()\n }else {\n response.status(404).send({ error: 'Product Not Found' })\n }\n }", "_update() {\n }", "function deleteResource(){\n\t//Recoge el value del boton pulsado\n\tvar recurso = this.value;\n\t/* LINEAS AÑADIDAS EN LA PRACTICA 9 */\n\t//Abre la conexion con la base de datos \n\tvar resourcesDB = indexedDB.open(nombreDB);\n\t//Si ha salido bien\n\tresourcesDB.onsuccess = function(event) { \n\t\t\tvar db = event.target.result; \n\t\t\tvar deleteObjectStore = db.transaction([\"recursos\"],\"readwrite\").objectStore(\"recursos\");\n\t\t\tvar objeto = deleteObjectStore.get(recurso);\n\t\t\tobjeto.onsuccess = function(event) {\n\t\t\t\t//Se elimina por el key path\n\t\t\t\tdeleteObjectStore.delete(objeto.result.link);\n\t\t\t\t//Muestra el modal y la pagina de inicio\n\t\t\t\texito();\n\t\t\t};//FIn de objeto.onsuccess\n\t};//Fin de resourcesDB.onsuccess\n}//Fin de deleteResource", "Remove() {}", "update() {\n // Subclasses should override\n }", "deleteCurrentEditEntry(key) {\n let newUserData = this.state.userData;\n delete newUserData[key];\n firebase.database().ref('userData/' + this.props.user.uid + '/userJournalEntries').set(newUserData);\n }", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "deleteEntry(i) {\r\n this.setTicker(true); //Adds a ticker\r\n\r\n //Delete\r\n axios\r\n .delete(`${ROUTE}/${this.state.details[i]._id}`)\r\n //If successful, rebuild table\r\n .then((_response) => {\r\n this.componentDidMount();\r\n })\r\n //If failed, log and reflect on screen\r\n .catch(() => {\r\n this.setTicker(false);\r\n console.error(\"CharitiesCMS: Error using DELETE route.\");\r\n document.getElementById(\"message\").innerText = \"Failed to delete.\";\r\n });\r\n }", "remove () {\n }", "function destroy(){\r\n }", "function destroy(){\r\n }", "destroy(req,res){\n res.status(200).json(\n {\n sucess: true,\n messages: 'Estructura base DELETE',\n errors: null,\n data: [{}, {}, {}]\n }\n );\n }", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}" ]
[ "0.66172093", "0.66172093", "0.66172093", "0.63162076", "0.6291264", "0.6274449", "0.6107854", "0.60586643", "0.60515946", "0.5969239", "0.59311575", "0.5893716", "0.5832892", "0.5818856", "0.5818856", "0.5818856", "0.5818856", "0.5818856", "0.5818856", "0.5818856", "0.5818856", "0.5815729", "0.58152586", "0.580253", "0.58010805", "0.5800121", "0.57792556", "0.57735085", "0.57530177", "0.5750823", "0.57471514", "0.5742647", "0.57233965", "0.5718378", "0.5716802", "0.5712617", "0.5711965", "0.5704009", "0.57009214", "0.5696899", "0.56952333", "0.5693746", "0.56917816", "0.5688322", "0.5676373", "0.5667707", "0.5662232", "0.56603795", "0.5660238", "0.56584144", "0.5657414", "0.5653988", "0.56518304", "0.56466603", "0.5644526", "0.5632868", "0.5632077", "0.56309146", "0.5629207", "0.56286716", "0.56257325", "0.56227684", "0.56218404", "0.5619751", "0.5619751", "0.5619751", "0.5613675", "0.5609704", "0.56028414", "0.5600259", "0.55989325", "0.55871874", "0.55811155", "0.55791783", "0.55726033", "0.5572246", "0.5566859", "0.5566859", "0.5566859", "0.5566859", "0.5566859", "0.5566859", "0.5566859", "0.5566859", "0.5566859", "0.55659246", "0.5565901", "0.5563829", "0.5563829", "0.55582726", "0.5555458", "0.5555458", "0.5555458", "0.5555458", "0.5555458", "0.5555458", "0.5555458", "0.5555458", "0.5555458", "0.5555458", "0.5555458" ]
0.0
-1
=== INTERNAL FUNCTION ===
function startNewMonth(lastMonthClosing, period) { const newMonth = {}; // sets the period of the new month and passes on the closing total of last month newMonth.period = period; newMonth.openingTotal = lastMonthClosing; return newMonth; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "transient private protected internal function m182() {}", "private public function m246() {}", "transient protected internal function m189() {}", "protected internal function m252() {}", "transient private internal function m185() {}", "transient final protected internal function m174() {}", "transient private protected public internal function m181() {}", "static private internal function m121() {}", "static final private internal function m106() {}", "static transient final private internal function m43() {}", "transient final private protected internal function m167() {}", "static private protected internal function m118() {}", "static transient final protected internal function m47() {}", "static transient final protected public internal function m46() {}", "transient final private internal function m170() {}", "static transient private protected internal function m55() {}", "transient final private protected public internal function m166() {}", "static transient final private protected internal function m40() {}", "transient private public function m183() {}", "function _____SHARED_functions_____(){}", "static transient private protected public internal function m54() {}", "static private protected public internal function m117() {}", "obtain(){}", "static final private protected internal function m103() {}", "static protected internal function m125() {}", "static transient private internal function m58() {}", "static final private protected public internal function m102() {}", "__previnit(){}", "static transient final protected function m44() {}", "static transient private public function m56() {}", "static final protected internal function m110() {}", "prepare() {}", "transient final private public function m168() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "_read () {}", "_read () {}", "_read () {}", "static final private public function m104() {}", "static transient final private protected public internal function m39() {}", "function StupidBug() {}", "function priv () {\n\t\t\t\n\t\t}", "function DWRUtil() { }", "static transient final private protected public function m38() {}", "static transient protected internal function m62() {}", "_initialize() {\n\n }", "_read() {}", "_read() {}", "_read() {\n\n }", "lastUsed() { }", "postorder() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "static transient final private public function m41() {}", "initialize() {\n // Needs to be implemented by derived classes.\n }", "prepare() {\n }", "_read() {\n }", "function _construct()\n\t\t{;\n\t\t}", "initialize()\n {\n }", "updated() {}", "static private public function m119() {}", "function accessesingData2() {\n\n}", "function accessesingData2() {\n\n}", "function oi(){}", "added() {}", "apply () {}", "__init3() {this._finished = false;}", "__init3() {this._finished = false;}", "__init3() {this._finished = false;}", "_firstRendered() { }", "_update() {\n }", "function __it() {}", "_validate() {\n\t}", "preorder() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "function __func(){}", "function Sread() {\r\n}", "adoptedCallback() { }", "function dummy(){}", "function dummy(){}", "function dummy(){}", "function miFuncion (){}", "constructor () {\r\n\t\t\r\n\t}", "function AeUtil() {}", "_reset() {}", "init() { }", "init() { }", "init() { }", "init() { }", "init() { }", "function fm(){}", "function kp() {\n $log.debug(\"TODO\");\n }", "function Utils() {}", "function Utils() {}", "update() {\n // Subclasses should override\n }", "function Scdr() {\r\n}", "function TMP() {\n return;\n }", "function ea(){}", "_add () {\n throw new Error('not implemented')\n }" ]
[ "0.7372542", "0.72303957", "0.7228333", "0.71747947", "0.70473444", "0.7014209", "0.68316734", "0.65947413", "0.6515423", "0.64470327", "0.64438653", "0.64324856", "0.6422316", "0.6364594", "0.62563163", "0.6251298", "0.6226414", "0.61214155", "0.61149085", "0.6104029", "0.60763985", "0.607134", "0.60330737", "0.60083914", "0.58944064", "0.58824784", "0.5882158", "0.5857751", "0.5817582", "0.5783892", "0.5700859", "0.56918466", "0.5641757", "0.56014913", "0.55614483", "0.55614483", "0.55614483", "0.55614483", "0.55614483", "0.55614483", "0.555961", "0.555961", "0.555961", "0.555888", "0.55538535", "0.55455744", "0.5464862", "0.545079", "0.5441308", "0.54390985", "0.5418923", "0.5411137", "0.5411137", "0.5406256", "0.5375448", "0.5363481", "0.5361545", "0.535673", "0.5355926", "0.5339418", "0.53387505", "0.5326466", "0.53204626", "0.5319174", "0.53015196", "0.53015196", "0.52929735", "0.52571106", "0.5249972", "0.5238898", "0.5238898", "0.5238898", "0.5225468", "0.52023095", "0.51938796", "0.5178528", "0.5178213", "0.51775897", "0.5168246", "0.51671326", "0.5165291", "0.5165291", "0.5165291", "0.51642233", "0.51510316", "0.51505816", "0.51468056", "0.5144953", "0.5144953", "0.5144953", "0.5144953", "0.5144953", "0.51415575", "0.51395", "0.5136557", "0.5136557", "0.5129016", "0.51289845", "0.51275337", "0.5127487", "0.5125235" ]
0.0
-1
creates the summary object for the months changes
function aggregateMonthChanges(changes) { const updatedChanges = { add: 0, death: 0, theft: 0, sale: 0 }; // accumulate the different changes for the month changes.forEach(change => { if (!updatedChanges[change.reasonForChange]) { updatedChanges[change.reasonForChange] = change.animalsMoved; } else { updatedChanges[change.reasonForChange] += change.animalsMoved; } }); return updatedChanges; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CalculateTotalsMonthToDate() {\n //use temp variables to prevent multiple dom updates\n var wt = 0; //written total\n var dt = 0; //delivered total\n var gt = 0; //goals total\n for (var i = 0; i < vm.territorySalesNumbers.length; i++) {\n wt += vm.territoryWritten[i];\n dt += vm.territoryDelivered[i];\n }\n\n var indexMonth = (vm.currentYear == vm.maxYear) ? vm.thisMonth:11; //this holds the month (as a 0-based integer) that will be used to loop through and add all the goals together\n\n\n for (var i = 0; i <= indexMonth; i++) {\n gt += vm.goals[i];\n }\n\n vm.writtenTotal = Round(wt, 2);\n vm.deliveredTotal = Round(dt, 2);\n vm.goalsTotal = Round(gt, 2);\n vm.goalsWrittenDifference = Round(vm.writtenTotal - vm.goalsTotal, 2);\n\n if (vm.goalsWrittenDifference > 0)\n vm.goalsWrittenDifference = '+' + vm.goalsWrittenDifference;\n }", "function dataSalesPerMonth(obj) {\n for (var i = 0; i < obj.length; i++) {\n var formattedData = moment(obj[i].date, \"DD/MM/YYYY\");\n var currentMonth = formattedData.format(\"MMMM\");\n var employeeSale = obj[i].amount;\n months[currentMonth] += employeeSale;\n }\n labelTotalSales = Object.keys(months);\n dataTotalSales = Object.values(months);\n for (var j = 0; j < Object.keys(months).length; j++) {\n optionMonth.value = Object.keys(months)[j];\n $(\".months\").append(selectTemplate(optionMonth));\n }\n}", "function monthly(monthName, income, food, rent) {\n this.monthName = monthName\n this.income = income;\n this.food = food;\n this.rent = rent;\n this.calculateExcess = function() {\n var totalExpenses = this.food + this.rent;\n return this.income - totalExpenses;\n };\n}", "compareProfitOnPriceChange(amount) {\n let report = {};\n this._monthNames.map((element, index) => {\n const days = this.getDaysInMonth(index + 1);\n const previousRate = this.totalProduction() * days;\n const newRate = this.totalProduction(amount) * this.getDaysInMonth(index + 1);\n const difference = newRate - previousRate;\n const profitOrLoss = difference > 0 ? 'Profit' : 'Loss';\n report[element] = {\n previousRate,\n newRate,\n profitOrLoss\n };\n });\n return report;\n }", "function calcMonthView(data) {\n var new_data = [];\n var new_month = [];\n var current_day = data[0];\n var current_month = data[0].date.getMonth();\n for(var i = 1; i < data.length; ++i) {\n if(data[i].date.getMonth() == current_month) {\n new_month.push(data[i]);\n } else {\n new_data.push(new_month);\n new_month = [];\n current_month = data[i].date.getMonth();\n }\n }\n new_data.push(new_month);\n return new_data;\n}", "function calculateMonth(last, data, date) {\n let churn_per_month = Math.round(data.get('churn') / 100 * last.get('total_sales'))\n // Last month's sales plus percentage growth minus total churn this month\n let sales_per_month = Math.round(last.get('sales_per_month') + data.get('perc') / 100 * last.get('sales_per_month'))\n let total_sales = last.get('total_sales') + sales_per_month - churn_per_month\n let net = last.get('total_revenue') + sales_per_month * data.get('rev') + churn_per_month * -data.get('rev') - data.get('burn')\n\n return fromJS({\n date: date\n , cash: last.get('cash') + net\n , net: net\n , total_sales: total_sales\n , sales_per_month: sales_per_month\n , revenue_per_month: sales_per_month * data.get('rev')\n , cpa_per_month: sales_per_month * -data.get('cpa')\n , total_revenue: last.get('total_revenue') + sales_per_month * data.get('rev') + churn_per_month * -data.get('rev')\n , churn_amount: churn_per_month * -data.get('rev')\n , churn_per_month: churn_per_month\n })\n}", "getMonthDetail() {\n var y = this.currentDate.getFullYear(),\n m = this.currentDate.getMonth();\n var firstDay = new Date(y, m, 1);\n var lastDay = new Date(y, m + 1, 0);\n return {\n date: this.currentDate,\n month: this.currentDate.getMonth(),\n firstDay: firstDay,\n lastDay: lastDay,\n year: y\n };\n }", "months() {\n return _monthLabels.map((ml, i) => ({\n label: ml,\n label_1: ml.substring(0, 1),\n label_2: ml.substring(0, 2),\n label_3: ml.substring(0, 3),\n number: i + 1,\n }));\n }", "function MonthView(date) {\n this.date = date;\n this.WEEKS_PER_MONTH = 5;\n this.DAYS_PER_WEEK = 7;\n }", "function creatMonthsArray(month, daysCount) {\n console.log(daysCount);\n debugger;\n var month2 = new Object({\n Week1: { days: new Array(7).fill(0), tatal: 0 },\n Week2: { days: new Array(7).fill(0), tatal: 0 },\n Week3: { days: new Array(7).fill(0), tatal: 0 },\n });\n if (daysCount === 31) {\n month2.Week4 = { days: new Array(10).fill(0), tatal: 0 };\n } else if (daysCount === 30) {\n month2.Week4 = { days: new Array(9).fill(0), tatal: 0 };\n } else if (daysCount === 29) {\n month2.Week4 = { days: new Array(8).fill(0), tatal: 0 };\n } else if (daysCount === 28) {\n month2.Week4 = { days: new Array(7).fill(0), tatal: 0 };\n }\n\n switch (month) {\n case 1:\n console.log(jan, 'month');\n jan = month2;\n break;\n case 2:\n Feb = month2;\n break;\n case 3:\n Mar = month2;\n break;\n case 4:\n aprile = month2;\n break;\n case 5:\n may = month2;\n break;\n case 6:\n jun = month2;\n break;\n case 7:\n jul = month2;\n break;\n case 8:\n ogst = month2;\n break;\n case 9:\n sept = month2;\n break;\n case 10:\n oct = month2;\n break;\n case 11:\n nov = month2;\n break;\n case 12:\n dec = month2;\n break;\n }\n}", "function getSalesByMonth(data) {\n\n var months = new Array(12).fill(0);\n\n for (var i = 0; i < data.length; i++) {\n var d = data[i];\n\n var monthNum = moment(d.date, \"DD-MM-YYYY\").month();\n var amount = Number(d.amount);\n\n months[monthNum] += amount;\n\n }\n return months;\n}", "_setInfo() {\n let { year: currentYear, month: currentMonth } = this.currentMonthInfo; \n \n this.prevMonthInfo = { \n year: currentMonth == 0 ? currentYear - 1 : currentYear,\n month: currentMonth == 0 ? 11 : currentMonth - 1,\n day: null\n };\n \n this.nextMonthInfo = {\n year: currentMonth == 11 ? currentYear + 1 : currentYear,\n month: currentMonth == 11 ? 0 : currentMonth + 1,\n day: null\n }\n }", "analyzeAccount () {\r\n let resultsArray = [];\r\n\r\n // Apply the following code for each transaction in this account\r\n this._transactionList.forEach( transaction =>{\r\n // Group transactions by month\r\n let transactionYearMonth = transaction.date.slice(0,7);\r\n let monthIndex = -1;\r\n for(let i = 0; i < resultsArray.length; i++){\r\n if (resultsArray[i].yymm.toString() === transactionYearMonth.toString()){\r\n monthIndex = i;\r\n break;\r\n }\r\n }\r\n /* If the month entry for this transaction was not found, generate a new one\r\n for that month */\r\n if (monthIndex === -1) {\r\n resultsArray.push({\r\n yymm: transactionYearMonth, //The month name is in yyyy-mm format\r\n expense: 0, // Total of all expense transactions\r\n income: 0, // Total of all income transactions\r\n balance: 0, // income total - expense total\r\n num: 0, // number of all transactions this month (income and expense)\r\n // each category expense and income transactions\r\n cat: {expense:{}, income:{}}\r\n }) ;\r\n monthIndex = resultsArray.length - 1;\r\n }\r\n\r\n // Update expense or income total (based on the transaction type)\r\n resultsArray[monthIndex][transaction.type] += parseFloat(transaction.amount);\r\n\r\n /* Update the category expense or income total\r\n (based on the transaction type and category) */\r\n if (typeof resultsArray[monthIndex].cat[transaction.type][transaction.category] === 'undefined'){\r\n resultsArray[monthIndex].cat[transaction.type][transaction.category] = 0;\r\n }\r\n resultsArray[monthIndex].cat[transaction.type][transaction.category] +=\r\n parseFloat(transaction.amount);\r\n\r\n // Update the month's balance\r\n resultsArray[monthIndex].balance =\r\n parseFloat(resultsArray[monthIndex].income) -\r\n parseFloat(resultsArray[monthIndex].expense);\r\n\r\n // Increase the number of transactions for this month\r\n resultsArray[monthIndex].num += 1;\r\n });\r\n\r\n // Sort the analysis array by recent month first\r\n resultsArray.sort( (monthA, monthB) => {\r\n return new Date(monthB.yymm+'-01') - new Date(monthA.yymm+'-01');\r\n });\r\n this._analysis = resultsArray;\r\n }", "updateMonth() {\n O('month-label').innerHTML = MONTHS[this.month];\n }", "function nbMonths(startPriceOld, startPriceNew, savingperMonth, percentLossByMonth) {\n if (startPriceOld >= startPriceNew) {\n return [0, Math.floor(startPriceOld - startPriceNew)];\n }\n \n let months = 0;\n let totalSaving = 0;\n let depreciatedPriceNew = startPriceNew;\n let depreciatedPriceOld = startPriceOld;\n let lossPercentage = percentLossByMonth; \n while ((totalSaving + depreciatedPriceOld) < depreciatedPriceNew) {\n months += 1;\n if (months % 2 === 0) {\n lossPercentage += 0.5; \n }\n totalSaving += savingperMonth;\n depreciatedPriceOld -= depreciatedPriceOld * (lossPercentage / 100);\n depreciatedPriceNew -= depreciatedPriceNew * (lossPercentage / 100);\n }\n return [months, Math.round(totalSaving + depreciatedPriceOld - depreciatedPriceNew)];\n }", "function nbMonths(startPriceOld, startPriceNew, savingperMonth, percentLossByMonth){\n \n // Case 1 : the old man has enough money\n \n // We return 0 for the number of month and the difference between the two prices\n if(startPriceOld >= startPriceNew) {return [0, Math.round(startPriceOld - startPriceNew)];}\n \n \n // Case 2 : the old man doesn't have enough money\n \n // We initiate two variables, months for the number of months he's been waiting\n // and total for the total money he has\n var months = 0, total = startPriceOld;\n \n // As long as the old man doesn't have enough money, we loop again for a new month\n while(total < startPriceNew) {\n // We add the savingperMonth for the new month\n total += savingperMonth;\n \n // We adjust the price of the old car\n total -= startPriceOld * percentLossByMonth / 100;\n \n \n // Applying the interest rate on the new car price and \n startPriceNew -= startPriceNew * percentLossByMonth / 100;\n startPriceOld -= startPriceOld * percentLossByMonth / 100;\n \n // We increase the month counter\n months++;\n \n // Increasing the rate for all the even months (we use the increased rate immediately after month 1)\n // So each time the numbers of passed months is odd, we increase the rate\n months % 2 !== 0 ? percentLossByMonth += 0.5 : percentLossByMonth;\n \n } // end while\n \n // Returning the number of months and what the old man has left after the purchase (rounded to units)\n return [months, Math.round(total - startPriceNew)];\n \n}", "function Month(parent){var _this=_super.call(this,parent)||this;_this.dayNameFormat='wide';_this.viewClass='e-month-view';_this.isInverseTableSelect=false;_this.monthDates={};return _this;}", "function changeByMonth(month, year, back) {\n back = back || false;\n var numDaysInMo,\n addend = 1;\n if (back) {\n addend = -1;\n }\n month = month + addend;\n if ((month < 0) || (month === 12)) {\n month = (month < 0) ? (month = 11) : month = 0;\n year = year + addend;\n }\n numDaysInMo = daysInMonth(month, year);\n return {month: month, year: year, numDaysInMo: numDaysInMo};\n }", "function FormMonthlyData(data) {\n var janArray = [];\n var febArray = [];\n var marArray = [];\n var aprArray = [];\n var mayArray = [];\n var junArray = [];\n var julArray = [];\n var augArray = [];\n var sepArray = [];\n var octArray = [];\n var novArray = [];\n var decArray = [];\n\n for (var i = 0; i < data.length; i++) {\n if(i < 743) {\n janArray.push(data[i]);\n }\n if(i > 744 && i < 1441) {\n febArray.push(data[i]);\n }\n if(i > 1442 && i < 2162) {\n marArray.push(data[i]);\n }\n if(i > 2163 && i < 2907) {\n aprArray.push(data[i]);\n }\n if(i > 2908 && i < 3628) {\n mayArray.push(data[i]);\n }\n if(i > 3629 && i < 4373) {\n junArray.push(data[i]);\n }\n if(i > 4374 && i < 5094) {\n julArray.push(data[i]);\n }\n if(i > 5095 && i < 5839) {\n augArray.push(data[i]);\n }\n if(i > 5840 && i < 6560) {\n sepArray.push(data[i]);\n }\n if(i > 6561 && i < 7305) {\n octArray.push(data[i]);\n }\n if(i > 7306 && i < 8026) {\n novArray.push(data[i]);\n }\n if(i > 8027 && i < 8771) {\n decArray.push(data[i]);\n }\n }\n return [janArray,febArray,marArray,aprArray,mayArray,junArray,julArray,augArray,sepArray,octArray,novArray,decArray];\n}", "getCreditCardMonths(startMonth) {\n let data = [];\n // build an array for \"Month\" dropdown list\n // - start at current month and loop until\n for (let theMonth = startMonth; theMonth <= 12; theMonth++) {\n // .push adds theMonth to the data array\n data.push(theMonth);\n }\n // the of operator from rxjs will wrap an object as an Observable!\n return of(data);\n }", "listMonths () {\n const currentYear = this.year\n const min = this.minMoment\n const max = this.maxMoment\n const inMinYear = currentYear === min.year()\n const inMaxYear = currentYear === max.year()\n const months = []\n Moment.months().forEach((name, m) => {\n if ((!inMinYear || m >= min.month()) && (!inMaxYear || m <= max.month())) {\n months.push({ text: name, value: m })\n }\n })\n return months\n }", "function monthChange(btn){\n let newMonth = Toolbar.curTime.getMonth() + Number(btn.getAttribute(\"data-dir\"));\n let newYear = Toolbar.curTime.getFullYear();\n if(newMonth<0){\n newMonth = 11;\n newYear--;\n }\n else if(newMonth > 11){\n newMonth = 0;\n newYear++;\n }\n Toolbar.curTime.setMonth(newMonth);\n Toolbar.curTime.setFullYear(newYear);\n genDateTable();\n}", "function updateViz(val){\r\n d3.select('#month').html(listMonths[val-1]);\r\n drawMap(currentMonth, currentYear); \r\n }", "generateSelectMonths() {\n let allRecords = this.props.allRecords\n let months = []\n let key = \"\"\n\n if (allRecords.length !== 0) {\n let startDate = allRecords.sort((a, b) => (new Date(a.date) - new Date(b.date)))[0].date\n let { startMonth, startYear, currentMonth, currentYear } = this.getDatesSelect(startDate)\n\n for (let year = startYear; year <= currentYear; year++) {\n for (let month = startMonth; month <= currentMonth; month++) {\n month = (month < 10) ? ('0' + month) : month\n key = `${month}/${year}`\n months.push(key)\n }\n }\n }\n return months;\n }", "function overviewChartMonthDisplay() {\n\t\tlet monthDisplay = document.getElementById('overviewChartMonth');\n\t\t\n\t\t// Year Display\n\t\tlet currentDate = new Date();\n\t\t\n\t\t// If month is December then show only the current year \n\t\tif(currentDate.getMonth() == 11) {\n\t\t\tmonthDisplay.innerText = currentDate.getFullYear();\n\t\t} else {\n\t\t\tmonthDisplay.innerText = (Number(currentDate.getFullYear()) - 1) + ' - ' + currentDate.getFullYear()\n\t\t}\n\t}", "function showMonth(target, delta) {\n var state = $.data(target, 'calendar');\n var opts = state.options;\n opts.month += delta;\n if (opts.month > 12) {\n opts.year++;\n opts.month = 1;\n } else if (opts.month < 1) {\n opts.year--;\n opts.month = 12;\n }\n show(target, state);\n\n var menu = $(target).find('.calendar-menu-month-inner');\n menu.find('td.calendar-selected').removeClass('calendar-selected');\n menu.find('td:eq(' + (opts.month - 1) + ')').addClass('calendar-selected');\n }", "function getDistinctMonths(allData) {\n var distinctMonths = {};\n allData.forEach(function(d) {\n if(d.OrderYear > 0 && d.OrderMonth > 0)\n distinctMonths[d.OrderYear + \"-\" + d.OrderMonth] = { OrderYear: d.OrderYear, OrderMonth: d.OrderMonth };\n })\n \n\n return Object.keys(distinctMonths).sort(function (x, y) {\n var isGreater;\n if (distinctMonths[x].OrderYear == distinctMonths[y].OrderYear) isGreater = distinctMonths[x].OrderMonth > distinctMonths[y].OrderMonth;\n else isGreater = distinctMonths[x].OrderYear > distinctMonths[y].OrderYear;\n\n return isGreater ? 1 : -1;\n });;\n }", "constructor(year, month) {\n let _y = parseInt(+year), _m = parseInt(+month);\n if (isNaN(_y) || isNaN(_m) || _m < 1 || _m > 12) {\n if (process.env.NODE_ENV !== 'production') {\n throw new TypeError('MonthObject constructor should receive a valid number!');\n }\n }\n this._year = _y;\n this._month = _m;\n this._isLeap = ((month == 2) && (year % 4 == 0 && year % 100 != 0 || year % 400 == 0));\n this._dayCount = [1, -2, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1][month - 1] + 30 + this._isLeap;\n }", "function monthPredicted(){\n var tempdata = \"\";\n var flag = 1;\n if (inspectedItem.funding_status === \"seed\"){\n tempdata = process_data_numeric(seed_to_a);\n }else if (inspectedItem.funding_status === \"series_a\"){\n tempdata = process_data_numeric(a_to_b);\n }else{\n flag = 0;\n tempdata = process_data(monthRateDefault);\n }\n var ans = [];\n if (flag === 1){\n for (var i in tempdata){\n if (tempdata[i].name === inspectedItem.name){\n const entries = Object.entries(tempdata[i])\n let id = 0;\n ans = entries.map(function(item){\n var info = {\n \"key\": id,\n \"period\": item[0],\n \"success_rate\": item[1],\n }\n id++;\n return info;\n })\n ans.shift()\n ans.shift()\n stateX = []\n stateX.push(ans.pop())\n stateX.push(ans.pop())\n stateX.push(ans.pop())\n stateX.push(ans.pop())\n stateX.push(ans.pop())\n }\n }\n return ans;\n }else{\n return tempdata;\n }\n }", "setMonthTable(state, {ledger}) {\n ledger.bill.forEach(e => {\n let item = {year: e.year, month: e.month, monthKey: e.monthKey};\n if(e.month && e.year && ledger.monthTable.findIndex(i => (i.year === e.year && i.month === e.month)) < 0) {\n ledger.monthTable.push(item);\n }\n });\n }", "constructor(yearNum, monthNum) {\n super();\n let monthIndex = monthNum - 1;\n let monthLabel = config.data.monthsLabels[monthIndex];\n let numDays;\n this.monthName = monthLabel.monthName;\n //maxDays determines the max possible number of days in a certain month, not whether the one we're dealing with actually has this max (think of February). Having a property explicitely defined in this object allows for cleaner / easier to read code.\n this.maxDays = monthLabel.maxDays;\n this.monthNum = monthNum;\n this.yearNum = yearNum;\n numDays = this.maxDays;\n if(this.monthNum == 2){\n // we use a moment.js abstraction to obtain the actual number of days of the month and directly generate the right number of DayData object, instead of having the 29th day of february having to hide itself on non leap year. Moreover, we decrease the \"human\" month num by one as moment.js indexes month starting at 0\n numDays = moment().month(monthIndex).year(yearNum).daysInMonth();\n }\n this.daysData = Array.from(new Array(numDays), (x,i) => i+1).map(dayNum => new DayData(this.yearNum, this.monthNum, dayNum));\n }", "function createReport() {\n let month = document.getElementById(\"reportMonth\").value;\n let thisMonthOper = JSON.parse(localStorage.getItem(\"operations\"));\n let reportObj = {};\n document.querySelector(\"tbody\").innerHTML = \"\";\n if (thisMonthOper === null) {\n thisMonthOper = [];\n }\n for (var i = 0; i < thisMonthOper.length; i++) {\n let operationsMonth = thisMonthOper[i].date[0]+thisMonthOper[i].date[1]+thisMonthOper[i].date[2]+thisMonthOper[i].date[3]+thisMonthOper[i].date[4]+thisMonthOper[i].date[5]+thisMonthOper[i].date[6];\n //create object from LS info\n if (operationsMonth === month) {\n if (reportObj.hasOwnProperty(thisMonthOper[i].item)) {\n reportObj[thisMonthOper[i].item] += thisMonthOper[i].sum;\n } else {\n reportObj[thisMonthOper[i].item] = thisMonthOper[i].sum;\n }\n }\n }\n //create report table\n let items = Object.keys(reportObj);\n let values = Object.values(reportObj);\n for (var i = 0; i < items.length; i++) {\n let newRow = tbody.insertRow();\n let rows = table.getElementsByTagName(\"tr\");\n let num = rows.length - 2;\n newRow.innerHTML = `\n <td>${num}</td>\n <td>${items[i]}</td>\n <td>${parseFloat(values[i] / 100 * 100).toFixed(2)}</td>\n <td>${months[month.slice(5,7)-1] + \"-\" + month.slice(0,4)}</td>\n `;\n }\n}", "function CalendarMonthCtrl($element,$scope,$animate,$q,$$mdDateUtil,$mdDateLocale){/** @final {!angular.JQLite} */this.$element=$element;/** @final {!angular.Scope} */this.$scope=$scope;/** @final {!angular.$animate} */this.$animate=$animate;/** @final {!angular.$q} */this.$q=$q;/** @final */this.dateUtil=$$mdDateUtil;/** @final */this.dateLocale=$mdDateLocale;/** @final {HTMLElement} */this.calendarScroller=$element[0].querySelector('.md-virtual-repeat-scroller');/** @type {boolean} */this.isInitialized=false;/** @type {boolean} */this.isMonthTransitionInProgress=false;var self=this;/**\n\t * Handles a click event on a date cell.\n\t * Created here so that every cell can use the same function instance.\n\t * @this {HTMLTableCellElement} The cell that was clicked.\n\t */this.cellClickHandler=function(){var timestamp=$$mdDateUtil.getTimestampFromNode(this);self.$scope.$apply(function(){self.calendarCtrl.setNgModelValue(timestamp);});};/**\n\t * Handles click events on the month headers. Switches\n\t * the calendar to the year view.\n\t * @this {HTMLTableCellElement} The cell that was clicked.\n\t */this.headerClickHandler=function(){self.calendarCtrl.setCurrentView('year',$$mdDateUtil.getTimestampFromNode(this));};}", "function calcYearOverview(data) {\n var new_data = [];\n var current_day = data[0];\n current_day.date.setDate(1);\n var current_month = data[0].date.getMonth();\n for(var i = 1; i < data.length; ++i) {\n if(data[i].date.getMonth() == current_month) {\n current_day.killed += data[i].killed;\n current_day.injured += data[i].injured;\n } else {\n new_data.push(current_day);\n current_day = data[i];\n current_day.date.setDate(1);\n current_month = data[i].date.getMonth();\n }\n }\n new_data.push(current_day);\n return new_data;\n}", "function buildDataByMonth(dataMap){\n var ret = {}; //the result data map\n var i = 1; //next month index\n var sum = 0; //the sum for current month\n var count = 0; //the day count for current month\n var m; //the month index for the current day\n for(var day in dataMap){\n m = new Date(day).getMonth() + 1;\n if(m > i) { // now we got to the first day of the next month, we need to caculate the current month firstly\n ret[\"2016年\"+(i++)+\"月\"] = sum / count;\n sum = count = 0;\n }\n sum += dataMap[day];\n ++count;\n }\n ret[\"2016年\"+(i)+\"月\"] = sum / count; //for the final month;\n return ret;\n}", "function CalendarMonthBodyCtrl($element,$$mdDateUtil,$mdDateLocale){/** @final {!angular.JQLite} */this.$element=$element;/** @final */this.dateUtil=$$mdDateUtil;/** @final */this.dateLocale=$mdDateLocale;/** @type {Object} Reference to the month view. */this.monthCtrl=null;/** @type {Object} Reference to the calendar. */this.calendarCtrl=null;/**\n\t * Number of months from the start of the month \"items\" that the currently rendered month\n\t * occurs. Set via angular data binding.\n\t * @type {number}\n\t */this.offset=null;/**\n\t * Date cell to focus after appending the month to the document.\n\t * @type {HTMLElement}\n\t */this.focusAfterAppend=null;}", "function calculateCumulativeCounts(data) {\n var counts = {}\n data.rows.forEach(function(row) {\n if (row.year && row.month) {\n yearMonthString = moment([row.year, row.month, 1]).format('YYYY-MM')\n counts[yearMonthString] = row.count\n }\n })\n\n total = 0\n countsAllMonths = {}\n\n dates().forEach(function(date) {\n var dateString = date.format('YYYY-MM');\n var newCovenantsThisMonth = counts[dateString]\n\n if (newCovenantsThisMonth) {\n total += newCovenantsThisMonth;\n }\n countsAllMonths[dateString] = total\n })\n\n return countsAllMonths\n }", "function buildMonthlyForEach(item) {\n const timeMoment = moment(item.time);\n const identityString = convertToFirstOfTheWeek(timeMoment);\n const dataObj = binarySearchHelper(monthlyData, moment(identityString), cmpDay);\n \n if (!dataObj && timeMoment.isoWeekday() < 6 && moment() > timeMoment) {\n const itemCpy = JSON.parse(JSON.stringify(item));\n itemCpy.time = identityString;\n monthlyData.push(itemCpy);\n } else if (timeMoment.isoWeekday() < 6 && timeMoment < moment()) {\n dataObj.hourCount = parseFloat(dataObj.hourCount) + parseFloat(item.hourCount);\n dataObj.hourEstimate = parseFloat(dataObj.hourEstimate) + parseFloat(item.hourEstimate);\n }\n}", "function setValueMonth(){\n \t$scope.tableMonth[0] = {'Cle': '1', 'Name': 'Janvier'};\n \t$scope.tableMonth[1] = {'Cle': '2', 'Name': 'Février'};\n \t$scope.tableMonth[2] = {'Cle': '3', 'Name': 'Mars'};\n \t$scope.tableMonth[3] = {'Cle': '4', 'Name': 'Avril'};\n \t$scope.tableMonth[4] = {'Cle': '5', 'Name': 'Mai'};\n \t$scope.tableMonth[5] = {'Cle': '6', 'Name': 'Juin'};\n \t$scope.tableMonth[6] = {'Cle': '7', 'Name': 'Juillet'};\n \t$scope.tableMonth[7] = {'Cle': '8', 'Name': 'Aout'};\n \t$scope.tableMonth[8] = {'Cle': '9', 'Name': 'Septembre'};\n \t$scope.tableMonth[9] = {'Cle': '10', 'Name': 'Octobre'};\n \t$scope.tableMonth[10] = {'Cle': '11', 'Name': 'Novembre'};\n \t$scope.tableMonth[11] = {'Cle': '12', 'Name': 'Décembre'};\n }", "function updateMonth(cal, elem) {\n\t\tif (isNaN(cal.date.getTime()))\n\t\t\tcal.date = new Date();\n\t\tcal.date.setMonth(parseInt(elem.value));\n\t\tcalRefresh();\n\t}", "function calculateMetrics(data) {\n let starting = calculateMonth(fromJS({\n sales_per_month: data.get('sales')\n , total_sales: data.get('sales')\n , cash: data.get('cash')\n , total_revenue: data.get('tot')\n }), data, moment())\n return Range(1,36).map(n => moment().add(n, 'months'))\n .reduce(\n (months, date) => months.push(calculateMonth(months.last(), data, date))\n , fromJS([starting])\n )\n}", "function makeMonthArray() {\n this.length=12;\n this[1] = \"Jan.\"; this[2] = \"Feb.\"; this[3] = \"March\";\n this[4] = \"April\"; this[5] = \"May\"; this[6] = \"June\";\n this[7] = \"July\"; this[8] = \"Aug.\"; this[9] = \"Sept.\";\n this[10] = \"Oct.\"; this[11] = \"Nov.\"; this[12] = \"Dec.\";\n return this;\n}", "compare(monthObject) {\n let y_cmp = this._year - monthObject.year;\n return y_cmp == 0 ? (this._month - monthObject.month) : (y_cmp > 0 ? 1 : -1);\n }", "function getPayments(loan, payment, months, mthRate) {\n let paymentArray = [];\n let totalInterest = 0;\n let balance = loan;\n let interest = 0;\n let principal = 0;\n\n for (let i = 1; i <= months; i++) {\n let obj = {};\n\n interest = balance * mthRate;\n principal = payment - interest;\n totalInterest += interest;\n balance -= principal;\n\n obj['month'] = i;\n obj['payment'] = payment;\n obj['principal'] = principal;\n obj['interest'] = interest;\n obj['totalInterest'] = totalInterest;\n obj['balance'] = Math.abs(balance); // Fix negative value\n\n paymentArray.push(obj);\n }\n\n return paymentArray;\n}", "function groupYearMonth(list) {\n\tvar result = {};\n\tvar years = groupBy(list, function(item) {\n\t\treturn item.date.substr(0, 4);\n\t});\n\tfor (var key in years) {\n\t\tresult[key] = {\n\t\t\tvisible: years[key].visible,\n\t\t\tdata: groupBy(years[key].data, function(item) {\n\t\t\t\treturn item.date.substr(5, 2);\n\t\t\t}),\n\t\t\tamount: years[key].amount,\n\t\t};\n\t}\n\treturn result;\n}", "function calcMonths(empStart) {\n var startDate = moment(empStart);\n var empMonths = startDate.fromNow('months');\n console.log(empMonths);\n\n return empMonths;\n}", "function monthUpdate() {\n const monthField = document.querySelector('#month');\n monthField.textContent = moment(currentDate).format('MMMM')\n }", "function calculus(loanAmount, numberPayments, rate) {\n let monthlyPayment = 0;\n let totalCost = 0;\n let totalInterest = 0;\n let eachMonth = {\n month: [0],\n payment: 0,\n principal: [0],\n interest: [0],\n totalInterestObj: [0],\n balance: [loanAmount],\n totalInterestEnd: 0,\n totalCost: 0,\n term: 0,\n loanAmount: 0,\n };\n \n //payment est la mensualité\n monthlyPayment = (loanAmount) * (rate / 1200) / (1 - (1 + rate / 1200) ** (-60));\n //25000 × (5 ÷ 1200) ÷ (1 - (1 + 5 ÷ 1200))^(-60)=471.7808411\n eachMonth.payment = monthlyPayment;\n eachMonth.loanAmount = loanAmount;\n totalInterest = parseFloat((monthlyPayment * numberPayments) - loanAmount);\n eachMonth.totalInterestEnd = parseFloat(totalInterest);\n totalCost = parseFloat(loanAmount) + parseFloat(totalInterest);\n eachMonth.totalCost = totalCost;\n eachMonth.term = numberPayments;\n\n for (let i = 1; i <= numberPayments; i++) {\n eachMonth.month.push(i);\n eachMonth.interest.push(eachMonth.balance[i - 1] * rate / 1200);\n eachMonth.principal.push(monthlyPayment - eachMonth.interest[i]);\n eachMonth.totalInterestObj.push(eachMonth.interest[i - 1] + eachMonth.interest[i]);\n eachMonth.balance.push(eachMonth.balance[i - 1] - eachMonth.principal[i]);\n }\n return eachMonth;\n // formules a verifier:\n //balance 0 =loanAmount\n /* first Term: interest1==balance0*5/1200\n principal1==payment-interest1\n balance1==balance0-principal1\n\n eachMonth.interest[i]==eachMonth.balance[i-1]*5/1200\n principali==payment-interesti\n balancei==balance[i-1]]-principali */\n}", "function buildAndSetResultListsPower(value){\t\r\n\t\tvar currentYear = moment().year();\r\n\t\t//var lastYear = moment().subtract(1, 'years').year();\t\r\n\r\n\t\tvar currentMonth = moment().month();\r\n\t\tvar currentMonthYear = moment().year();\r\n\t\tvar currentMonthDays = moment().daysInMonth();\r\n\t\t//var lastMonth = moment().subtract(1, 'month').month();\r\n\t\t//var lastMonthYear = moment().subtract(1, 'month').year();\t\r\n\r\n\t\tvar currentWeek = moment().isoWeek();\r\n\t\tvar currentWeekYear = moment().isoWeekYear();\r\n\t\t//var lastWeek = moment().subtract(1, 'week').isoWeek();\r\n\t\t//var lastWeekYear = moment().subtract(1, 'week').isoWeekYear(); \r\n\r\n\t\tvar statisticsDataCurrentYear_sum = 0;\r\n\t\tvar statisticsDataCurrentYear_values = new Array();\r\n\t\tvar statisticsDataCurrentYearPerMonth_rawValues = new Array(12).fill(0);\r\n\t\tvar statisticsDataCurrentYearPerMonth_values = new Array();\r\n\t\t//var statisticsDataLastYear_sum = 0;\r\n\t\t//var statisticsDataLastYear_values = new Array();\r\n\t\t//var statisticsDataLastYearPerMonth_rawValues = new Array(12).fill(0);\r\n\t\t//var statisticsDataLastYearPerMonth_values = new Array();\r\n\r\n\t\tvar statisticsDataCurrentMonth_sum = 0;\r\n\t\tvar statisticsDataCurrentMonth_values = new Array();\r\n\t\tvar statisticsDataCurrentMonthPerDay_rawValues = new Array(currentMonthDays).fill(0);\r\n\t\tvar statisticsDataCurrentMonthPerDay_values = new Array();\r\n\t\t//var statisticsDataCurrentMonthPerWeek_rawValues = new Array(53).fill(0);\r\n\t\t//var statisticsDataCurrentMonthPerWeek_values = new Array();\r\n\t\t//var statisticsDataLastMonth_sum = 0;\r\n\t\t//var statisticsDataLastMonth_values = new Array();\r\n\t\t//var statisticsDataLastMonthPerWeek_rawValues = new Array(53).fill(0);\r\n\t\t//var statisticsDataLastMonthPerWeek_values = new Array();\r\n\r\n\t\tvar statisticsDataCurrentWeek_sum = 0;\r\n\t\tvar statisticsDataCurrentWeek_values = new Array();\r\n\t\tvar statisticsDataCurrentWeekPerDay_rawValues = new Array(7).fill(0);\r\n\t\tvar statisticsDataCurrentweekPerDay_values = new Array();\r\n\t\t//var statisticsDataLastWeek_sum = 0;\r\n\t\t//var statisticsDataLastWeek_values = new Array();\r\n\r\n\t\tfor(var item in value) {\r\n\t\t\tvar year = moment(value[item].x).year();\r\n\t\t\tvar month = moment(value[item].x).month();\r\n\r\n\t\t\tvar week = moment(value[item].x).isoWeek();\r\n\t\t\tvar weekYear = moment(value[item].x).isoWeekYear();\r\n\r\n\t\t\tvar dayOnWeek = moment(value[item].x).isoWeekday();\r\n\t\t\tvar dayOnMonth = moment(value[item].x).date();\r\n\r\n\t\t\t//year\r\n\t\t\tif(year == currentYear) {\r\n\t\t\t\tstatisticsDataCurrentYear_sum += value[item].y;\r\n\t\t\t\tstatisticsDataCurrentYear_values.push(value[item]);\r\n\t\t\t\tstatisticsDataCurrentYearPerMonth_rawValues[month]+=value[item].y;\r\n\t\t\t} \r\n\t\t\t/*else if(year == lastYear) {\r\n\t\t\t\tstatisticsDataLastYear_sum += value[item].y;\r\n\t\t\t\tstatisticsDataLastYear_values.push(value[item]);\r\n\t\t\t\tstatisticsDataLastYearPerMonth_rawValues[month]+=value[item].y;\r\n\t\t\t}*/\r\n\r\n\t\t\t//month\r\n\t\t\tif(year == currentMonthYear && month == currentMonth) {\r\n\t\t\t\tstatisticsDataCurrentMonth_sum += value[item].y;\r\n\t\t\t\tstatisticsDataCurrentMonth_values.push(value[item]);\r\n\t\t\t\tstatisticsDataCurrentMonthPerDay_rawValues[dayOnMonth-1]+=value[item].y;\r\n\r\n\t\t\t\t//statisticsDataCurrentMonthPerWeek_rawValues[week]+=value[item].y;\r\n\t\t\t}\r\n\t\t\t/*else if(year == lastMonthYear && month == lastMonth) {\r\n\t\t\t\tstatisticsDataLastMonth_sum += value[item].y;\r\n\t\t\t\tstatisticsDataLastMonth_values.push(value[item]);\r\n\t\t\t\t//statisticsDataLastMonthPerWeek_rawValues[week]+=value[item].y;\r\n\t\t\t}*/\r\n\r\n\t\t\t//week\r\n\t\t\tif(weekYear == currentWeekYear && week == currentWeek) {\r\n\t\t\t\tstatisticsDataCurrentWeek_sum += value[item].y;\r\n\t\t\t\tstatisticsDataCurrentWeek_values.push(value[item]);\r\n\t\t\t\tstatisticsDataCurrentWeekPerDay_rawValues[dayOnWeek-1]+=value[item].y;\r\n\t\t\t}\r\n\t\t\t/*else if(weekYear == lastWeekYear && week == lastWeek) {\r\n\t\t\t\tstatisticsDataLastWeek_sum += value[item].y;\r\n\t\t\t\tstatisticsDataLastWeek_values.push(value[item]);\r\n\t\t\t}*/\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\t/*\r\n\t\tBuild year per month array (current/last) \r\n\t\t*/\r\n\t\tfor (var i in statisticsDataCurrentYearPerMonth_rawValues) {\r\n\t\t\tstatisticsDataCurrentYearPerMonth_values.push({\r\n \t\tx: moment().months(parseInt(i)).startOf('month').valueOf(),\r\n \t\ty: statisticsDataCurrentYearPerMonth_rawValues[i]\r\n \t\t});\r\n\t\t};\r\n\r\n\t\tfor (var i in statisticsDataCurrentMonthPerDay_rawValues) {\r\n\t\t\tstatisticsDataCurrentMonthPerDay_values.push({\r\n \t\tx: moment().date(parseInt(i)+1).startOf('day').valueOf(),\r\n \t\ty: statisticsDataCurrentMonthPerDay_rawValues[i]\r\n \t\t});\r\n\t\t};\r\n\r\n\t\tfor (var i in statisticsDataCurrentWeekPerDay_rawValues) {\r\n\t\t\tstatisticsDataCurrentweekPerDay_values.push({\r\n \t\tx: moment().isoWeekday(parseInt(i)+1).startOf('day').valueOf(),\r\n \t\ty: statisticsDataCurrentWeekPerDay_rawValues[i]\r\n \t\t});\r\n\t\t};\r\n\r\n\t\t/*for (var i in statisticsDataLastYearPerMonth_rawValues) {\r\n\t\t\tstatisticsDataLastYearPerMonth_values.push({\r\n \t\tx: moment().months(parseInt(i)).startOf('month').valueOf(),\r\n \t\ty: statisticsDataLastYearPerMonth_rawValues[i]\r\n \t\t});\r\n\r\n\t\t};*/\r\n\r\n\t\t/*\r\n\t\tBuild month per week array (current/last) \r\n\t\t*/\r\n\t\t/*for (var i in statisticsDataCurrentMonthPerWeek_rawValues) {\r\n\t\t\tstatisticsDataCurrentMonthPerWeek_values.push({\r\n \t\tx: i,\r\n \t\ty: statisticsDataCurrentMonthPerWeek_rawValues[i]\r\n \t\t});\r\n\t\t};\r\n\r\n\t\tfor (var i in statisticsDataLastMonthPerWeek_rawValues) {\r\n\t\t\tstatisticsDataLastMonthPerWeek_values.push({\r\n \t\tx: i,\r\n \t\ty: statisticsDataLastMonthPerWeek_rawValues[i]\r\n \t\t});\r\n\t\t};*/\r\n\r\n\t\t$scope.statisticsDataCurrentYear = {\t\t\t\t\r\n\t\t\tkey: $scope.fhemDevicePowerDaySumReadingText,\t\t\t\t\t\t\r\n\t\t\tvalues: statisticsDataCurrentYearPerMonth_values//statisticsDataCurrentYear_values\r\n\t\t};\r\n\r\n\t\t/*$scope.statisticsDataLastYear = {\t\t\t\t\r\n\t\t\tkey: $scope.fhemDevicePowerDaySumReadingText,\t\t\t\t\t\t\r\n\t\t\tvalues: statisticsDataLastYearPerMonth_values\r\n\t\t};*/\r\n\r\n\t\t$scope.statisticsDataCurrentMonth = {\t\t\t\t\r\n\t\t\tkey: $scope.fhemDevicePowerDaySumReadingText,\t\t\t\t\t\t\r\n\t\t\tvalues: statisticsDataCurrentMonthPerDay_values//statisticsDataCurrentMonth_values\r\n\t\t};\r\n\r\n\t\t/*$scope.statisticsDataLastMonth = {\t\t\t\t\r\n\t\t\tkey: $scope.fhemDevicePowerDaySumReadingText,\t\t\t\t\t\t\r\n\t\t\tvalues: statisticsDataLastMonth_values\r\n\t\t};*/\r\n\r\n\t\t$scope.statisticsDataCurrentWeek = {\t\t\t\t\r\n\t\t\tkey: $scope.fhemDevicePowerDaySumReadingText,\t\t\t\t\t\t\r\n\t\t\tvalues: statisticsDataCurrentweekPerDay_values//statisticsDataCurrentWeek_values\r\n\t\t};\r\n\r\n\t\t/*$scope.statisticsDataLastWeek = {\t\t\t\t\r\n\t\t\tkey: $scope.fhemDevicePowerDaySumReadingText,\t\t\t\t\t\r\n\t\t\tvalues: statisticsDataLastWeek_values\r\n\t\t};*/\r\n\r\n\r\n\t\t$scope.statisticsDataCurrentYear_sum = statisticsDataCurrentYear_sum;\r\n\t\t//$scope.statisticsDataLastYear_sum = statisticsDataLastYear_sum;\r\n\r\n\t\t$scope.statisticsDataCurrentMonth_sum = statisticsDataCurrentMonth_sum;\r\n\t\t//$scope.statisticsDataLastMonth_sum = statisticsDataLastMonth_sum;\r\n\t\t\r\n\t\t$scope.statisticsDataCurrentWeek_sum = statisticsDataCurrentWeek_sum;\r\n\t\t//$scope.statisticsDataLastWeek_sum = statisticsDataLastWeek_sum;\r\n\t\t\t\t\r\n\t}", "function getMonthDetails(month, year) {\n var start = moment({ year: year, month: month })\n return { startDay: start.isoWeekday(), length: start.endOf('month').date() }\n}", "function CalculateMonthlyAverage(data){\n let monthName = \"\"; // to use for calculating of monthly average value\n var janSum, febSum, marSum, aprSum, maySum, junSum, julSum, augSum, sepSum, octSum, novSum, decSum;\n janSum = febSum = marSum = aprSum = maySum = junSum = julSum = augSum = sepSum = octSum = novSum = decSum = 0; // variable for each monthly total\n var janAvg, febAvg, marAvg, aprAvg, mayAvg, junAvg, julAvg, augAvg, sepAvg, octAvg, novAvg, decAvg;\n janAvg = febAvg = marAvg = aprAvg = mayAvg = junAvg = julAvg = augAvg = sepAvg = octAvg = novAvg = decAvg = 0; // variable for each monthly average\n let counter = 0; // count only the day that has a valid value \n let month, day = \"\";\n \n for (let m=1; m<13; m++){ // loop over months\n if (m<10) month=\"0\"+m;\n else month=m.toString();\n \n for (let d=1; d<32; d++){ // loop over days\n if(monthName == \"\" || monthName != month){ // first calculation of the average or calculation of the new month\n monthName = month;\n counter = 0;\n } \n \n if (d<10) day=\"0\"+d; \n else day=d;\n \n let ymd = \"2020-\"+month+\"-\"+day; // ymd : year-month-day\n \n data.forEach(function(element){\n if(element[ymd] == undefined || element[ymd] == \"\" || element[ymd] == null ){\n // set 0 for undefined value \n element[ymd] = 0 \n }else{\n counter++ \n \n switch(month){\n case \"01\":\n janSum += parseFloat(element[ymd])\n janAvg = janSum/counter\n\n element[month] = janAvg.toFixed(2)\n break;\n case \"02\":\n febSum += parseFloat(element[ymd])\n febAvg = febSum /counter\n element[month] = febAvg.toFixed(2)\n break;\n case \"03\":\n marSum += parseFloat(element[ymd])\n marAvg = marSum /counter\n element[month] = marAvg.toFixed(2)\n break;\n case \"04\":\n aprSum += parseFloat(element[ymd])\n aprAvg = aprSum /counter\n element[month] = aprAvg.toFixed(2)\n break;\n case \"05\":\n maySum += parseFloat(element[ymd])\n mayAvg = maySum /counter\n element[month] = mayAvg.toFixed(2)\n break;\n case \"06\":\n junSum += parseFloat(element[ymd])\n junAvg = junSum /counter\n element[month] = junAvg.toFixed(2)\n break;\n case \"07\":\n julSum += parseFloat(element[ymd])\n julAvg = julSum /counter\n element[month] = julAvg.toFixed(2)\n break;\n case \"08\":\n augSum += parseFloat(element[ymd])\n augAvg = augSum /counter\n element[month] = augAvg.toFixed(2)\n break;\n case \"09\":\n sepSum += parseFloat(element[ymd])\n sepAvg = sepSum /counter\n element[month] = sepAvg.toFixed(2)\n break;\n case \"10\": \n octSum += parseFloat(element[ymd])\n octAvg = octSum /counter\n element[month] = octAvg.toFixed(2)\n break;\n case \"11\":\n novSum += parseFloat(element[ymd])\n novAvg = novSum /counter\n element[month] = novAvg.toFixed(2)\n break;\n case \"12\":\n decSum += parseFloat(element[ymd])\n decAvg = decSum /counter\n element[month] = decAvg.toFixed(2)\n break;\n default:\n }\n }\n });\n }}\n }", "getMonthComps(month, year) {\n const key = `${month}-${year}`;\n let comps = this.monthData[key];\n\n if (!comps) {\n const inLeapYear = year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;\n const firstWeekday = new Date(year, month - 1, 1).getDay() + 1;\n const days = month === 2 && inLeapYear ? 29 : daysInMonths[month - 1];\n const weeks = Math.ceil((days + Math.abs(firstWeekday - this.firstDayOfWeek)) / daysInWeek);\n comps = {\n firstDayOfWeek: this.firstDayOfWeek,\n inLeapYear,\n firstWeekday,\n days,\n weeks,\n month,\n year\n };\n this.monthData[key] = comps;\n }\n\n return comps;\n }", "getMonthComps(month, year) {\n const key = `${month}-${year}`;\n let comps = this.monthData[key];\n\n if (!comps) {\n const inLeapYear = year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;\n const firstWeekday = new Date(year, month - 1, 1).getDay() + 1;\n const days = month === 2 && inLeapYear ? 29 : daysInMonths[month - 1];\n const weeks = Math.ceil((days + Math.abs(firstWeekday - this.firstDayOfWeek)) / daysInWeek);\n comps = {\n firstDayOfWeek: this.firstDayOfWeek,\n inLeapYear,\n firstWeekday,\n days,\n weeks,\n month,\n year\n };\n this.monthData[key] = comps;\n }\n\n return comps;\n }", "previousMonthComps() {\n if (this.month === 1) return {\n days: _daysInMonths[11],\n month: 12,\n year: this.year - 1,\n }\n return {\n days: (this.month === 3 && this.isLeapYear) ? 29 : _daysInMonths[this.month - 2],\n month: this.month - 1,\n year: this.year,\n };\n }", "get monthString(){\n if (this.timeSavedMonthes === 1){\n return 'Monthly payment'\n }\n return 'Monthly payments'\n }", "function buildMonth(prevDays, thisMonthStarts){\r\n\tcreateMonthContainer()\r\n\tinsertPreviousMonth(prevDays, thisMonthStarts)\t\t\t\t\t\t\t\t// inserts some days of previous month\r\n\tfor(let i = 0; i < amountOfDays ( year, month+1 ); i++){\r\n\t\tvar dayElement = document.createElement('div');\r\n\t\tdayElement.innerHTML = i+1;\r\n\t\tif((new Date(year, month, i)).getDay() == 6) dayElement.className+=\" weekend \"\t// every sixth day is a holiday\r\n\t\tif( toDayDate.getDate() == i+1 && toDayDate.getFullYear() == year && toDayDate.getMonth() == month ) \r\n\t\tdayElement.className += \" today light-bg \"\t\t\t\t\t\t\t\t\t\t// highlights current day\r\n\t\tdocument.getElementById('month').appendChild(dayElement);\r\n\t}\r\n\tinsertNextMonth(thisMonthStarts)\t\t\t\t\t\t\t\t\t\t\t// inserts some days of next month\r\n}", "function monthNos (dataArray) {\n\tvar repoMonths = [];\n\tvar weekMonths = [];\n\n\tdataArray.forEach(function(d, i) {\n\t\t//week as unix time\n\t\tvar week = d.week;\n\t\tvar weekTotal = d.total;\n\t\t//convert unix time for js\n\t\tvar date = new Date(week*1000);\n\t\tvar month = new Array();\n\t\tmonth[0] = \"January\";\n\t\tmonth[1] = \"February\";\n\t\tmonth[2] = \"March\";\n\t\tmonth[3] = \"April\";\n\t\tmonth[4] = \"May\";\n\t\tmonth[5] = \"June\";\n\t\tmonth[6] = \"July\";\n\t\tmonth[7] = \"August\";\n\t\tmonth[8] = \"September\";\n\t\tmonth[9] = \"October\";\n\t\tmonth[10] = \"November\";\n\t\tmonth[11] = \"December\";\n\t\t//extract month no. from date\n\t\tvar monthNo = month[date.getMonth()];\n\t\n\t\tvar obj = {};\t\n\t\tobj['month'] = monthNo;\n\t\tobj['weekTotal'] = weekTotal;\n\t\tweekMonths.push(obj);\t\n\t});\n\n\treturn weekMonths;\n}", "monthIndex() {\n return this.month - 1;\n }", "nextMonthComps() {\n if (this.month === 12) return {\n days: _daysInMonths[0],\n month: 1,\n year: this.year + 1,\n };\n return {\n days: (this.month === 2 && this.isLeapYear) ? 29 : _daysInMonths[this.month],\n month: this.month + 1,\n year: this.year,\n };\n }", "function getMonth () {\n var mese = moment.months();\n return mese;\n}", "function Month(year, month) {\n\t\"use strict\";\n\tthis.year = year;\n\tthis.month = month;\n\tthis.nextMonth = function () {\n\t\treturn new Month( year + Math.floor((month+1)/12), (month+1) % 12);\n\t};\n\t\n\tthis.prevMonth = function () {\n\t\treturn new Month( year + Math.floor((month-1)/12), (month+11) % 12);\n\t};\n\t\n\tthis.getDateObject = function(d) {\n\t\treturn new Date(this.year, this.month, d);\n\t};\n\t\n\tthis.getWeeks = function () {\n\t\tvar firstDay = this.getDateObject(1);\n\t\tvar lastDay = this.nextMonth().getDateObject(0);\n\t\t\n\t\tvar weeks = [];\n\t\tvar currweek = new Week(firstDay);\n\t\tweeks.push(currweek);\n\t\twhile(!currweek.contains(lastDay)){\n\t\t\tcurrweek = currweek.nextWeek();\n\t\t\tweeks.push(currweek);\n\t\t}\n\t\t\n\t\treturn weeks;\n\t};\n}", "matchGrowthRange(months) {\n\n const ageFilter = growthChanges.filter((item) => Number(item.ageMonthes) < months);\n return ageFilter.length ? Number(ageFilter[ageFilter.length - 1].change) : 1.55;\n\n }", "function conteggioMesi(month){\n\n //imposto una variabile per calcolare i giorni del mese del mese che imposto\n var giorniMese = moment(\"2018-\" + month, \"YYYY-MM\").daysInMonth();\n \n \n //apro un ciclo for sulla lunghezza del mese che ho selezionato nella mia variabile\n for (i = 1; i <= giorniMese; i++) {\n //variabile che valorizza la data\n var currentDate = moment('2018-' + month + '-' + i , 'YYYY-MM-D').format('YYYY-MM-DD');\n\n //creo la variabile che mi stamperà in pagina l'output\n var currentDay = moment(currentDate).format(\"dddd DD MMMM\");\n //stampo in pagina\n $(\".mese\").append('<div data-date=\"' + currentDate + '\">' + currentDay + '</div>');\n }\n }", "function calculateTable(monthCategoryExpenseMap) {\n let result = {}\n\n categoryList.forEach(category => {\n result[category.id] = {};\n\n Object.keys(monthCategoryExpenseMap).sort(asc).map(month => {\n const categoryToExpenses = monthCategoryExpenseMap[month];\n const expenseList = categoryToExpenses[category.id] || [];\n const sum = expenseList.reduce((acc, x) => acc + x.amount, 0)\n result[category.id][month] = sum;\n })\n\n })\n\n return result;\n }", "function CalendarMonthCtrl($element, $$mdDateUtil, $mdDateLocale) {\n this.dateUtil = $$mdDateUtil;\n this.dateLocale = $mdDateLocale;\n this.$element = $element;\n this.calendarCtrl = null;\n\n /**\n * Number of months from the start of the month \"items\" that the currently rendered month\n * occurs. Set via angular data binding.\n * @type {number}\n */\n this.offset;\n\n /**\n * Date cell to focus after appending the month to the document.\n * @type {HTMLElement}\n */\n this.focusAfterAppend = null;\n }", "function CalendarMonthCtrl($element, $$mdDateUtil, $mdDateLocale) {\n this.dateUtil = $$mdDateUtil;\n this.dateLocale = $mdDateLocale;\n this.$element = $element;\n this.calendarCtrl = null;\n\n /**\n * Number of months from the start of the month \"items\" that the currently rendered month\n * occurs. Set via angular data binding.\n * @type {number}\n */\n this.offset;\n\n /**\n * Date cell to focus after appending the month to the document.\n * @type {HTMLElement}\n */\n this.focusAfterAppend = null;\n }", "updateChart() {\n let tempData = [];\n let tempLabel = [];\n\n this.newData = [];\n\n rentalService.getMonthlyPrice(newdata => {\n this.newLabel.length = newdata.length;\n\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 }", "function addMonths(startMonth,startYear){\n\tconsole.log(startMonth,'startMonth')\n\tvar newMon = startMonth + 1;\n\tif(newMon>12){\n\t\tvar monDiff = newMon-12;\n\t\tvar finalnewMon = monDiff;\n\t\tvar endYear = (startYear + 1);\n\t}\n\telse{\n\t\tvar finalnewMon = newMon;\n\t\tvar endYear = startYear;\n\t}\n\tconsole.log(newMon,finalnewMon)\n\treturn [finalnewMon,endYear];\n}", "function Month(year, month) {\n\t\"use strict\";\n\t\n\tthis.year = year;\n\tthis.month = month;\n\t\n\tthis.nextMonth = function () {\n\t\treturn new Month( year + Math.floor((month+1)/12), (month+1) % 12);\n\t};\n\t\n\tthis.prevMonth = function () {\n\t\treturn new Month( year + Math.floor((month-1)/12), (month+11) % 12);\n\t};\n\t\n\tthis.getDateObject = function(d) {\n\t\treturn new Date(this.year, this.month, d);\n\t};\n\t\n\tthis.getWeeks = function () {\n\t\tvar firstDay = this.getDateObject(1);\n\t\tvar lastDay = this.nextMonth().getDateObject(0);\n\t\t\n\t\tvar weeks = [];\n\t\tvar currweek = new Week(firstDay);\n\t\tweeks.push(currweek);\n\t\twhile(!currweek.contains(lastDay)){\n\t\t\tcurrweek = currweek.nextWeek();\n\t\t\tweeks.push(currweek);\n\t\t}\n\t\t\n\t\treturn weeks;\n\t};\n}", "function display_month(data_moment){\n //svuoto il calendario\n $('#calendario').empty();\n\n //clono l'oggetto moment per usarlo per il data-day\n var date = data_moment.clone();\n\n //numero giorni del mese da visualizzare\n var days_of_month = date.daysInMonth();\n //mese testuale\n var text_month = date.format('MMMM');\n text_month = text_month.charAt(0).toUpperCase() + text_month.slice(1);\n //giorno della settimana in numero\n var day_of_week = date.day();\n //mese in numero\n var month = date.month();\n //anno in numero\n var year = date.year();\n\n //popolo dinaminamente il mese che appare come titolo\n $('#current_month').text(text_month);\n\n //devo stampare dei li vuoti per i giorni mancanti dall'inizio\n display_empty_block(day_of_week);\n //devo stampare i giorni\n display_days(days_of_month, date);\n //richiamo funzione per stampare le festività\n display_holiday(start_moment);\n }", "function getChargesLastMonth(charges) {\n var chargesLastMonth = {};\n \n for( var key in charges ) {\n var dateCreated = new Date(0);\n var dateLastMonth = new Date();\n dateLastMonth.setMonth(dateLastMonth.getMonth() - 1);\n\n dateCreated.setUTCSeconds(charges[key].created);\n\n if(dateCreated.getMonth() == dateLastMonth.getMonth()){\n chargesLastMonth[key] = charges[key];\n }\n }\n return chargesLastMonth;\n}", "setMonth(month){\n let monthNo = this.state.allMonths.indexOf(month);\n let dateObject = Object.assign({}, this.state.dateObject);\n // change which month will be displayed\n dateObject = moment(dateObject).set(\"month\", monthNo);\n // when click on month, close month selector and show days in that month\n this.setState({\n dateObject: dateObject,\n showMonthTable: !this.state.showMonthTable,\n })\n }", "function startNewMonth(lastMonthClosing, period) {\n const newMonth = {};\n\n // sets the period of the new month and passes on the closing total of last month\n newMonth.period = period;\n newMonth.openingTotal = lastMonthClosing;\n\n return newMonth;\n}", "function month(){\n step=1.2;\n timeSelector=\"month\";\n resetGraph();\n}", "constructor() {\n this.month; //0 through 11 representing January through December.\n this.year;\n }", "function getNums(month) {\n var income = getIncome(month);\n var outcome = getOutcome(month);\n return {\n \"income\" : income,\n \"outcome\" : - outcome,\n \"total\" : income - outcome,\n };\n}", "function scrapeMonth(date) {\n var originalDate = new Date(date.getTime());\n var year = date.getFullYear();\n var month = date.getMonth();\n var data = {\n date: originalDate,\n month: undefined\n };\n exports.monthTracker.current = new Date(date.getTime());\n exports.monthTracker.current.setDate(1);\n exports.monthTracker.years[year] = exports.monthTracker.years[year] || {};\n if (exports.monthTracker.years[year][month] !== undefined) {\n data.month = exports.monthTracker.years[year][month];\n return data;\n }\n date = new Date(date.getTime());\n date.setDate(1);\n exports.monthTracker.years[year][month] = [];\n var tracker = exports.monthTracker.years[year][month];\n var rowTracker = 0;\n while (date.getMonth() === month) {\n var _date = date.getDate();\n var day = date.getDay();\n if (_date === 1) {\n tracker[rowTracker] = fill([], day);\n }\n tracker[rowTracker] = tracker[rowTracker] || [];\n tracker[rowTracker][day] = _date;\n if (day === 6) {\n rowTracker++;\n }\n date.setDate(date.getDate() + 1);\n }\n var lastRow = 5;\n if (tracker[5] === undefined) {\n lastRow = 4;\n tracker[5] = fill([], 7);\n }\n var lastRowLength = tracker[lastRow].length;\n if (lastRowLength < 7) {\n var filled = tracker[lastRow].concat(fill([], 7 - lastRowLength));\n tracker[lastRow] = filled;\n }\n data.month = tracker;\n return data;\n}", "function structureMonthFlowData() {\n for (i = 0; i < self.flowCategories.length; i++) {\n if (self.flowCategories[i].item_amount === undefined || self.flowCategories[i].item_amount === null) {\n self.flowCategories[i].item_amount = 0;\n }\n var monthlyBudgetCategoryData = {\n item_month: self.currentMonthIndex,\n item_year: self.currentYear,\n item_name: self.flowCategories[i].item_name,\n item_amount: parseInt(self.flowCategories[i].item_amount)\n };\n self.newFlowBudget[i] = monthlyBudgetCategoryData;\n }\n } // end structureMonthFlowData", "header() {\n const month = this.months[this.monthIndex];\n return {\n month: month,\n year: this.year.toString(),\n shortYear: this.year.toString().substring(2, 4),\n label: month.label + ' ' + this.year,\n };\n }", "get month() {\n return this.date.getMonth();\n }", "function updateCurrentMonth() {\n updateDays();\n currentM.textContent = months[month];\n}", "removeMonthOverview () {\n this.items\n .selectAll ('.item-block-month')\n .selectAll ('.item-block-rect')\n .transition ()\n .duration (this.settings.transition_duration)\n .ease (d3.easeLinear)\n .style ('opacity', 0)\n .attr ('x', (d, i) => {\n return i % 2 === 0 ? -this.settings.width / 3 : this.settings.width / 3;\n })\n .remove ();\n this.labels.selectAll ('.label-day').remove ();\n this.labels.selectAll ('.label-week').remove ();\n this.hideBackButton ();\n }", "function Month(parent) {\n var _this = _super.call(this, parent) || this;\n\n _this.dayNameFormat = 'wide';\n _this.isInverseTableSelect = false;\n _this.monthDates = {};\n return _this;\n }", "getMonthName(index) {\n return this.settings.months[index];\n }", "function mdCalendarMonthDirective() {\n return {\n require: ['^^mdCalendar', 'mdCalendarMonth'],\n scope: {offset: '=mdMonthOffset'},\n controller: CalendarMonthCtrl,\n controllerAs: 'mdMonthCtrl',\n bindToController: true,\n link: function(scope, element, attrs, controllers) {\n var calendarCtrl = controllers[0];\n var monthCtrl = controllers[1];\n\n monthCtrl.calendarCtrl = calendarCtrl;\n monthCtrl.generateContent();\n\n // The virtual-repeat re-uses the same DOM elements, so there are only a limited number\n // of repeated items that are linked, and then those elements have their bindings updataed.\n // Since the months are not generated by bindings, we simply regenerate the entire thing\n // when the binding (offset) changes.\n scope.$watch(function() { return monthCtrl.offset; }, function(offset, oldOffset) {\n if (offset != oldOffset) {\n monthCtrl.generateContent();\n }\n });\n }\n };\n }", "function mdCalendarMonthDirective() {\n return {\n require: ['^^mdCalendar', 'mdCalendarMonth'],\n scope: {offset: '=mdMonthOffset'},\n controller: CalendarMonthCtrl,\n controllerAs: 'mdMonthCtrl',\n bindToController: true,\n link: function(scope, element, attrs, controllers) {\n var calendarCtrl = controllers[0];\n var monthCtrl = controllers[1];\n\n monthCtrl.calendarCtrl = calendarCtrl;\n monthCtrl.generateContent();\n\n // The virtual-repeat re-uses the same DOM elements, so there are only a limited number\n // of repeated items that are linked, and then those elements have their bindings updataed.\n // Since the months are not generated by bindings, we simply regenerate the entire thing\n // when the binding (offset) changes.\n scope.$watch(function() { return monthCtrl.offset; }, function(offset, oldOffset) {\n if (offset != oldOffset) {\n monthCtrl.generateContent();\n }\n });\n }\n };\n }", "function _buildAvailableMonths() {\n var today = new Date();\n var lastmonth = new Date(today.getFullYear() + 2, 11, 1, 0, 0, 0, 0);\n\n\n var iterator = new Date(today.getFullYear(), today.getMonth(), 1);\n var tt = true;\n while (lastmonth >= iterator) {\n var availmonth = {\n monthname: _getMonthNameSpanish(iterator.getMonth()),\n monthindex: iterator.getMonth(),\n year: iterator.getFullYear(),\n selectiontext: _getMonthNameSpanish(iterator.getMonth()) + ' ' + iterator.getFullYear()\n };\n\n if (tt) { $scope.selectnewmonth = availmonth; tt = false; }\n\n $scope.availablemonths.push(availmonth);\n iterator.setMonth(iterator.getMonth() + 1);\n\n }\n }", "function getMonths() {\n\treturn [...Array(12).keys()].map((index) => index + 1);\n}", "prevMonth() {\n if (this.monthIndex==0){\n this.monthIndex = 11;\n this.month = monthsArray[this.monthIndex];\n this.year -= 1;\n } else {\n this.monthIndex -= 1;\n this.month = monthsArray[this.monthIndex];\n }\n this._renderCalendarMonth();\n }", "function thisMonthData(data, userChoice) {\n var startOfMonth = moment().startOf('month').toDate();\n var startDate = moment(startOfMonth).format(\"D\");\n displayDateData(data, userChoice, startDate); \n}", "function CalendarMonthBodyCtrl($element, $$mdDateUtil, $mdDateLocale) {\n /** @final {!angular.JQLite} */\n this.$element = $element;\n\n /** @final */\n this.dateUtil = $$mdDateUtil;\n\n /** @final */\n this.dateLocale = $mdDateLocale;\n\n /** @type {Object} Reference to the month view. */\n this.monthCtrl = null;\n\n /** @type {Object} Reference to the calendar. */\n this.calendarCtrl = null;\n\n /**\n * Number of months from the start of the month \"items\" that the currently rendered month\n * occurs. Set via angular data binding.\n * @type {number}\n */\n this.offset = null;\n\n /**\n * Date cell to focus after appending the month to the document.\n * @type {HTMLElement}\n */\n this.focusAfterAppend = null;\n }", "function CalendarMonthBodyCtrl($element, $$mdDateUtil, $mdDateLocale) {\n /** @final {!angular.JQLite} */\n this.$element = $element;\n\n /** @final */\n this.dateUtil = $$mdDateUtil;\n\n /** @final */\n this.dateLocale = $mdDateLocale;\n\n /** @type {Object} Reference to the month view. */\n this.monthCtrl = null;\n\n /** @type {Object} Reference to the calendar. */\n this.calendarCtrl = null;\n\n /**\n * Number of months from the start of the month \"items\" that the currently rendered month\n * occurs. Set via angular data binding.\n * @type {number}\n */\n this.offset = null;\n\n /**\n * Date cell to focus after appending the month to the document.\n * @type {HTMLElement}\n */\n this.focusAfterAppend = null;\n }", "function writeMonth(name, common) {\n //console.log(currentYear);\n yearEl.innerHTML = currentYear.year;\n yearNameEl.innerHTML = currentYear.name;\n monthEl.innerHTML = name;\n if (name == \"The Feast of the Moon\") {\n monthEl.style = \"font-size: 4.3em;\";\n }\n else {\n monthEl.style = \"font-size: 6em;\";\n }\n commonEl.innerHTML = (common === undefined) ? \"\" : common;\n }", "function calculateCalendarMonthView(calendarDateObject, events) {\n var cdo = calendarDateObject;\n if (calculateCalendarMonthView.view[cdo.titleMY]) return calculateCalendarMonthView.view[cdo.titleMY];\n /* caching optimisation check */\n console.warn('calculateCalendarMonth');\n\n var weeks = [],\n daysInMonth = cdo.daysInMonth;\n\n for (var day = 1; day < daysInMonth + 1; day += 1) {\n\n var dayDate = new Date(cdo.year, cdo.month - 1, day),\n dayWeekNumber = dayDate.getDay(),\n week = week || [null, null, null, null, null, null, null];\n\n week[dayWeekNumber] = getCalendarDateObject(dayDate)\n\n if (isAllowedDate(week[dayWeekNumber])) {\n if (events) getDateEvents(week[dayWeekNumber], events);\n } else {\n week[dayWeekNumber].disabled = true;\n }\n\n if (dayWeekNumber === 6 || day === daysInMonth) {\n weeks.push(week);\n week = null;\n }\n }\n /* caching optimisation */\n calculateCalendarMonthView.view[cdo.titleMY] = {\n calendarTitle: cdo.titleMY,\n currentMonth: getPrevNextMonth(cdo).current,\n weeks: weeks,\n period: getPrevNextMonth(cdo)\n }\n return calculateCalendarMonthView.view[cdo.titleMY];\n }", "function bindCalculateLeaseMonth(startContractDate, endContractDate) {\n var months;\n months = (endContractDate.getFullYear() - startContractDate.getFullYear()) * 12;\n months -= startContractDate.getMonth() + 1;\n months += endContractDate.getMonth();\n // plus one because month is base on index\n months += 1;\n return months <= 0 ? 0 : months;\n}", "constructor(month, budget, list) {\n // Properties of budget items.\n let time;\n let maxBudget;\n let expenses = [];\n\n\n\n // setter for time.\n this.setTime = function(t) {\n time = t;\n }\n\n // set max budget.\n this.setMaxBudget = function (m) {\n maxBudget = m;\n }\n // set expenses.\n this.setExp = function (e) {\n\n expenses = e;\n }\n\n\n // Getter function returns the month of the budget item.\n this.getTime = function () {\n return time;\n }\n // Getter function returns the max value of the budget item.\n this.getMaxBudget = function () {\n return maxBudget;\n }\n // Getter function returns the expenses array of the budget item.\n this.getExp = function () {\n return expenses;\n }\n\n\n // Setting all passed values from constructor.\n this.setTime(month);\n this.setMaxBudget(budget);\n this.setExp(list);\n\n }", "function renderMonthsCounts(data, appendToElement){\n data = $(data).hide();\n $(appendToElement).append(data);\n $(data).slideDown();\n}", "_setMonth(date, monthSelector, updateDatesOnly) {\n const that = this,\n selectedDates = that._getDays(date, that.selectedDates),\n importantDates = that._getDays(date, that.importantDates),\n restrictedDates = that._getDays(date, that.restrictedDates);\n\n date.setDate(1);\n\n if (!monthSelector) {\n monthSelector = that.$.month;\n }\n\n monthSelector._date = new Date(date);\n\n if (!updateDatesOnly) {\n if (!that._viewDates || that._viewDates.length >= that.months) {\n that._viewDates = [];\n }\n\n that._viewDates.push(new Date(date));\n }\n\n date = new Date(date);\n\n //Correct the start day according to firstDayOfWeek property\n let firstDayOfWeek = (date.getDay() - that.firstDayOfWeek + 7) % 7;\n\n date.setDate(0);\n\n let previusMonthDays = date.getDate();\n\n date.setDate(32); // current month.\n date.setDate(1); // set to first day of month.\n date.setDate(32); // next month.\n\n if (that._selectedCells) {\n for (let i = 0; i < that._selectedCells.length; i++) {\n if (that._selectedCells[i].closest('.jqx-calendar-month') === monthSelector) {\n that._setCellState(that._selectedCells[i], 'selected', false);\n }\n }\n }\n\n that._setMonthContent(date, monthSelector, {\n previusMonthDays: previusMonthDays,\n firstDayOfWeek: firstDayOfWeek,\n selectedDates: selectedDates,\n importantDates: importantDates,\n restrictedDates: restrictedDates\n });\n }", "function displayMonthlyCosts() {\n var newCost = calculateMonthlyCosts();\n newCost = newCost - removedCosts;\n $('#monthlyCostsReport span').text(newCost);\n // NOTE: I didn't \"append\" this info to the DOM per the instructions, because we wanted to update the new value each time.\n} // END: displayMonthlyCosts()", "function dataForMonth(month) {\n var obj = {};\n obj.flights = flights.find(function (el) {\n return Object.keys(el)[0] === month;\n })[month];\n obj.vehicles = vehicles.find(function (el) {\n return Object.keys(el)[0] === month;\n })[month];\n return obj;\n }" ]
[ "0.63781214", "0.6243058", "0.6224361", "0.61561763", "0.6020074", "0.60071856", "0.59950596", "0.5955951", "0.5841789", "0.57974535", "0.57925195", "0.57576716", "0.57401246", "0.5680722", "0.5643301", "0.56413084", "0.55726916", "0.55608064", "0.5555992", "0.55387586", "0.55229956", "0.5514194", "0.5501975", "0.5489673", "0.547193", "0.5469441", "0.54670054", "0.543055", "0.54279166", "0.54262817", "0.54250705", "0.54233915", "0.54099184", "0.53588295", "0.5345428", "0.53374463", "0.53194505", "0.5315484", "0.5309902", "0.53077304", "0.5299544", "0.52946025", "0.5287082", "0.528559", "0.52796775", "0.5274034", "0.5270741", "0.52639145", "0.5253283", "0.52531904", "0.524941", "0.5238833", "0.5238833", "0.5230499", "0.5229292", "0.5220949", "0.5214295", "0.5208961", "0.52072406", "0.5166241", "0.5166105", "0.5162915", "0.5156659", "0.5151953", "0.51513666", "0.51513666", "0.5144859", "0.51429504", "0.5126502", "0.512436", "0.5114639", "0.51058847", "0.5104444", "0.51044184", "0.5098358", "0.509667", "0.5094436", "0.50879633", "0.5087443", "0.50874335", "0.50868386", "0.50837004", "0.50815153", "0.5074719", "0.50654", "0.50654", "0.50622565", "0.5060561", "0.50545746", "0.50423354", "0.5039348", "0.5039348", "0.50334865", "0.5023381", "0.50229126", "0.5020254", "0.50170076", "0.50141555", "0.5013168", "0.50117266" ]
0.6885843
0
calculates the closing total
function getClosingTotal(monthsChanges, openingTotal) { let closingTotal = openingTotal; for (let i = 0; i < monthsChanges.length; i++) { closingTotal += monthsChanges[i].animalsMoved; } return closingTotal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function finalTotalAmountOfThisOrder()\n {\n return (nanCheck(parseFloat(subTotalWithoutShippingCost())) + nanCheck(parseFloat(shippingCostOfThisMainOrder()))).toFixed(2);\n }", "close(monowave) {\n\t\tthis.dateEnd\t= monowave.timeEnd;\n\t\tthis.valueEnd\t= monowave.valueEnd;\n\t\tvar deltaPrice \t= this.valueEnd - this.valueStart;\n\t\tvar deltaTime \t= this.dateEnd - this.dateStart;\n\t\tthis.ratio\t\t= deltaPrice / deltaTime;\n\t}", "setearTotal() {\n this.setState({\n subtotalCalculate: this.props.total,\n totalCalculate: parseFloat(\n this.props.total -\n this.state.discountCalculate -\n this.state.cuponCalculate\n ).toFixed(2)\n });\n }", "function calcTotalDayAgain() {\n var eventCount = $this.find('.this-month .event-single').length;\n $this.find('.total-bar b').text(eventCount);\n $this.find('.events h3 span b').text($this.find('.events .event-single').length)\n }", "function calculateTotal() {\n const firstClassCount = getInputValue('first-class');\n const economyCount = getInputValue('economy');\n\n const subTotal = firstClassCount * 150 + economyCount * 100;\n document.getElementById('sub-total').innerText = '$' + subTotal;\n\n const vat = subTotal * 0.1;\n document.getElementById('vat').innerText = '$' + vat;\n\n const total = subTotal + vat;\n document.getElementById('total').innerText = '$' + total;\n}", "function calcSubtotal() {\n const sub = Object.keys(lineStates)\n .reduce((acum, lineKey) => {\n if (lineKey === 'shippingState') {\n return acum;\n } else {\n const {liveQuantity, unitPrice} = lineStates[lineKey].getState();\n const nextAcum = acum + (liveQuantity * unitPrice);\n return nextAcum;\n }\n }, 0);\n getElements.subtotalPrice().innerHTML = formatMoney(sub, theme.moneyFormat);\n return sub;\n}", "function subTotal(amount) {\n var subTotal = numPizzas * PRICEPIZZA - DISCOUNTRATE;\n return subTotal;\n}", "function calcTotals() {\n var incomes = 0;\n var expenses = 0;\n var budget;\n // calculate total income\n data.allItems.inc.forEach(function(item) {\n incomes+= item.value;\n })\n //calculate total expenses\n data.allItems.exp.forEach(function(item) {\n expenses+= item.value;\n })\n //calculate total budget\n budget = incomes - expenses;\n // Put them in our data structure\n data.total.exp = expenses;\n data.total.inc = incomes;\n //Set Budget\n data.budget = budget;\n }", "function getTotalAmountFinanced(){\n\t\treturn parseInt(localStorage.pSlider)-parseInt(localStorage.dPayment);\t\t\n\t}", "function subTotalAmountOfThisOrder()\n {\n var sum = 0;\n $('.cr_getSubtotalClass').each(function(){\n sum += parseFloat($(this).text());\n });\n return parseFloat(sum).toFixed(2);\n }", "forAllDays() {\n if (this.breakDown() !== 'No Information to display') {\n let totalCost = this.breakDown().reduce((acc, item) => acc += item.totalCost, 0)\n return totalCost || 0;\n }\n }", "function total(){\n\tvar TotalPrice=CakeSizePrice() +FilingPrice()+ CandlePrice()+InscriptionPrice() ;\n\n\t//final result\n\tdocument.getElementById(\"display\").innerHTML=\"total price $\"+TotalPrice;\n}", "total () {\n\t\treturn this.subtotal() - this.discounts();\n\t}", "getTotalCalories() {\n return this.state.breakfast.reduce((accumulator, elem) => parseInt(elem.calories) + accumulator, 0)\n + this.state.lunch.reduce((accumulator, elem) => parseInt(elem.calories) + accumulator, 0)\n + this.state.dinner.reduce((accumulator, elem) => parseInt(elem.calories) + accumulator, 0)\n + this.state.snacks.reduce((accumulator, elem) => parseInt(elem.calories) + accumulator, 0);\n }", "function calculateTotal(){\n \n var childPrice = (getageGroupPrice() * getlengthOfDayInput()) * \n getdaysperweekInput() * gettimeframeInput() +\n summerClassPrice() + nonstudentfeeInput();\n\n// Display the results\n var grandTotal = document.getElementById('totalPrice');\n grandTotal.style.display='block';\n grandTotal.innerHTML = \"Total price for this child is $\"+childPrice.toFixed(2);\n}", "function calculatePrice() {\n const priceTotal = priceCalculation();\n innerChanger('sum', priceTotal);\n innerChanger('sum-footer', priceTotal);\n}", "function totalCalculation() {\n const firstClassTicketCount = getTicketInput('firstClass');\n const economyTicketCount = getTicketInput('economy');\n const subTotal = firstClassTicketCount * 150 + economyTicketCount * 100;\n document.getElementById('subTotal').innerText = subTotal;\n const vat = subTotal / 10;\n document.getElementById('vat').innerText = vat;\n const total = subTotal + vat;\n document.getElementById('total').innerText = total;\n document.getElementById('confirmAmount').innerText = total;\n}", "function normalizeYesterdayClose() {\n var yClose = $('#id_close-1').val(),\n yOpen = $('#id_open-1').val(),\n nYClose = 0;\n\n nYClose = (yClose - yOpen) / yClose;\n nYClose = isNaN(nYClose) ? 0 : nYClose;\n\n $('#id_n_close-1').val(nYClose);\n\n console.log(\"Normalized Yesterday Close: \" + nYClose);\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 closeStatus(output, totalCashInDrawer) {\n output.status = STATUS.close;\n output.change = totalCashInDrawer;\n return output;\n}", "function total(cost) {\n var total = subtotal * '.08';\n return total;\n}", "calcTotal(){\n\t\t\tlet length = this.sales.length;\n\t\t\tthis.paidCommissionTotal = 0;\n\t\t\tthis.commissionTotal = 0;\n\t\t\tfor(let i = 0; i < length; ++i){\n\t\t\t\t\tthis.commissionTotal += this.sales[i].commission;\n\t\t\t\t\tif(this.sales[i].paid == true){\n\t\t\t\t\t\tthis.paidCommissionTotal += this.sales[i].commission;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tthis.sales.length;\n\t\t}", "function calculateTotal(){\n\t\tlet basketTotalContainer = document.querySelector('#basket-total');\n\t\tlet basketCount = document.querySelector('#basket-count');\n\t\tlet minibasketTotal = document.querySelector('#mini-basket-total');\n\t\tbasketTotalContainer.innerHTML = '';\n\t\tbasketCount.innerHTML = '';\n\t\tminibasketTotal.innerHTML = '';\n\t\tlet basket = document.querySelector('.basket tbody'), basketTotalVal = 0, basketTotalItems = 0, basketTotalValCurrency;\n\t\tfor(let i = 0; i < (basket.rows.length); i++){\n\t\t\tlet rowTotal = Number(basket.rows[i].cells[2].innerHTML);\n\t\t\tlet itemsTotal = Number(basket.rows[i].cells[1].childNodes[0].innerHTML);\n\t\t\tbasketTotalVal = basketTotalVal + rowTotal;\n\t\t\tbasketTotalValCurrency = basketTotalVal.toFixed(2);\n\t\t\tbasketTotalItems = basketTotalItems + itemsTotal;\t\t\n\t\t};\n\t\tbasketTotalContainer.innerHTML = basketTotalValCurrency;\n\t\tbasketCount.innerHTML = basketTotalItems;\n\t\tminibasketTotal.innerHTML = basketTotalValCurrency;\n\t\t// avoid 'undefined' if basket is empty\n\t\tif (basketTotalValCurrency == null){\n\t\t\tbasketTotalContainer.innerHTML = '';\n\t\t\tminibasketTotal.innerHTML = '';\n\t\t}\n\t}", "function update_escrow_amount() {\n // Sum the total amount of funding outputs we haven't used yet\n var total = 0;\n for (var i = 0; i < funding_outputs.length; i++) {\n if (funding_outputs[i].output_state != OUTPUT_STATES.DEPLETED)\n {\n total += funding_outputs[i].satoshis;\n }\n }\n escrow_amount = total - fee;\n coin_width = escrow_amount / 100;\n\n // Don't let the coin_width get too low\n if (coin_width < price_per_second)\n {\n coin_width = price_per_second;\n }\n console.log(\"coin_width: \" + coin_width);\n}", "function calc_cart_total() {\n shopping_cart_total = calc_total();\n set_cart_total_dom();\n update_shipping_icons();\n update_tax_dom();\n}", "function calculateSubTotal(){\n const firstCount = getInputValue('first')\n const economyCount = getInputValue('economy')\n const subTotalPrice = firstCount*150 + economyCount*100; //sub total Calculation\n document.getElementById('sub-Total').innerText = '$' + subTotalPrice;\n\n const tax = subTotalPrice * .1 //tax Calculation\n document.getElementById('tax-Amount').innerText = '$' + tax;\n const grandTotal = tax + subTotalPrice;\n document.getElementById('grand-Total').innerText = '$' + grandTotal; //grand total Calculation\n}", "function belowCloseF(stock, stockAwayPctF) { \n \n if (stock.pcls < stock.opn) {\n return true;\n }\n }", "totalStockValue()\n {\n return this.shares*this.price;\n }", "function calculateTotal() {\n const firstCount = getInputValue('first');\n const economyCount = getInputValue('economy');\n\n const totalPrice = firstCount * 150 + economyCount * 100;\n document.getElementById('total-price').innerText = totalPrice;\n\n const tax = totalPrice * 0.1;\n document.getElementById('tax-amount').innerText = tax;\n\n const finalTotal = totalPrice + tax;\n document.getElementById('final-total').innerText = finalTotal\n}", "function calculateTotal () {\n const fistClassQuantity = getQuantityNumber('first-class');\n\n const economyQuantity = getQuantityNumber('economy');\n\n const subtotal = fistClassQuantity * 150 + economyQuantity * 100;\n document.getElementById('subtotal').innerText = subtotal;\n document.getElementById('show-subtotal').innerText = subtotal;\n\n const vat = Math.floor(subtotal * 0.1);\n document.getElementById('vat').innerText = vat;\n document.getElementById('show-vat').innerText = vat;\n\n const total = subtotal + vat;\n document.getElementById('total').innerText = total;\n document.getElementById('show-total').innerText = total;\n}", "update() {\n\n // Explicit update otherwise there will\n // an auto-update before the current update() call\n let v0 = ind1.update(12)\n // get value of SomeIndicator1\n v5 = ind1[5]\n\n ta_lib.some_f()\n\n let sum = close[0]\n for (var i = 1; i < length; i++) {\n sum = sum + nz(close[i])\n }\n return sum / length // Returns the last value\n }", "function calc_rsi(cdata, period) {\n var up, down, lastClose, rsi, rs, s;\n up = 0;\n down = 0;\n s = cdata.length - period;\n Object.keys(cdata).map(k => {\n if (k >= s) {\n if (lastClose > 0) {\n var calc = parseFloat(cdata[k]) - parseFloat(lastClose)\n if (calc >= 0) {\n up = parseFloat(up) + parseFloat(calc)\n } else {\n down = parseFloat(down) - parseFloat(calc)\n }\n }\n lastClose = cdata[k]\n }\n })\n up = parseFloat(up) / period\n down = parseFloat(down) / period\n rs = parseFloat(up) / parseFloat(down)\n rsi = 100 - (100 / (1 + parseFloat(rs)))\n return parseFloat(rsi).toFixed(3);\n}", "function calculateTotal() {\n let l_total = 0; //defines l_total as 0\n let l_collectionTotal = 0; //defines l_collectionTotal as 0\n let l_checkboxCheck = 0;\n\n const c_items = c_form.querySelectorAll(\"div.item\"); //get array of events\n const c_itemsCount = c_items.length; //get length of the array\n\n //Loops through the items array\n for (let t_i = 0; t_i < c_itemsCount; t_i++) {\n const t_item = c_items[t_i];\n const t_checkbox = t_item.querySelector(\"input[data-price][type=checkbox]\");\n\n if (t_checkbox.checked) {\n l_total = l_total + parseFloat(t_checkbox.dataset.price); //changes the string for the price into a number.\n l_checkboxCheck = 1;\n } //end of else if\n }//end of for\n\n if(l_checkboxCheck === 1) {\n l_eventSelected = true;\n }\n else {\n l_eventSelected = false;\n c_submitButton.disabled = true;\n }\n\n const c_radio = c_form.querySelector(\"input[data-price][type=radio]\");\n if (c_radio.checked) {\n l_collectionTotal = l_collectionTotal + parseFloat(c_radio.dataset.price); //changes the string for the price into a number.\n }\n\n l_collectionTotal.toFixed(2);\n let l_grandTotal = l_total + l_collectionTotal; //combines delivery and total.\n\n l_grandTotal.toFixed(2);\n\n c_form.total.value = \"£\" + l_grandTotal; //sets the total in the form to the grand total variable.\n }", "function billTotal(food,drinks){\n var price = food + drinks;\n return price + price*(15/100) + price*((9.5)/100) ;\n}", "function calcTotal (taxTot, shipTot, subTot) {\n taxTot = parseFloat(taxTot);\n shipTot = parseFloat(shipTot);\n subTot = parseFloat(subTot);\n console.log(\"in calcTotal\");\n total = (subTot + taxTot + shipTot);\n total = total.toFixed(2);\n document.getElementById(\"total\").innerHTML = \"Total: $\" + total;\n // Update Total in Table\n}", "function calc_cart_total() {\n shopping_cart_total = calc_total(shopping_cart);\n set_cart_total_dom();\n update_shipping_icons();\n update_tax_dom();\n}", "function finalTotalAmount() {\n //total cost\n totalCost.innerText = parseFloat(macCost.innerText) + parseFloat(memoryCost.innerText) + parseFloat(storageCost.innerText) + parseFloat(deliveryCost.innerText);\n //final amount\n finalAmount.innerText = parseFloat(totalCost.innerText);\n}", "function calculateTotal() {\n const firstClassCount = getInputValue(\"first-class\");\n const economyCount = getInputValue(\"economy\");\n\n // Calculating subtotal\n const subTotal = firstClassCount * 150 + economyCount * 100;\n document.getElementById(\"subtotal-amount\").innerText = '$' + subTotal;\n\n // Calculating VAT\n const vat = Math.round(subTotal * 0.1);\n document.getElementById(\"vat-amount\").innerText = '$' + vat;\n\n // Calculating Total\n const Total = subTotal + vat;\n document.getElementById(\"total-amount\").innerText = '$' + Total;\n}", "function getTotal() {\n const firstClassCount = getInputValue('firstClass');\n const economyCount = getInputValue('economy');\n const subTotal = firstClassCount * 150 + economyCount * 100;\n document.getElementById('subTotalAmount').innerText = subTotal;\n\n const vat = subTotal * 0.1;\n const total = subTotal + vat;\n document.getElementById('vatAmount').innerText = vat;\n document.getElementById('totalAmount').innerText = total;\n}", "function calcSummary() {\n oldPrice.innerHTML = \"£\" + (findActiveLeft() + findActiveRight()).toFixed(2);\n newPrice.innerHTML = \"£\" + (findActiveLeft() + findActiveRight() - bestOffer.discount).toFixed(2);\n}", "function calculateTotal()\n{ \n\tvar total = 0;\n\tfor (var i = 0; i<document.getElementsByClassName(\"price\").length; i++)\n\t{\n\t\tvar price = document.getElementsByClassName(\"price\")[i].innerHTML;\n\t\ttotal += parseFloat(price.substring(1,price.length-1)); \n\t}\n\t\n\ttotal = total.toFixed(2);\n\tdocument.getElementById(\"total_cost\").innerHTML = total;\n\tupdateCheckOut();\n}", "calculateSpace()\n {\n\n return (this.getMaxBudget() - this.sumOfExpenses());\n }", "function calculateTotal() {\n //Ti.API.info(parseInt(Global.Functions.euroToNum(labelImport.getText()) * 100) + \" - \" + parseInt(editEuro.getValue().replace(\",\", \".\") * 100));\n labelImportTotal2.setText(Global.Functions.numToEuro((parseInt(Global.Functions.euroToNum(labelImport.getText()) * 100) - parseInt(editEuro.getValue().replace(\",\", \".\") * 100)) / 100));\n if(changeEvent != undefined)\n changeEvent();\n }", "function calculateCashLeftOverEachWeek(){\n var cashLeftoverEachWeek = weeklyIncome-weeklyExpenses; \n console.log(\"You will have $\"+cashLeftoverEachWeek+\" left over per week\");\n}", "function calculatePrice() {\n const firstClassCount = getBooking(\"firstClass\");\n const economyCount = getBooking(\"economy\");\n const subTotalPricing = firstClassCount * 150 + economyCount * 100;\n document.getElementById(\"subtotal\").innerText = \"$\" + subTotalPricing;\n\n const tax = Math.round(subTotalPricing * 0.1);\n document.getElementById(\"tax\").innerText = \"$\" + tax;\n\n const total = subTotalPricing + tax;\n document.getElementById(\"total\").innerText = \"$\" + total;\n}", "function calcSubtotal () {\n var prices = $('div.item span.painting.price');\n var subtotal = 0;\n \n $.each(prices, function(index, value) {\n var price = unformatMoney(value.innerHTML);\n console.log(\"Price #\" + index + \": \" + price);\n subtotal = subtotal + price;\n })\n \n console.log(\"Page subtotal: \" + subtotal);\n \n return formatMoney(subtotal);\n }", "function calculateGrandTotal() {\n\n var GrandTotal = 0;\n self.selectItems.forEach(function (item) {\n GrandTotal += item.co2_offset;\n self.Co2GrandTotal=Math.floor(GrandTotal * 10000)/10000;\n });\n }", "totalSpent(){\n return this.meals().reduce((a,b)=>(a += b.price), 0);\n }", "function calcTotal(){\n var subT=0; \n if($(document.getElementById(\"productos\").rows)[\"0\"].childElementCount>2){\n \n $(document.getElementById(\"productos\").rows).each(function(i,item){\n // alert(item.childNodes[3].innerText);\n \n subT= subT + parseFloat((item.childNodes[4].textContent).replace(\"¢\",\"\")); \n });\n $(\"#subTotal\")[0].textContent = \"¢\"+subT.toFixed(2); \n factura.descuento = $(\"#desc_val\")[0].textContent = \"¢\"+ (subT * (parseFloat(($(\"#desc_100\")[0].textContent).replace(\"%\",\"\"))) / 100).toFixed(2) ;\n factura.impuesto = $(\"#iv_val\")[0].textContent = \"¢\"+ ((subT * (parseFloat(($(\"#iv_100\")[0].textContent).replace(\"%\",\"\")) / 100)) - (parseFloat(($(\"#desc_val\")[0].textContent).replace(\"¢\",\"\")))).toFixed(2) ;\n $(\"#total\")[0].textContent = \"¢\" + ((($(\"#subTotal\")[0].textContent).replace(\"¢\",\"\")) - parseFloat(($(\"#desc_val\")[0].textContent).replace(\"¢\",\"\")) + parseFloat(($(\"#iv_val\")[0].textContent).replace(\"¢\",\"\"))).toFixed(2);\n }\n else{\n $('#open_modal_fac').attr(\"disabled\", true);\n $(\"#subTotal\")[0].textContent = \"¢0\"; \n $(\"#desc_val\")[0].textContent = \"¢0\";\n $(\"#iv_val\")[0].textContent = \"¢0\";\n $(\"#total\")[0].textContent = \"¢0\";\n \n }\n}", "function calculate() {\n if (numberDayBooking) {\n return numberDayBooking * room.price;\n }\n else\n return room.price;\n }", "function getTotalAmount()\n {\n return ((getSubTotalByProductAmountAndQuantity() - getTotalDiscountAmount()).toFixed(2));\n }", "function calculateTotal() {\n const fisrtClassTotalQuantity = document.getElementById('firstClass-ticket-quantity').value;\n const ecoClassTotalQuantity = document.getElementById('ecoClass-ticket-quantity').value;\n const totalPrice = fisrtClassTotalQuantity * 150 + ecoClassTotalQuantity * 100;\n\n document.getElementById('sub-total').innerText = ('$' + totalPrice);\n const vat = Math.round(totalPrice * .10);\n document.getElementById('vat').innerText = ('$' + vat);\n const grandTotal = totalPrice + vat;\n document.getElementById('grand-total').innerText = '$' + grandTotal;\n}", "updateTotals(){\r\n\t\tvar rows = document.getElementById('orderDetailsBody')['rows'], subTotal=0, freight, x, grandTotal;\r\n\t\t//console.log(rows[0]['cells'][4].innerText);\r\n\t\t//console.log(rows[0]['cells'][1]['children'][0]['value']);\t\t//Unit Price\r\n\t\t//console.log(rows[0]['cells'][2]['children'][0]['value']);\t\t//Quantity\r\n\t\t//console.log(rows[0]['cells'][3]['children'][0]['value']);\t\t//Discount\r\n\t\t//console.log(rows[0]['cells'][4]['children'][0]['value']);\t\t//Extented Price\r\n\t\t//console.log(rows[0]['cells'][4]['innerText']);\r\n\t\t//this.commaFormatted(''+ (unitPrice).toFixed(2));\r\n\r\n\t\t//Calculate the 'Extended Price' cell of every row in the order-details HTML table.\r\n\t\t//And set it in its cell as a string comma formatted.\r\n\t\tfor(let r = 0; r < rows.length; r += 1){\r\n\t\t\tlet unitPrice = this.ParseFloat(rows[r]['cells'][1]['children'][0]['value']);\r\n\t\t\tlet quantity = this.ParseFloat(rows[r]['cells'][2]['children'][0]['value']);\r\n\t\t\tlet discount = this.ParseFloat(rows[r]['cells'][3]['children'][0]['value']);\r\n\t\t\tif(discount >= 1.0){\r\n\t\t\t\tdiscount = discount /100.0;\r\n\t\t\t}\r\n\t\t\tlet extPrice = (unitPrice * (1 - discount)) * quantity;\r\n\t\t\trows[r]['cells'][4]['innerText'] = this.commaFormatted(''+ (extPrice).toFixed(2));\r\n\t\t\tsubTotal += extPrice;\r\n\t\t\tif(discount < 1.0){\r\n\t\t\t\tdiscount = (discount * 100.0);\r\n\t\t\t}\r\n\t\t\trows[r]['cells'][3]['children'][0]['value'] = ''+ ((discount).toFixed(0)) + '%';\r\n\t\t}\r\n\t\t\r\n\t\tx = this.commaFormatted(''+ (subTotal).toFixed(2));\r\n\t\tthis.setIdValue('SubTotal', x);\r\n\t\t\r\n\t\tfreight = this.ParseFloat(this.getInputBoxValue('Freight'));\r\n\t\tx = this.commaFormatted(''+ (freight).toFixed(2));\r\n\t\tthis.setInputBoxValue('Freight', x);\r\n\r\n\t\tgrandTotal = subTotal + freight;\r\n\t\tx = this.commaFormatted(''+ (grandTotal).toFixed(2));\r\n\t\tthis.setIdValue('ExtendedTotal', x);\r\n\r\n\t\treturn 0;\r\n\t}", "function calculate () {\n const finalPrice = priceArray.reduce(getSum);\n priceDisplay.textContent = 'Total - Price $' + finalPrice;\n}", "function calculateTotalMontlyPay(loans) {\n const total = loans.reduce(function (sum, currentElement) {\n if (!currentElement.closed) {\n return sum + currentElement.perMonth.value;\n }\n return sum;\n }, 0);\n\n return total;\n}", "function count(){\n\t\treturn CLOSE.length;\n\t}", "function runningTotal() {\n let total = 0;\n let sumTotal = \"\";\n //main conference \n if (mainCon.firstElementChild.checked) {\n total = total + parseInt(mainConPrice);\n sumTotal = total;\n } \n if (mainCon.firstElementChild.checked === false) {\n sumTotal = sumTotal - mainConPrice;\n }\n\n //js libraries workshop\n if (jsWorkshop.firstElementChild.checked) {\n total = total + parseInt(jsWorkshopPrice);\n sumTotal = total;\n jsFrameWorkshop.firstElementChild.disabled = true;\n jsFrameWorkshop.classList.add('disabled');\n }\n if (jsWorkshop.firstElementChild.checked === false) {\n sumTotal = sumTotal - jsWorkshopPrice;\n jsFrameWorkshop.firstElementChild.disabled = false;\n jsFrameWorkshop.classList.remove('disabled');\n }\n\n //node js workshop\n if (nodeWorkshop.firstElementChild.checked) {\n total = total + parseInt(nodeWorkshopPrice);\n sumTotal = total;\n buildWorkshop.firstElementChild.disabled = true;\n buildWorkshop.classList.add('disabled');\n }\n if (nodeWorkshop.firstElementChild.checked === false) {\n sumTotal = sumTotal - nodeWorkshopPrice;\n buildWorkshop.firstElementChild.disabled = false;\n buildWorkshop.classList.remove('disabled');\n }\n\n //js frameworks workshop\n if (jsFrameWorkshop.firstElementChild.checked) {\n total = total + parseInt(jsFrameWorkshopPrice);\n sumTotal = total;\n jsWorkshop.firstElementChild.disabled = true;\n jsWorkshop.classList.add('disabled');\n }\n if (jsFrameWorkshop.firstElementChild.checked === false) {\n sumTotal = sumTotal - jsFrameWorkshopPrice;\n jsWorkshop.firstElementChild.disabled = false;\n jsWorkshop.classList.remove('disabled');\n }\n\n //build tools workshop\n if (buildWorkshop.firstElementChild.checked) {\n total = total + parseInt(buildWorkshopPrice);\n sumTotal = total;\n nodeWorkshop.firstElementChild.disabled = true;\n nodeWorkshop.classList.add('disabled');\n }\n if (buildWorkshop.firstElementChild.checked === false) {\n sumTotal = sumTotal - buildWorkshopPrice;\n nodeWorkshop.firstElementChild.disabled = false;\n nodeWorkshop.classList.remove('disabled');\n }\n\n //npm workshop\n if (npmWorkshop.firstElementChild.checked) {\n total = total + parseInt(npmWorkshopPrice);\n sumTotal = total;\n }\n if (npmWorkshop.firstElementChild.checked === false) {\n sumTotal = sumTotal - npmWorkshopPrice;\n }\n\n //express workshop\n if (expressWorkshop.firstElementChild.checked) {\n total = total + parseInt(expressWorkshopPrice);\n sumTotal = total;\n }\n if (expressWorkshop.firstElementChild.checked === false) {\n sumTotal = sumTotal - expressWorkshopPrice;\n }\n\n priceTotal.textContent = `Total: $${total}`;\n \n if (total > 0) {\n return true;\n } else if (total === 0) {\n return false;\n }\n \n}", "function totalCalculate(){\n const firstClassQuantityNumber = getQuantityValue('firstClass');\n const economyQuantityNumber = getQuantityValue('economy');\n\n //Sub-total Price\n const subTotalPrice = firstClassQuantityNumber * 150 + economyQuantityNumber * 100;\n document.getElementById('sub-total').innerText = subTotalPrice;\n\n //Total Tax\n const totalTax = Math.round(subTotalPrice * 0.1);\n document.getElementById('tax-amount').innerText = totalTax;\n \n //Total Amount\n const totalAmount = subTotalPrice + totalTax;\n document.getElementById('total-amount').innerText = totalAmount;\n \n //Total Fare\n const ticketFare = totalAmount;\n document.getElementById('total-fare').innerText = ticketFare;\n \n //Total Ticket\n const totalTicket = firstClassQuantityNumber + economyQuantityNumber;\n document.getElementById('total-ticket').innerText = totalTicket;\n}", "function updateSubTotal() {\r\n\r\nlet subTotal = 0;\r\ncartItems.forEach(function(item){\r\n subTotal = subTotal + item.price;\r\n console.log(subTotal);\r\n});\r\n document.getElementById(\"val\").innerHTML = \"Total = N\" + subTotal.toFixed(2);\r\n}", "function totalCalculate(){\n const firstClassCount = getInput('firstClassTicket');\n const economyClassCount = getInput('economyClassTicket');\n var totalTicket = firstClassCount + economyClassCount;\n const totalPrice = firstClassCount * 150 + economyClassCount * 100;\n document.getElementById('subTotal').innerText = '$' + totalPrice;\n const tax = Math.round(totalPrice * 0.1);\n document.getElementById('tax-amount').innerText = '$' + tax;\n const grandTotal = totalPrice + tax;\n document.getElementById('grand-total').innerText = '$' + grandTotal;\n document.getElementById('firstClassQuantity').innerText = firstClassCount;\n document.getElementById('firstClassPrice').innerText ='$' + firstClassCount * 150;\n document.getElementById('economyClassQuantity').innerText = economyClassCount;\n document.getElementById('economyClassPrice').innerText ='$' + economyClassCount * 100;\n document.getElementById('totalTicket').innerText = totalTicket;\n document.getElementById('totalTicketPrice').innerText ='$' + totalPrice;\n}", "total()\r\n\t{\r\n \t\tthis.cart = Cookie.get(this.settings.cookie_name);\r\n\r\n \t\tvar total = 0.00;\r\n \t\tlet i;\r\n\r\n \t\tfor (i = 0; i < this.cart.items.length; i++) {\r\n \t\t\ttotal += parseFloat(this.cart.items[i].price.amount) * this.cart.items[i].quantity;\r\n \t\t}\r\n\r\n \t\treturn total.toFixed(2);\r\n\t}", "function total(shipping, subTotal) {\n return \"$\" + sum(shipping, subTotal);\n}", "calculateQuantity() {\n console.log('Calculating quantity... ');\n const symbol = this.symbol.meta;\n const minQuantity = symbol.minQty;\n const maxQuantity = symbol.maxQty;\n const quantitySigFig = symbol.quantitySigFig;\n const stepSize = symbol.stepSize; //minimum quantity difference you can trade by\n const currentPrice = this.ticker.meta.bid;\n const budget = this.config.budget;\n\n let quantity = minQuantity;\n while (quantity * currentPrice <= budget) quantity += stepSize;\n if (quantity * currentPrice > budget) quantity -= stepSize;\n if (quantity === 0) quantity = minQuantity;\n\n assert(quantity >= minQuantity && quantity <= maxQuantity, 'invalid quantity');\n\n console.log('Quantity Calculated: ', quantity.toFixed(quantitySigFig));\n return quantity.toFixed(quantitySigFig);\n }", "function calculateCalories(){\n\n\tweightCal = $('#currentWeight').val();\n\theightCal = $('#currentHeight').val();\n\tgenderRadio = $(\"input:radio[name=genderCalorie]:checked\");\n\tgenderCal = genderRadio.val();\n\tageCal = $('#ageCounter').val();\n\tfitnessCal = $('#fitnessCalories').val();\n\tgoalCal = $('#goalWeight').val();\n\ttimeCal = $('#timeFrame').val();\n\tvar caloriesNeeded = 0;\n\tif (genderCal == \"male\"){\n\t\tconsole.log(\"Male\")\n\t\tcaloriesRMR = 66.473 + 13.751*.4536*weightCal + 5.0033*2.54*heightCal - 6.755*ageCal;\n\t}\n\telse {\n\t\tconsole.log(\"Female\")\n\t\tcaloriesRMR = 655.0955 + 9.463*.4536*weightCal + 1.8456*2.54*heightCal - 4.6756*ageCal;\n\t\t}\n\n\t\tcaloriesNeededDay = ((caloriesRMR*1.35)+parseFloat(fitnessCal));\n\t\tconsole.log(caloriesNeededDay);\n\t\t\n\t\t//3750 is used to for the number of calories in one pound. This number is debated among scientists at this point.\n\t\ttotalCaloriesLBS = (weightCal - goalCal)*3750;\n\n\n\t\ttotalCaloriesLBSDay = totalCaloriesLBS/(timeCal*7);\n\t\tconsole.log(totalCaloriesLBSDay);\n\t\t\n\t\t\n\t\tif (weightCal-goalCal < 0){\n\t\t\tfinalOutputCalories = caloriesNeededDay - totalCaloriesLBSDay;\n\t\t\tconsole.log(finalOutputCalories);\n\t\t\tfinalOutputCalories = finalOutputCalories.toFixed(2);\n\t\t}\n\t\telse{\n\t\t\tfinalOutputCalories = (caloriesNeededDay - totalCaloriesLBSDay);\n\t\t\tfinalOutputCalories = finalOutputCalories.toFixed(2);\n\t\t}\n\t\t\n\t\t$('#caloriesOutput').val(finalOutputCalories);\n\t\t$('#caloriesRMR').val(caloriesRMR.toFixed(2));\n\t\treturn false\n\t}", "function getTotal() {\n if (!runningTotal) {\n operate(x, sign, y);\n runningTotal = true;\n } else if (runningTotal) {\n operate(total, sign, y);\n } \n}", "function calcAll() {\n let subTotal = 0;\n [...cart.children].forEach(product => subTotal += updateSubtot(product));\n document.querySelector('h2 > span').innerHTML = subTotal;\n}", "function ex7(){\n // return\n\n let discount = totalShoppingCart * 0.2 \n totalShoppingCartFriday = totalShoppingCart - discount\n }", "function calculateSubTotal() {\n totalSum = 0;\n $('.total_Prices').each(function(i, obj) { \n totalSum = Number(totalSum) + Number($('#total_price_amount'+i).html().replace(\"$\",''));\n });\n $('#total_p').val(totalSum);\n }", "calculateDenialRunningTotal(inventories) {\n let current = 0;\n return inventories.map(inventory => {\n if (inventory.isPayment) {\n current = current - inventory.amount;\n } else if (inventory.credited) {\n current = current - inventory.creditAmount;\n } else {\n current = current + inventory.rejectAmount;\n }\n inventory.rejectionRunningTotal = current;\n return inventory;\n });\n }", "function totalcalc() {\n let total = 1299 + rmemory + ssd + deli;\n return total;;\n}", "function economyClassHandler(increase) \n {\n const bookingnumber = document.getElementById(\"ebookingNumber\");\n const bookingCount = parseInt(bookingnumber.value);\n let bookingNewCount = 0;\n if(increase==true){\n bookingNewCount = bookingCount + 1;\n }\n if(increase == false && bookingCount>0){\n bookingNewCount = bookingCount - 1;\n }\n ebookingNumber.value = bookingNewCount; \n const nettotal = bookingNewCount *100;\n document.getElementById(\"netPrice\").innerText = '$'+nettotal;\n subtotal();\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}", "function updateTotal() {\n\n}", "total() {\n const rawTotal = this.rawTotal();\n const appliedDiscounts = this.getAppliedDiscounts();\n const discountTotal = this.discountSrv.total(appliedDiscounts);\n return rawTotal - discountTotal;\n }", "function getDiscountAmountOfThisMainOrder(subTotal)\n {\n var mainDiscountAmount = 0;\n if(getSelectedDiscountTypeOfThisMainOrder() == 'percentageValue')\n {\n mainDiscountAmount = ((subTotal * getDiscountValueOfThisMainOrder()) / 100).toFixed(2);\n }\n else if(getSelectedDiscountTypeOfThisMainOrder() == 'fixedValue')\n {\n mainDiscountAmount = getDiscountValueOfThisMainOrder();\n }\n return mainDiscountAmount;\n }", "function CalculateTotalPrice() {\n \n var totalSpotFee = 0;\n var totalPersonalFee = 0;\n var totalAddOnFee = 0;\n var totalDiscount = 0;\n\n //The daysOnCamping is used to check if the four day discount is achieved.\n var daysOnCamping = 1;\n\n //Gets the dates to be looped through.\n var startDate = new Date(document.getElementById(\"MainContent_startDate\").value);\n var endDate = new Date(document.getElementById(\"MainContent_endDate\").value);\n \n \n //Gets the sopt type to chcek if it is selected and if its a season spot as a season spot pay a flat rate.\n var spotType = GetCheckedRadioButtonFromName('typeSelector');\n\n //Calculate the total add on fees.\n totalAddOnFee += CalculateAddOnFee();\n\n \n\n //This loop is used for evrey thing that are paid on a daily basis.\n while (startDate < endDate) {\n\n //Chceks if a spotType has been selected or not and runs the function if a spotType has been selected.\n if (spotType != null && !FourDayDiscountIsAchieved(daysOnCamping)) {\n totalSpotFee += CalculateSpotFee(HighOrLowSeason(startDate))\n }\n //Gets the totalSpotFee per day.\n else if (spotType !=null) {\n totalDiscount += CalculateSpotFee(HighOrLowSeason(startDate));\n }\n //Calculates the total personal fee.\n totalPersonalFee += CalculatePersonalFee();\n daysOnCamping++;\n startDate.setDate(startDate.getDate() + 1);\n }\n\n //If the spotType has been selected and seasonSpot has been selected.\n if (spotType != null && spotType.value == \"Sæsonplads\") {\n\n //Calculates the spot fee for a seaonspot.\n totalSpotFee += CalculateSeasonSpotFee();\n\n //Sets the price of personal to 0 because personal is free when seasonspot is chosen.\n totalPersonalFee = 0;\n }\n //sets the price labels\n SetPriceLabels(totalSpotFee, totalPersonalFee, totalAddOnFee, totalDiscount, totalDiscount);\n}", "function getTotalDiscountAmountOfThisMainOrder()\n {\n return getDiscountAmountOfThisMainOrder(subTotalAmountOfThisOrder());\n }", "calcCeilingPrice( cb ){\n\t\tconst price = this.calcAreaPaintingPrice( this.state.roomArea, this.state.paintingPrice, this.state.ceilingPaintPrice );\n\t\t this.setState({ ceilingPrice: price },cb);\n\t}", "function updateTotalValue() {\r\n\r\n const ramPrice = parseInt(document.getElementById('extra-memory-price').innerText);\r\n\r\n const storagePrice = parseInt(document.getElementById('extra-storage-price').innerText);\r\n\r\n const deliveryCharge = parseInt(document.getElementById('delivery=charge').innerText);\r\n\r\n const bestPrice = parseInt(document.getElementById('best-price').innerText);\r\n\r\n\r\n\r\n ////////////////////// Final Calculation ////////////////////////\r\n\r\n const totalValue = document.getElementById('total-price');\r\n totalValue.innerText = bestPrice + ramPrice + storagePrice + deliveryCharge;\r\n const finalPrice = document.getElementById('final-price');\r\n finalPrice.innerText = totalValue.innerText;\r\n\r\n\r\n}", "function calculateTotal() {\r\n\t\tvar Amount =getPrice() *getPages();\r\n\t\t//display cost.\r\n\t\tvar obj =document.getElementById('totalPrice');\r\n\t\tobj.style.display='block';\r\n\t\tobj.innerHTML =\" Cost of the paper: \\t $\"+ Amount;\r\n\t}", "function updateSubtot(product) {\n let sum = 0;\n for (let i = 0; i < rows.length; i++) {\n let currentProduct = rows[i];\n let subTotal = currentProduct.querySelector('.subtot');\n let quantity = currentProduct.querySelector('.qty input').value;\n let currPrice = currentProduct.querySelector('.pu span').innerHTML;\n subTotal.innerHTML =\n '$' + (Number(quantity) * Number(currPrice)).toFixed(2);\n sum += Number(quantity) * Number(currPrice);\n }\n total = sum.toFixed(2);\n // calcAll();\n //we could use calcAll(), so when we add qty it could calculate total at same time.\n //instead of extra click for total.\n}", "function updateRemaining () {\n\n let total = 0;\n\n for (const ball of balls){\n total += ball.points*ball.quantity\n }\n\n if (redOn){\n total += balls[lookup[\"black\"]].points * balls[lookup[\"red\"]].quantity;\n }\n else {\n total += balls[lookup[\"black\"]].points * (balls[lookup[\"red\"]].quantity + 1);\n }\n\n return total;\n\n}", "getAmount(){ \n var totalAmount = (this.gallonsRequested * this.getPrice());\n\n return totalAmount;\n }", "function getTotalBalance (s, cb) {\n s.exchange.getBalance(s, function (err, balance) {\n if (err) {\n console.log(err)\n return cb(err)\n \n }\n \n var summary = {product: s.product_id, asset: balance.asset, currency: balance.currency}\n\n s.exchange.getQuote({product_id: s.product_id}, function (err, quote) {\n if (err) return cb(err)\n asset_value = n(balance.asset).multiply(quote.ask)\n summary.currency_value = n(balance.currency)\n //myLog(s.product_id + \": \" + n(balance.asset).format('0.00') + \" \" + quote.ask + \" Total: \" + asset_value.format('0.00'))\n summary.ask = quote.ask\n summary.asset_value = asset_value\n cb(summary)\n })\n })\n \n }", "function getFinancials(){\n let propertyValue = getPropertyValue();\n setTotal('overallSummarySoldProperties', formatCurrency(propertyValue));\n\n let goodsValue = getGoodsValue();\n setTotal('overallSummarySoldGoods', formatCurrency(goodsValue));\n\n let soldTotal = propertyValue + goodsValue;\n let formattedSoldTotal = formatCurrency(soldTotal);\n setTotal('overallSummarySoldTotal', formattedSoldTotal);\n\n let expensesValue = getTotalExpenses();\n setTotal('overallSummaryExpensesTotal', formatCurrency(expensesValue));\n\n let balance = (soldTotal - expensesValue);\n setTotal('overallSummaryBalance', formatCurrency(balance));\n}", "total(){\n return operations.incomes() + operations.expenses()\n }", "function totalPrice() {\n const firstCount = document.getElementById('first-count');\n const firstCountNumber = parseInt(firstCount.value);\n\n const economyCount = document.getElementById('economy-count');\n const economyCountNumber = parseInt(economyCount.value);\n\n // subtotal price...\n const subTotalPrice = (firstCountNumber * 150) + (economyCountNumber * 100);\n document.getElementById('sub-total').innerText = subTotalPrice;\n\n // sub total price..\n const vat = subTotalPrice * 0.1;\n document.getElementById('total-vat').innerText = vat;\n\n // total price...\n const totalTicketPrice = subTotalPrice + vat;\n document.getElementById('total-price').innerText = totalTicketPrice;\n}", "function calculatTotal(){\n const ticketCount = getInputValue(\"first-class-count\");\n const economyCount = getInputValue(\"economy-count\");\n const totalPrice = ticketCount * 150 + economyCount * 100;\n elementId(\"total-price\").innerText = '$' + totalPrice;\n const vat = totalPrice * .1;\n elementId(\"vat\").innerText = \"$\" + vat;\n const grandTotal = totalPrice + vat;\n elementId(\"grandTotal\").innerText = \"$\" + grandTotal;\n}", "function reglaAumPrecioFullCobertura(){\n if(producto.f_cobertura.sellIn -1){\n precio_FullCobertura + 1;\n }else{\n\n }\n}", "function calculateSubTotal()\n{\n\tvar overallSubtotalTime = 0;\n\tvar overallSubtotalTimeHoursMins = 0;\n\t\n\tfor (var i=0; i < numOfTimeEntries; i++)\n\t{\n\t\t// See if the checkbox on each row is checked or not\n\t\tvar subTotalRowChecked = $('#subTotal' + i).is(':checked');\n\t\t\n\t\tif (subTotalRowChecked)\n\t\t{\n\t\t\t// Get the values from the form\n\t\t\tvar startHour = $('#startHour' + i).val();\n\t\t\tvar startMin = $('#startMin' + i).val();\n\t\t\tvar endHour = $('#endHour' + i).val();\n\t\t\tvar endMin = $('#endMin' + i).val();\t\t\t\n\t\t\tvar timeDifference = 0;\n\t\t\t\n\t\t\t// Make sure all fields are filled out for that row then work out time difference and add to sub total\n\t\t\tif ((startHour != '') && (startMin != '') && (endHour != '') && (endMin != ''))\n\t\t\t{\n\t\t\t\ttimeDifference = calculateTimeDifference(startHour, startMin, endHour, endMin);\t\n\t\t\t}\n\t\t\t\n\t\t\t// Update subtotal\n\t\t\toverallSubtotalTime += timeDifference;\t\t\t\n\t\t}\t\t\n\t}\n\t\n\t// Round to 2dp and format wording\n\toverallSubtotalTime = roundNumber(overallSubtotalTime, 2);\n\toverallSubtotalTime = overallSubtotalTime;\n\toverallSubtotalTimeHoursMins = formatToHoursMins(overallSubtotalTime);\n\t\n\t// Update overall sub total time on page and object\n\t$('#overallSubtotalTime').text(overallSubtotalTime);\t\n\t$('#overallSubtotalTimeHoursMins').text(overallSubtotalTimeHoursMins);\t\n\ttimeStorage['overallSubtotalTime'] = overallSubtotalTime;\n\ttimeStorage['overallSubtotalTimeHoursMins'] = overallSubtotalTimeHoursMins;\n}", "checkClosing() {\n let ret = false;\n if (\n (this.type === PositionType.LONG &&\n (/* this.pair.currentPrice >= this.takeProfitPrice || */\n this.pair.currentPrice <= this.stopLossPrice)) ||\n (this.type === PositionType.SHORT &&\n (/* this.pair.currentPrice <= this.takeProfitPrice || */\n this.pair.currentPrice >= this.stopLossPrice))\n ) {\n ret = true;\n }\n return ret;\n }", "function endRound()\n{\n //@TODO: Hier coderen we alles om een ronde te beëindigen\n\n}", "function inventoryTotals() {\r\n\t\tvar totalHP = 0;\r\n\t\tvar numCooked = 0;\r\n\t\tvar totalRawHP = 0;\r\n\t\tvar numRaw = 0;\r\n\t\tvar numBurnts = 0;\r\n\t\tvar totals = 0;\r\n\r\n\t\tvar myDivs = inv.getElementsByTagName('div');\r\n\r\n\t\tif(myDivs) {\t\r\n\t\t\tfor (i=0;i<myDivs.length;i++) {\r\n\t\t\t\ttotals += parseInt(myDivs[i].textContent);\r\n\r\n\t\t\t\tfor (j=0;j<Foods.length;j++) {\r\n\t\t\t\t\tif (myDivs[i].title == Foods[j][0]) {\r\n\t\t\t\t\t\ttotalHP += parseInt(myDivs[i].textContent)*Foods[j][1];\r\n\t\t\t\t\t\tnumCooked += parseInt(myDivs[i].textContent);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor (j=0;j<Cookables.length;j++) {\r\n\t\t\t\t\tif (myDivs[i].title == Cookables[j][0]) {\r\n\t\t\t\t\t\ttotalRawHP += parseInt(myDivs[i].textContent)*Cookables[j][1];\r\n\t\t\t\t\t\tnumRaw += parseInt(myDivs[i].textContent);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (myDivs[i].title.indexOf('Burnt') > -1) {\r\n\t\t\t\t\tnumBurnts += parseInt(myDivs[i].textContent);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\nvar newstr = \"\";\r\n\t\tif (totals > 0) {\r\n\t\t\tTotal.textContent = 'Total of ' + totals + ' Items';\r\n\t\t\tTotal.parentNode.style.display = '';\r\n\t\t} else {\r\n\t\t\tTotal.parentNode.style.display = 'none';\r\n\t\t}\r\n\t\tif (numBurnts > 0) {\r\n\t\t\t\t\t\tBrns.parentNode.style.display = 'none';\r\n\t\t}\r\n\t\tif (numCooked > 0) {\r\n\t\t\t\t\t\tCked.parentNode.style.display = 'none';\r\n newstr = \"HP: \" + addCommas(totalHP);\r\n\t\t}\r\n if (numRaw > 0) {\r\n\t\tRaws.parentNode.style.display = 'none';\r\n newstr = newstr + \" Raw: \" + addCommas(totalRawHP); \r\n\t\t}\r\n try{\r\n document.getElementById(\"inventoryStats\").innerHTML = '<div id=\"inventoryStats\" style=\"color: white; text-align: center;\">'+newstr+'</div>'\r\n }catch(err){}\r\n\t\tinv.addEventListener('DOMSubtreeModified',inventoryTotalsDelay,false);\r\n\t}", "function profitGenerated(days,clicks,rClick,renewingCost)\r\n{\r\n var nbo_generated = clicks * rClick;\r\n var nbo_eachDayCosts = ( (100-discountObtained()) * renewingCost / 100 ) / 30;\r\n var nbo_expenses = nbo_eachDayCosts * days;\r\n return (nbo_generated - nbo_expenses);\r\n}", "function TotalPriceCalc() {\n var total = 0;\n $(\".indCartGrndTotal\").each(function() {\n total += parseFloat($(this).text());\n });\n var subTotal = total.toFixed(2);\n var placetotal = $(\"#cart_page_subtotal\").text(subTotal);\n //$(\"#right_side_cart_subtotal\").text(subTotal);\n $('#inputSubtotal').val(subTotal);\n \n var minimum_buy = $('#minimumBuyAm').val();\n\n\n var couponType = $('#couponType').val();\n if(couponType == 'Fixed'){\n\n // if(subTotal <= minimum_buy){\n // alert(\"hello\");\n // }\n\n var disValue = $('#couponValue').val();\n subTotal = parseFloat(subTotal) - parseFloat(disValue);\n $('#couponDiscountValue_show').text(disValue);\n\n var couponDiv = document.getElementById(\"couponCodeDiv\");\n couponDiv.classList.add(\"d-none\");\n\n var couponSuccessDiv = document.getElementById(\"AppliedCoupon\");\n couponSuccessDiv.classList.remove(\"d-none\");\n\n }\n else if(couponType == 'Percentage'){\n\n // if(minimum_buy < subTotal){\n // alert(minimum_buy);\n // }\n\n var disValue = $('#couponValue').val();\n var maxDis = $('#maxCValue').val();\n var discountAmount_in_percent = (disValue * subTotal)/100;\n if(discountAmount_in_percent > maxDis) {\n $('#couponDiscountValue_show').text(maxDis);\n subTotal = parseFloat(subTotal) - parseFloat(maxDis);\n }\n else {\n $('#couponDiscountValue_show').text(discountAmount_in_percent);\n subTotal = parseFloat(subTotal) - parseFloat(discountAmount_in_percent);\n }\n\n var couponDiv = document.getElementById(\"couponCodeDiv\");\n couponDiv.classList.add(\"d-none\");\n\n var couponSuccessDiv = document.getElementById(\"AppliedCoupon\");\n couponSuccessDiv.classList.remove(\"d-none\");\n\n }\n\n\n var shippingCrg = $('#shippingchargeHi').val();\n var subtotalWithSh = parseFloat(subTotal) + parseFloat(shippingCrg);\n\n $('#cart_grandTotal').text(subtotalWithSh);\n //alert(subtotalWithSh);\n //console.log(total);\n}", "function calculate(weeklyrent,agreelength,discount)\n {\n var totalweeks = (52 * agreelength)\n var newtotal = (totalweeks * weeklyrent) - discount;\n var newweekpayments = newtotal/totalweeks;\n return \"£\"+parseFloat(newweekpayments).toFixed(2);\n }", "function close(n){\n\t\treturn barsAgo(CLOSE,n);\n\t}", "function calculateCashLeftOverEachWeek(){\n // weeklyIncome & weeklyExpenses are 'free' variables. They are not declared within the body of the calculateCashLeftOverEachWeek function.\n var cashLeftoverEachWeek = weeklyIncome-weeklyExpenses;\n console.log(\"You will have $\"+cashLeftoverEachWeek+\" left over per week\");\n}", "countClosing() {\n return(Object.keys(tClosers).length)\n }", "function calcFinalPrice(cartTotal,couponValue,tax){\n let total = cartTotal * (1 + tax);\n total = total - couponValue;\n return total;\n}" ]
[ "0.6102411", "0.56489104", "0.5648566", "0.55740833", "0.5551331", "0.5542211", "0.5503885", "0.54976916", "0.54424524", "0.5420663", "0.5413911", "0.5407438", "0.5402365", "0.54008365", "0.53891134", "0.5364391", "0.53439355", "0.5342617", "0.5325134", "0.53202355", "0.53146416", "0.53118557", "0.5307898", "0.530061", "0.5300081", "0.52958304", "0.52907944", "0.5287003", "0.5285251", "0.5279056", "0.52753425", "0.5264124", "0.5263711", "0.5261064", "0.5248836", "0.5247346", "0.52443594", "0.5236539", "0.52348816", "0.52279294", "0.52257043", "0.5223517", "0.52231264", "0.5220942", "0.5217759", "0.5208447", "0.5196953", "0.51960766", "0.5192226", "0.51822424", "0.5177136", "0.5173427", "0.5172662", "0.51692426", "0.5163991", "0.5159095", "0.5159092", "0.5157994", "0.51412576", "0.5136774", "0.513655", "0.5136052", "0.5135686", "0.51328075", "0.51263607", "0.5117919", "0.51063204", "0.5104751", "0.5097808", "0.50949705", "0.5088682", "0.5087965", "0.50873804", "0.5087284", "0.50809485", "0.5078902", "0.5077984", "0.5076839", "0.5068793", "0.506723", "0.5066014", "0.50562346", "0.505277", "0.50489646", "0.5041591", "0.50382954", "0.50367105", "0.50350386", "0.50340545", "0.503014", "0.5030136", "0.5029748", "0.50293094", "0.50228", "0.50227934", "0.5021345", "0.5021187", "0.5020201", "0.50182414", "0.50174516" ]
0.66610575
0
updateUserType(): update type and company
async function updateUserHire(user, type, company) { user.type = type; user.company = company; return getParticipantRegistry('org.pow.app.User').then(function(registry) { return registry.update(user) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateUserType(userType) {\n \n }", "async function handleUserTypeValueSave() {\n updateIsSaving(true);\n\n await updateInstance({\n variables: {\n actionId: UPDATE_USER_TYPE_FOR_APP_SPEC_ACTION_ID,\n executionParameters: JSON.stringify({\n value: userTypeValue,\n instanceId: userType.id,\n }),\n },\n refetchQueries,\n });\n\n updateIsEditMode(false);\n updateIsSaving(false);\n }", "editUserType({ idUser }, { idType }, result) {\r\n let query = `update uZvFiNMuwF.user set idType = ${idType}`;\r\n query += ` where idUser = ${idUser}`;\r\n\r\n sql.query(query, (err, rows, fields) => {\r\n if (err) {\r\n result(err, rows);\r\n return;\r\n }\r\n\r\n result(null, rows);\r\n });\r\n }", "function handleUserTypeValueChange(e) {\n updateUserTypeValue(e.target.value);\n }", "async update(id, user, type) {\n\t\tconst dto = await this.entityDto.domain()\n\t\tuser.id = id\n\t\tuser = morphism(dto, user)\n\t\tif (type == 'password') {\n\t\t\tconst salt = await bcrypt.genSalt(10)\n\t\t\tuser.password = await bcrypt.hash(user.password, salt)\n\t\t\treturn this.usersRepository.updatePassword(id, user)\n\t\t}\n\t\treturn this.usersRepository.updateUsername(id, user)\n\t}", "function updateProfileHandler(type, value) {\n if (type === 'address' || type === 'phone' || type === 'hours') {\n setUserProfile(() => ({\n ...userProfile,\n contactInfo: {\n ...userProfile.contactInfo,\n [type]: value\n }\n }));\n }\n else {\n setUserProfile(() => ({\n ...userProfile,\n [type]: value\n }));\n }\n }", "updateType() {\n this.incorrectTypeAttributes = false;\n // Since we can just change name and do not touch attributes\n // this is safety check to not touch existing array of attributes\n if(!Array.isArray(this.type.attrs)) {\n this.type.attrs = this.getAttributes();\n }\n\n if(this.incorrectTypeAttributes) {\n this.toastr.error('Attributes must be separated by comma without spaces', 'Error');\n return;\n }\n\n this.TypeService.updateType(this.type)\n .then(this.handleFormSuccess.bind(this, 'Type was updated'))\n .catch(this.handleFormErrors.bind(this));\n }", "function updateUserIdInDB(userId, userType) {\n var condition = \"type = '\" + userType + \"'\";\n var data = \"value = '\" + userId + \"'\";\n /**\n * We create the final query.\n * @type {string}\n */\n paramsInQuery = \"UPDATE TR_LastUserId SET \" + data + \" WHERE \" + condition;\n console.log(\"Query: \" + paramsInQuery);\n /**\n * We update the data.\n */\n connectionVariable.query(paramsInQuery, function (err, data) {\n if (err) throw err;\n });\n}", "async updateUser () {\n\t// add the team's ID to the user's teamIds array, and the company ID to the companyIds array\n\t\tconst op = {\n\t\t\t$addToSet: {\n\t\t\t\tcompanyIds: this.attributes.companyId,\n\t\t\t\tteamIds: this.model.id\n\t\t\t},\n\t\t\t$unset: {\n\t\t\t\tcompanyName: true\n\t\t\t},\n\t\t\t$set: {\n\t\t\t\tmodifiedAt: Date.now()\n\t\t\t}\n\t\t};\n\t\tthis.updateUserJoinMethod(this.user, op);\n\t\tthis.transforms.userUpdate = await new ModelSaver({\n\t\t\trequest: this.request,\n\t\t\tcollection: this.data.users,\n\t\t\tid: this.user.id\n\t\t}).save(op);\n\t}", "function saveBookingType(type) {\n if (type === 'phone') {\n $scope.editBookingPhone = false;\n }\n else if (type === 'email') {\n $scope.editBookingEmail = false;\n }\n else if (type === 'website') {\n $scope.editBookingUrl = false;\n }\n\n saveBookingInfo();\n }", "setUserData(field, value) {\r\n\r\n // Get all user data\r\n var userData = this.getUserData()\r\n\r\n // Set new field\r\n userData[field] = value\r\n\r\n // Update entity\r\n Entities.editEntity(this.id, JSON.stringify(userData))\r\n\r\n }", "typeOfUser(type) {\n this.setState({userType:type})\n }", "function User_Update_Types_de_personne_Liste_des_types_de_personne0(Compo_Maitre)\n{\n var Table=\"typepersonne\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var tp_type=GetValAt(49);\n if (!ValiderChampsObligatoire(Table,\"tp_type\",TAB_GLOBAL_COMPO[49],tp_type,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"tp_type\",TAB_GLOBAL_COMPO[49],tp_type))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"tp_type=\"+(tp_type==\"\" ? \"null\" : \"'\"+ValiderChaine(tp_type)+\"'\" )+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "function set_update_type(type, form){\n\ttry{\n\tvar p = document.createElement(\"input\");\n\n\t// Add the new element to our form. \n\tform.appendChild(p);\n\tp.name = \"update\";\n\tp.type = \"hidden\";\n\tp.value = type;\n\t}\n\tcatch(e) {\n\t\t//alert(\"Error Caught: 260\");\n\t\tlog(\"profile.js\", e.lineNumber, e);\n\t}\n}", "typeUpdate( context, data )\n\t\t{\n\t\t\treturn fetch( `/api/types/${data.id}`, {\n\t\t\t\theaders: {\n\t\t\t\t\t'X-Requested-With': 'XMLHttpRequest',\n\t\t\t\t\t'X-CSRF-token': window.token,\n\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t'Accept': 'application/json',\n\t\t\t\t\t'Authorization': `Bearer ${sessionStorage.getItem('token')}`\n\t\t\t\t},\n\t\t\t\tmethod: 'PUT',\n\t\t\t\tbody: JSON.stringify( data )\n\t\t\t})\n\t\t\t\t.then( response => response.json() )\n\t\t\t\t.then( response => {\n\t\t\t\t\tif( response.errors ) {\n\t\t\t\t\t\tcontext.commit( 'errors', response.errors );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontext.commit( 'errors', []);\n\t\t\t\t\t}\n\t\t\t\t\tcontext.commit( 'message', response.message );\n\t\t\t\t\tcontext.commit( 'success', response.success );\n\t\t\t\t})\n\t\t\t\t.catch( error => console.error( 'typeUpdate', error ) );\n\t\t}", "function alterarTipoGerencia(){\n\tvar unidade = DWRUtil.getValue(\"comboUnidade\"); \n\tvar tipoGerencia = DWRUtil.getValue(\"comboGerencia\"); \n\tFacadeAjax.alterarGerencia(unidade,tipoGerencia);\n}", "function User_Update_Types_de_lien_Liste_des_types_de_lien_entre_personne0(Compo_Maitre)\n{\n var Table=\"typelien\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var tl_libelle=GetValAt(45);\n if (!ValiderChampsObligatoire(Table,\"tl_libelle\",TAB_GLOBAL_COMPO[45],tl_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"tl_libelle\",TAB_GLOBAL_COMPO[45],tl_libelle))\n \treturn -1;\n var tl_description=GetValAt(46);\n if (!ValiderChampsObligatoire(Table,\"tl_description\",TAB_GLOBAL_COMPO[46],tl_description,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"tl_description\",TAB_GLOBAL_COMPO[46],tl_description))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"tl_libelle=\"+(tl_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(tl_libelle)+\"'\" )+\",tl_description=\"+(tl_description==\"\" ? \"null\" : \"'\"+ValiderChaine(tl_description)+\"'\" )+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "function setAccountTypeData() \n {\n var pageData = GetPageData();\n setPageData(pageData, \"accounttype\", \"mailaccount\",false);\n setPageData(pageData, \"accounttype\", \"newsaccount\", false);\n // Other account type, e.g. Movemail\n setPageData(pageData, \"accounttype\", \"otheraccount\", true);\n }", "function updateTypeOfVehicle(type){\r\n if ( type == tCar)\r\n isCar = true;\r\n else if ( type == tTruck )\r\n isTruck = true;\r\n else if ( type == tTw )\r\n isTw = true;\r\n }", "set_type(new_type){\n if(new_type){\n this.type = new_type;\n }\n else{\n this.invalid();\n }\n }", "_onEdit(type) {\n this.refs.screen.updateValues(type);\n this.refs.advanced.updateValues(type);\n this.refs.misc.updateValues(type);\n }", "function add_new_user_selection(type){\n\tif(type==0){\n\t\t$(\"#add_professor_option\").prop(\"checked\", false);\n\t\t$(\"#aem_tr\").show();\n\t\t$(\"#add_user_type\").val('0');\n\t}else{\n\t\t$(\"#add_student_option\").prop(\"checked\", false);\n\t\t$(\"#aem_tr\").hide();\n\t\t$(\"#add_user_type\").val('1');\n\t}\n}", "function UserType({\n userType,\n parentId,\n selected,\n updateInstance,\n deleteInstance,\n refetchQueries,\n onSelect,\n // ns__custom_start unit: appSpec, comp: UserType, loc: addedProps\n // ns__custom_end unit: appSpec, comp: UserType, loc: addedProps\n}) {\n const [userTypeValue, updateUserTypeValue] = useState(userType.value);\n const [isEditMode, updateIsEditMode] = useState(false);\n const [isSaving, updateIsSaving] = useState(false);\n const [isDeleteMode, updateIsDeleteMode] = useState(false);\n const [isDeleting, updateIsDeleting] = useState(false);\n // ns__custom_start unit: appSpec, comp: UserType, loc: beginning\n\n const styles = useStyles();\n // ns__custom_end unit: appSpec, comp: UserType, loc: beginning\n\n const screenData =\n userType.children &&\n userType.children.find((child) => child.typeId === TYPE_SCREEN_ID);\n const screens = screenData ? screenData.instances : [];\n // ns__custom_start unit: appSpec, comp: UserType, loc: beforeReturn\n // ns__custom_end unit: appSpec, comp: UserType, loc: beforeReturn\n\n // ns__start_replacement notSelected\n if (selected) {\n return (\n <UserTypeStyleWrapper onClick={() => onSelect(userType.id)}>\n {userTypeValue}\n </UserTypeStyleWrapper>\n );\n }\n // ns__end_replacement notSelected\n\n // ns__start_section change\n function handleUserTypeValueChange(e) {\n updateUserTypeValue(e.target.value);\n }\n // ns__end_section change\n\n // ns__start_section save\n async function handleUserTypeValueSave() {\n updateIsSaving(true);\n\n await updateInstance({\n variables: {\n actionId: UPDATE_USER_TYPE_FOR_APP_SPEC_ACTION_ID,\n executionParameters: JSON.stringify({\n value: userTypeValue,\n instanceId: userType.id,\n }),\n },\n refetchQueries,\n });\n\n updateIsEditMode(false);\n updateIsSaving(false);\n }\n // ns__end_section save\n\n // ns__start_section cancel\n function handleCancelEdit() {\n updateIsEditMode(false);\n }\n // ns__end_section cancel\n\n // ns__start_section isEdit\n if (isEditMode) {\n return (\n <UserTypeStyleWrapper>\n <EditInstanceForm\n id={userType.id}\n label='UserType Value:'\n value={userTypeValue}\n onChange={handleUserTypeValueChange}\n onSave={handleUserTypeValueSave}\n onCancel={handleCancelEdit}\n disabled={isSaving}\n />\n </UserTypeStyleWrapper>\n );\n }\n // ns__end_section isEdit\n\n // ns__start_section delete\n async function handleDelete() {\n updateIsDeleting(true);\n\n try {\n await deleteInstance({\n variables: {\n actionId: DELETE_USER_TYPE_FOR_APP_SPEC_ACTION_ID,\n executionParameters: JSON.stringify({\n parentInstanceId: parentId,\n instanceId: userType.id,\n }),\n },\n refetchQueries,\n });\n } catch (e) {\n updateIsDeleting(false);\n }\n }\n // ns__end_section delete\n\n // ns__start_section cancelDelete\n function handleCancelDelete() {\n updateIsDeleteMode(false);\n }\n // ns__end_section cancelDelete\n\n // ns__start_section isDelete\n if (isDeleteMode) {\n return (\n <UserTypeStyleWrapper selected={selected} isDeleting={isDeleting}>\n {userTypeValue}\n <DeleteInstanceMenu\n onDelete={handleDelete}\n onCancel={handleCancelDelete}\n disabled={isDeleting}\n />\n </UserTypeStyleWrapper>\n );\n }\n // ns__end_section isDelete\n\n // ns__start_section functionReturn\n return (\n <UserTypeStyleWrapper selected={selected}>\n {/* ns__start_replacement instanceValue */}\n\n <InputLabel className={styles.titleLabel}>User Type</InputLabel>\n <TitleWrapper>\n {userTypeValue}\n <div>\n <Button type='button' onClick={() => updateIsEditMode(true)}>\n &#9998;\n </Button>\n <Button type='button' onClick={() => updateIsDeleteMode(true)}>\n &#128465;\n </Button>\n </div>\n </TitleWrapper>\n\n {/* ns__end_replacement instanceValue */}\n\n {/* ns__start_replacement childrenList */}\n\n <Screens\n screens={screens}\n userTypeId={userType.id}\n label={userTypeValue}\n refetchQueries={refetchQueries}\n />\n\n {/* ns__end_replacement childrenList */}\n\n {/* ns__custom_start unit: appSpec, comp: UserType, loc: renderEnding */}\n {/* ns__custom_end unit: appSpec, comp: UserType, loc: renderEnding */}\n </UserTypeStyleWrapper>\n );\n // ns__end_section functionReturn\n}", "function updateUFMap(typeMap) {\r\n\tfor(type in typeMap) ufMap[type] = ufMap[type] ? ufMap[type] + 1 : 1;\r\n}", "function fillAndShowUpdateProfileModal(data, userType) {\n var profileDetails;\n if (userType === 'supervisor') {\n profileDetails = data[0];\n } else if (userType === 'supervisee') {\n profileDetails = data;\n }\n\n $('#user-name').val(\"\");\n $(\".update-profile-pic\").attr('src',profileDetails.image);\n $(\".supervisor-name-label\").each(function(index, value) {\n if (index === 1) {\n $(this).val(profileDetails.first_name + \" \" + profileDetails.last_name);\n }\n })\n $(\".supervisor-email-label\").each(function(index, value) {\n if (index === 1) {\n $(this).val(profileDetails.email);\n }\n })\n $(\".supervisor-role-label\").each(function(index, value) {\n if (index === 1) {\n $(this).val(profileDetails.role);\n }\n })\n $(\".supervisor-address-label\").each(function(index, value) {\n if (index === 1) {\n $(this).val(profileDetails.location);\n }\n })\n modal.modalOverlay.fadeIn(200);\n $(window).scrollTop(0);\n $('body').addClass('fixed');\n modal.updateProfileModal();\n }", "function setEntityType() {\n var new_type = $(this).attr('label')\n var edits = [];\n $(\".entity.ui-selected\").each(function() {\n var eid = this.id;\n edits.push({action:'change_entity_type', id:eid, old_type:entities[eid].type, new_type:new_type});\n });\n if (edits.length > 0) makeEdits(edits);\n return false;\n }", "function changeAccountType() {\n //Creates and sends an AJAX request\n fetch(\"/user/changeUserType\", {\n method: \"PUT\",\n })\n .then(() => {\n location.reload(true);\n alert(\"You've changed your account type\");\n })\n .catch((err) => {\n console.log(err);\n });\n}", "updateSignUpDeveloperCname(state, value) {\n state.signUp.developer.CompanyName = value;\n }", "function addUserToTable(username, userType, userId) {\n users.set(userId, {username: username, userType: userType})\n refreshUserTable();\n}", "function determineAndApplyUpdate(fieldType, stringObjects, addOrDelete, userFriendAppId, bofffsSpecificData, bofffsData)\n{\n\tTi.API.info(\"determineUpdateType\");\n\t\n\t// TODO: Replace this with return statement\n\tif(contact == null) alert(\"Contact must be initialized ya beheema !\");\n\t\n\t// TODO: Handle if addOrDelete\n\tswitch(fieldType) {\n\t\t\n\t\tcase \"phone_number\":\n\t\tcase \"mails\":\n\t\tcase \"social_links\":\n\t\t{\n\t\t\t// Create the type and key strings\n\t\t\t// TODO: Should be replaced on the server with the approperiate key\n\t\t\tvar type, key;\n\t\t\tif(fieldType == \"phone_number\") {\n\t\t\t\ttype = \"phone\";\n\t\t\t\tkey = \"mobile\";\n\t\t\t}\n\t\t\telse if(fieldType == \"mails\") {\n\t\t\t\ttype = \"email\";\n\t\t\t\tkey = \"work\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttype = \"url\";\n\t\t\t\tkey = \"home\";\n\t\t\t}\n\t\t\t\n\t\t\tif(addOrDelete == 'add') UpdateAddableField(type, key, stringObjects[fieldType]);\n\t\t\telse DeleteAddableField(type, stringObjects[fieldType]);\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcase \"job_title\":\n\t\tcase \"birthday_date\":\n\t\tcase \"company\":\n\t\t// TODO: Adding nickname if needed\n\t\t// TODO: Note if needed\n\t\t{\n\t\t\tvar type;\n\t\t\tif(fieldType == \"job_title\") type = \"jobTitle\";\n\t\t\telse if(fieldType == \"birthday_date\") type = \"birthday\";\n\t\t\telse type = \"company\";\n\t\t\t\n\t\t\tUpdateNonAddableField(type, stringObjects[fieldType]);\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcase \"residence\":\n\t\t\t// TODO: Unimplemented\n\t\t\tbreak;\n\t\t\n\t\tdefault:\n\t\t{\n\t\t\talert(\"ERROR: Field type is not recongnizable.\");\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t/* TODO: It could be done like the first code to remove these if and else statements\n\t\t * but it's better that these names are used to put the updates on the server and when that happens,\n\t\t * there will be no need for these if and else statements\n\t\t */\n\t}\n}", "function updateData(uType, uValue){\n /*Grab Value. Update the needed header, set the values again\n */\n let tempOptions = {};\n storage.get('options', function(items) {\n\n //if the object has been created before\n if (items.options) {\n // textarea.value = items.css;\n // alert(\"Loaded saved options: \");\n //store options object\n tempOptions = items.options;\n\n //update value\n tempOptions.userOptions[uType] = uValue;\n\n //set value\n storage.set({'options': tempOptions}, function() {\n // Notify that we saved.\n // alert(\"Settings saved with updates: \"+uType+\" to \"+uValue);\n });\n }\n\n //if the object has not been created before\n else{\n let anObject =\n {\n userOptions: {\n stackOverflow: true,\n GitHub: true\n }\n }\n\n //update the object\n anObject.userOptions[uType] = uValue;\n\n //set value\n storage.set({'options': anObject}, function() {\n // Notify that we saved.\n // alert(\"Settings saved\");\n });\n }\n });\n}", "function updateOrderType(req, res) {\n if (!validator.isValid(req.body.orderTypeName)) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.FIELD_REQUIRED\n });\n }\n else {\n orderType.findOne({orderTypeName: {$regex: new RegExp('^' + req.body.orderTypeName + '$', \"i\")}, deleted: false, companyId: req.body.companyId}, function(err, orderData) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n }\n else {\n if (orderData) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.ORDER_TYPE_ALREADY_EXIST\n });\n }\n else {\n var sourceData = {\n orderTypeName: req.body.orderTypeName\n\n };\n orderType.findByIdAndUpdate(req.body.typeId, sourceData, function(err, data) {\n\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n } else {\n res.json({code: Constant.SUCCESS_CODE, data: data});\n }\n });\n }\n }\n });\n }\n}", "treetypeUpdate( context, data )\n\t\t{\n\t\t\treturn fetch( `/api/treetypes/${data.id}`, {\n\t\t\t\theaders: {\n\t\t\t\t\t'X-Requested-With': 'XMLHttpRequest',\n\t\t\t\t\t'X-CSRF-token': window.token,\n\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t'Accept': 'application/json',\n\t\t\t\t\t'Authorization': `Bearer ${sessionStorage.getItem('token')}`\n\t\t\t\t},\n\t\t\t\tmethod: 'PUT',\n\t\t\t\tbody: JSON.stringify( data )\n\t\t\t})\n\t\t\t\t.then( response => response.json() )\n\t\t\t\t.then( response => {\n\t\t\t\t\tif( response.errors ) {\n\t\t\t\t\t\tcontext.commit( 'errors', response.errors );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontext.commit( 'errors', []);\n\t\t\t\t\t}\n\t\t\t\t\tcontext.commit( 'message', response.message );\n\t\t\t\t\tcontext.commit( 'success', response.success );\n\t\t\t\t})\n\t\t\t\t.catch( error => console.error( 'treetypeUpdate', error ) );\n\t\t}", "function changeUserType(radioName){\n\tvar selValue = radioCheckedValueGet(radioName);\n\tif (!selValue) return;\t\t\n\n switch (parseInt (selValue, 10)){ \n \t\tcase 1:\t/* Admin */\n\t\t\t\tfieldStateChangeWr ('tf1_xauth tf1_xauth_hidden', '', 'tf1_pptp tf1_pptp_hidden tf1_l2tp tf1_l2tp_hidden tf1_l2tp_hidden tf1_sslvpn tf1_sslvpn_hidden tf1_captivePortal tf1_captivePortal_hidden tf1_openVpn tf1_openVpn_hidden', '');\n \t\tvidualDisplay ('tf1_pptp tf1_l2tp tf1_sslvpn tf1_captivePortal tf1_openVpn','configRow');\t \n \t\tvidualDisplay ('break_pptp break_l2tp break_sslvpn break_captivePortal break_openvpn','break');\n\t\t\t\t\tvidualDisplay ('tf1_xauth tf1_xauth_hidden','hide');\n \t\tvidualDisplay ('break_xauth','hide');\n \t\tenableTextFieldByAnchorClick('tf1_sslvpn','tf1_sslPortalName tf1_sslAuthType tf1_sslNTDOMAINProfile tf1_sslActiveDirectoryProfile tf1_sslLDAPProfile tf1_sslRadiusProfile','break_sslPortalName break_sslAuthType break_sslNTDOMAINProfile break_sslActiveDirectoryProfile break_sslLDAPProfile break_sslRadiusProfile','');\n \t\tchangeAuthType('tf1_sslAuthType');\t\n \t\t\t\tbreak; \n \t\tcase 2:\t/* Network */\n \t\t\tfieldStateChangeWr ('', '', 'tf1_pptp tf1_pptp_hidden tf1_l2tp tf1_l2tp_hidden tf1_xauth tf1_xauth_hidden tf1_sslvpn tf1_sslvpn_hidden tf1_captivePortal tf1_captivePortal_hidden tf1_openVpn tf1_openVpn_hidden', '');\n \t\tvidualDisplay ('tf1_pptp tf1_l2tp tf1_xauth tf1_xauth_hidden tf1_sslvpn tf1_captivePortal tf1_openVpn','configRow');\t \n \t\tvidualDisplay ('break_pptp break_l2tp break_xauth break_sslvpn break_captivePortal break_openvpn','break');\n \t\t\n \t\tenableTextFieldByAnchorClick('tf1_sslvpn','tf1_sslPortalName tf1_sslAuthType tf1_sslNTDOMAINProfile tf1_sslActiveDirectoryProfile tf1_sslLDAPProfile tf1_sslRadiusProfile','break_sslPortalName break_sslAuthType break_sslNTDOMAINProfile break_sslActiveDirectoryProfile break_sslLDAPProfile break_sslRadiusProfile','');\n \t\tchangeAuthType('tf1_sslAuthType');\t\n \t\tbreak; \t\t\n \t\tcase 3:\t/* Front Desk */\n \t\tcase 4:\t/* Guest */\n \t\t\tfieldStateChangeWr ('tf1_pptp tf1_pptp_hidden tf1_l2tp tf1_l2tp_hidden tf1_xauth tf1_xauth_hidden tf1_sslvpn tf1_sslvpn_hidden tf1_openVpn tf1_openVpn_hidden tf1_sslPortalName tf1_sslAuthType tf1_sslNTDOMAINProfile tf1_sslActiveDirectoryProfile tf1_sslLDAPProfile tf1_sslRadiusProfile tf1_captivePortal tf1_captivePortal_hidden', '', '', '');\n \t\tvidualDisplay ('tf1_pptp tf1_l2tp tf1_xauth tf1_xauth_hidden tf1_sslvpn tf1_openVpn tf1_sslPortalName tf1_sslAuthType tf1_sslNTDOMAINProfile tf1_sslActiveDirectoryProfile tf1_sslLDAPProfile tf1_sslRadiusProfile tf1_captivePortal','hide');\t \n \t\tvidualDisplay ('break_pptp break_l2tp break_xauth break_sslvpn break_sslPortalName break_sslAuthType break_sslNTDOMAINProfile break_sslActiveDirectoryProfile break_sslLDAPProfile break_sslRadiusProfile break_captivePortal break_openvpn','hide'); \t\t\n \t\tbreak;\n \t\t\n \t}\n}", "function toggleBookingType(type) {\n\n var saveNeeded = false;\n if ($scope.bookingModel.url && !$scope.viaWebsite) {\n $scope.bookingModel.url = '';\n $scope.editBookingUrl = true;\n saveNeeded = true;\n }\n\n if ($scope.bookingModel.phone && !$scope.viaPhone) {\n $scope.bookingModel.phone = '';\n $scope.editBookingPhone = true;\n saveNeeded = true;\n }\n\n if ($scope.bookingModel.email && !$scope.viaEmail) {\n $scope.bookingModel.email = '';\n $scope.editBookingEmail = true;\n saveNeeded = true;\n }\n\n if (saveNeeded) {\n saveBookingType();\n }\n\n }", "updateUser (context, user) {\n context.commit('updateUser', user)\n }", "async doUserUpdate () {\n\t\tconst now = Date.now();\n\t\tconst op = {\n\t\t\t$set: {\n\t\t\t\tisRegistered: true,\n\t\t\t\tmodifiedAt: now,\n\t\t\t\tregisteredAt: now,\n\t\t\t\t\"preferences.acceptedTOS\": true\n\t\t\t}, \n\t\t\t$unset: {\n\t\t\t\tconfirmationCode: true,\n\t\t\t\tconfirmationAttempts: true,\n\t\t\t\tconfirmationCodeExpiresAt: true,\n\t\t\t\t'accessTokens.conf': true,\n\t\t\t\tinviteCode: true,\n\t\t\t\tneedsAutoReinvites: true,\n\t\t\t\tautoReinviteInfo: true\n\t\t\t}\n\t\t};\n\n\t\tif (this.passwordHash) {\n\t\t\top.$set.passwordHash = this.passwordHash;\n\t\t}\n\n\t\t['email', 'username', 'fullName', 'timeZone'].forEach(attribute => {\n\t\t\tif (this.data[attribute]) {\n\t\t\t\top.$set[attribute] = this.data[attribute];\n\t\t\t}\n\t\t});\n\t\tif (this.data.email) {\n\t\t\top.$set.searchableEmail = this.data.email.toLowerCase();\n\t\t}\n\n\t\tif ((this.user.get('teamIds') || []).length > 0) {\n\t\t\tif (!this.user.get('joinMethod')) {\n\t\t\t\top.$set.joinMethod = 'Added to Team';\t// for tracking\n\t\t\t}\n\t\t\tif (!this.user.get('primaryReferral')) {\n\t\t\t\top.$set.primaryReferral = 'internal';\n\t\t\t}\n\t\t\tif (\n\t\t\t\t!this.user.get('originTeamId') &&\n\t\t\t\tthis.teamCreator && \n\t\t\t\tthis.teamCreator.get('originTeamId')\n\t\t\t) {\n\t\t\t\top.$set.originTeamId = this.teamCreator.get('originTeamId');\n\t\t\t}\n\t\t}\n\n\t\tthis.request.transforms.userUpdate = await new ModelSaver({\n\t\t\trequest: this.request,\n\t\t\tcollection: this.request.data.users,\n\t\t\tid: this.user.id\n\t\t}).save(op);\n\t}", "function putUser(req, res) {\n\tvar user = req.body.username;\n\tvar pass = req.body.password;\n\tvar date = new Date().toISOString().slice(0, 10);\n\tvar last = req.session.uid;\n\tif (req.body.usertype == 'Admin') {\n\t\tvar userType = 1;\n\t} else if (req.body.usertype == 'User') {\n\t\tvar userType = 2;\n\t}\n\n\tbcrypt.hash(pass, saltRounds, function(err, hash) {\n\t\tvar query = {\n\t\t\ttext: 'INSERT INTO users(username, password, user_type, date_entered, last_update) VALUES ($1, $2, $3, $4, $5)',\n\t\t\tvalues: [user, hash, userType, date, last]\n\t\t}\n\n\t\tmodel.pullData(query, (rows) => {\n\t\t\tconsole.log(rows);\n\t\t});\n\t});\n}", "Store(user, callback) {\n\t\tdelete user.type;\n\t\tuser._id = uniqid();\n\t\tsuper.PutUpdate(user, (data) => {\n\t\t\tcallback(data);\n\t\t});\n\t}", "async setTypingStatus(value){\n\n this.currUser.update({ isTyping: value });\n\n }", "onSubmit() {\n if(this.updatingType){\n this.updateType();\n } else {\n this.createType();\n }\n }", "updateType(type) {\n\t\tif (type === \"Meteorites\") this.category = \"meteors\";\n\t\telse if (type === \"Fireballs\") this.category = \"fireballs\";\n\t\telse if (type === \"Future Events\") this.category = \"futureEvents\";\n\t\telse this.category = \"default\";\n\t\tlet selectedData = this.selectionData[this.category]; //this.allData[this.category];\n\t\t\n\t\tlet options = d3.select(\"#columnSelect\")\n\t\t\t.selectAll(\"option\")\n\t\t\t.data(selectedData);\n\t\t\n\t\toptions.exit().remove();\n\t\toptions = options.enter().append(\"option\").merge(options);\n\t\toptions.attr(\"value\", function(d) { return d; })\n\t\t\t.text(function(d) { return d; });\n\t}", "function _saveProfileCompany() {\n if (vm.item.companyId === 0) {\n vm.item.companyId = vm.item.userId;\n vm.item.userId = vm.item.id;\n vm.item.modifiedBy = vm.data.name;\n vm.genericService.postById(\"/api/profile/company/\", vm.item.userId, vm.item)\n .then(_serviceCallSuccess, _serviceCallError);\n } else {\n vm.item.userId = vm.item.id;\n vm.item.modifiedBy = vm.data.name;\n vm.genericService.put(\"/api/profile/company/\", vm.item.userId, vm.item)\n .then(_serviceCallSuccess, _serviceCallError);\n }\n }", "function fillEditUserModal(user, type) {\n $('#edit-user-modal #lastname').val(user[\"Last Name\"]);\n $('#edit-user-modal #firstname').val(user[\"First Name\"]);\n $('#edit-user-modal #phone').val(user[\"Phone\"]);\n $('#edit-user-modal #email').val(user[\"Email\"]);\n $('#edit-user-modal #company-name').val(user[\"Company Name\"]);\n $('#edit-user-modal #country-incorporation').val(user[\"Country of Incorporation\"]);\n $('#edit-user-modal #registration-number').val(user[\"Registration Number\"]);\n $('#edit-user-modal #corporate-address').val(user[\"Corporate Address\"]);\n $('#edit-user-modal #legal-rep').val(user[\"Legal Representative\"]);\n $('#edit-user-modal #setup-fee').val(user[\"Setup Fee\"]);\n $('#edit-user-modal #license-fee').val(user[\"License Fee\"]);\n $('#edit-user-modal #comment').val(user[\"Comment\"]);\n $('#edit-user-modal #userId').val(user[\"id\"]);\n if(type == 'white-label') {\n $('#edit-user-modal #minimum-fee').val(user[\"Minimum Fee\"]);\n $('#edit-user-modal #platform').val(user[\"Platform\"]);\n }\n else if(type == 'franchise') {\n $('#edit-user-modal #platform').val(user[\"Platform\"]);\n $('#minfeegroup').hide();\n }\n else if(type == 'resaler'){\n $('#platformgroup').hide();\n $('#minfeegroup').hide();\n }\n}", "function User_Update_Types_d_attribut_Catégories_2(Compo_Maitre)\n{\n var Table=\"categorie\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var cr_libelle=GetValAt(33);\n if (!ValiderChampsObligatoire(Table,\"cr_libelle\",TAB_GLOBAL_COMPO[33],cr_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"cr_libelle\",TAB_GLOBAL_COMPO[33],cr_libelle))\n \treturn -1;\n var cr_description=GetValAt(34);\n if (!ValiderChampsObligatoire(Table,\"cr_description\",TAB_GLOBAL_COMPO[34],cr_description,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"cr_description\",TAB_GLOBAL_COMPO[34],cr_description))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"cr_libelle=\"+(cr_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(cr_libelle)+\"'\" )+\",cr_description=\"+(cr_description==\"\" ? \"null\" : \"'\"+ValiderChaine(cr_description)+\"'\" )+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "function User_Update_Types_d_attribut_Liste_des_types_d_attribut_de_personne0(Compo_Maitre)\n{\n var Table=\"typeattribut\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ta_nom=GetValAt(30);\n if (!ValiderChampsObligatoire(Table,\"ta_nom\",TAB_GLOBAL_COMPO[30],ta_nom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ta_nom\",TAB_GLOBAL_COMPO[30],ta_nom))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"ta_nom=\"+(ta_nom==\"\" ? \"null\" : \"'\"+ValiderChaine(ta_nom)+\"'\" )+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "function updateUser() {\n if (model.addAdmin) {\n model.user.roles.push(\"ADMIN\");\n }\n if (model.addMember) {\n model.user.roles.push(\"MEMBER\");\n }\n userService\n .updateUser(model.userId, model.user)\n .then(function() {\n model.message = \"User updated successfully.\";\n });\n }", "function updateUser(){\n\tuser.age++;\n\tuser.name = user.name.toUpperCase();\n}", "function updateUser(){\n\tuser.age++;\n\tuser.name = user.name.toUpperCase();\n}", "function User_Update_Types_de_journaux_Liste_des_types_de_journaux0(Compo_Maitre)\n{\n var Table=\"typejournal\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var tj_libelle=GetValAt(201);\n if (!ValiderChampsObligatoire(Table,\"tj_libelle\",TAB_GLOBAL_COMPO[201],tj_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"tj_libelle\",TAB_GLOBAL_COMPO[201],tj_libelle))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"tj_libelle=\"+(tj_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(tj_libelle)+\"'\" )+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "async function createAndModifyLinhVuc(type, dataForm) {\n const { linhVuc } = dataForm;\n const dataRequest = {\n ten_linh_vuc: linhVuc,\n };\n if (type === CONSTANTS.CREATE) {\n const apiResponse = await createLinhVuc(dataRequest);\n if (apiResponse) {\n getDataLinhVuc();\n handleShowModal(false);\n toast(CONSTANTS.SUCCESS, 'Thêm mới lĩnh vực thành công');\n }\n }\n\n if (type === CONSTANTS.UPDATE) {\n dataRequest._id = state.userSelected._id;\n const apiResponse = await updateLinhVuc(dataRequest);\n if (apiResponse) {\n const docs = linhvuc.docs.map(doc => {\n if (doc._id === apiResponse._id) {\n doc = apiResponse;\n }\n return doc;\n });\n setLinhVuc(Object.assign({}, linhvuc, { docs }));\n handleShowModal(false);\n toast(CONSTANTS.SUCCESS, 'Chỉnh sửa thông tin lĩnh vực thành công');\n }\n }\n }", "function resolveUserType(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('userbasicdetails');\n\t\t\t}\n\t\t}", "function resolveUserType(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('userbasicdetails');\n\t\t\t}\n\t\t}", "function addEligibilityType (user) {\n if (!user.name) {\n user.engageType = 'profile'\n } else {\n user.engageType = 'post'\n }\n\n return user\n}", "function handleTypeChange(e){\n //update the selectedType object\n publicAPI.$npcSelectedType = $(this);\n // update the available skills to select based on the new matrix\n //debug string\n console.log(`Type changed to ${publicAPI.$npcSelectedType.val()}`);\n updateAvailableSkillsSelectors();\n }", "function handleUserType(userTypeData){\n console.log(\"from data, admin: \"+userTypeData['usertype']);\n if (userTypeData['usertype'].localeCompare(\"admin\") == 0){\n $(\"#dashBoardButton\").append(\"<a href='admin/_dashboard.html' class='btn btn-primary'>Back to DashBoard</a>\");\n addItem.remove();\n }\n}", "function editType() {\n let currentType = document.getElementById(\"typeEdit\").value\n if (currentType === \"classic\") {\n setType(\"classic\"); \n setTypeText(\"Classical Music\");\n }\n\n else if (currentType === \"popular\") {\n setType(\"popular\"); \n setTypeText(\"Popular Music\")\n }\n\n else if (currentType === \"jazzy/pop\") {\n setType(\"jazzy/pop\"); \n setTypeText(\"Jazzy-Pop music\");\n }\n\n else if (currentType === \"surprise\") {\n setType(\"suprise\"); \n setTypeText(\"A surprise\");\n }\n}", "function GetUserType() {\n\n typeUserSelecte = document.getElementById(\"userType\").value;\n typeUserSelecteUpdate = document.getElementById(\"_userType\").value;\n \n switch (typeUserSelecte) {\n\n case \"1\":\n getSecretary();\n break;\n case \"2\":\n getDoctor();\n break;\n \n }\n\n}", "function pushUserData(accountType){\n\tif (accountType === 'newAccount'){\t\n\t\tcreateUserInformation();\n\t}\n\tif (accountType === 'updateAccount'){\n\t\tupdateUserInformation();\n\t}\n}", "function update_values(type, amount){\n\t\tconvert_to_number();\n\t\tif(type === 'income'){\n\t\t\tdisplayed_total += amount;\n\t\t\tdisplayed_income += amount;\n\t\t} else {\n\t\t\tdisplayed_total -= amount;\n\t\t\tdisplayed_expenses += amount;\t\t\t\n\t\t}\n\n\t\tconvert_to_number();\n\t\tdisplayed_total = displayed_total.toFixed(2);\n\t\tdisplayed_income = displayed_income.toFixed(2);\n\t\tdisplayed_expenses = displayed_expenses.toFixed(2);\n\t}", "function updateUserInfoInEditForm(user) {\n $('#ename').val(user.fullName);\n //$('#eid').val(user.id);\n $('#egender').val(user.gender);\n $('#ebirthyear').val(user.birthYear);\n $('#eemail').val(user.email);\n $('#epassword').val(user.password);\n $('#estreet').val(user.street);\n $('#ecity').val(user.city);\n $('#estate').val(user.state);\n $('#ezip').val(user.zipCode);\n}", "toggleType() {\n this.setState({ type: !this.state.type });\n if (this.state.formtype === \"Volunteer\") {\n this.setState({ formtype: \"Organization\" });\n } else {\n this.setState({ formtype: \"Volunteer\" });\n }\n \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 changeUserType(itm){\r\n\r\n if(itm == 'p') // primary user !\r\n {\r\n var ap_emptype = $(\"#ap_emptype\").val();\r\n var ap_resident = $(\"#ap_resident\").val();\r\n \r\n if(ap_emptype == '1' && ap_resident == '1'){\r\n var theTemplateScript = $(\"#tab1-psindian-template\").html();\r\n }\r\n else if(ap_emptype == '1' && ap_resident == '2'){\r\n var theTemplateScript = $(\"#tab1-psnri-template\").html();\r\n \r\n }\r\n else if(ap_emptype == '2' && ap_resident == '1'){\r\n var theTemplateScript = $(\"#tab1-pspindian-template\").html();\r\n\r\n }\r\n else if(ap_emptype == '2' && ap_resident == '2'){\r\n \r\n var theTemplateScript = $(\"#tab1-pspnri-template\").html();\r\n\r\n }\r\n else if(ap_emptype == '3' && ap_resident == '1'){\r\n\r\n var theTemplateScript = $(\"#tab1-psnpindian-template\").html();\r\n\r\n }\r\n else if(ap_emptype == '3' && ap_resident == '2'){\r\n \r\n var theTemplateScript = $(\"#tab1-psnpnri-template\").html();\r\n \r\n }\r\n\r\n var theTemplate = Handlebars.compile(theTemplateScript);\r\n $('#ppersontype').html(theTemplate());\r\n\r\n\r\n $('.income_amount').each(function(e,v) {\r\n var inc = $(this).val().replace(/,/g, \"\");\r\n inc = (ap_emptype == 1) ? (inc/12) : inc;\r\n if(inc != '') {\r\n if(e == 0) {\r\n $('#ap_grossincome').val(parseInt(inc));\r\n $('#ap_netincome').val(parseInt(inc));\r\n }\r\n }\r\n });\r\n\r\n }\r\n else if(itm == 'c'){\r\n\r\n var ap_emptype = $(\"#cp_emptype\").val();\r\n var ap_resident = $(\"#cp_resident\").val();\r\n \r\n\r\n if(ap_emptype == '1' && ap_resident == '1'){\r\n var theTemplateScript = $(\"#tab1-csindian-template\").html();\r\n }\r\n else if(ap_emptype == '1' && ap_resident == '2'){\r\n var theTemplateScript = $(\"#tab1-csnri-template\").html();\r\n \r\n }\r\n else if(ap_emptype == '2' && ap_resident == '1'){\r\n var theTemplateScript = $(\"#tab1-cspindian-template\").html();\r\n\r\n }\r\n else if(ap_emptype == '2' && ap_resident == '2'){\r\n \r\n var theTemplateScript = $(\"#tab1-cspnri-template\").html();\r\n\r\n }\r\n else if(ap_emptype == '3' && ap_resident == '1'){\r\n\r\n var theTemplateScript = $(\"#tab1-csnpindian-template\").html();\r\n\r\n }\r\n else if(ap_emptype == '3' && ap_resident == '2'){\r\n \r\n var theTemplateScript = $(\"#tab1-csnpnri-template\").html();\r\n \r\n }\r\n\r\n\r\n var theTemplate = Handlebars.compile(theTemplateScript);\r\n $('#cpersontype').html(theTemplate());\r\n\r\n }\r\n\r\n dynamic_bind();\r\n refreshSection();\r\n\r\n }", "function updateUser(user) {\n return {\n type: 'UPDATE_USER',\n user\n }\n}", "function updateMoneyFlow(eachPayment,moneyflow)\n{\n if(moneyflow)\n {\n eachPayment.type = 'credit';\n }\n else\n {\n eachPayment.type = 'debit';\n }\n}", "function updateUser(tableSvc, username, amount) {\n const userEntry = {\n PartitionKey: ENTGEN.String(username),\n RowKey: ENTGEN.String('1'),\n schreefstock: ENTGEN.Int32(amount),\n };\n\n tableSvc.insertOrReplaceEntity(TABLENAME, userEntry, null, (error, result, response) => {\n if (!error) {\n // Entity updated\n } else {\n LOG.error(error);\n }\n });\n}", "function editSaveAcc() {\n const editUserId = accounts.find(update => update.username == (document.getElementById(\"editUsernameTitle\").innerHTML)).username;\n console.log(editUserId);\n \n for (let i = 0; i < accounts.length; i++) {\n if (accounts[i].username == editUserId) {\n console.log(accounts[i]);\n\n accounts[i].name = document.getElementById(\"editFullName\").value;\n console.log(accounts[i].name);\n\n accounts[i].username = document.getElementById(\"editUsername\").value;\n console.log(accounts[i].username);\n\n accounts[i].email = document.getElementById(\"editEmail\").value;\n console.log(accounts[i].email);\n\n accounts[i].suspended = document.getElementById(\"editSuspended\").checked;\n console.log(accounts[i].suspended);\n\n // Update password\n if (document.getElementById(\"editPassword\").value) {\n accounts[i].password = document.getElementById(\"editPassword\").value;\n console.log(\"Password changed to\", document.getElementById(\"editPassword\").value);\n }\n\n // Update userType\n const userTypes = document.getElementsByName(\"editUserType\");\n console.log(userTypes);\n \n for (let j = 0; j < userTypes.length; j++) {\n const userType = userTypes[j];\n if (userType.checked) {\n console.log(\"User type checked:\", userType.value);\n accounts[i].userType = userType.value;\n }\n }\n }\n }\n saveAcc();\n window.location.reload();\n console.log({accounts});\n}", "function setOpenAirVendorFieldsVBIntegration (type)\n{\t \n\tvar recType = nlapiGetRecordType();\n\tvar nlobjContext = nlapiGetContext();\t\n var enableExpenseVBIntegration = nlobjContext.getSetting('SCRIPT', 'custscript_oa_expense_vb_int');\n\n\tif (recType == 'vendor' && enableExpenseVBIntegration == 'T')\n\t{\n\t\tvar multiCurrency = nlobjContext.getFeature('MULTICURRENCY'); \n \tvar mapToParentVendor = nlapiGetFieldValue('custentity_oa_map_to_parent_vendor');\t\n\t\t\n\t\t// if we are exporting vendors as users and using the expense report to vendor bill integration\n\t\t// and this is a multi-currency, set the proper currency to create expense reports in OpenAir\n\t\tif (multiCurrency === true)\n\t\t{\n\t\t\tvar parentVendor = nlapiGetFieldValue('custentity_oa_vendor_parent');\t\n\t\t\tif (parentVendor != null && parentVendor != '' && parentVendor != 'F' && mapToParentVendor == 'T')\n\t\t\t{\n\t\t\t\tvar parentVendorCurrency = nlapiLookupField('vendor', parentVendor, 'currency');\n\t\t\t\tnlapiSetFieldValue('custentity_oa_vendor_user_currency', parentVendorCurrency);\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tvar vendorCurrency = nlapiGetFieldValue('currency');\t\n\t\t\t\tnlapiSetFieldValue('custentity_oa_vendor_user_currency', vendorCurrency);\t\t\t\n\t\t\t}\t\n\t\t}\n\t}\n}", "set type(type) {\n this._type = type;\n }", "setType(type) {\n\t\tthis.type = type;\n\t}", "_update(type, mapper) {\r\n return (props) => this.postCore({\r\n body: jsS(extend(metadata(type), props)),\r\n headers: {\r\n \"X-HTTP-Method\": \"MERGE\",\r\n },\r\n }).then((d) => mapper(d, props));\r\n }", "onUpdateChallengePrizeType (type, index) {\n const { challenge: oldChallenge } = this.state\n const newChallenge = { ...oldChallenge }\n if (oldChallenge.prizes[index].type !== type) {\n newChallenge.prizes[index].type = type\n this.setState({ challenge: newChallenge })\n }\n }", "function api_updateuser(ctx, newuser) {\n newuser.a = 'up';\n res = api_req(newuser, ctx);\n}", "updateUser (callback) {\n\t\tthis.doApiRequest(\n\t\t\t{\n\t\t\t\tmethod: 'put',\n\t\t\t\tpath: '/users/me',\n\t\t\t\tdata: this.data,\n\t\t\t\ttoken: this.token\n\t\t\t},\n\t\t\t(error, response) => {\n\t\t\t\tif (error) { return callback(error); }\n\t\t\t\tObject.assign(this.expectedUser, response.user.$set, this.data, {\n\t\t\t\t\tlastReads: {},\n\t\t\t\t\tpreferences: {\n\t\t\t\t\t\tacceptedTOS: true\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tdelete this.data;\t// don't need this anymore\n\t\t\t\tcallback();\n\t\t\t}\n\t\t);\n\t}", "function personnelChanged(userId,userName)\n{\n\tif(personnelType == 'buyer')\n\t\t{\n\t\t\tbeanGrid.cells(selectedRowId,beanGrid.getColIndexById(\"defaultBuyerName\")).setValue(userName);\n\t\t\tbeanGrid.cells(selectedRowId,beanGrid.getColIndexById(\"defaultBuyerId\")).setValue(userId);\n\t\t}\n\telse\n\t\t{\n\t\t\tbeanGrid.cells(selectedRowId,beanGrid.getColIndexById(\"csrName\")).setValue(userName);\n\t\t\tbeanGrid.cells(selectedRowId,beanGrid.getColIndexById(\"csrPersonnelId\")).setValue(userId);\n\t\t}\n\tparent.closeTransitWin();\n}", "set type(value) {}", "statechangeforaccounttype() {\n if (this.firstForm.controls['fan'].value == true) {\n this.firstForm.controls['model'].setValue(false);\n this.firstForm.controls['signupaffiliate'].setValue(false);\n this.firstForm.controls['dancer'].setValue(false);\n this.firstForm.controls['musicians'].setValue(false);\n }\n if (this.firstForm.controls['musicians'].value == true || this.firstForm.controls['dancer'].value == true || this.firstForm.controls['model'].value == true) {\n this.firstForm.controls['signupaffiliate'].setValue(true);\n this.firstForm.controls['fan'].setValue(false);\n }\n }", "statechangeforaccounttype() {\n if (this.firstForm.controls['fan'].value == true) {\n this.firstForm.controls['model'].setValue(false);\n this.firstForm.controls['signupaffiliate'].setValue(false);\n this.firstForm.controls['dancer'].setValue(false);\n this.firstForm.controls['musicians'].setValue(false);\n }\n if (this.firstForm.controls['musicians'].value == true || this.firstForm.controls['dancer'].value == true || this.firstForm.controls['model'].value == true) {\n this.firstForm.controls['signupaffiliate'].setValue(true);\n this.firstForm.controls['fan'].setValue(false);\n }\n }", "function typeUpdated(e) {\n var index = item.index();\n console.log(index, signals[id]);\n var signal = signals[id][index];\n var typeVal = type_select.val();\n var subtypeVal = subtype_select.val();\n signal.type = typeVal;\n signal.subtype = subtypeVal;\n }", "handleCompanyInfoChange(e) {\n let type = e.target.name;\n\n this.setState({\n metadata: Object.assign(\n {},\n this.state.metadata,\n {\n [type]: e.target.value\n }\n )\n });\n }", "updateBusinessOwnerStatus(id, type) {\n return new Promise((resolve, reject) => {\n logger.info('initialize updateBusinessOwnerStatus() ');\n let timestamp = util.getGMT();\n let sql = sqlConfig.businessOwner.updateBusinessOwnerStatus;\n let sqlQuery = format(sql, type, timestamp, id)\n DbInstance.doUpdate(sqlQuery).then(status => {\n logger.info('success in updateBusinessOwnerStatus() ');\n resolve(status);\n }).catch(err => {\n logger.error('error in updateBusinessOwnerStatus() ');\n reject(err);\n });\n });\n }", "function updateUser(){\n // use save instead of update to trigger 'save' event for password hashing\n\t\nconsole.log('REQUEST IS ', req.body)\n\tif (!user.termsAccepted_v1) user.termsAccepted_v1 = false;\n user.set(req.body);\n user.save(function(err, user){\n \n // Uniqueness and Save Validations\n \n if (err && err.code == 11001){\n var duplicatedAttribute = err.err.split(\"$\")[1].split(\"_\")[0];\n req.flash('error', \"That \" + duplicatedAttribute + \" is already in use.\");\n return res.redirect('/account');\n }\n if(err) return next(err);\n \n // User updated successfully, redirecting\n \n req.flash('success', \"Account updated successfully.\");\n return res.redirect('/account');\n });\n }", "handleTypeChange(e) {\n this.setState({\n newType: e.target.value\n })\n }", "async updateUser(parent, {\n updateUserInput: {\n id,\n name,\n email,\n password\n }\n }, context, info) {\n try {\n const updateUser = await context.prisma.user.update({\n where: {\n id\n },\n data: {\n name,\n email,\n password\n }\n });\n return \"user update sucessfully\";\n } catch (error) {\n return error;\n }\n }", "function updateUI(type) {\n var messageObject = {\n type: CONFIG.UPDATE_UI,\n subtype: type ? type : \"\",\n value: type ? dynamicData[type] : dynamicData\n };\n if (DEBUG) {\n print(\"Update UI\", type);\n }\n ui.sendToHtml(messageObject);\n }", "_handleSave () {\n let password = this.state.userData[1].value;\n let name = this.state.userData[2].value;\n let email = this.state.userData[3].value;\n let homeCurrency = this.state.userData[4].value;\n let userData = {\n userName: this.state.userData[0].value,\n password: password !== this.state.originalUserData[1].value ? password : null,\n name: name !== this.state.originalUserData[2].value ? name : null,\n email: email !== this.state.originalUserData[3].value ? email : null,\n homeCurrency: homeCurrency !== this.state.originalUserData[4].value ? homeCurrency : null,\n };\n this.props.dispatch(putUser(userData));\n }", "function setVendorFieldsClient(type, name)\n{\n\tvar recType = nlapiGetRecordType();\t\n\tvar nlobjContext = nlapiGetContext();\t\n\tvar enableExpenseVBIntegration = nlobjContext.getSetting('SCRIPT', 'custscript_oa_expense_vb_int');\n var enablePOIntegration = nlobjContext.getSetting('SCRIPT', 'custscript_oa_po_integration');\n\tvar enableVBtoOAPOIntegration = nlobjContext.getSetting('SCRIPT', 'custscript_oa_vb_oa_po_export');\n\t\n\tif (recType == 'vendor')\n\t{\n\t\t// hiding, unhiding fields\n\t\tif (nlapiGetFieldValue('custentity_oa_export_to_openair') == 'T' && enableExpenseVBIntegration == 'T')\n\t\t{\n\t\t\tnlapiDisableField('custentity_oa_vendor_user_currency', false);\n\t\t\tnlapiDisableField('custentity_oa_map_to_parent_vendor', false);\n\t\t\tnlapiDisableField('custentity_oa_expense_to_vendorbill', false);\n\t\t\tnlapiDisableField('custentity_oa_vendor_tax_nexus', false);\n\t\t\tnlapiDisableField('custentity_oa_vendor_parent', false);\t\n\t\t\t\n\t\t\tif (enablePOIntegration == 'T' || enableVBtoOAPOIntegration == 'T')\n\t\t\t{\n\t\t\t\tnlapiDisableField('custentity_oa_user_or_vendor', false);\t\t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t// give an alert if added parent vendor\n\t\t\tif (name == 'custentity_oa_vendor_parent' && nlapiGetFieldValue('custentity_oa_vendor_parent') > 0)\n\t\t\t{\n\t\t\t\talert(\"If vendor bills should be created for this parent vendor from OpenAir expense reports, please check the 'Map to Parent Vendor' box.\");\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t// give an alert to pick vendor or user if necessary \n\t\t\tif (name == 'custentity_oa_export_to_openair' && (enablePOIntegration == 'T' || enableVBtoOAPOIntegration == 'T') && nlapiGetFieldValue('custentity_oa_user_or_vendor') < 1)\n\t\t\t{\n\t\t\t\talert(\"Be sure to indicate whether this NetSuite vendor should be created as an OpenAir user or vendor.\");\n\t\t\t}\n\t\t\t\n\t\t\t// give an alert to pick parent vendor\n\t\t\tif (name == 'custentity_oa_map_to_parent_vendor' && nlapiGetFieldValue('custentity_oa_map_to_parent_vendor') == 'T' && nlapiGetFieldValue('custentity_oa_vendor_parent') < 1)\n\t\t\t{\n\t\t\t\talert(\"Be sure to indicate the parent vendor for this vendor.\");\n\t\t\t}\t\t\t\n\t\t\t\n\t\t}\n\t\telse \n\t\t{\n\t\t\tnlapiSetFieldValue('custentity_oa_vendor_user_currency', '', false, true);\n\t\t\tnlapiSetFieldValue('custentity_oa_map_to_parent_vendor', 'F', false, true);\n\t\t\tnlapiSetFieldValue('custentity_oa_expense_to_vendorbill', 'F', false, true);\t\t\t\n\t\t\tnlapiSetFieldValue('custentity_oa_vendor_tax_nexus', '', false, true);\n\t\t\tnlapiSetFieldValue('custentity_oa_vendor_parent', '', false, true);\n\t\t\tnlapiSetFieldValue('custentity_oa_user_or_vendor', '', false, true);\n\t\t\t\n\t\t\tnlapiDisableField('custentity_oa_vendor_user_currency', true);\n\t\t\tnlapiDisableField('custentity_oa_map_to_parent_vendor', true);\n\t\t\tnlapiDisableField('custentity_oa_expense_to_vendorbill', true);\n\t\t\tnlapiDisableField('custentity_oa_vendor_tax_nexus', true);\n\t\t\tnlapiDisableField('custentity_oa_vendor_parent', true);\t\t\t\n\t\t\tnlapiDisableField('custentity_oa_user_or_vendor', true);\t\n\t\t}\n\t}\n}", "function onAddContributorTypeChange() {\n const type = $(this).attr(\"data-contributor-type\");\n const isHydroShareUser = type === \"hs-user\";\n\n // Toggle form visibility\n $(\"#add-contributor-dialog div[data-contributor-type]\").hide();\n $(\"#add-contributor-dialog div[data-contributor-type='\" + type + \"']\").show();\n\n let buttons = $(\"#add-contributor-dialog .author-types .btn\");\n buttons.each(function() {\n const isActive = $(this).attr(\"data-contributor-type\") === type;\n $(this).toggleClass(\"btn-primary\", isActive);\n $(this).toggleClass(\"btn-default\", !isActive);\n });\n }", "function updateUser() {\r\n let email = $('#update-email').val();\r\n let fullname = $('#update-fullname').val();\r\n let role = $('#update-role').val();\r\n let cbRead;\r\n let cbCreate;\r\n let cbUpdate;\r\n let cbDelete;\r\n let cbUser;\r\n let cbBlog;\r\n let cbCommerce;\r\n let cbConsult;\r\n let cbSupply;\r\n let cbReport;\r\n\r\n if($('.cb2 #cb-read').is(':checked')) \r\n cbRead = 1;\r\n else\r\n cbRead = 0;\r\n if($('.cb2 #cb-create').is(':checked')) \r\n cbCreate = 1;\r\n else\r\n cbCreate = 0;\r\n if($('.cb2 #cb-update').is(':checked')) \r\n cbUpdate = 1;\r\n else\r\n cbUpdate = 0;\r\n if($('.cb2 #cb-delete').is(':checked')) \r\n cbDelete = 1;\r\n else\r\n cbDelete = 0;\r\n if($('.cb2 #cb-user').is(':checked')) \r\n cbUser = 1;\r\n else\r\n cbUser = 0;\r\n if($('.cb2 #cb-blog').is(':checked')) \r\n cbBlog = 1;\r\n else\r\n cbBlog = 0;\r\n if($('.cb2 #cb-commerce').is(':checked')) \r\n cbCommerce = 1;\r\n else\r\n cbCommerce = 0;\r\n if($('.cb2 #cb-consult').is(':checked')) \r\n cbConsult = 1;\r\n else\r\n cbConsult = 0;\r\n if($('.cb2 #cb-supply').is(':checked')) \r\n cbSupply = 1;\r\n else\r\n cbSupply = 0;\r\n if($('.cb2 #cb-report').is(':checked')) \r\n cbReport = 1;\r\n else\r\n cbReport = 0;\r\n\r\n let authority = {\r\n user: {\r\n read: cbRead,\r\n create: cbCreate,\r\n update: cbUpdate,\r\n delete: cbDelete\r\n },\r\n api: {\r\n user: cbUser,\r\n blog: cbBlog, \r\n commerce: cbCommerce, \r\n consult: cbConsult, \r\n supply: cbSupply, \r\n report: cbReport \r\n }\r\n }\r\n\r\n if(email == null || fullname == null || role == null) {\r\n alert(\"Form cannot be empty\");\r\n }\r\n else {\r\n $.get(address + ':3000/update-user', {email: email, fullname: fullname, role: role, authority: authority}, function(data) {\r\n if(data.ok == 1) {\r\n let userEmail = email;\r\n let query = `mutation updateSingleUser($userEmail:String!, $input:PersonInput) {\r\n updateUser(email: $userEmail, input: $input) {\r\n fullname\r\n }\r\n }`;\r\n\r\n fetch(address + ':3000/graphql', {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Accept': 'application/json',\r\n },\r\n body: JSON.stringify({\r\n query,\r\n variables: {\r\n userEmail,\r\n input: {\r\n email,\r\n fullname,\r\n role,\r\n authority\r\n }\r\n }\r\n })\r\n }).then(r => r.json()).then(function(data) {\r\n console.log(data);\r\n });\r\n alert(\"Update Success\");\r\n window.location.replace(address + \":3001/dashboard.html\");\r\n }\r\n else {\r\n alert(\"Update Error\");\r\n }\r\n });\r\n }\r\n}", "setType(type) { }", "function updateUser(id, userName, email, password,userType) {\n id = idEl.value;\n userName = nameEl.value;\n password = passwordEl.value;\n email = emailEl.value;\n userType = userTypeEl.value;\n if (id && userName && email && password && userType) {\n var updateQuery = `update users set name = '${userName}', password=${password}, email=${email}, type ='${userType}' where id = ${id}`;\n db.transaction(function (tx) {\n tx.executeSql(updateQuery, [], function (transaction, result) {\n }, function (transaction, error) {\n console.log(error);\n });\n }, transError, showSuccess());\n }\n else{\n alert(\"Please Fill All Records!!\");\n }\n}", "typingNow(userId, typingNow = false) {\n Meteor.users.update(userId, { $set: { typingNow } });\n }", "_changeType(to) {\n removeType(this, this.type);\n addType(this, to);\n }", "viewEditModel(data, type) {\n if (type != \"checkbox\") {\n if (data) {\n this.setState({\n showEditModal: true, itemEdit: data,\n selectedExpensesTypeItemEdit: { label: data.expenseTypeName, value: data.expenseTypeId }\n });\n }\n }\n }", "async function update(data) {\n console.debug(\"Update\");\n const user = await JoblyApi.updateUserInfo(currentUser.username, data);\n setCurrentUser(user);\n }", "updateUser(h, p){\n\t\tlet oldInfo = this.props.user;\n\t\tlet updatedInfo = { happiness: oldInfo.happiness + h,\n\t\t pollution: oldInfo.pollution + p};\n\t\tlet userUrl = `/api${this.props.match.url}`;\n\t\tthis.props.actions.updateUser(userUrl, updatedInfo);\n\t}", "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", "SET_TYPE(state, type) {\n state.type = type\n }", "function updateUser(e){\n var user = updateForm.getValueForm();\n user[\"id\"] = userId;\n var val = updateForm.form.find('#myForm').valid();\n if(val){\n e.preventDefault();\n collectionOfUser.update(\n user,\n function(newUser){\n $('tr[data-id='+userId +']').html('').html(logic.template(templates.tColumOfTable, newUser))\n $('tr[data-id='+userId +']').on('click', select);\n updateForm.hide();\n },\n error\n ); \n }\n }" ]
[ "0.8273181", "0.6726988", "0.66048133", "0.65727586", "0.6209959", "0.6169125", "0.60411185", "0.5779423", "0.57591254", "0.56994724", "0.5686445", "0.5627551", "0.5609914", "0.5605066", "0.55989826", "0.55763876", "0.5547815", "0.5544743", "0.55432266", "0.551386", "0.5490869", "0.548787", "0.548097", "0.5479709", "0.54713184", "0.5463851", "0.5404091", "0.5398936", "0.53833", "0.5371777", "0.53706783", "0.53527415", "0.53525347", "0.533485", "0.53316134", "0.5319213", "0.53141576", "0.53097767", "0.53092664", "0.5271197", "0.5269386", "0.52515453", "0.5251142", "0.5236749", "0.52356297", "0.5233482", "0.5232161", "0.52189463", "0.52189463", "0.51974225", "0.5195866", "0.51798123", "0.51798123", "0.5174903", "0.5153755", "0.51491266", "0.51364285", "0.5130686", "0.5123829", "0.51219183", "0.511765", "0.5073518", "0.5063617", "0.50602144", "0.5056611", "0.50523746", "0.50492793", "0.5047565", "0.50451857", "0.5043519", "0.50417715", "0.50173897", "0.50115645", "0.49882576", "0.49820694", "0.4977927", "0.49721", "0.4971046", "0.4971046", "0.49646762", "0.4951911", "0.49501", "0.493961", "0.4926315", "0.4905128", "0.49044332", "0.49019217", "0.4900516", "0.4899984", "0.48860005", "0.48846963", "0.48818028", "0.48796198", "0.48774332", "0.48768497", "0.48617935", "0.48589122", "0.48581147", "0.4839133", "0.48367706" ]
0.6883742
1
when the mode changes (players turn to pick card or vote ), notify the card so it can transition to the new mode
ngOnChanges(changes) { if (this.currMode !== undefined && changes.currMode) { console.log(`new mode: ${this.currMode}`); this.transitionToNewMode(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "transitionToNewMode() {\n console.log('transition');\n if (this.card != null) {\n switch (this.currMode) {\n case _entity_data_structures_card_modes__WEBPACK_IMPORTED_MODULE_1__[\"cardMode\"].voting: {\n this.cardText.nativeElement.textContent = \"\";\n this.transitionCardToFace(\"front\");\n if (this.votingPhraseText == null) {\n this.cardText.nativeElement.textContent = \"vote above !\";\n }\n else {\n this.cardText.nativeElement.textContent = this.votingPhraseText;\n }\n break;\n }\n case _entity_data_structures_card_modes__WEBPACK_IMPORTED_MODULE_1__[\"cardMode\"].waiting: {\n this.cardText.nativeElement.textContent = \"\";\n this.transitionCardToFace(\"front\");\n this.cardText.nativeElement.textContent = \"waiting ...\";\n break;\n }\n case _entity_data_structures_card_modes__WEBPACK_IMPORTED_MODULE_1__[\"cardMode\"].myTurn: {\n this.cardText.nativeElement.textContent = \"\";\n this.transitionCardToFace(\"back\");\n this.cardText.nativeElement.textContent = this.cardData.card_text;\n break;\n }\n }\n this.disableCardChooseButton();\n }\n }", "changeGameMode(mode) {\n DATA.difficultyMode = mode;\n VIEW.displayDifficulty();\n }", "function modeChanged(fn) {\n bind('modeChanged', fn);\n }", "updateGameMode(mode) {\n this.pente.maxTime = this.interface.penteOptions.maxTime;\n let op = this.getOptionsString();\n let init = this.pente.init(mode, op);\n if(init) init.then(() => {\n this.updateMessage();\n this.board.reset();\n this.board.updateBoard(this.pente.board);\n if(mode == 4) this.botvbot();\n })\n }", "handleModeChange() {\n const {controller, mode} = this.props;\n let nextMode = SONG_PLAY_MODE_REPEAT;\n\n switch (mode) {\n case SONG_PLAY_MODE_REPEAT:\n nextMode = SONG_PLAY_MODE_LOOP;\n break;\n case SONG_PLAY_MODE_LOOP:\n nextMode = SONG_PLAY_MODE_SHUFFLE;\n break;\n case SONG_PLAY_MODE_SHUFFLE:\n break;\n }\n // change mode\n controller\n .mode(nextMode)\n .updatePlayList();\n }", "switchMode(newMode: Mode) {\n this.mode = newMode;\n }", "function gameMode(mode) {\n gameType = mode;\n activePlayerIndex = 0;\n toggle($('[data-menu]'), 'is-open');\n clearScore();\n clearBoard();\n}", "function toggleMode(){\n if(mode == 3){\n mode = 2;\n console.log(\"RC mode : 2\");\n }else{\n mode = 3;\n console.log(\"RC mode : 3\");\n }\n }", "function changeMode(e){\n PUZZLE_DIFFICULTY = e.value;\n onImage();\n}", "function switchMode(mode) {\n\tvar modeData = modes[mode];\n\tif (!modeData) {\n\t\tconsole.log(\"No mode found for \" + mode);\n\t} else {\n\t\tui.mode = modeData;\n\t\tconsole.log(\"Start: \" + modeData.title);\n\n\t\t// Set the title and clear the UI\n\t\t$(\"#left-col > .section-header > .section-title\").html(modeData.title);\n\t\t$(\"#main-entities\").html(\"\");\n\t\t$(\"#side-entities\").html(\"\");\n\n\t\t// Custom behavior\n\t\tmodeData.onStart();\n\n\t\t// Record as the last mode\n\t\tlocalStorage.setItem(\"lastMode\", mode);\n\n\t}\n}", "changeMode() {\n this.attendBooths = !this.attendBooths;\n }", "swapMode(event) {\r\n if (this.state == STATES.play) {\r\n this.mode = (this.mode == MODES.flag) ? MODES.dig : MODES.flag;\r\n event.target.value = this.mode;\r\n }\r\n }", "function changeMode() {\n\n\tlet visibleContent = $('#switchMode').find('.visible').first()\n\tlet hiddenContentIcon = $('#switchMode').find('.hidden').first().find('.icon').first()\n\n\tif (visibleContent.html().includes('VIDEO')) {\n\t\tvisibleContent.html('SWITCH TO IMAGE MODE')\n\t} else {\n\t\tvisibleContent.html('SWITCH TO VIDEO MODE')\n\t}\n\n\thiddenContentIcon.toggleClass('image')\n\thiddenContentIcon.toggleClass('video')\n}", "changeCard(card) {\n console.log(\"Changing card to \\\"\" + card.question + \"\\\"\");\n Dispatcher.handleViewAction({\n type: Constants.ActionTypes.CARD_CHANGED,\n card: card\n });\n }", "function modeSwitch(mode) {\n\tresetViews();\n resetCameras();\n\tswitch(mode) {\n\t\tcase \"absolute\":\n\t\t\tupdateShipData(true);\n\t\t\tstepSize = 1; // reset step size\n\t\t\tcurrentMode = 1;\n\t\tbreak;\n\t\tcase \"relative\":\n\t\t\tupdateShipData(false);\n\t\t\tstepSize = Math.PI/64; // reset step size\n\t\t\tcurrentMode = 2;\n\t\tbreak;\n\t\tcase \"geosynchronous\":\n\t\t\tupdateShipData(false);\n\t\t\tcurrentPlanet = 3;\n\t\t\tcurrentMode = 3;\n\t\t\tupdateGeoSyncLookAt(earth, false);\n\t\tbreak;\n\t}\n}", "changeMode(mode) {\n\t\treturn this.call('set_mode', [ mode ], {\n\t\t\trefresh: [ 'power', 'mode' ],\n\t\t\trefreshDelay: 200\n\t\t})\n\t\t\t.then(MiioApi.checkOk)\n\t\t\t.catch(err => {\n\t\t\t\tthrow err.code === -5001 ? new Error('Mode `' + mode + '` not supported') : err;\n\t\t\t});\n\t}", "function onModeChange(inst, ui)\n{\n // Update group configs based on mode selected\n networkScript.setBeaconSuperFrameOrders(inst, ui);\n oadScript.setDefaultOadBlockReqRate(inst);\n oadScript.setDefaultOadBlockReqPollDelay(inst);\n\n // Set visibility of network group dependents\n networkScript.setNetworkConfigHiddenState(inst, ui, \"channels\");\n networkScript.setNetworkConfigHiddenState(inst, ui, \"fhChannels\");\n networkScript.setNetworkConfigHiddenState(inst, ui, \"fhAsyncChannels\");\n networkScript.setNetworkConfigHiddenState(inst, ui, \"fhNetname\");\n networkScript.setNetworkConfigHiddenState(inst, ui, \"fhBroadcastDwellTime\");\n networkScript.setNetworkConfigHiddenState(inst, ui, \"fhBroadcastInterval\");\n\n // Polling interval not used in beacon mode\n networkScript.setNetworkConfigHiddenState(inst, ui, \"pollingInterval\");\n}", "handleChangeMode() {\n this.props.setMode(\"Board\");\n }", "function setGameMode(mode) {\n gameMode = mode;\n decks.player2.name = (mode === 'ai')? 'Mr. AI' : 'Player 2';\n updatePlayerStatuses();\n}", "changeMode(mode, current = false) {\n\t\t\tthis.setState(prev => {\n\t\t\t\tprev.mode = mode;\n\t\t\t\tprev.current = current;\n\t\t\t\treturn prev;\n\t\t\t})\n\t\t\tthis.seeResult = this.seeResult.bind(this)\n\t\t}", "function continueModeChange() {\n var mode = targetMode[0].id.split('-')[1];\n robopaint.switchMode(mode); // Actually switch to the mode\n}", "function handleModeChange(mode) {\r\n if (mode == \"pen\") {\r\n if (penclasses.contains(\"active\")) {\r\n // make options visible\r\n penOptions.classList.add(\"show\");\r\n } else {\r\n ctx.strokeStyle = \"blue\";\r\n ctx.lineWidth = 5;\r\n mytool = \"pen\";\r\n ctx.globalCompositeOperation = \"source-over\";\r\n\r\n activetool.classList.remove(\"active\");\r\n activeoption.classList.remove(\"show\");\r\n pen.classList.add(\"active\");\r\n activetool = pen;\r\n activeoption = penOptions;\r\n }\r\n } else if (mode == \"eraser\") {\r\n if (eraserclasses.contains(\"active\")) {\r\n // make options available\r\n eraserOptions.classList.add(\"show\");\r\n } else {\r\n ctx.strokeStyle = \"white\";\r\n ctx.lineWidth = 5;\r\n ctx.globalCompositeOperation = \"destination-out\";\r\n mytool = \"eraser\";\r\n activetool.classList.remove(\"active\");\r\n activeoption.classList.remove(\"show\");\r\n\r\n eraser.classList.add(\"active\");\r\n \r\n activetool = eraser;\r\n activeoption = eraserOptions;\r\n }\r\n }\r\n}", "function Card1click(){\n console.log(\"card 1 clickt\");\n if(currentplayer)\n setcardstate(0, 0, 1);\n else\n setcardstate(0, 0, 2);\n}", "playerSwitchComplete(){\n this.switchPlayer();\n }", "function setMode(e) {\n console.log(`current mode was: ${currentMode}`);\n currentMode = e.target.getAttribute('id');\n console.log(`current mode is now: ${currentMode}`);\n}", "function handlePlayerChange() {\n currentPlayer = currentPlayer === \"X\" ? \"O\" : \"X\";\n //updating interface\n statusDisplay.innerHTML = currentPlayerTurn();\n}", "function updateMode(mode) {\n\n // LOOP THROUGH MODES ARRAY AND SELECT/DESELECT AS NEEDED\n for (var i = 0; i < modes.length; i++) {\n // DOM ELEMENT FOR EACH MODE DISPLAY\n var d = document.getElementById(modes[i] + '-display');\n // DOM ELEMENT FOR EACH MODE BUTTON\n var l = document.getElementById(modes[i]);\n\n // LOOP THROUGH MODES TO FIND WHAT WAS SELECTED\n if (mode === modes[i]) {\n // FOR THE SELECTED MODE\n // TOGGLE CORRESPONDING DISPLAY TO DISPLAY\n d.classList.add('active-display');\n // ADD SELECTED CLASS\n l.classList.add('btn-selected');\n // UPDATE ARIA PRESSED STATE\n l.setAttribute('aria-pressed', 'true');\n // SET AS ACTIVE\n activeMode = modes[i];\n } else {\n // FOR THE UNSELECTED MODES\n // HIDE THEIR DISPLAY\n d.classList.remove('active-display');\n // REMOVE SELECTED CLASS\n l.classList.remove('btn-selected');\n // UPDATE ARIA PRESSED STATE\n l.setAttribute('aria-pressed', 'false');\n }\n }\n}", "function setChoosingStateOn() {\n\t\tplayerIsChoosing = true;\n\t}", "function agisEnFonctionDuMode() {\n console.log(\"agisEnFonctionDuMode\");\n\n\n switch (mode_actuel) {\n case \"Commun\":\n modeCommun();\n break;\n case 'Conseil des gorgées':\n modeConseilGorgees();\n break;\n case 'Dilemme':\n modeDilemme();\n break;\n case 'Pour combien':\n modePourCombien();\n break;\n case 'A determiner':\n $(\"#body\").hide();\n $(\"#spinner\").show();\n choisisUnMode();\n break;\n }\n}", "function playercardturn(player){\n //show cards\n //ask to select cards to play\n //push them into action slot\n }", "function onDealCardsClicked(){\n\t\tif(poker._bet > 0){\n\t\t\t$(\"#commandbutton_2\").off(\"click\").addClass(\"disabled\");\n\t\t\t$(\"#commandbutton_3\").off(\"click\").addClass(\"disabled\");\n\t\t\t$(\"#commandbutton_4\").off(\"click\").addClass(\"disabled\");\n\t\t\tcardsFliped = false;\n\t\t\tswitch (draw){\n\t\t\t\tcase 0:\n\t\t\t\t\t\n\t\t\t\t\tpoker.cards.shuffle();\n\t\t\t\t\tresetHeld();\n\t\t\t\t\tfirstCard = poker.cards.dealCard();\n\t\t\t\t\tsecondCard = poker.cards.dealCard();\n\t\t\t\t\tthirdCard = poker.cards.dealCard();\n\t\t\t\t\tfourthCard = poker.cards.dealCard();\n\t\t\t\t\tfifthCard = poker.cards.dealCard();\n\t\t\t\t\tdraw++;\n\t\t\t\t\tWinner.html(\"Draw \" + draw);\n\t\t\t\t\tbreak;\n\t\t\t\t/*case 1:\n\t\t\t\t\tif(!_firstCardHold)\n\t\t\t\t\t\tfirstCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_secondCardHold)\n\t\t\t\t\t\tsecondCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_thirdCardHold)\n\t\t\t\t\t\tthirdCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_fourthCardHold)\n\t\t\t\t\t\tfourthCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_fifthCardHold)\n\t\t\t\t\t\tfifthCard = poker.cards.dealCard();\n\t\t\t\t\tdraw++;\n\t\t\t\t\tWinner.html(\"Draw \" + draw);\n\t\t\t\t\tbreak;*/\n\t\t\t\tcase 1:\n\t\t\t\t\tcardsFliped = false;\n\t\t\t\t\tif(!_firstCardHold)\n\t\t\t\t\t\tfirstCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_secondCardHold)\n\t\t\t\t\t\tsecondCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_thirdCardHold)\n\t\t\t\t\t\tthirdCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_fourthCardHold)\n\t\t\t\t\t\tfourthCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_fifthCardHold)\n\t\t\t\t\t\tfifthCard = poker.cards.dealCard();\n\t\t\t\t\tdraw = 0;\n\t\t\t\t\tresetHeld();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\trefresh();\n\t\t}else{\n\t\t\talert(\"no bet\");\n\t\t}\n\t}", "function changeMode(response, intent){\n var desired = intent['slots']['LightMode']['value'];\n var value = 0;\n switch(desired){\n case 'combination':\n value = 0;\n break;\n case 'steady on':\n value = 1;\n break;\n case 'in wave':\n value = 2;\n break;\n case 'twin light chasing':\n value = 3;\n break;\n case 'twinkle flashing':\n value = 4;\n break;\n case 'slow glow':\n value = 5;\n break;\n case 'stepping on':\n value = 6;\n break;\n case 'slow fade':\n value = 7;\n break;\n case 'next':\n value = increaseMode();\n break;\n case 'last':\n value = decreaseMode();\n break;\n case '0': case '1': case '2': case '3':\n case '4': case '5': case '6': case '7':\n value = desired;\n break;\n default:\n console.log(\"Unhandled Mode Request: \" + desired);\n break;\n }\n\n updateIotShadow({\"power\": 1, \"mode\": value}, function(){successfulChange(response)});\n\n}", "function roboxAppSwitch(mode)\n{\n challengeOff();\n testingOff();\n drivingOff();\n battleOff();\n \n roboxTitle(mode);\n\n switch(mode) {\n case 'challenge':\tchallengeOn(); break;\n case 'testing':\ttestingOn(); break;\n case 'driving': drivingOn(); battleOn(); break;\n case 'competition':\tdrivingOn(); battleOn(); break;\n }\n\n roboxSelector(mode);\n}", "changeAppMode(newMode, memberId, memberName){\n //console.log('Change mode => ' + newMode + ' => ' + memberId + ' => ' + memberName);\n\n this.setState({currentMode: newMode});\n if(memberId !== undefined){\n this.setState({memberId: memberId});\n }\n\n if(memberName !== undefined){\n this.setState({memberName: memberName});\n }\n \n //this.onRender();\n }", "function setupModeButtons() {\n\t$(\".mode\").on(\"click\", function() {\n\t\t$(\".mode\").each(function() { \n\t\t\t$(this).removeClass(\"selected\");\t\t\t\n\t\t});\t\n\t\t$(this).addClass(\"selected\");\n\t\tif($(this).text() === \"Easy\") {\n\t\t\tsetUpGame($(this).text(), whatTypeIsSelected());\n\t\t}else if($(this).text() === \"Medium\") {\n\t\t\tsetUpGame($(this).text(), whatTypeIsSelected());\n\t\t}else {\n\t\t\tsetUpGame($(this).text(), whatTypeIsSelected());\n\t\t}\n\t});\t\n}", "function onEnableCards(e) {\n\t\tuserInterface.enableRestartBtn();\n\n\t\tcards.forEach(card => {\n\t\t\tcard.enableMe();\n\t\t});\n\n\t\t// If game is resetting or over reset the card positions and run start game\n\t\tif (currentState == gameState.resetting || currentState == gameState.over) {\n\t\t\tcardCount++;\n\n\t\t\tif (cardCount == 17) {\n\t\t\t\tcardCount = 1;\n\t\t\t\tresetCardPositions();\n\t\t\t\tonStartGame(e);\n\t\t\t}\n\t\t}\n\t}", "changeAppMode(newMode, CveM){\n this.setState({\n currentMode: newMode,\n CveM: CveM\n });\n\n }", "onSwitch() {}", "onSwitch() {}", "onSwitch() {}", "function changeMode(e){\n //removes the selected class from the current mode to the new selected mode\n document.getElementById(modeType).className = \" \"; \n modeType = e.target.id;\n document.getElementById(modeType).className = \"selected\";\n }", "get modeChanged() {\n return this._modeChanged;\n }", "function UpdateOptionCardInfo(){ //Send info of the options of Event card to Option Card Controller\r\n \r\n if (Important.ImmidiateDrawCardNumber != 0){ //To Override the queue and immidiately draw certain cards (eg. Desolation)\r\n Scripts.OptionClickControlScript.UpdateCards(\r\n AllEventCardsInGame[0].Miscellaneous[Important.ImmidiateDrawCardNumber-1].CardIdentifier[0],\r\n AllEventCardsInGame[0].Miscellaneous[Important.ImmidiateDrawCardNumber-1].CardIdentifier[1]);\r\n\r\n return;\r\n }\r\n\r\n Scripts.OptionClickControlScript.UpdateCards(\r\n Important.CardToUse[EventCardPlayed-1].CardIdentifier[0],\r\n Important.CardToUse[EventCardPlayed-1].CardIdentifier[1]);\r\n}", "set(mode) {\n this.oldMode = this.mode;\n this.mode = mode;\n this.updateUITools();\n }", "function setMode(newMode, force) {\n\n let oldMode = storedGameState.mode;\n\n if ((newMode === storedGameState.mode) && !force) {\n return;\n }\n\n if ((newMode !== MODE_REVEAL) || (force === true)) {\n changeMode(oldMode, newMode);\n } else {\n if (confirm('Are you sure? Revealing the map somewhat spoils the game.')) {\n changeMode(oldMode, newMode);\n }\n }\n}", "function LtnObserveDisplayDeckChange(event) {\n var deck = event.target;\n\n // Bug 309505: The 'select' event also fires when we change the selected\n // panel of calendar-view-box. Workaround with this check.\n if (deck.id != \"displayDeck\") {\n return;\n }\n\n var id = null;\n try { id = deck.selectedPanel.id } catch (e) { }\n\n // Switch back to mail mode in case we find that this\n // notification has been fired but we're still in calendar or task mode.\n // Specifically, switch back if we're *not* in mail mode but the notification\n // did *not* come from either the \"calendar-view-box\" or the \"calendar-task-box\".\n if (gCurrentMode != 'mail') {\n if (id != \"calendar-view-box\" && id != \"calendar-task-box\") {\n ltnSwitch2Mail();\n }\n }\n}", "setMode(mode) {\n this._mode = mode;\n }", "function updateContent(mode) {\n //update screen\n if(mode === 'focus_mode') {\n screenImg.addClass('hidden') ;\n largeTimer.removeClass('hidden');\n }else{\n screenImg.removeClass('hidden') ;\n largeTimer.addClass('hidden');\n\n screenImg.attr('src', screen_path + mode + \".png\");\n }\n\n //update others\n camera.prop('disabled', false);\n mic.prop('disabled', false);\n\n if(mode !== 'interactive_mode') {\n mic.prop('disabled', true);\n\n //enable quite mode warning\n quiteModeWarning.addClass('show');\n }else {\n dismissQuiteModeWarning();\n }\n\n if(mode === 'pressure_mode'){\n camera.prop('disabled', true);\n\n //update video pic to screens\n isVideoScreen = true;\n updateCameraImg();\n } else if(isVideoScreen) {\n isVideoScreen = false;\n updateCameraImg();\n }\n}", "function uiState(mode) {\r\n\tif (mode == 0) {\r\n\t\tdocument.getElementById(\"messageDisplay\").innerHTML = \"Message for encryption:\"\r\n\t\tdocument.getElementById(\"keyDisplay\").innerHTML = \"Key for encryption:\"\r\n\t\tdocument.getElementById(\"cryptonyte\").innerHTML = \"Encrypt\"\r\n\t\tdocument.getElementById(\"output\").innerHTML = \"Encrypted message appears here\"\r\n\t\tdocument.getElementById(\"message\").placeholder = \"Message for encryption\"\r\n\t\tdocument.getElementById(\"key\").placeholder = \"Key for encryption\"\r\n\t\tdocument.getElementById(\"copy\").innerHTML = \"Copy encrypted message to clipboard\"\r\n\t} else if (mode == 1) {\r\n\t\tdocument.getElementById(\"messageDisplay\").innerHTML = \"Message for decryption:\"\r\n\t\tdocument.getElementById(\"keyDisplay\").innerHTML = \"Key for decryption:\"\r\n\t\tdocument.getElementById(\"cryptonyte\").innerHTML = \"Decrypt\"\r\n\t\tdocument.getElementById(\"output\").innerHTML = \"Decrypted message appears here\"\r\n\t\tdocument.getElementById(\"message\").placeholder = \"Message for decryption\"\r\n\t\tdocument.getElementById(\"key\").placeholder = \"Key for decryption\"\r\n\t\tdocument.getElementById(\"copy\").innerHTML = \"Copy decrypted message to clipboard\"\r\n\t}\r\n}", "function selectMode(e){\n\t\t\t\tmode = $(\".mode-select option:selected\").val();\n\n\t\t\t\tif(mode != \"explore\"){\n\t\t\t\t\t$(\".explore\").hide();\n\t\t\t\t\t$(\".stats-table .charged, .stats-table .fast\").hide();\n\t\t\t\t\t$(\".stats-table .\"+mode).show();\n\t\t\t\t\t$(\".move-table-container\").show();\n\n\t\t\t\t\tself.displayMoves();\n\n\t\t\t\t} else{\n\t\t\t\t\t$(\".move-table-container\").hide();\n\t\t\t\t\t$(\".explore\").show();\n\t\t\t\t\t$(\".loading\").hide();\n\t\t\t\t}\n\n\t\t\t\tself.pushHistoryState(mode);\n\t\t\t}", "function setupMode()\n{\n\tfor(var i = 0; i < modebtn.length; i++)\n\t{\n\t\tmodebtn[i].addEventListener(\"click\", function() {\n\t\t\tfor(var i = 0; i < modebtn.length; i++)\n\t\t\t{\n\t\t\t\tmodebtn[i].classList.remove(\"selected\");\n\t\t\t}\n\t\t\tthis.classList.add(\"selected\");\n\t\t\tif(this.innerHTML === \"Easy\")\n\t\t\t{\n\t\t\t\tgameMode = 3;\n\t\t\t\tcontainer.style.maxWidth = \"600px\";\n\t\t\t}\n\t\t\telse if(this.innerHTML === \"Hard\")\n\t\t\t{\n\t\t\t\tgameMode = 6;\n\t\t\t\tcontainer.style.maxWidth = \"600px\";\n\t\t\t}\n\t\t\telse if(this.innerHTML === \"Expert\")\n\t\t\t{\n\t\t\t\tgameMode = 9;\n\t\t\t\tcontainer.style.maxWidth = \"600px\";\n\t\t\t}\n\t\t\telse if(this.innerHTML === \"Master\")\n\t\t\t{\n\t\t\t\tgameMode = 12;\n\t\t\t\tcontainer.style.maxWidth = \"900px\";\n\t\t\t}\n\t\t\telse if(this.innerHTML === \"Torment\")\n\t\t\t{\n\t\t\t\tgameMode = 15;\n\t\t\t\tcontainer.style.maxWidth = \"1200px\";\n\t\t\t}\n\t\t\tresetgame(gameMode);\n\t\t});\n\t}\n}", "ChangeSearchMode(mode) {\n console.log('Changed');\n if (mode == 'Gif') {\n //Set showSticker var depending on the received mode\n this.showStickersChange.emit(false);\n }\n else {\n this.showStickersChange.emit(true);\n }\n }", "function checkMode(){\n var selValue = comboSelectedValueGet('tf1_selAdvtMode');\n if (!selValue) \n return;\n switch (parseInt(selValue, 10)) {\n case 1:\n fieldStateChangeWr('', '', 'tf1_txtAdvInterval', '');\n vidualDisplay('tf1_txtAdvInterval', 'configRow');\n vidualDisplay('break_txtAdvInterval', 'break');\n \n break;\n case 2:\n fieldStateChangeWr('tf1_txtAdvInterval', '', '', '');\n vidualDisplay('tf1_txtAdvInterval', 'hide');\n vidualDisplay('break_txtAdvInterval', 'hide');\n \n break;\n }\n}", "set callbackWhenModeChange(callback) {\n this._callbackWhenModeChange = callback;\n }", "function changeMode(modeID) {\n\n // reset\n $parent.removeClass('jq-ci--h jq-ci--m');\n\n switch (modeID) {\n case MODE_HOURS:\n $parent.addClass('jq-ci--h');\n\n break;\n\n case MODE_MINUTES:\n if (!DISABLE_MINUTES)\n $parent.addClass('jq-ci--m');\n else\n changeMode(MODE_HOURS); // go back\n\n break;\n }\n }", "function changeMode(){ \n if(IslightMode)\n darkMode();\n else\n lightMode();\n}", "isMode(mode) {\n return this.state.mode === mode;\n }", "function modeChangedHandler(paramStr) {\n return new Promise(function (resolve, reject) {\n try {\n let params = JSON.parse(paramStr);\n var mode = params[\"value\"];\n log(\"Mode changed to \" + mode);\n //Get the new mode from the parameters passed by CIF and update our state accordingly\n switch(mode) {\n case DisplayMode.Docked:\n expandPanel();\n break;\n case DisplayMode.Minimized:\n collapsePanel();\n break;\n case DisplayMode.Hidden:\n HidePanel();\n break;\n }\n resolve(true);\n }\n catch (error) {\n reject(error);\n }\n });\n\n}", "function changeMode() {\n if ($(\"#mode\").html() === \"EASY MODE\") {\n $(\"#mode\").html(\"ADVANCED MODE\"); //Change title of menu link\n $(\"#advancedMode\").css(\"display\", \"none\"); // hide Advance Mode elements\n $(\"#easyMode\").css(\"display\", \"block\"); // unhide Easy Mode elements\n } else {\n $(\"#mode\").html(\"EASY MODE\"); //Change title of menu link\n $(\"#easyMode\").css(\"display\", \"none\"); // hide Easy Mode elements\n $(\"#advancedMode\").css(\"display\", \"flex\"); // unhide Advance Mode elements\n\n }\n}", "function computerMediumModeTurn() {\n \n}", "function cycleSubMode() {\n if (M32.isSubMode < (M32.modeName[M32.isMode].length - 1)) {\n M32.isSubMode++;\n } else {\n M32.isSubMode = 1;\n }\n host.showPopupNotification(M32.modeName[M32.isMode][0] + \" sub-mode: \" + M32.modeName[M32.isMode][M32.isSubMode]);\n}", "function switchMode(){\n\t\ttoggleSwitch(addrSwitch);\n\t\tif (compMode()==\"data\"){\n\t\t\t//$('.led-a').each(function(){ toggleLedOff($(this)); });\n\t\t\tfor(var i=0; i<=7; i++){\n\t\t\t\tif (isOn($('.switch-a'+i))){ toggleLedOn($('.led-d'+i)); }\n\t\t\t\telse{ toggleLedOff($('.led-d'+i)); }\n\t\t\t}\n\t\t}\n\t\telse if (compMode()==\"addr\"){\n\t\t\t//$('.led-d').each(function(){ toggleLedOff($(this)); });\n\t\t\tfor(var i=0; i<=15; i++){\n\t\t\t\tif (isOn($('.switch-a'+i))){ toggleLedOn($('.led-a'+i)); }\n\t\t\t\telse{ toggleLedOff($('.led-a'+i)); }\n\t\t\t}\n\t\t}\n\t\tflashSwitchStatesToTempMemory();\n\t}", "function handleMode() {\n const imgName = chairImageHigh.querySelector(`img`);\n if (phoneMode.matches || (ipadMode.matches && transverseMode.matches)) {\n if (chairImageHigh.querySelector(`img`) === null) {\n chairAnimation(\n `img/chair_blue.gif`,\n `phone-chair`,\n `img/chair_black.gif`,\n `phone-chair`\n );\n } else if (imgName.classList.contains(`pc-chair`)) {\n remove();\n chairAnimation(\n `img/chair_blue.gif`,\n `phone-chair`,\n `img/chair_black.gif`,\n `phone-chair`\n );\n }\n } else if (tabletMode.matches || ipadMode.matches || pcMode.matches) {\n if (chairImageHigh.querySelector(`img`) === null) {\n chairAnimation(\n `img/chair_blue.gif`,\n `pc-chair`,\n `img/chair_black.gif`,\n `pc-chair`\n );\n } else if (imgName.classList.contains(`phone-chair`)) {\n remove();\n chairAnimation(\n `img/chair_blue.gif`,\n `pc-chair`,\n `img/chair_black.gif`,\n `pc-chair`\n );\n }\n }\n}", "function setupModeButtons() {\n // By placing buttons for game mode in For-loop code is no longer\n // duplicated and it becomes easier to add another game mode later on\n for (let i = 0; i < buttonsMode.length; i++) {\n buttonsMode[i].addEventListener('click', function() {\n buttonsMode[0].classList.remove('selected');\n buttonsMode[1].classList.remove('selected');\n this.classList.add('selected');\n // Change number of squares according to game mode\n if (this.textContent === 'Easy') {\n gameMode = 3;\n } else {\n gameMode = 6;\n }\n resetGame();\n });\n }\n}", "playerStateChanged(playerCurrentState) {\n // console.log('player current update state', playerCurrentState)\n }", "function modeChangedHandler(paramStr) {\n return new Promise(function (resolve, reject) {\n try {\n let params = JSON.parse(paramStr);\n var mode = params[\"value\"];\n log(\"Mode changed to \" + mode);\n //Get the new mode from the parameters passed by CIF and update our state accordingly\n if (mode == DisplayMode.Docked) {\n expandPanel();\n }\n else {\n collapsePanel();\n } \n resolve(true);\n }\n catch (error) {\n reject(error);\n }\n });\n\n}", "function optionChanged(id){\n showPlots(id);\n infoCard(id);\n}", "function changeMode(){\n $('.fill').css('height','0%');\n $('.clock').addClass('shadow-pulse');\n $('.clock').on('animationend', function(){\n $('.clock').removeClass('shadow-pulse');\n });\n if(mode==\"session\"){\n $('.clock .session_time').css('display','none');\n $('.clock .break_time').css('display','block');\n $('.clock .break_time').html($('.span_break').html());\n mode=\"break\";\n $('.action').html(\"Break\");\n sec=0;\n min=parseInt($('.span_break').html());\n clearInterval(each_sec_interval);\n clock=false;\n $('.clock').click();\n }\n else if(mode==\"break\"){\n $('.clock .break_time').css('display','none');\n $('.clock .session_time').css('display','block');\n $('.clock .session_time').html($('.span_session').html());\n mode=\"session\";\n $('.action').html(\"Session\");\n sec=0;\n min=parseInt($('.span_session').html());\n clearInterval(each_sec_interval);\n clock=false;\n $('.clock').click();\n }\n }", "transitionCardToFace(face) {\n let cardIsOnFace = this.card.nativeElement.classList.contains('flip');\n //switch statement on which card face we would like to end up at after some fancy flipping\n switch (face) {\n case (\"front\"): {\n console.log('to front');\n if (cardIsOnFace) {\n setTimeout(() => this.card.nativeElement.classList.toggle('flip'), this.cardFlipTime);\n this.card.nativeElement.classList.toggle('flip');\n }\n else {\n this.card.nativeElement.classList.toggle('flip');\n }\n break;\n }\n // NOTE: setTimeout is an asynchronous function, so toggling nativeElement outside of\n // a setTimeout will always execute faster regardless of position in code\n case (\"back\"): {\n console.log('to back');\n if (cardIsOnFace) {\n this.card.nativeElement.classList.toggle('flip');\n }\n break;\n }\n }\n }", "function changeAce() {\n if (playerData.aceSwitch === false && playerData.totalScore <= 11) {\n playerData.aceSwitch = true;\n playerData.totalScore += 10;\n }\n\n if (playerData.aceSwitch === true && playerData.totalScore > 21) {\n playerData.aceSwitch = false;\n playerData.totalScore -= 10;\n }\n}", "switchMode(arg) {\n let mode = arg;\n // if force mode not provided, switch to opposite of current mode\n if (!mode || mode instanceof MouseEvent)\n mode = this.currentView === 'source' ? 'preview' : 'source';\n if (arg instanceof MouseEvent) {\n if (obsidian.Keymap.isModEvent(arg)) {\n this.app.workspace.duplicateLeaf(this.leaf).then(() => {\n var _a, _b;\n const viewState = (_a = this.app.workspace.activeLeaf) === null || _a === void 0 ? void 0 : _a.getViewState();\n if (viewState) {\n viewState.state = Object.assign(Object.assign({}, viewState.state), { mode: mode });\n (_b = this.app.workspace.activeLeaf) === null || _b === void 0 ? void 0 : _b.setViewState(viewState);\n }\n });\n }\n else {\n this.setState(Object.assign(Object.assign({}, this.getState()), { mode: mode }), {});\n }\n }\n else {\n // switch to preview mode\n if (mode === 'preview') {\n this.currentView = 'preview';\n obsidian.setIcon(this.changeModeButton, 'pencil');\n this.changeModeButton.setAttribute('aria-label', 'Edit (Ctrl+Click to edit in new pane)');\n this.renderPreview(this.recipe);\n this.previewEl.style.setProperty('display', 'block');\n this.sourceEl.style.setProperty('display', 'none');\n }\n // switch to source mode\n else {\n this.currentView = 'source';\n obsidian.setIcon(this.changeModeButton, 'lines-of-text');\n this.changeModeButton.setAttribute('aria-label', 'Preview (Ctrl+Click to open in new pane)');\n this.previewEl.style.setProperty('display', 'none');\n this.sourceEl.style.setProperty('display', 'block');\n this.editor.refresh();\n }\n }\n }", "function initMode(mode, index) {\n mode.addEventListener('click', (event) => onMode(event, index));\n}", "function changeMode()\n{\n mode = $('input[name=mode]:checked').val();\n \n $('#shape').hide();\n $('#color').hide();\n $('#filters').hide();\n $('#optimization').hide();\n showAll(); // shows all elements (circles and triangles)\n removeBehaviors(); // disables click and drag behaviors\n removeTextBoxes(); // removes any text boxes from optimizations\n\n switch (mode)\n {\n case \"Add\":\n {\n modeAdd();\n break;\n }\n case \"Resize\":\n {\n modeResize();\n break;\n }\n case \"Move\":\n {\n modeMove();\n break;\n }\n case \"Delete\":\n {\n modeDelete();\n break;\n }\n case \"Filter\":\n {\n modeFilter();\n break;\n }\n case \"Optimize\":\n {\n modeOptimize();\n break;\n }\n }\n\n changeText(instructions[mode]);\n}", "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", "cardFlip(card) {\n if (this.allowedToFlip(card)) {\n this.soundControl.flip();\n this.totalClicks++;\n this.ticktok.innerText = this.totalClicks;\n card.classList.add('visible');\n\n if(this.verifyCard) {\n this.checkForCardMatch(card);\n } else {\n this.verifyCard = card;\n }\n }\n }", "function reactToNewAICards () {\n /* update behaviour */\n players[currentTurn].hand.determine();\n if (players[currentTurn].hand.strength == HIGH_CARD) {\n players[currentTurn].updateBehaviour([BAD_HAND, ANY_HAND]);\n } else if (players[currentTurn].hand.strength == PAIR) {\n players[currentTurn].updateBehaviour([OKAY_HAND, ANY_HAND]);\n } else {\n players[currentTurn].updateBehaviour([GOOD_HAND, ANY_HAND]);\n }\n \n players[currentTurn].commitBehaviourUpdate();\n \n players[currentTurn].swapping = false;\n \n saveSingleTranscriptEntry(currentTurn);\n\n /* wait and then advance the turn */\n timeoutID = window.setTimeout(advanceTurn, GAME_DELAY / 2);\n}", "function updateCardsDisplayed(playerClass, setType){\n \n // EVENT THAT TRIGGERED FN\n const eventTarget = event.target;\n const eventTag = eventTarget.tagName;\n const eventName = eventTarget.name;\n const eventValue = eventTarget.value;\n\n if (eventTag === 'SELECT' || eventTag === 'INPUT') {\n // QUERY CHANGED\n CARD_CONFIGS = updateQueryConfig(eventName, eventValue)\n renderCardsWithQuery();\n } else if (playerClass && CARD_CONFIGS.class_type !== playerClass) {\n // HERO CHANGED\n CARD_CONFIGS = defaultConfig(playerClass);\n resetDeck();\n resetQuerySelectors();\n renderCards();\n } else if (setType && CARD_CONFIGS.set_type !== setType) {\n // SWITCH BETWEEN NEUTRAL & CLASS CARDS\n CARD_CONFIGS = changeSetConfig(setType);\n switchActiveSetType(eventTarget)\n renderCardsWithQuery(); \n } else if (eventTag === 'BUTTON') {\n // RESET BUTTON\n CARD_CONFIGS = defaultConfig();\n resetQuerySelectors();\n renderCards();\n }\n}", "function gamechanger() {\n\n\t\n\t//restarting the game\n\t\n\t\t//restarting widgets\n\n\trestartTimer();\n\trestartFlicker();\n\n\n\tconsole.log(selectLevel.value);\n\n\tif (selectLevel.value === \"game-small\") {\n\t\tmainSection[1].classList.add(\"not-selected\");\n\t\tmainSection[0].classList.remove(\"not-selected\");\n\t\tcards.length = 12;\n\n\t\tboard[0].addEventListener(\"click\", firstChosen);\n\n\t} else {\n\t\tmainSection[0].classList.add(\"not-selected\");\n\t\tmainSection[1].classList.remove(\"not-selected\");\n\t\tcards.length = 18;\n\n\t\tboard[1].addEventListener(\"click\", firstChosen);\n\t}\n\tassign();\n\tplay();\n\tif(firebase.auth().currentUser){recordKeeping(firebase.auth().currentUser.uid)};\n\tgetChampion();\n}", "function myChangePlayer(src) {\r\n\t// if (!debugMuteAll) { console.log('asked for changing player!'); }\r\n\tif (!globData.compareMode) {\r\n\t\tif (globFunc.menuView.hidden) {\r\n\t\t\tglobFunc.menuView.show();\r\n\t\t\tglobFunc.menuView.resize();\r\n\t\t} else {\r\n\t\t\tglobFunc.menuView.hide();\r\n\t\t}\r\n\t\t//\r\n\t\tif (src.innerHTML == 'Change Player') {\r\n\t\t\tglobData.singleSelectMode = true;\r\n\t\t\tsrc.innerHTML = 'Close Selection';\r\n\t\t} else {\r\n\t\t\tglobData.singleSelectMode = false;\r\n\t\t\tsrc.innerHTML = 'Change Player';\r\n\t\t}\r\n\t}\r\n}", "handleAppModeSwitch(mode) {\n this.setState(prevState => {\n if (prevState.mode === mode) {\n return null;\n } else {\n return { mode: mode };\n }\n });\n }", "function cycleMode() {\n if (M32.isMode < (M32.modeName.length - 1)) {\n M32.isMode++;\n } else {\n M32.isMode = 0;\n }\n M32.isSubMode = 1; // Reset isSubMode\n // Change panel layout\n if (M32.modeName[M32.isMode] == MIXER) {\n application.setPanelLayout(\"MIX\");\n }\n if (M32.modeName[M32.isMode] == TRACK) {\n application.setPanelLayout(\"ARRANGE\");\n }\n host.showPopupNotification(\"Controller mode: \" + M32.modeName[M32.isMode][0]);\n println(M32.isPanelLayout);\n}", "function changeIsActionChosen(state) {\r\n CanvasManager.isActionChosen = state;\r\n}", "pickCard(card) {\n this.socket.emit('clientPickedCard', this.connectedRoom, card);\n }", "function toggleMode(){\n\n\tconsole.log(objects);\n\n\toptions.mode = options.mode == \"MODE_IDLE\" ? \"MODE_ACTIVE\" : \"MODE_IDLE\";\n\t$('#modeButton').text(options.mode);\n\n\tif(options.mode==\"MODE_IDLE\"){\n\t\tdestroyAllIdleObjects();\n\t}\n}", "setActualState(autoModeIdx) { \r\n if(autoModeIdx >= 0 && autoModeIdx < this.modeTitleList.length){\r\n this.actValText = this.modeTitleList[autoModeIdx];\r\n } else {\r\n this.actValText = \"????\";\r\n }\r\n this.hasData = true;\r\n }", "enterFullMode() {\n if (!this.isFullMode) {\n this._mode = 'full';\n this.dispatchEvent(new Event('modechange'));\n }\n }", "modeChange() {\n if (drawButton.checked) {\n this.mode = \"draw\";\n canvas.addEventListener(\"click\", this.click);\n\n canvas.removeEventListener(\"mousedown\", this.selectPoint);\n canvas.removeEventListener(\"mousemove\", this.mouseMove);\n canvas.removeEventListener(\"mousedown\", this.selectCurve);\n canvas.removeEventListener(\"mouseup\", this.mouseUp);\n } else if (moveButton.checked) {\n this.mode = \"move\";\n canvas.removeEventListener(\"click\", this.click);\n canvas.removeEventListener(\"mousedown\", this.selectCurve);\n canvas.addEventListener(\"mousedown\", this.selectPoint);\n canvas.addEventListener(\"mousemove\", this.mouseMove);\n canvas.addEventListener(\"mouseup\", this.mouseUp);\n } else if (selectButton.checked || colorButtton.checked) {\n if (selectButton.checked) this.mode = \"select\";\n else this.mode = \"color\";\n canvas.removeEventListener(\"click\", this.click);\n canvas.removeEventListener(\"mousedown\", this.selectPoint);\n canvas.removeEventListener(\"mousemove\", this.mouseMove);\n canvas.removeEventListener(\"mouseup\", this.mouseUp);\n\n canvas.addEventListener(\"mousedown\", this.selectCurve);\n }\n }", "onMoveChange() {\n\t\tif (!this.state.activePlayer) {\n\t\t\treturn;\n\t\t}\n\t\tconst move = this.state.move;\n\t\t\n\t\t// Make sure we rerender\n\t\tthis.forceUpdate();\n\n\t\t// Return if this move isn't ready to send yet\n\t\tif (!move.card ||\n\t\t\tmove.card.type === 'DECOY' && !move.target ||\n\t\t\tmove.card.type === 'HORN' && !move.range) {\n\t\t\treturn;\n\t\t}\n\n\t\t// This move is ready to send\n\t\tmove.playerId = this.state.playerId;\n\t\tmove.type = 'PLAY';\n\t\tthis.state.server.emit('move', move);\n\t}", "switchCaseStatus() {\n // console.log(\"111\");\n this.isShowCaseloadTrend = false;\n if (this.isShowCaseStatus == false) {\n this.isShowCaseStatus = true;\n } else {\n this.isShowCaseStatus = false;\n }\n }", "function checkFor(mode) {\n\n // console.log(\"looking for \" + mode);\n\n // Refernece to FireBase node\n let modeRef = firebase.database().ref('/rpm_multiuser');\n\n //modeRef.child('connections').orderByChild('mode').equalTo(mode).on(\"value\", function (snapshot) {\n modeRef.orderByChild('mode').equalTo(mode).on(\"value\", function (snapshot) {\n\n // Get the id, name and choice of players, then save localy\n snapshot.forEach(function (data) {\n\n // console.log(\"*******************\");\n // console.log(\"KEY: \" + data.key);\n // console.log(\"NAME: \" + data.val().name);\n // console.log(\"MODE: \" + data.val().mode);\n // console.log(\"CHOICE: \" + data.val().choice);\n // console.log(\"*******************\");\n\n // Getting the values from the database into the local 'player1' or 'player2' objects\n // when mode = 'player1' these lines would do:\n // player1.name = data.val().name;\n // player1.choice = data.val().choice;\n eval(mode).name = data.val().name; // Gets the player's name from the database\n eval(mode).choice = data.val().choice; // Gets the player's choice from the databsae\n });\n });\n }", "function mode() {\r\n for (let i = 0; i < modebtn.length; i++) {\r\n modebtn[i].addEventListener(\"click\", function () {\r\n modebtn[0].classList.remove(\"active\");\r\n modebtn[1].classList.remove(\"active\");\r\n this.classList.add(\"active\");\r\n this.textContent === \"easy\" ? (num = 3) : (num = 6);\r\n reset();\r\n });\r\n }\r\n}", "function selectMode(){\n\n textSize(20);\n fill(\"black\");\n text(\"CHOOSE YOUR MODE\",700,380);\n mode1 = createSprite(120,100,100,50);\n mode1.addImage(mode1Image);\n mode1.scale = 2.5;\n mode2 = createSprite(770,140,50,50);\n mode2.addImage(mode2Image);\n mode2.scale = 2.3;\n mode3 = createSprite(1480,140,50,50);\n mode3.addImage(mode3Image);\n mode3.scale = 2.5;\n\n modeGroup.add(mode1);\n modeGroup.add(mode2);\n modeGroup.add(mode3);\n\n console.log(\"modeSpritesCreated\");\n\n //drawSprites();\n\n if(mousePressedOver(mode1)){\n console.log(\"enteringM1\");\n gameState = 1;\n \n }\n\n else if(mousePressedOver(mode2)){\n console.log(\"enteringM2\");\n gameState = 2;\n \n }\n\n else if(mousePressedOver(mode3)){\n console.log(\"enteringM3\");\n gameState = 3;\n \n }\n\n\n\n //setTimeout(checkState, 1000);\n //sleep(1000);\n //checkState();\n\n}", "function changeMode(){\n\tmessage.textContent = \" \"\n\thardBtn.classList.remove(\"selectedGameMode\");\n\teasyBtn.classList.remove(\"selectedGameMode\");\n\th1.style.backgroundColor = \"steelblue\";\n}", "function change() {\n\n local = localStorage.getItem(\"nightmode\");\n\n if (local !== \"activado\") {\n nightmode();\n\n } else {\n daymode();\n\n }\n}", "function player_change(){\n console.log(\"changing player\")\n if (current_player == \"X\")\n current_player = \"O\";\n else\n current_player = \"X\";\n displayed_msg.innerHTML = current_player\n}", "function checkCardStatus() {\n\n\t\tif ( $('#mycard').hasClass('flip') ) {\n\t\t\t$('#mycard').toggleClass('flip');\n\t\t}\n\n\t}", "function saveMode(m){\n mode = m;\n chrome.storage.local.set({\"mode\": m});\n\n //Refresh policies\n chrome.storage.sync.clear();\n chrome.storage.sync.set(mapToSettings());\n}", "function setupModeButtons() {\n // Loop over modes and add event listeners\n for (var i = mode.length - 1; i >= 0; i--) {\n mode[i].addEventListener('click', function() {\n for (var i = mode.length - 1; i >= 0; i--) {\n mode[i].classList.remove('selected');\n }\n this.classList.add('selected');\n switch (this.textContent) {\n case 'Easy':\n numSquares = 3;\n break;\n case 'Normal':\n numSquares = 6;\n break;\n case 'Hard':\n numSquares = 9;\n }\n reset();\n });\n }\n // Set default difficulty to normal\n mode[1].classList.add('selected');\n}", "function changeClockface() {\n let type = clockfaceButton.textContent;\n\n switch (type) {\n case \"24\":\n clockfaceButton.textContent = \"A.M.\";\n clockfaceState = 1;\n faceTotal = 12;\n drawClock();\n break;\n case \"A.M.\":\n clockfaceButton.textContent = \"P.M.\";\n clockfaceState = 2;\n faceTotal = 12;\n drawClock();\n break;\n case \"P.M.\":\n clockfaceButton.textContent = \"24\";\n clockfaceState = 0;\n faceTotal = 24;\n drawClock();\n break;\n }\n}", "function handleChangeOfView() {\n if (section.buttonDisplay === RULES) {\n section.buttonDisplay = RANK;\n replaceContent(\n scoreTable,\n gameWrapper,\n modeRules,\n buttonsWrapper,\n buttonRulesRanking,\n 'id-badge',\n );\n } else {\n section.buttonDisplay = RULES;\n replaceContent(\n modeRules,\n gameWrapper,\n scoreTable,\n buttonsWrapper,\n buttonRulesRanking,\n 'graduation-cap',\n );\n }\n }" ]
[ "0.7414258", "0.69916946", "0.6913078", "0.68663174", "0.67285115", "0.65880203", "0.6555028", "0.6534676", "0.6502349", "0.63831896", "0.6364362", "0.634549", "0.6335072", "0.63145643", "0.6262125", "0.62173915", "0.6210121", "0.61701095", "0.61609906", "0.6155178", "0.61353415", "0.61187696", "0.6091834", "0.6078367", "0.6067564", "0.6043259", "0.6042838", "0.60334563", "0.6027612", "0.5984871", "0.5981712", "0.59801066", "0.5964557", "0.59615755", "0.59472156", "0.59254456", "0.59226656", "0.5922198", "0.5922198", "0.5922198", "0.5913682", "0.5899646", "0.58554536", "0.58351314", "0.5830223", "0.582646", "0.5826177", "0.5821144", "0.5802483", "0.5776139", "0.57681644", "0.5768112", "0.57543397", "0.5735354", "0.5732415", "0.57190424", "0.57066196", "0.5705824", "0.56806475", "0.5677986", "0.56592447", "0.56498957", "0.5640752", "0.56365895", "0.56309295", "0.5621919", "0.56202394", "0.56174976", "0.56164795", "0.5616151", "0.5614636", "0.5602719", "0.55947655", "0.5593925", "0.5593411", "0.55920583", "0.5582188", "0.5579172", "0.5578662", "0.55767274", "0.5571459", "0.55631393", "0.5562902", "0.5561548", "0.5557436", "0.55550754", "0.55516803", "0.5550924", "0.55504215", "0.5549867", "0.5547578", "0.55460304", "0.55378205", "0.55362", "0.5533258", "0.55272853", "0.55229634", "0.55163807", "0.5514502", "0.5512818" ]
0.553447
94
modify the text and flip the cards as necessary to enter the new mode
transitionToNewMode() { console.log('transition'); if (this.card != null) { switch (this.currMode) { case _entity_data_structures_card_modes__WEBPACK_IMPORTED_MODULE_1__["cardMode"].voting: { this.cardText.nativeElement.textContent = ""; this.transitionCardToFace("front"); if (this.votingPhraseText == null) { this.cardText.nativeElement.textContent = "vote above !"; } else { this.cardText.nativeElement.textContent = this.votingPhraseText; } break; } case _entity_data_structures_card_modes__WEBPACK_IMPORTED_MODULE_1__["cardMode"].waiting: { this.cardText.nativeElement.textContent = ""; this.transitionCardToFace("front"); this.cardText.nativeElement.textContent = "waiting ..."; break; } case _entity_data_structures_card_modes__WEBPACK_IMPORTED_MODULE_1__["cardMode"].myTurn: { this.cardText.nativeElement.textContent = ""; this.transitionCardToFace("back"); this.cardText.nativeElement.textContent = this.cardData.card_text; break; } } this.disableCardChooseButton(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function flipCard(card) {\n //Change the question (for now)\n if (card.className !== \"card flipped\") {\n card.children[1].textContent = BTQuestions[counter++];\n if (counter === BTQuestions.length) {\n BTQuestions = shuffle(BTQuestions);\n counter = 0\n }\n }\n card.classList.toggle(\"flipped\");\n}", "function flipCard(card) {\n\tif (card.getAttribute('data-card') === 'queen') {\n\t\tcard.innerHTML = '<img src=\"queen.png\" alt=\"queen\" />';\n\t\t// cardElement.innerHTML = '<img src=\"my_king.png\" alt=\"King of Spades\" />';.\n\t} else {\n\t\tcard.innerHTML = '<img src= \"king.png\" alt=\"king\"/>';\n\t}\n}", "function mirrorText(clickedCard){\n\n//checks clickedCard for class selectedCard\t\nif (clickedCard.classList.contains(\"selectedCard\")){\n//checks clickedCard for the bio class and replaces the innerHTML input.value\t\n\tclickedCard.querySelector(\".bio\").innerHTML = input.value;\n\t}\n\t\n\t\n}", "function flipCard(event) {\n\t// when the card is clicked it flips to the other side\n\t// have the definition side be hidden (toggle) and on click/flip hide the term\n\tterm.classList.toggle('hidden');\n\tdefinition.classList.toggle('hidden');\n}", "function flipCard(){\n if(cardSide == \"QuestionSide\"){\n cardSide = \"AnswerSide\";\n $(\".card-title-question\").hide();\n $(\".card-text-answer\").show();\n console.log(\"show Q\")\n }else{\n $(\".card-title-question\").show();\n $(\".card-text-answer\").hide();\n console.log(\"show A\");\n cardSide = \"QuestionSide\"\n }\n }", "function flipFlashCard(el) {\n el.parentNode.parentNode.querySelector(\".answer\").style.opacity = \"1\";\n el.parentNode.querySelector(\".correct-answer\").disabled = false;\n el.parentNode.querySelector(\".wrong-answer\").disabled = false;\n\n textToSpeech();\n}", "function flipCard() {\n\n\tfor(var i = 0; i <= 5; i++)\n\t{\n\t\tif($('#card' + (i + 1)).text() == 'L') {\n\t\t\tvar c = Math.floor((Math.random() * largeValues.length));\n\t\t\tcards.push(largeValues[c]);\n\t\t}else {\n\t\t\tvar c = Math.floor((Math.random() * smallValues.length));\n\t\t\tcards.push(smallValues[c]);\n\t\t}\n\t\t$('#card' + (i + 1)).text(cards[i]);\n\t}\n}", "function updateFront(){\r\n\t\t\tdocument.getElementById(\"flashcard-content-front\").innerHTML = currentText;\r\n\t\t\t\r\n\t\t}", "function flipCard(card_index) \n{\n if(speelveld[card_index].classList.contains('flipped')) {\n speelveld[card_index].classList.remove('flipped');\n speelveld[card_index].children[CARD_FRONT].innerHTML = \"\";\n } else {\n speelveld[card_index].children[CARD_FRONT].innerHTML = getCardImageTag(card_index);\n speelveld[card_index].classList.add('flipped');\n }\n}", "function changeText() {\n\t\tflipDisableOption();\n\t\trunning = true;\n\t\tcurrentFrames = $(\"text-area\").value;\n\t\tcurrentInterval = setInterval(insertFrame, currentSpeed);\n\t}", "function showBack() {\n // return all words that are not on the front of the card and that have a value for their key\n const backWords = ['english', 'kana', 'kanji']\n .map(k => k !== CURRENT_CARD.front && CURRENT_CARD[k])\n .filter(j => !!j);\n const innerText = `<p style=\"font-size:28px\" align=\"center\">${backWords.join('<br><br>')}</p>`;\n\n CURRENT_CARD.showingFront = false;\n document.getElementById('flashcard').innerHTML = innerText;\n\n}", "function flipEasyCard() {\n var easyCardId = this.getAttribute('data-id'); \n easyCardsSelected.push(kittenCardsEasy[easyCardId].name);\n easyCardsSelectedId.push(easyCardId);\n this.setAttribute('src', kittenCardsEasy[easyCardId].img);\n this.setAttribute('alt', kittenCardsEasy[easyCardId].name);\n if (easyCardsSelected.length === 2) {\n checkEasyMatch(); \n } else if (easyCardsSelected.length > 2) {\n this.setAttribute('src', './assets/images/kitten-card-back.png');\n }\n easyCardsSelected.length = Math.min(easyCardsSelected.length, 2);\n}", "function flippCard(){\n\n /* Flipp is a boolean variable that stores whether we need to flip the card or to not. */\n flipp = !flipp;\n\n /* save the tranform attribute value to rotate the card in temp variable */\n let temp = \"rotateY(180deg)\";\n\n /* If the flipp stores false that means User dont want to flip the card or want to undo it so remove the attribute from temp */\n if(!flipp){\n temp = \"\"; /* Overwriting the temp to forget prev value */\n }\n\n /* As decided: update the transform attribute of the front-card element to temp */\n document.getElementById(\"front-card\").style.transform = temp;\n}", "function drawFlipCard(cards) {\n\n _.each(cards, function(card) {\n\n var $tmplFlipCard = $($(\"#templateFlipCard\").html());\n\n // Set the name of the card for Google Analytics\n $(\"#data-cardname\", $tmplFlipCard).html(card.name);\n\n // Set the question for the front of the card\n $(\".question\", $tmplFlipCard).html(card.question)\n\n // Set the back content of the card\n $(\".back1\", $tmplFlipCard).html(card.back1);\n $(\".back2\", $tmplFlipCard).html(card.back2);\n $(\".back3\", $tmplFlipCard).html(card.back3);\n $(\".back4\", $tmplFlipCard).html(card.back4);\n $(\".back5\", $tmplFlipCard).html(card.back5);\n\n\n\n\n $(\"img.background-image\", $tmplFlipCard).attr(\"src\", \"img/training/\" + card.image);\n\n // _NOW_ we add this template to the training page\n $(\"#flipCardList\").append($tmplFlipCard);\n\n });\n\n // Flip Cards Flipping Script\n // ====================================\n $('.flip').on('click', function(event) {\n $(event.target).parents('.card').toggleClass('flipped');\n });\n\n}", "cardFlip(card) {\n if (this.allowedToFlip(card)) {\n this.soundControl.flip();\n this.totalClicks++;\n this.ticktok.innerText = this.totalClicks;\n card.classList.add('visible');\n\n if(this.verifyCard) {\n this.checkForCardMatch(card);\n } else {\n this.verifyCard = card;\n }\n }\n }", "function flipCard(cardElem) {\n // Count flip\n data.flips += 1;\n\n cardElem.classList.add(FLIP);\n\n // Update aria label to symbol\n cardElem.setAttribute('aria-label', cardElem.dataset.symbol);\n }", "function nextCard()\r\n\t\t{\r\n\t\t\tvar length = questions.length;\r\n\r\n\t\t\tif(questionNumber<length-1)\r\n\t\t\t\tquestionNumber++;\r\n\t\t\telse\r\n\t\t\t\tquestionNumber=0;\r\n\t\t\t\r\n\t\t\tif(cardState==0){\r\n\t\t\t\tcurrentText = questions[questionNumber];\r\n\t\t\t\tupdateFront();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tflipCard();\r\n\t\t\t\tflashcard.classList.toggle('flipped');\r\n\t\t\t\tupdateText();\r\n\t\t\t}\r\n\r\n\t\t}", "function flipBack() {\n $('.card').filter($('.open')).toggleClass('open');\n OpenCards = [];\n numOfmoves = numOfmoves + 1;\n $('.moves').text(numOfmoves);\n }", "function flipCard() {\r\n //this - whatever card we have clicked \r\n //we're getting the card clicked id and store to the cardsArray arrayChosen but only the name \r\n let cardId = this.getAttribute('data-id')\r\n cardsChosen.push(cardsArray[cardId].name)\r\n cardsChosenIds.push(cardId)\r\n\r\n //flip the card when clicked\r\n this.setAttribute('src', cardsArray[cardId].img)\r\n\r\n //revert if two selected aren't the same\r\n if (cardsChosen.length === 2) {\r\n setTimeout(checkForMatch, 500)\r\n\r\n }\r\n\r\n }", "function flipCardKeyboard(card) {\n\t\tif (!cards[card].classList.contains('open', 'show', 'match') && chosenCards.length !== 2) {\n\t\t\t\tcards[card].classList.add('open');\n\t\t\t\taddChosenCard(cards[card]);\n\t\t\t\tif (timer === false && pairsRemain > 0) {\n\t\t\t\t\t\ttimerOn();\n\t\t\t\t}\n\t\t\t\tsetTimeout(showCard, 300, cards[card]);\n\t\t}\n}", "function turnCard() {\n\tcount++;\n\tif (count % 2 === 0) {\n\t\tthis.innerText = 'X';\n\t} else {\n\t\tthis.innerText = 'O';\n\t}\n\n}", "function unFlipCard(str) {\n document.getElementById(\"chosen-one\").style = \"transform: rotateY(180);\";\n document.getElementById(\"chosen-two\").style = \"transform: rotateY(180);\";\n\n document.getElementById(\"chosen-one\").id = \"\";\n document.getElementById(\"chosen-two\").id = \"\";\n clickCount = 0;\n}", "function changeCard() {\n $(\".questions\").hide();\n $(\"#question\" + next).show();\n $(\".feedback_containers\").fadeOut();\n $(\".incorrect\").hide();\n $(\".correct\").hide();\n $(\".notification\").fadeOut();\n $(\"#test_card\").css({left: to}).animate({left: \"0%\"});\n }", "function showFront() {\n // Just update the text with the current card's front word\n const innerText = `<p style=\"font-size:32px\" align=\"center\">${CURRENT_CARD[CURRENT_CARD.front]}</p>`;\n\n CURRENT_CARD.showingFront = true;\n document.getElementById('flashcard').innerHTML = innerText;\n}", "function flip(card){\r\ncard.target.classList.add(\"open\");\r\ncard.target.classList.add(\"show\");\r\n\r\n}", "function flipCard(card_index)\n{\n if(speelveld[card_index].classList.contains('flipped')) {\t// Bevat de kaart al de css class flipped?\n /*\n Ja!\n Dan gaan de kaart weer terugdraaien door de css class flipped weer weg te halen\n */\n speelveld[card_index].classList.remove('flipped');\t\t\t// Hier halen we de css class flipped weg\n speelveld[card_index].children[CARD_FRONT].innerHTML = \"\";\t// We gaan de img-tag ook weer verwijderen\n } else {\n /*\n Nee!\n Dan draaien we de kaart om zodat de afbeelding zichtbaar wordt.\n Dit doen we door de css class flipped toe te voegen aan de kaart en de tweede div\n in de kaart te vullen met de img-tag van de echte afbeelding\n */\n speelveld[card_index].children[CARD_FRONT].innerHTML = getCardImageTag(card_index);\t// Toon de afbeelding\n speelveld[card_index].classList.add('flipped');\t\t\t\t\t\t\t\t\t\t// Voeg de css class flipped toe.\n }\n}", "function flipCard() {\n if (lockBoard) return;\n if (this === firstCard) return;\n this.classList.add('flip');\n if (!hasFlippedCard) {\n //first card clicked\n hasFlippedCard = true;\n firstCard = this;\n return;\n }\n //second card clicked\n hasFlippedCard = false;\n secondCard = this;\n checkForMatch();\n\n if (checkWin()){\n stopCheck.stop(`/memory-solution-saver/${gameId}`);\n }\n\n\n }", "function flipCard(card) {\n //if there is no card clicked\n if(flippedCard === null){\n flippedCard = card;\n flippedCard.classList.toggle(\"active\");\n //if there is a card already clicked\n } else if(secondCardFlipped === null) {\n secondCardFlipped = card;\n secondCardFlipped.classList.toggle(\"active\");\n \n //if cards have different content:\n if(flippedCard.textContent.trim() !== secondCardFlipped.textContent.trim()) {\n setTimeout(\n function(){\n flippedCard.classList.remove(\"active\");\n secondCardFlipped.classList.remove(\"active\"); \n //Back to the original\n flippedCard = null;\n secondCardFlipped = null;\n }, 2000\n );\n } else {\n //if cards have the same content\n //Back to the original\n flippedCard = null;\n secondCardFlipped = null;\n }\n } \n}", "function flipNeutralCard (cardRank) {\n lastNeutralCard = cardRank;\n $('.upcard').empty();\n $( ` <div class=\"card rank-${cardRank} diams\">\n <span class=\"rank\">${cardRank}</span>\n <span class=\"suit\">&diams;</span>\n </div>` ).appendTo( \".upcard\" );\n }", "function startAbout(){\n $(\"#flippy_A1\").text(\"A\");\n $(\"#flippy_B1\").text(\"B\");\n $(\"#flippy_B2\").text(\"O\");\n $(\"#flippy_B3\").text(\"U\");\n $(\"#flippy_C2\").text(\"T\");\n }", "function flipOnClick(card, val) {\r\n if (card.innerHTML == \"\" && memory_values.length < 2) {\r\n card.style.background = '#FFF';\r\n card.innerHTML = val;\r\n if (memory_values.length == 0) {\r\n memory_values.push(val);\r\n memory_card_ids.push(card.id);\r\n } else if (memory_values.length == 1) {\r\n memory_values.push(val);\r\n memory_card_ids.push(card.id);\r\n if (memory_values[0] == memory_values[1]) {\r\n card_flipped += 2;\r\n pairsFound += 1;\r\n pairs.innerHTML = pairsFound;\r\n // clear both arrays\r\n memory_values = [];\r\n memory_card_ids = [];\r\n if (card_flipped == memory_array.length) {\r\n showWinScreen();\r\n }\r\n } else {\r\n function flipToBack() {\r\n // flip the cards back \r\n let card_1 = document.getElementById(memory_card_ids[0]);\r\n let card_2 = document.getElementById(memory_card_ids[1]);\r\n card_1.style.backgroundColor = '#BF42D5';\r\n card_1.innerHTML = \"\";\r\n card_2.style.backgroundColor = '#BF42D5';\r\n card_2.innerHTML = \"\";\r\n // clear both arrays\r\n memory_values = [];\r\n memory_card_ids = [];\r\n }\r\n setTimeout(flipToBack, 700);\r\n }\r\n }\r\n }\r\n}", "function charactersInerface(characterSelected) {\n // Restore defualt\n document.getElementById('card #1').style.transform = 'scale(1)';\n document.getElementById('card #2').style.transform = 'scale(1)';\n document.getElementById('card #3').style.transform = 'scale(1)';\n\n document.getElementById('cardOne').style.color = 'white';\n document.getElementById('cardTwo').style.color = 'white';\n document.getElementById('cardThree').style.color = 'white';\n\n switch (characterSelected) {\n case 'plane #1':\n document.getElementById('card #1').style.transform = 'scale(1.1)';\n document.getElementById('cardOne').style.color = 'cyan';\n break;\n\n case 'plane #2':\n document.getElementById('card #2').style.transform = 'scale(1.1)';\n document.getElementById('cardTwo').style.color = 'cyan';\n\n break;\n\n case 'plane #3':\n document.getElementById('card #3').style.transform = 'scale(1.1)';\n document.getElementById('cardThree').style.color = 'cyan';\n\n break;\n\n default:\n break;\n }\n}", "function changeCardsText (playerNum, cText) {\r\n\tif (cText === \"\") {\r\n\t\t$(\"#cardCombination\" + playerNum).css(\"border\", \"0px solid #FFFFFF\");\r\n\t} else {\r\n\t\t$(\"#cardCombination\" + playerNum).css(\"border\", \"2px solid #FFFFFF\");\r\n\t}\r\n\t$(\"#cardCombination\" + playerNum).html(cText);\r\n}", "function newCardOne(randomText){\n\n\tif(count<5){\t\t\t\t\t\n\t\tvar countTranslate=0;\n\t\tvar title = data[randomText].theme;\n\t\tvar descrip = data[randomText].sourceText;\n\t\tvar translation = data[randomText].translation;\n\t\tvar cologne = document.querySelector(\".cologne__one\");\n\t\tvar add = document.querySelector(\".add\");\n\t\tvar div = document.createElement('div');\n\t\tdiv.id = \"cards\";\n\t\tdiv.className = \"aligner\";\n\t\tdiv.innerHTML = \"<h3>\" + title + \"</h3>\" + \"<p>\" + descrip + \"</p>\";\n\t\tvar g = bgColor();\n\t\tdiv.style.backgroundColor = g;\n\n\t\t/**************Card illumination********************/\n\t\tdiv.addEventListener(\"mouseover\", function(){\n\t\t\tdiv.style.backgroundColor = 'white';\n\t\t});\n\t\tdiv.addEventListener(\"mouseout\", function(){\n\t\t\tdiv.style.backgroundColor = g;\n\t\t});\n\t\tcologne.insertBefore(div, add);\n\n\t\t/****text translation****/\n\t\tdiv.onclick = function(){\n\t\t\tvar interval = setInterval(translate,200);\n\t\t\tfunction translate(){\n\t\t\t\tif (countTranslate%2==0) {\n\t\t\t\t\tdiv.innerHTML = \"<h3>\" + title + \"</h3>\" + \"<p>\" + translation + \"</p>\";\n\t\t\t\t\tcountTranslate++;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdiv.innerHTML = \"<h3>\" + title + \"</h3>\" + \"<p>\" + descrip + \"</p>\";\n\t\t\t\t\tcountTranslate--;\n\t\t\t\t}\n\t\t\t\tclearInterval(interval);\n\t\t\t}\n\t\t\tfunction ret(){\n\t\t\t\tdiv.innerHTML = \"<h3>\" + title + \"</h3>\" + \"<p>\" + descrip + \"</p>\";\n\t\t\t}\n\t\t\tsetTimeout(ret,3500);\n\t\t}\n\n\t\t/*******Deleting a card************/\n\t\t\n\t\t$(div).on(\"taphold\",function(){\n\t\t\tdiv.remove();\n\t\t\tdocument.querySelector(\".add\").style.display = \"block\";\n\t\t\tcount--;\n\t\t}); \n\t\t\n\t\tdiv.ondblclick = function(){\n\t\t\tdiv.remove();\n\t\t\tdocument.querySelector(\".add\").style.display = \"block\";\n\t\t\tcount--;\n\t\t}\n\t\t\tif(count+1==5) document.querySelector(\".add\").style.display = \"none\"; \n\t\t\tcount++;\n\t\t}\n\t}", "flipCard(card) {\n if(this.canFlipCard(card)) {\n this.AudioFiles.flip();\n this.totalClicks++;\n this.ticker.innerText = this.totalClicks;\n card.classList.add('visible');\n\n if(this.cardToCheck) {\n this.checkForCardMatch(card);\n } else {\n this.cardToCheck = card;\n }\n }\n }", "function UpdateCurrentText() {\n if(cardsData.length === 0) {\n current.innerText = ''\n } else {\n current.innerText = `${currentActiveCard + 1}/${cardsData.length}`\n }\n}", "function flipFlashcard() {\n console.log(CURRENT_CARD);\n if (CURRENT_CARD.showingFront) return showBack();\n return showFront();\n}", "function flipCard(e) {\n if (e.target.nodeName === 'LI' || e.target.nodeName === 'I') {\n if (currentOpenCards.length % 2) {\n moves++;\n tally.textContent = moves;\n if (moves === 15 || moves === 20 || moves === 25 || moves === 30) {\n stars.firstElementChild.remove();\n }\n }\n }\n if (e.target.nodeName === 'LI') {\n const card = e.target;\n loadCard(card);\n } else if (e.target.nodeName === 'I') {\n const card = e.target.parentNode;\n loadCard(card);\n }\n}", "function updateCurrentText() {\n currentEl.innerText = `${currentActiveCard + 1 }/${cardsEl.length}`;\n }", "function flipCard() {\n if (app.lockBoard) return;\n if (event.target === document.getElementById('game-panel')) return;\n if (event.target === app.firstCard) return;\n event.target.classList.add(\"flip\");\n cardFlipSound();\n\n if (!app.hasFlippedCard) {\n app.hasFlippedCard = true;\n app.firstCard = event.target;\n return;\n }\n\n app.secondCard = event.target;\n moveCounter();\n checkMatch();\n}", "flipCard(card) {\n if (this.canFlipCard(card)) {\n this.totalClicks++;\n this.moveTicker.innerText = this.totalClicks;\n card.classList.add('visible');\n if (this.cardToCheck) {\n this.checkForCardMatch(card);\n } else {\n this.cardToCheck = card;\n };\n }\n }", "function flip() {\n cardContainerRef.current.classList.toggle(style.is_flipped);\n }", "function flipCard(element, id) {\n // make flip sound\n myAudio.volume = 0.3;\n myAudio.play();\n\n element.parentElement.classList.add(\"open\");\n\n // in order to not show solution at first sight in the html code, the backside of card is\n // appended if user clicks on card\n var nodeBackDiv = document.createElement(\"div\");\n nodeBackDiv.classList.add(\"back\");\n\n var img = document.createElement(\"IMG\");\n img.src = \"assets/images/pool/1x/\" + cardArr[id][\"img\"] + \".png\";\n img.setAttribute(\"alt\", \"Train your Brain\");\n\n nodeBackDiv.appendChild(img);\n element.appendChild(nodeBackDiv);\n }", "function flipCard(index) {\n setOpenedCard((prevState) =>\n prevState.map((item, idx) => (idx === index ? !item : item))\n );\n // setOpenedCard((opened) => [...opened, index]);\n // cardFlipStatus[index] = !cardFlipStatus[index];\n // console.log(cardFlipStatus[index]);\n }", "function flip(card) {\n card.classList.toggle('open');\n card.classList.toggle('show');\n}", "show() {\n this.card.style.transform = \"rotateY(180deg)\";\n this.textarea.style.color = this.screen.getForegroundColor();\n this.textarea.style.backgroundColor = this.screen.getBackgroundColor();\n this.textarea.focus();\n this.editing = true;\n }", "function flipCard(item) {\n debug(\"flipCard\", item);\n item.setAttribute(\"class\", \"card open show\");\n }", "function flipCard() {\n\n\tvar cardID = this.getAttribute('data-id');\n\tthis.setAttribute('src', cards[cardID].cardImage);\n\n\tconsole.log(\"User flipped \" + cards[cardID].rank);\n\tconsole.log(cards[cardID].cardImage);\n\tconsole.log(cards[cardID].suit);\n\tcardsInPlay.push(cards[cardID].rank);\n\n\tcheckForMatch();\n\n}", "function redoFlashCard(el) {\n // Copy the card and send it to the back\n let card = el.parentNode.parentNode.parentNode.parentNode;\n card.style.display = \"none\";\n card.querySelector(\".answer\").style.opacity = \"0\";\n\n document.getElementById(\"flashcard-modal-content\").insertBefore(card, null);\n\n // Show the next card\n let cards = document.querySelectorAll(\".flash-card\");\n\n cards[0].style.display = \"block\";\n}", "function flipMe(){\n var flip = [\"Heads\", \"Tails\"];\n var side = flip[Math.floor(Math.random()*flip.length)]; //randomly selects heads or tails\n\n if (side == \"Heads\"){\n $('#regTitle').html(\"You Got \" + side);\n $(\".image\").html('<img src=\"http://www.goldcoinhistory.com/wp-content/uploads/2012/05/GP_US_1850_C_Liberty_Head_One_Dollar_Type_I_obverse.jpeg\"/>');\n } else {\n $('#regTitle').html(\"You Got \" + side);\n $(\".image\").html('<img src=\"http://www.goldcoinhistory.com/wp-content/uploads/2012/05/GP_US_1850_C_Liberty_Head_One_Dollar_Type_I_reverse.jpeg\"/>');\n }\n\n $(this).hide();\n $('#stage5').show(); //shows who is first screen\n\n }", "function resetFlip() {\n if (event.target.matches(\".start_button\") || event.target.matches(\".playAgain_button\")) {\n return;\n }\n let resetInfo = document.querySelectorAll(\".card\");\n function flipUp() {\n resetInfo.forEach(function (card) {\n setTimeout(card.classList.add(\"selected\"), 3000);\n });\n }\n setTimeout(flipUp, 500);\n\n function flipDown() {\n resetInfo.forEach(function (card) {\n card.classList.remove(\"selected\");\n });\n }\n setTimeout(flipDown, 1000);\n }", "function flipCard() {\n let cardId = this.getAttribute('data-id')\n cardsChosen.push(cardArray[cardId].name)\n cardsChosenId.push(cardId)\n this.setAttribute('src', cardArray[cardId].img)\n if (cardsChosen.length === 2) {\n setTimeout(checkForMatch, 720) // ask how I can set this to increase for level two and 3\n }\n }", "function createCards() {\n\ttitles_flipped = 0; \n\tvar card = '';\n\tmemorCards.shuffle(); \n\tfor(var i = 0 ; i < memorCards.length; i++){\n\tcard = card + '<div id=\"title_' + i + '\" class=\"'+memorCards[i]+'\"onclick=\"cardSwitch(\\''+i+'\\',\\''\n\t+memorCards[i]+'\\')\"></div>';\n\tmemoryValues = [];\n\tmemoryTitleIds = []; \n\n\t}\t\n\t\tdocument.getElementById('playground').innerHTML = card; \n}", "function reflipCards(){\n Array.from(cards).forEach(card => card.classList.remove('fadeOutDown'));\n Array.from(cards).forEach(card => card.addEventListener('click', flipCard));\n Array.from(cards).forEach(card => card.classList.remove('flip'));\n resetBoard(); \n shuffle();\n}", "function flipCards(){\n\t\t\t\n\tfor(var i = 0;i<16;i++){\n\t\t\t\t\n\t\tcards[i].className += ' down';\n\t\t\t\t\n\t}\n\t\n\t//enable all cards\n\tfor(var i = 0;i<16;i++){\n\t\t\t\n\t\tdocument.getElementById(i).style.pointerEvents = 'auto';\n\t\t\t\n\t}\n\t\t\t\n}", "function rearrangeCards(cards) {\n for (let i = 0; i < shuffledCards.length; i++) {\n deck.appendChild(shuffledCards[i]);\n shuffledCards[i].classList.remove('open', 'show', 'match', 'disable');\n }\n}", "function flipCard(num) {\n\tTweenMax.set(\".board\", {transformPerspective: 600});\n\tTweenMax.staggerFrom(\".cards\", 1.5, {\n\t\trotationX: 40 * num,\n\t\trotationY: 180 * num,\n\t\tz: 100,\n\t\tease:Back.easeInOut,\n\t\trepeatDelay:0.2, \n\t\t// onComplete: tellFortune(num, color),\n\t\t// onCompleteParams:[num, color]\n\t\t// transformPerspective:300,\n\t\t// transformOrigin: \"left 20%\"\n\t});\n\ttellFortune(num);\n}", "function flipCard() {\n var i = this.getAttribute('data-id');\n var c = cards[i];\n cardsInPlay.push(c);\n this.setAttribute('src', c.cardImage)\n console.log('User flipped ' + c.rank + ' of ' + c.suit);\n checkMatch();\n}", "function switchText(){\n\tif(Text_Index >= text.length){\n\t\tredirectPage();\n\t}\n\tif(Time_Index % 2 == 1) Time_Index = 11;\n\telse Time_Index = 10;\n document.getElementById(\"speechtext\").textContent = text[Text_Index];\n Text_Index += 1;\n document.getElementById(\"clicktocontinue\").style.visibility = \"hidden\";\n}", "function flip(e)\n\t{\n\t\tvar e=e? e : window.event;\n\t\tvar el=e.target? e.target : e.srcElement;\n\t\tvar allTextareas = document.getElementsByTagName('textarea');\n\t\t///// Welche Textarea hat den Focus? /////\n\t\tvar input = allTextareas[el.name];\n \t\tinput.focus();\n\t\tif(typeof input.selectionStart != 'undefined')\n\t\t{\t\n\t\t\t///// Smilie an Pos. 'X' einfügen /////\n\t\t\tvar start = input.selectionStart;\n\t\t\tvar end = input.selectionEnd;\n\t\t\tvar insText = input.value.substring(start, end);\n\t\t\tinsText = flipString(insText.toLowerCase());\n\t\t\tinput.value = input.value.substr(0, start) + el.id + insText + input.value.substr(end);\n\t\t\t///// Anpassen der Cursorposition /////\n\t\t\tvar pos;\n\t\t\tif (insText.length == 0) {\n\t\t\t\tpos = start + el.id.length;\n\t\t\t\talert('Markiere den Text den du bearbeiten möchtest.');\n\t\t\t} else {\n\t\t\t\tpos = start + el.id.length + insText.length + el.id.length;\n\t\t\t}\n\t\t\tinput.selectionStart = pos;\n\t\t\tinput.selectionEnd = pos;\n\t\t}\n\t}", "function flipThatCard(deck,val) {\n if(deck.innerHTML == \"\" && card_memory.length < 2){\n deck.style.background = 'white';\n deck.innerHTML = val;\n if (card_memory.length == 0){\n card_memory.push(val);\n deck_cards_ids.push(deck.id);\n } else if(card_memory.length == 1){\n card_memory.push(val);\n deck_cards_ids.push(deck.id);\n if (card_memory[0] == card_memory[1]){\n flip_cards += 2;\n card_memory = [];\n deck_cards_ids = [];\n if(flip_cards == card_arrays.length){\n if (moves < 14){\n alert(\"Great Job! You completed With A Perfect Score 3 Stars with \" + moves + \" Moves and a time of \" + document.getElementById(\"mins\").innerHTML + \" Minutes and \" + document.getElementById(\"secs\").innerHTML + \" Seconds\");\n document.getElementById('deck_cards').innerHTML = \"\";\n reloadPage();\n }\n else if (moves > 14 && moves < 20) {\n alert(\"Good Job! You completed With An Average Score 2 Stars with \" + moves + \" Moves and a time of \" + document.getElementById(\"mins\").innerHTML + \" Minutes and \" + document.getElementById(\"secs\").innerHTML + \" Seconds\");\n document.getElementById('deck_cards').innerHTML = \"\";\n reloadPage();\n } else {\n alert(\"Let's Do Better Next Time :(. You completed With 1 Star with \" + moves + \" Moves and a time of \" + document.getElementById(\"mins\").innerHTML + \" Minutes and \" + document.getElementById(\"secs\").innerHTML + \" Seconds\");\n document.getElementById('deck_cards').innerHTML = \"\";\n reloadPage();\n }\n }\n } else {\n function wrongAnswer(){\n var deck_1 = document.getElementById(deck_cards_ids[0]);\n var deck_2 = document.getElementById(deck_cards_ids[1]);\n deck_1.style.background = '#2e3d49';\n deck_1.innerHTML = \"\";\n deck_2.style.background = '#2e3d49';\n deck_2.innerHTML = \"\";\n card_memory = [];\n deck_cards_ids = [];\n }\n setTimeout(wrongAnswer, 700);\n }\n moves++;\n }\n document.getElementById(\"myMoves\").innerHTML = moves;\n scoreRating(moves);\n\n }\n}", "function changeToCards(number) {\n switch (number) {\n case -1:\n return \"J -\";\n case 0:\n return \"J +\";\n case 1:\n return \"&#9734\";\n case 2:\n return \"10 &#9825\";\n case 3:\n return \"9 &#9825\";\n case 4:\n return \"8 &#9825\";\n case 5:\n return \"7 &#9825\";\n case 6:\n return \"7 &#9827\";\n case 7:\n return \"8 &#9827\";\n case 8:\n return \"9 &#9827\";\n case 9:\n return \"10 &#9827\";\n case 10:\n return \"10 &#9824\";\n case 11:\n return \"K &#9825\";\n case 12:\n return \"6 &#9825\";\n case 13:\n return \"5 &#9825\";\n case 14:\n return \"4 &#9825\";\n case 15:\n return \"4 &#9827\";\n case 16:\n return \"5 &#9827\";\n case 17:\n return \"6 &#9827\";\n case 18:\n return \"K &#9827\";\n case 19:\n return \"10 &#9671\";\n case 20:\n return \"9 &#9824\";\n case 21:\n return \"6 &#9824\";\n case 22:\n return \"Q &#9825\";\n case 23: \n return \"3 &#9825\";\n case 24: \n return \"2 &#9825\";\n case 25: \n return \"2 &#9827\";\n case 26: \n return \"3 &#9827\";\n case 27: \n return \"Q &#9827\";\n case 28: \n return \"6 &#9671\";\n case 29:\n return \"9 &#9671\";\n case 30:\n return \"8 &#9824\";\n case 31:\n return \"5 &#9824\";\n case 32:\n return \"3 &#9824\";\n case 33:\n return \"Q &#9824\";\n case 34:\n return \"A &#9825\";\n case 35:\n return \"A &#9827\";\n case 36:\n return \"Q &#9671\";\n case 37:\n return \"3 &#9671\";\n case 38:\n return \"5 &#9671\";\n case 39:\n return \"8 &#9671\";\n case 40:\n return \"7 &#9824\";\n case 41: \n return \"4 &#9824\";\n case 42: \n return \"2 &#9824\";\n case 43: \n return \"A &#9824\";\n case 44: \n return \"K &#9824\";\n case 45: \n return \"K &#9671\";\n case 46: \n return \"A &#9671\";\n case 47: \n return \"2 &#9671\";\n case 48: \n return \"4 &#9671\";\n case 49: \n return \"7 &#9671\";\n default:\n return \"-2\";\n }\n}", "function displayHandUpdate(){\r\n displayHand = [`Cards:`];\r\n \r\n for (let i=0; i<cards.length; i++){\r\n displayHand.push(\" \"+ cards[i])\r\n\r\n } displayHand = displayHand.join(\"\");\r\n hand.textContent = displayHand;\r\n \r\n}", "function flipBack(openCards) {\n // Loop through each card and add new class/change style to indicate not match\n openCards.forEach(function(openCard) {\n openCard.parentElement.setAttribute('style', 'background-color: #ff0000');\n openCard.parentElement.classList.add('animated', 'wobble');\n });\n // Flip back open cards by removing added class and styles after a delay of 0.8 seconds\n setTimeout(function() {\n openCards.forEach(function(openCard) {\n openCard.parentElement.classList.remove('open', 'animated', 'wobble');\n openCard.parentElement.removeAttribute('style', 'background-color: #ff0000');\n });\n openCards.splice(0, 2);\n }, 800);\n moveCounter();\n starRating();\n}", "function redisplayMain() {\n var elMains = document.getElementById('mains');\n var context = {lings: selectedDances.map(function(index) { return dances[index].lines; }) };\n var mains = templateCard(context);\n mains = replaceGenderWords(mains);\n elMains.innerHTML = mains;\n\n var controls = document.getElementsByClassName('cardcontrols');\n for (var i = 0; i < selectedDances.length; ++i) {\n var x = controls[i];\n var name = selectedDances[i];\n x.getElementsByClassName('up')[0].addEventListener('click', getUpDance(name, x.parentNode));\n x.getElementsByClassName('down')[0].addEventListener('click', getDownDance(name, x.parentNode));\n x.getElementsByClassName('out')[0].addEventListener('click', getCloseDance(name, x.parentNode));\n }\n}", "function setNewCards() {\n\tcardList = shuffle(cardList);\n\tfor (let i = 0; i < cardList.length; i++) {\n\t\tcardList[i].classList.remove('match', 'open', 'show');\n\t\tcardList[i].addEventListener('click', turnCard);\n\t\tmyDeck.appendChild(cardList[i]);\n\t}\n}", "function flipCard() {\n\tvar cardId = this.getAttribute('data-id');\n\tconsole.log(\"User flipped \" + cards[cardId].rank + \" of \" + cards[cardId].suit);\n\tconsole.log(cards[cardId].cardImage);\n\tconsole.log(cards[cardId].suit);\n\tthis.setAttribute('src',cards[cardId].cardImage);\n\tcardsInPlay.push(cards[cardId].rank);\n\tcheckForMatch();\n\t// remove eventListener for cards that have already been flipped\n\tthis.removeEventListener('click',flipCard);\n}", "function swapCards(hideItems, showItems, audio, num){\n\tfor (var i=0, j=hideItems.length; i<j; i++) {\n\t\t$(\thideItems[i] ).addClass('off');\n\t}\n\tfor (var k=0, m=showItems.length; k<m; k++) {\n\t\t$(\tshowItems[k] ).removeClass('off');\n\t}\n\tshell.caption.onSubSubPage = true;\n\tshell.caption.subSubPageNum = num;\n\tshell.caption.subSubPosition = 0;\n\t/*shell.caption.current.page = 'subSub';\n\tshell.caption.current.position = shell.caption.subSubPosition;\n\tshell.caption.current.num = shell.caption.subSubPageNum;*/\n\tif (audio != \"\") {\n\t\tloadPageAudio(audio);\n\t} else {\n\t\tclearAudio();\t\n\t\tclearCC();\n\t}\n\tif (num == 4) {\n\t\tcontentSwap.extraCompleted = true;\n\t\tconsole.log(contentSwap.clickedArray);\n\t\tcheckClickCompletion(contentSwap.clickedArray);\n\t}\n}", "function swapCards(hideItems, showItems, audio, num){\n\tfor (var i=0, j=hideItems.length; i<j; i++) {\n\t\t$(\thideItems[i] ).addClass('off');\n\t}\n\tfor (var k=0, m=showItems.length; k<m; k++) {\n\t\t$(\tshowItems[k] ).removeClass('off');\n\t}\n\tshell.caption.onSubSubPage = true;\n\tshell.caption.subSubPageNum = num;\n\tshell.caption.subSubPosition = 0;\n\t/*shell.caption.current.page = 'subSub';\n\tshell.caption.current.position = shell.caption.subSubPosition;\n\tshell.caption.current.num = shell.caption.subSubPageNum;*/\n\tif (audio != \"\") {\n\t\tloadPageAudio(audio);\n\t} else {\n\t\tclearAudio();\t\n\t\tclearCC();\n\t}\n\treturn false;\n}", "function changeText() {\n \n }", "playerCardReveal() {\n // $(\".player-text\").eq(this.playerHand.length-1).addClass(`${this.playerHand[this.playerHand.length-1].suit} ${this.playerHand[this.playerHand.length-1].icon}`)\n\n $(\".player-text\").eq(this.playerHand.length-1).text(`${this.playerHand[this.playerHand.length-1].sign}${this.playerHand[this.playerHand.length-1].unicode}`);\n if(this.playerHand[this.playerHand.length-1].suit===\"diamonds\" || this.playerHand[this.playerHand.length-1].suit===\"hearts\"){\n $(\".player-text\").eq(this.playerHand.length-1).css(\"color\", \"red\");\n }\n else{\n $(\".player-text\").eq(this.playerHand.length-1).css(\"color\", \"black\");\n };\n if(this.playerHand[this.playerHand.length-1].icon===\"two\"){\n $(\".player-card-img\").eq(this.playerHand.length-1).attr(\"src\", caterpie)\n }\n else if(this.playerHand[this.playerHand.length-1].icon===\"three\"){\n $(\".player-card-img\").eq(this.playerHand.length-1).attr(\"src\", zubat)\n }\n else if(this.playerHand[this.playerHand.length-1].icon===\"four\"){\n $(\".player-card-img\").eq(this.playerHand.length-1).attr(\"src\", geodude)\n }\n else if(this.playerHand[this.playerHand.length-1].icon===\"five\"){\n $(\".player-card-img\").eq(this.playerHand.length-1).attr(\"src\", machop)\n }\n else if(this.playerHand[this.playerHand.length-1].icon===\"six\"){\n $(\".player-card-img\").eq(this.playerHand.length-1).attr(\"src\", gastly)\n }\n else if(this.playerHand[this.playerHand.length-1].icon===\"seven\"){\n $(\".player-card-img\").eq(this.playerHand.length-1).attr(\"src\", chansey)\n }\n else if(this.playerHand[this.playerHand.length-1].icon===\"eight\"){\n $(\".player-card-img\").eq(this.playerHand.length-1).attr(\"src\", alakazam)\n }\n else if(this.playerHand[this.playerHand.length-1].icon===\"nine\"){\n $(\".player-card-img\").eq(this.playerHand.length-1).attr(\"src\", onix)\n }\n else if(this.playerHand[this.playerHand.length-1].icon===\"ten\"){\n $(\".player-card-img\").eq(this.playerHand.length-1).attr(\"src\", gyrados)\n }\n else if(this.playerHand[this.playerHand.length-1].icon===\"jack\"){\n $(\".player-card-img\").eq(this.playerHand.length-1).attr(\"src\", snorlax)\n }\n else if(this.playerHand[this.playerHand.length-1].icon===\"queen\"){\n $(\".player-card-img\").eq(this.playerHand.length-1).attr(\"src\", dragonite)\n }\n else if(this.playerHand[this.playerHand.length-1].icon===\"king\"){\n $(\".player-card-img\").eq(this.playerHand.length-1).attr(\"src\", mewtwo)\n }\n else if(this.playerHand[this.playerHand.length-1].icon===\"ace\"){\n $(\".player-card-img\").eq(this.playerHand.length-1).attr(\"src\", pikachu)\n }\n }", "_rollDeck(upNext) {\n\n if (this.options.rollingOrStepThrough !== \"rolling\") {\n throw \"Flippity's _rollDeck method requires rollingOrStepThrough to be set to \\\"rolling\\\"\"\n }\n if (typeof upNext !== 'string' || (!(upNext instanceof String))) {\n upNext = String(upNext)\n }\n\n const upNextArray = upNext.split(\"\");\n this.root.style.setProperty(\"--flippity-fliptime\", `${0}s`);\n\n this.childNodeArray.forEach((parentNode, index) => {\n let card = parentNode.querySelector('.card');\n card.classList.remove(\"is-flipped\");\n // this._drawInnerHtml(parentNode, this.upNow[index], upNextArray[index]);\n\n let background = parentNode.querySelector('.background');\n let backgroundTop = background.querySelector('.number__top');\n console.log(backgroundTop);\n backgroundTop.innerHTML = String(upNextArray[index]);\n\n let frontTop = card.querySelector('.card__face--front-top');\n let numberTop = frontTop.querySelector('.number__top');\n console.log(numberTop);\n numberTop.innerHTML = String(this.upNow[index]);\n\n let back = card.querySelector('.card__face--back');\n let numberflipped = back.querySelector('.number__top--flipped');\n numberflipped.innerHTML = String(upNextArray[index]);\n\n let frontBack = parentNode.querySelector('.card__face--front-bottom');\n let numberBottom = frontBack.querySelector('.number__bottom');\n numberBottom.innerHTML = String(this.upNow[index]);\n });\n\n this.root.style.setProperty(\"--flippity-fliptime\", `${this.options.flipTime}s`);\n\n\n // short delay time to wait for innerHTML to be set\n setTimeout(() => {\n this.childNodeArray.forEach((parentNode, index) => {\n let card = parentNode.querySelector('.card');\n card.classList.add(\"is-flipped\");\n });\n }, 0);\n\n }", "function flipCard(card, flipDirection) {\n if(flipDirection != 'reverse') {\n card.setAttribute('class', 'card open show');\n } else {\n card.setAttribute('class', 'card');\n }\n}", "function updateCurrentText() {\n curEl.innerText = `${curActCd + 1}/${cardsEl.length}` \n}", "function flipHorizontal() {\n var oldstr = currentOrientationIndex + \" \" + orientations[currentOrientationIndex];\n \n // N <--> rS, S <--> rN\n // E <--> rE, W <--> rW\n // N E S W\n // ↕ ↕ ↕ ↕\n // rS rE rN rW\n \n // N S rN rS (even indices)\n if(currentOrientationIndex % 2 === 0)\n {\n currentOrientationIndex = 6 - currentOrientationIndex;\n }\n \n \n // E rW W rE (odd indices)\n else\n {\n currentOrientationIndex = (currentOrientationIndex + 4) % 8;\n }\n \n \n var newstr = currentOrientationIndex + \" \" + orientations[currentOrientationIndex];\n var str = \"orientations - old: \" + oldstr + \" new: \" + newstr;\n console.log(str);\n \n //...........\n drawPiece();\n}", "function flipCard() {\n if (lockBoard) return;\n if (this === firstCard) return;\n\n this.classList.add('flip');\n\n if (!hasFlippedCard) {\n hasFlippedCard = true;\n firstCard = this;\n\n return;\n }\n\n secondCard = this;\n checkForMatch();\n}", "function createCard(card) {\n // if card isn't faceUp\n if (!card.faceUp) {\n return unknownCard;\n\n }\n\n var cardText = (card.rank != \"10\" ? `______\n|R S|\n| |\n|S R|\n` + (unicode ? \"\\u203E\\u203E\\u203E\\u203E\\u203E\\u203E\" : \"------\") : `______\n|R S|\n| |\n|S R|\n`+ (unicode ? \"\\u203E\\u203E\\u203E\\u203E\\u203E\\u203E\" : \"------\"));\n var s;\n switch(card.suit) {\n case \"Spades\":\n s = (unicode ? \"\\u2660\" : \"S\");\n break;\n case \"Hearts\":\n s = (unicode ? \"\\u2665\" : \"H\");\n break;\n case \"Clubs\":\n s = (unicode ? \"\\u2663\" : \"C\");\n break;\n case \"Diamonds\":\n s = (unicode ? \"\\u2666\" : \"D\");\n break;\n }\n\n var r = card.rank;\n\n // replace all instances of \"R\" with rank\n cardText = cardText.replace(/R/g, r);\n\n // replace all instances of \"S\" with rank\n cardText = cardText.replace(/S/g, s);\n\n // if card is black, replace all spaces with a \"/\"\n if (isBlack(card.suit)) {\n cardText = cardText.replace(/ /g, \"/\");\n }\n\n return cardText;\n}", "function flipCard() {\n\tvar cardId = this.getAttribute('data-id');\n\t/* Debug --------\n\tconsole.log(\"You flipped \" + shuffleCards[cardId].rank + \".\");\n\tconsole.log(shuffleCards[cardId].suit);\n\tconsole.log(shuffleCards[cardId].cardImage); */\n\tcardsInPlay.push(shuffleCards[cardId].rank); \n\tthis.setAttribute('src', shuffleCards[cardId].cardImage);\n\tcheckForMatch();\n}", "function flipVertical() {\n var oldstr = currentOrientationIndex + \" \" + orientations[currentOrientationIndex];\n \n // N <--> rN, S <--> rS\n // E <--> rW, W <--> rE\n // N E S W\n // ↕ ↕ ↕ ↕\n // rN rW rS rE\n \n \n // N S rN rS (even indices)\n if(currentOrientationIndex % 2 === 0)\n {\n currentOrientationIndex = (currentOrientationIndex + 4) % 8;\n }\n \n \n // E rW W rE (odd indices)\n else\n {\n currentOrientationIndex = 8 - currentOrientationIndex;\n }\n \n \n \n var newstr = currentOrientationIndex + \" \" + orientations[currentOrientationIndex];\n var str = \"orientations - old: \" + oldstr + \" new: \" + newstr;\n console.log(str);\n \n //...........\n drawPiece();\n}", "function flipCard(elem) {\n elem.style = \"transform: rotateY(180deg);\";\n\n}", "function flipCard() { // flip card function, flips card on click, only applies when board not locked and flipping 1st or 2nd card\n if (lockBoard) return;\n if (this === firstCard) return;\n\n this.classList.add(\"flip\");\n\n if (!hasFlippedCard) {\n hasFlippedCard = true;\n firstCard = this;\n\n return;\n }\n\n secondCard = this;\n checkCards();\n}", "function flipCard(id) {\n this.cards[id].flip();\n if (this.open.length > 1) {\n this.checkMatch() ? this.matchFound() : this.matchNotFound();\n };\n /* Render the scoreboard */\n this.render();\n }", "function flipAllCards(){\n Array.from(cards).forEach(card => card.classList.remove('flip'));\n Array.from(cards).forEach(card => card.style.cursor = \"pointer\");\n}", "function flipCards() {\n if (wrongAnswer) {\n openCards[0].removeClass('open show fail bounce locked');\n openCards[1].removeClass('open show fail bounce locked');\n }\n}", "function flipCard(event) {\n \n//counter for the moves\n moves++;\n counter.innerHTML= 'Moves '+ moves;\n\n if (!firstCard || !secondCard) {\n event.target.classList.toggle('front');\n //lock the bord \n if (lockBord) return; \n if (this === firstCard) return;\n\n if (!hasFlippedCard) {\n hasFlippedCard = true;\n firstCard = this; \n return; \n }\n secondCard = this;\n checkForMatch();\n }\n }", "function switchtext(){\n\t\t$(\"ol\").html(\"falseFact\");\n\t\t$(\"ol\").html(\"TrueFact\");\n\t\n\t}", "function flipCard (){\n\t//getAttribute method to get the data-id attribute of the card that was just clicked and store it in a variable cardId.\n\tvar cardId = this.getAttribute('data-id');\n\tcardsInPlay.push(cards[cardId].rank); //add the card that the user flipped to the cardsInPlay array.\n\t//log into the console the flipped card details.\n\tconsole.log(\"User flipped \" + cards[cardId].rank);\n\tconsole.log(cards[cardId].cardImage);\n\tconsole.log(cards[cardId].suit);\n\t//use the setAttribute method to update the src attribute to the image of the card that was just clicked\n\tthis.setAttribute('src', cards[cardId].cardImage);\n\n\t//if statement that checks to see if the length of the cardsInPlay array is 2 to call checkForMatch.\n\tif (cardsInPlay.length === 2){\n\t\tcheckForMatch();\n\t}\n}", "function flipBack(){\n\t\t\t\t var One = document.getElementById(card_ids[card_ids.length-1]);\n\t\t\t\t var Two = document.getElementById(card_ids[card_ids.length-2]);\n\t\t\t\t One.style.background = 'rgb(36, 96, 147) no-repeat';\n\t\t\t\t Two.style.background = 'rgb(36, 96, 147) no-repeat';\n\t\t\t\t One.innerHTML = \"\";\n \t Two.innerHTML = \"\";\n\t\t\t\t card_values = [];\n \t card_ids.pop();\n \t card_ids.pop();\n \t\t}", "function flipCard() {\n //get data-id attribute of card clicked and store in var cardId\n let cardId = this.getAttribute('data-id');\n console.log(\"User flipped \"+cards[cardId].rank);\n console.log(cards[cardId].cardImage);\n console.log(cards[cardId].suit);\n cardsInPlay.push(cards[cardId].rank);\n //update src attribute to image of card that was just clicked\n this.setAttribute('src', cards[cardId].cardImage);\n //checking if player picked two cards\n if (cardsInPlay.length === 2) {\n checkForMatch();\n }\n}", "function flipCard() {\r\n if (lockBoard) return;\r\n if (this === firstCard) return;\r\n\r\n this.classList.add(\"flip\");\r\n\r\n if (!hasFlippedCard) {\r\n hasFlippedCard = true;\r\n firstCard = this;\r\n\r\n return;\r\n }\r\n\r\n secondCard = this;\r\n checkForMatch();\r\n if (correct_flips >= 6) {\r\n endGame();\r\n }\r\n}", "function displayAbilitiesFromCard(card) {\n var cardExp = document.getElementById(\"card-exp\");\n var oracleText = card.oracle_text;\n var cardName = \"<em>\" + card.name + \"</em>\";\n var text = \"<div class='center'><h2>Abilities</h2></div><p>Creatures often have special abilities to help you vanquish your opponents!</p>\"\n // match a bunch of different matches for abilities\n // TODO\n // get rid of the card name from the box, gets rid of stuff like \"flying men\"\n var replacedText = oracleText.replace(card.name, \"\");\n // deathtouch\n if (replacedText.match(\"Deathtouch\") || replacedText.match(\", deathtouch\")) {\n text += \"<p>If a creature is dealt damage by a creature with <span class='jargon'>deathtouch</span>, it is destroyed, even if it was only 1 damage. Kinda terrifying.</p>\"\n }\n // defender\n if (replacedText.match(\"Defender\") || replacedText.match(\", defender\")) {\n text += \"<p>Creatures with <span class='jargon'>defender</span> are made for blocking. They can't attack, even if they wanted to.</p>\"\n }\n // first strike\n if (replacedText.match(\"First strike\") || replacedText.match(\", first strike\")) {\n text += \"<p>\" + cardName + \" is a creature with <span class='jargon'>first strike</span> - it deals damage first in combat. If it deals enough damage to defeat the opposing creature, that creature doesn't get to fight back!</p>\"\n }\n // flash\n if (replacedText.match(\"Flash\") || replacedText.match(\", flash\")) {\n text += \"<p>Cards with <span class='jargon'>flash</span> can be played almost any time, even during your opponents' turns. Who doesn't like using the element of surprise?</p>\"\n }\n // flying\n if (replacedText.match(\"Flying\") || replacedText.match(\", flying\")) {\n text += \"<p>This creature has <span class='jargon'>flying</span> - it can only be blocked by other creatures with flying. This means you can often attack your opponent directly and who doesn't want to do that?</p>\"\n }\n // haste\n if (replacedText.match(\"Haste\") || replacedText.match(\", haste\")) {\n text += \"<p>Creatures without <span class='jargon'>haste</span> have to wait a turn before they can attack or <span class='jargon'>\\'tap\\'</span>. However, creatures like \" + cardName + \" can attack the turn they are summoned. Good if you're in a rush!</p>\"\n }\n // hexproof\n if (replacedText.match(\"Hexproof\") || replacedText.match(\", hexproof\")) {\n text += \"<p>Creatures with <span class='jargon'>hexproof</span> can't be <span class='jargon'>\\'targeted\\'</span> by your opponents' spells and abilities. \" + cardName + \" is gonna be a pesky one for your opponents to get rid of!</p>\"\n }\n // lifelink\n if (replacedText.match(\"Lifelink\") || replacedText.match(\", lifelink\")) {\n text += \"<p>\" + cardName + \" has <span class='jargon'>lifelink</span>, which means that you gain life equal to the damage it deals. That makes it less likely that you die, which I'm pretty sure is a bonus.</p>\"\n }\n // menace\n if (replacedText.match(\"Menace\") || replacedText.match(\", menace\")) {\n text += \"<p>Creatures like \" + cardName + \" are so <span class='jargon'>menace</span>-ing that they can only be blocked if two or more creatures get the courage to block it at the same time. Me? I wouldn't dare.</p>\"\n }\n // reach\n if (replacedText.match(\"Reach\") || replacedText.match(\", reach\")) {\n text += \"<p>\" + cardName + \" has <span class='jargon'>reach</span>, so it can block those pesky fliers your opponent has.</p>\";\n }\n // TODO tap symbol {T}\n // if (replacedText.match(\"{t}\")) {\n // var tapSymbol = \"<img alt='T.svg' src='assets/img/T.svg' width='30px' height='30px' class='inline-image'>\";\n // text += \"<p>\" + tapSymbol + \" is the <span class='jargon'>\\'tap\\'</span> symbol.</p>\"\n // }\n // trample\n if (replacedText.match(\"Trample\") || replacedText.match(\", trample\")) {\n text += \"<p>Creatures with <span class='jargon'>trample</span> deal their excess damage to the <span class='jargon'>defending player</span> when they're blocked. It's best on huge, beefy creatures.</p>\"\n }\n // vigilance\n if (replacedText.match(\"Vigilance\") || replacedText.match(\", vigilance\")) {\n text += \"<p>Normally, creatures must <span class='jargon'>\\'tap\\'</span>, or be turned 90 degrees, to attack. If a creature has <span class='jargon'>vigilance</span> (like this one), however, attacking doesn't cause it to tap. This is useful as only <span class='jargon'>\\'untapped\\'</span> creatures are able to block.</p>\"\n }\n // add the rulebook bit\n text += \"<p>If you want to read more in detail about the game's rules and abilities, there is a hefty comprehensive rulebook, (over 200 pages!) available <a href=\\\"http://magic.wizards.com/en/game-info/gameplay/rules-and-formats/rules\\\" target=blank>here</a>. Be warned, it is really dry and technical!</p>\";\n cardExp.innerHTML = text;\n}", "function flipCard() {\n for (i = 0; i < 24; i++) {\n if (this.classList.contains('available')) {\n this.classList.add(\"flipCard\");\n this.classList.remove('available');\n }\n }\n}", "function setDeniseText() {\n var textToApplyDenise = \"\";\n if (houseUpgrades.upgrades[1].owned == 0) { textToApplyDenise = \"We Need a BED to sleep in\"; }\n else if (houseUpgrades.upgrades[2].owned == 0) { textToApplyDenise = \"I wish I had a CHEST to put stuff.\"; }\n else if (houseUpgrades.upgrades[3].owned == 0) { textToApplyDenise = \"We need a SINK to cook and clean - please buy one\"; }\n else if (houseUpgrades.upgrades[4].owned == 0) { textToApplyDenise = \"Are we Animals? We need a TABLE to eat on.\"; }\n else if (houseUpgrades.upgrades[5].owned == 0) { textToApplyDenise = \"You are gonna buy some CHAIRS right?\"; }\n else if (houseUpgrades.upgrades[6].owned == 0) { textToApplyDenise = \"All the ladies in town have a DRESSING TABLE, but I do not....\"; }\n else if (houseUpgrades.upgrades[7].owned == 0) { textToApplyDenise = \"A BEDSIDE TABLE would be very nice to have\"; }\n else if (houseUpgrades.upgrades[8].owned == 0) { textToApplyDenise = \"We need more decor. A POTTED PLANT would be nice\"; }\n else if (houseUpgrades.upgrades[9].owned == 0) { textToApplyDenise = \"A COUCH to sit on would be nice to have over there\"; }\n else if (houseUpgrades.upgrades[10].owned == 0) {\n if (houseUpgrades.upgrades[0].owned == 1) { textToApplyDenise = \"We need some CURTAINS for this new space\"; }\n else { textToApplyDenise = \"We need more room; a little one is on the way\"; }\n }\n else if (houseUpgrades.upgrades[11].owned == 0) {\n if (houseUpgrades.upgrades[0].owned == 1) { textToApplyDenise = \"We need a DOUBLE BED to fill this space\"; }\n else { textToApplyDenise = \"We need more room; a little one is on the way\"; }\n }\n else if (houseUpgrades.upgrades[12].owned == 0) {\n if (houseUpgrades.upgrades[0].owned == 1) { textToApplyDenise = \"I wish I had STOOL to sit on back there\"; }\n else { textToApplyDenise = \"We need more room; a little one is on the way\"; }\n }\n else if (houseUpgrades.upgrades[13].owned == 0) {\n if (houseUpgrades.upgrades[0].owned == 1) { textToApplyDenise = \"I wish I had WARDROBE to hang my dresses\"; }\n else { textToApplyDenise = \"We need more room; a little one is on the way\"; }\n }\n else if (houseUpgrades.upgrades[14].owned == 0) {\n if (houseUpgrades.upgrades[0].owned == 1) { textToApplyDenise = \"I sure do like that FANCY COUCH. Won't you buy it for me?\"; }\n else { textToApplyDenise = \"We need more room; a little one is on the way\"; }\n }\n else if (houseUpgrades.upgrades[15].owned == 0) {\n if (houseUpgrades.upgrades[0].owned == 1) { textToApplyDenise = \"Don't you think BOOKSHELVES would look good here?\"; }\n else { textToApplyDenise = \"We need more room; a little one is on the way\"; }\n }\n else if (houseUpgrades.upgrades[16].owned == 0) {\n if (houseUpgrades.upgrades[0].owned == 1) { textToApplyDenise = \"That FANCY TABLE is so elegant. I wish we could have it\"; }\n else { textToApplyDenise = \"We need more room; a little one is on the way\"; }\n }\n else if (houseUpgrades.upgrades[17].owned == 0) {\n if (houseUpgrades.upgrades[0].owned == 1) { textToApplyDenise = \"Now we need some FANCY CHAIRS to complete our set\"; }\n else { textToApplyDenise = \"We need more room; a little one is on the way\"; }\n }\n else if (houseUpgrades.upgrades[18].owned == 0) {\n if (houseUpgrades.upgrades[0].owned == 1) { textToApplyDenise = \"Don't you need a DESK to keep the farm in order?\"; }\n else { textToApplyDenise = \"We need more room; a little one is on the way\"; }\n }\n else if (houseUpgrades.upgrades[19].owned == 0) {\n if (houseUpgrades.upgrades[0].owned == 1) { textToApplyDenise = \"That PAINTING would look good over the mantle\"; }\n else { textToApplyDenise = \"We need more room; a little one is on the way\"; }\n }\n else if (houseUpgrades.upgrades[20].owned == 0) {\n if (houseUpgrades.upgrades[0].owned == 1) { textToApplyDenise = \"I need a DISH CABINET to keep our dishes\"; }\n else { textToApplyDenise = \"We need more room; a little one is on the way\"; }\n }\n else if (houseUpgrades.upgrades[21].owned == 0) {\n if (houseUpgrades.upgrades[0].owned == 1) { textToApplyDenise = \"We need a TRUNK to store Patricia's toys\"; }\n else { textToApplyDenise = \"We need more room; a little one is on the way\"; }\n }\n else if (houseUpgrades.upgrades[22].owned == 0) {\n if (houseUpgrades.upgrades[0].owned == 1) { textToApplyDenise = \"A different color of walls would be a nice\"; }\n else { textToApplyDenise = \"We need more room; a little one is on the way\"; }\n }\n else { textToApplyDenise = \"I am happy and don't need anything....for the moment\"; }\n //apply the deireved text\n questText1House.setText(textToApplyDenise);\n }", "function flipCard(){\n let cardId = this.getAttribute('data-id')\n cardChosen.push(cardArray[cardId].name)\n cardChosenId.push(cardId)\n this.setAttribute('src', cardArray[cardId].img)\n if(cardChosen.length ===2){\n setTimeout(checkForMatch, 500)\n }\n}", "changeCard(card) {\n console.log(\"Changing card to \\\"\" + card.question + \"\\\"\");\n Dispatcher.handleViewAction({\n type: Constants.ActionTypes.CARD_CHANGED,\n card: card\n });\n }", "function updateCards(index) {\n let card = cards[index]\n let cardsArr = [...cards]\n\n // If card is already flipped, or has been \"removed\" don't do anything\n if (!card.view || card.view === card.front) {\n return\n }\n\n if (turn <= 1) {\n card.view = card.front // Flip the card\n cardsArr[index] = card // Overwrite the old card state in the cards array\n\n let matchArr = checkMatch(cardsArr) // Get matching cards\n\n if (matchArr) {\n setTurn(0) // If match is found, reset turn to 0, because\n cardsArr = handleMatch(matchArr, cardsArr) //\n } else {\n setTurn((prev) => prev + 1)\n }\n setCards(cardsArr)\n } else {\n props.setCurrPlayer((props.currPlayer === \"player1\" ? \"player2\" : \"player1\"))\n setTurn(1)\n cardsArr = resetCards(cardsArr)\n card.view = card.front\n cardsArr[index] = card\n setCards(cardsArr)\n }\n return\n }", "function flipCard(e) {\n\t\tlet chosen = e.target;\n\t\t// Checks if clicked element is a card, is not open, and if there are already 2 open cards\n\t\tif (chosen.nodeName === 'LI' && !chosen.classList.contains('open', 'show', 'match') && chosenCards.length !== 2) {\n\t\t\t\tchosen.classList.add('open');\n\t\t\t\taddChosenCard(chosen);\n\t\t\t\tif (timer === false && pairsRemain > 0) {\n\t\t\t\t\t\ttimerOn();\n\t\t\t\t}\n\t\t\t\tsetTimeout(showCard, 300, chosen);\n\t\t}\n}", "function flipCard()\n\t{\n\t\tvar cardId = this.getAttribute('data-id');\n\t\tcardsInPlay.push(cards[cardId].rank);\n\t\t//console.log(\"User flipped \" + cards[cardId].rank+ \"\"+cards[cardId].cardImage);\n\t\tthis.setAttribute('src',cards[cardId].cardImage);\n\n\t\t//to check if two card are the same\n\t\tif(cardsInPlay.length===2)\t\n\t\tif (cardsInPlay[0] === cardsInPlay[1])\n\t\t { \n\t\t \t alert(\"You found a match!\"); \n\t\t //update score\n\t\t score = ++score; \n\t\t }\n\t\t // if user did not flip the same cards\n\t\telse \n\t\t {\n\t\t \talert(\"Sorry, try again.\");\n\n\t\t }\n\t}", "function changeMode(){\n\tmessage.textContent = \" \"\n\thardBtn.classList.remove(\"selectedGameMode\");\n\teasyBtn.classList.remove(\"selectedGameMode\");\n\th1.style.backgroundColor = \"steelblue\";\n}", "function flipCard() {\n if (lockBoard) return;\n if (this === firstCardFlip) return;\n this.classList.add('flip');\n if (!cardHasFlipped) {\n cardHasFlipped = true;\n firstCardFlip = this;\n return;\n }\n secondCardFlip = this;\n\n checkForMatch();\n}" ]
[ "0.6693379", "0.6615352", "0.6580999", "0.65573806", "0.6531578", "0.644659", "0.6374866", "0.63484454", "0.6326378", "0.6326366", "0.62626284", "0.62561923", "0.6254042", "0.6251482", "0.6244136", "0.6243179", "0.6217477", "0.621517", "0.62074244", "0.6166291", "0.61537254", "0.61172587", "0.6098115", "0.6079678", "0.6074274", "0.6074091", "0.6066125", "0.60575306", "0.6023183", "0.6022347", "0.60153687", "0.60107476", "0.5990277", "0.59802866", "0.59751606", "0.5960038", "0.59575677", "0.5952155", "0.5936508", "0.5931647", "0.591768", "0.5914741", "0.59053874", "0.58958095", "0.58888656", "0.5883884", "0.5882755", "0.5862766", "0.5854451", "0.585102", "0.58469045", "0.58434016", "0.58372384", "0.58354664", "0.58346224", "0.5824507", "0.58205706", "0.580989", "0.5805965", "0.58021414", "0.57976085", "0.5790369", "0.5787991", "0.5786372", "0.5782328", "0.57765454", "0.5772921", "0.5769292", "0.5769122", "0.576272", "0.57605106", "0.575836", "0.5750684", "0.57453567", "0.5739472", "0.5735293", "0.57306445", "0.5725003", "0.57245624", "0.57204235", "0.57186645", "0.5717869", "0.5717178", "0.5713648", "0.57113004", "0.5705168", "0.56993824", "0.569731", "0.56941426", "0.56904835", "0.56900203", "0.5689542", "0.5689153", "0.56873786", "0.5681295", "0.56789273", "0.56738734", "0.56698203", "0.56674486", "0.56650734" ]
0.664673
1
disable the choice button to select a card when it is not a player's turn
disableCardChooseButton() { let choiceButtonIsDisabled = this.choiceButton.nativeElement.classList.contains('disabled'); if ((this.currMode == _entity_data_structures_card_modes__WEBPACK_IMPORTED_MODULE_1__["cardMode"].voting && !choiceButtonIsDisabled) || (this.currMode == _entity_data_structures_card_modes__WEBPACK_IMPORTED_MODULE_1__["cardMode"].myTurn && choiceButtonIsDisabled) || (this.currMode == _entity_data_structures_card_modes__WEBPACK_IMPORTED_MODULE_1__["cardMode"].waiting && !choiceButtonIsDisabled)) { this.choiceButton.nativeElement.classList.toggle('disabled'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectCard (card) {\n humanPlayer.hand.tradeIns[card] = !humanPlayer.hand.tradeIns[card];\n \n if (humanPlayer.hand.tradeIns[card]) {\n dullCard(HUMAN_PLAYER, card);\n } else {\n fillCard(HUMAN_PLAYER, card);\n }\n}", "function disableCorrectCards(){\n $(selectedCards[0]).find('.card-front').attr('src','images/done-card-back.png');\n $(selectedCards[1]).find('.card-front').attr('src','images/done-card-back.png');\n $(selectedCards[0]).find('.card-front').removeClass('active');\n $(selectedCards[1]).find('.card-front').removeClass('active');\n $(selectedCards[0]).off('click');\n $(selectedCards[1]).off('click');\n flipCardsBackDown();\n}", "function buttondisable1 () {\n $('#playcard').prop('disabled', false)\n}", "function disableCardClick() {\n setTimeout(() => {\n $(\".matched\").off(\"click\", clearCardInPlay);\n }, 500);\n }", "function onDisableCards(e) {\n\t\tuserInterface.disableRestartBtn();\n\n\t\tcards.forEach(card => {\n\t\t\tcard.disableMe();\n\t\t});\n\t}", "function disableCards() {\n app.lockBoard = true;\n setTimeout(() => {\n app.firstCard.style.pointerEvents = \"none\";\n app.secondCard.style.pointerEvents = \"none\";\n resetBoard();\n }, 500);\n}", "function disableCards() {\n firstCard.removeEventListener('click', flipCard);\n secondCard.removeEventListener('click', flipCard);\n resetBoard();\n winner();\n }", "function playercardturn(player){\n //show cards\n //ask to select cards to play\n //push them into action slot\n }", "function disable() {\n Array.prototype.filter.call(cards, function(cards) {\n card.classList.add(\"disable\");\n });\n }", "function disable(){\n [].filter.call(allCardsGame, function(card) {\n card.classList.add('disabled');\n });\n}", "function start_turn(){\n\tif(dbg){\n\t\tdebug(\"Start turn\");\n\t}\n\t\n\t//enable selection buttons\n\tvar x = document.getElementsByClassName(\"select\");\n\tfor (i=0; i < x.length; i++){\n\t\tx[i].disabled = false;\n\t}\n}", "function disableCards(){\n let name = secondCard.dataset.name;\n player.innerHTML = name;\n firstCard.removeEventListener(\"click\", flipCard);\n secondCard.removeEventListener(\"click\", flipCard);\n player.classList.add(\"active\");\n resetBoard();\n setTimeout(gameFinished,1000);\n setTimeout(()=>{\n player.classList.remove(\"active\");\n },2000)\n}", "function disable() {\n Array.prototype.filter.call(cards, function (card) {\n if (card.className === 'card') {\n card.className += ' disabled';\n }\n });\n}", "function disableCLick() {\n openCards.forEach(function (card) {\n card.off('click');\n });\n}", "function enableCardOrNot(){\n let transferenciaELEM = document.getElementById(\"selectorDatosCuenta\");\n let sel = document.getElementById(\"selectorTarjeta\");\n let tarjetaELEM = document.getElementById(\"tarjeta\");\n let esTarjeta = tarjetaELEM.checked;\n if(esTarjeta){\n transferenciaELEM.disabled = true;\n sel.disabled = false;\n } else {\n transferenciaELEM.disabled = false;\n sel.disabled = true;\n }\n}", "function chosenClick() {\n if (core || all || career) { // If any other tab is currently open, set them to false and show user's chosen courses\n setAll(false);\n setCore(false);\n setCareer(false);\n setChosen(true);\n }\n }", "function handleChoiceCardType(e) {\n if (currentPage == \"cardservice/create/visa/card-unlock\") {\n handleChoiceCardTypeClose();\n if ((e.selectedValue1 != undefined) && (e.selectedValue1 != null)) {\n var tagAccNo = document.getElementById(\"open-card-lock-type\");\n if (tagAccNo.nodeName == \"INPUT\") {\n tagAccNo.value = e.selectedValue1;\n }\n else {\n tagAccNo.innerHTML = e.selectedValue1;\n }\n }\n if ((e.selectedValue2 != undefined) && (e.selectedValue2 != null)) {\n if(pCardTypeSelected != e.selectedValue2) {\n document.getElementById(\"open-card-lock-no\").value = CONST_STR.get('COM_TXT_SELECTION_PLACEHOLDER');\n }\n pCardTypeSelected = e.selectedValue2;\n\n //disable if do not card\n document.getElementById(\"open-card-lock-no\").disabled = 'disable';\n for(var i=0; i< gTrans.carUnLockArr.length; i++) {\n var tmpCard = gTrans.carUnLockArr[i];\n if(tmpCard.LOAI_THE == pCardTypeSelected) {\n document.getElementById(\"open-card-lock-no\").disabled = '';\n break;\n }\n }\n }\n }\n }", "function freezeEnBoard() {\n setTimeout(() => {\n if (enCardInPlay >= 1) {\n $(\".game-card-en\").off(\"click\", playGame);\n }\n }, 100);\n }", "function disable() {\n openCards[0].classList.add('disabled');\n openCards[1].classList.add('disabled');\n allCards.forEach(function(card) {\n card.classList.add('disabled');\n });\n}", "function setChoosingStateOn() {\n\t\tplayerIsChoosing = true;\n\t}", "enableAll(){\n let guessedCards = this.state.guessedCards;\n guessedCards = guessedCards.flat();\n let clickedCards = this.state.clickedCards;\n clickedCards = clickedCards.flat();\n $('button').each(function(){\n this.disabled = false;\n });\n }", "function disableCards() {\n firstCard.removeEventListener('click', flipCard);\n secondCard.removeEventListener('click', flipCard);\n\n resetBoard();\n }", "function lockChoice(){\r\n $(\"input\").attr(\"disabled\", true);\r\n}", "function end_turn(){\n\tif(dbg){\n\t\tdebug(\"ending turn\");\n\t}\n\tupdate_hand();\n\tvar x = document.getElementsByClassName(\"actions\");\n\tfor (i=0; i < x.length; i++){\n\t\tx[i].disabled = true;\n\t}\n}", "function noPair () {\n openCards[0].classList.add(\"noPair\");\n openCards[1].classList.add(\"noPair\");\n /*stops the possibility of clicking a third card*/\n disable();\n /*delay of animation after clicking two cards*/\n setTimeout (function(){\n openCards[0].classList.remove(\"show\", \"open\", \"noPair\");\n openCards[1].classList.remove(\"show\", \"open\", \"noPair\");\n /*when it isnt a match, allow player to click again on the cards*/\n enable();\n openCards = [];\n /*time of animation*/\n },600);\n }", "function notMatched() {\n let selected = document.querySelectorAll('.selected');\n selected.forEach(function(card) {\n card.classList.add('unmatched');\n });\n disable();\n guessesReset();\n}", "function disableCards() {\n firstCard.removeEventListener('click', flipCard);\n secondCard.removeEventListener('click', flipCard);\n resetBoard();\n}", "function disableCards() {\n firstCard.removeEventListener('click', flipCard);\n secondCard.removeEventListener('click', flipCard);\n ++score;\n checkForWin();\n resetBoard();\n}", "function handleSelection(choice) {\n // document.getElementById('usertype').disabled=false;\n document.getElementById(choice).style.display=\"block\";\n \n}", "function forbiden(){\n\tdocument.getElementById(\"sub\").disabled = true;\n\tdocument.getElementById(\"A_choice\").disabled = true;\n\tdocument.getElementById(\"B_choice\").disabled = true;\n\tdocument.getElementById(\"C_choice\").disabled = true;\n\tdocument.getElementById(\"D_choice\").disabled = true;\n}", "function Disable() {\n\tmainMenuElements.SetActive(false);\n\tsingleplayerElements.SetActive(false);\n\tmultiplayerElements.SetActive(false);\n\toptionsElements.SetActive(false);\n}", "function enableUnmatched(){\n Array.prototype.filter.call(deckOfCards, function(card){\n // removes disabled class from card div\n card.parentElement.classList.remove('disabled');\n });\n //Call disableMatched function to permantly disable matched cards\n disableMatched();\n}", "function disable() {\n firstCard.removeEventListener(\"click\", flipCard);\n secondCard.removeEventListener(\"click\", flipCard);\n matches++;\n match.innerHTML = `${matches}`;\n remains--;\n remaining.innerHTML = `${remains}`;\n\n reset();\n}", "function disable() {\n for (let shuffledCard of shuffledCards) {\n shuffledCard.classList.add('disable');\n };\n}", "function disableCards() {\n firstCard.removeEventListener('click', flipCard);\n secondCard.removeEventListener('click', flipCard);\n\n resetBoard();\n}", "function notMatching(){\n\t\t\t\t\t\t\t\n\tselectedCard.className += ' down';\n\t\t\t\t\t\n\tstoredCard.className += ' down';\n\t\n\t//enable all cards again \n\tfor(var i = 0;i<16;i++){\n\t\t\t\t\n\t\tdocument.getElementById(i).style.pointerEvents = 'auto';\n\t\t\t\t\n\t}\n\t\n\tclickCount+=2;\n\t\n\t\n}", "function disableCards() {\r\n firstCard.removeEventListener('click', flipCard);\r\n secondCard.removeEventListener('click', flipCard);\r\n resetBoard();\r\n}", "function disableCards() {\n firstCard.removeEventListener('click', flipCard);\n secondCard.removeEventListener('click', flipCard);\n resetBoard();\n}", "function disableCards() {\n firstCard.removeEventListener('click', flipCard);\n secondCard.removeEventListener('click', flipCard);\n resetBoard();\n }", "function disableCards(){\n // removes ability to flip the cards back over.\n firstCard.removeEventListener('click', flipCard);\n secondCard.removeEventListener('click', flipCard);\n // add to matched cards counter\n matchedCards++;\n // reset the board \n resetBoard();\n}", "function enableCard(cardToEnable){\n cardToEnable.classList.remove('disabled');\n}", "toggleSelected() {\n\t\tif (this.props.toggleToPlay(this.props.card))\n\t \tthis.setState({selected: !this.state.selected});\n\t else\n\t \tconsole.log(\"Invalid card combination\");\n\t \t//We can do rejection animations here\n \t}", "function Update()\r\n{\r\n\tif (selected && !activated)\r\n\t{\r\n\t\tif (puzzle_desc_box.enabled == false)\r\n\t\t{\r\n\t\t\teditor_object.SendMessage(\"assign_target\", this.gameObject, \r\n\t\t\t\t\t\t\t\t\t SendMessageOptions.DontRequireReceiver);\r\n\t\t\tpuzzle_desc_box.enabled = true;\r\n\t\t}\r\n\t} else if (puzzle_desc_box.enabled == true) \r\n\t{\r\n\t\tpuzzle_desc_box.enabled = false;\r\n\t}\r\n}", "function disable(){\n Array.prototype.filter.call(cards, function(card){\n card.classList.add('disabled');\n });\n}", "function disableCards() {\n firstCard.removeEventListener('click', flipCard());\n secondCard.removeEventListener('click', flipCard());\n resetBoard();\n}", "function disableCards() {\r\n firstCard.removeEventListener(\"click\", flipCard);\r\n secondCard.removeEventListener(\"click\", flipCard);\r\n\r\n resetBoard();\r\n}", "function onDealCardsClicked(){\n\t\tif(poker._bet > 0){\n\t\t\t$(\"#commandbutton_2\").off(\"click\").addClass(\"disabled\");\n\t\t\t$(\"#commandbutton_3\").off(\"click\").addClass(\"disabled\");\n\t\t\t$(\"#commandbutton_4\").off(\"click\").addClass(\"disabled\");\n\t\t\tcardsFliped = false;\n\t\t\tswitch (draw){\n\t\t\t\tcase 0:\n\t\t\t\t\t\n\t\t\t\t\tpoker.cards.shuffle();\n\t\t\t\t\tresetHeld();\n\t\t\t\t\tfirstCard = poker.cards.dealCard();\n\t\t\t\t\tsecondCard = poker.cards.dealCard();\n\t\t\t\t\tthirdCard = poker.cards.dealCard();\n\t\t\t\t\tfourthCard = poker.cards.dealCard();\n\t\t\t\t\tfifthCard = poker.cards.dealCard();\n\t\t\t\t\tdraw++;\n\t\t\t\t\tWinner.html(\"Draw \" + draw);\n\t\t\t\t\tbreak;\n\t\t\t\t/*case 1:\n\t\t\t\t\tif(!_firstCardHold)\n\t\t\t\t\t\tfirstCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_secondCardHold)\n\t\t\t\t\t\tsecondCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_thirdCardHold)\n\t\t\t\t\t\tthirdCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_fourthCardHold)\n\t\t\t\t\t\tfourthCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_fifthCardHold)\n\t\t\t\t\t\tfifthCard = poker.cards.dealCard();\n\t\t\t\t\tdraw++;\n\t\t\t\t\tWinner.html(\"Draw \" + draw);\n\t\t\t\t\tbreak;*/\n\t\t\t\tcase 1:\n\t\t\t\t\tcardsFliped = false;\n\t\t\t\t\tif(!_firstCardHold)\n\t\t\t\t\t\tfirstCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_secondCardHold)\n\t\t\t\t\t\tsecondCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_thirdCardHold)\n\t\t\t\t\t\tthirdCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_fourthCardHold)\n\t\t\t\t\t\tfourthCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_fifthCardHold)\n\t\t\t\t\t\tfifthCard = poker.cards.dealCard();\n\t\t\t\t\tdraw = 0;\n\t\t\t\t\tresetHeld();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\trefresh();\n\t\t}else{\n\t\t\talert(\"no bet\");\n\t\t}\n\t}", "function disable() {\n document.addEventListener(\"click\",handler,true);\n function handler(e){\n /*if matches two cards on click*/\n if(openCards.length == 2) {\n /* avoids clicking a third card when 2 cards are open*/\n e.stopPropagation();\n }\n }\n}", "function freezeFrBoard() {\n setTimeout(() => {\n if (frCardInPlay >= 1) {\n $(\".game-card-fr\").off(\"click\", playGame);\n }\n }, 100);\n }", "function enable() {\n Array.prototype.filter.call(cards, function (card) {\n if (card.className === 'card disabled') {\n card.className = 'card';\n }\n });\n}", "function disableGame() {\n cards.forEach(card => {\n card.removeEventListener('click', flipCard);\n });\n resetBoard();\n}", "function toggleChoice(e) {\n var pn = getPlayerNameFromCharpane();\n var curstate = true;\n if (pn) {\n curstate = !!GM_getValue(pn+'_ncactionbar_togglechoice','true');\n curstate = !curstate;\n GM_setValue(pn+'_ncactionbar_togglechoice',(curstate ? 'true' : ''));\n var ar = document.getElementById('ncactionbar_togglechoice');\n if (ar) {\n if (curstate) {\n ar.innerHTML = 'Action bar shown for choice adventures';\n } else {\n ar.innerHTML = 'Action bar not shown for choice adventures';\n }\n }\n }\n}", "function flipDisableOption() {\n\t\t$(\"start_button\").disabled = !$(\"start_button\").disabled;\n\t\t$(\"stop_button\").disabled = !$(\"stop_button\").disabled;\n\t\t$(\"animation-dropbox\").disabled = !$(\"animation-dropbox\").disabled;\n\t}", "setPlayerO(){\n\n this.modelGame.save(this.modelGame.resources[0], {playerTwo: \"O\"});\n setTimeout(() => {\n this.modelGame.save(this.modelGame.resources[0], {disabledO: true});\n }, 50);\n this.showGrid();\n\n if (this.state.currentPlayer === \"C\"){\n this.setState({currentPlayer: \"O\"});\n }else{\n return alert(\"You already have chosen your role: \" + this.state.currentPlayer);\n }\n }", "async function selectTops(e) {\r\n //Will not let the player change cards once the game has started\r\n if (!game_started) {\r\n var this_value = $(e).attr(\"alt\");\r\n if (this_value !== \"deck\") {\r\n $(\".start-menu\").css(\"display\", \"none\");\r\n var temp = players[0].top.filter(val => val !== this_value);\r\n players[0].top = temp;\r\n players[0].hand.push(this_value);\r\n $(e).attr(\"src\", \"images/deck_01.svg\");\r\n $(e).attr(\"alt\", \"deck\");\r\n newCards();\r\n }\r\n }\r\n }", "function handleSelection(choice) {\r\n document.getElementById('usertype').disabled=true;\r\n document.getElementById(choice).style.display=\"block\";\r\n}", "function disableCard(cardToDisable){\n cardToDisable.classList.add(\"disabled\");\n}", "onChooseGame(proceed, game) {\n this.chooseGameScreen.hide();\n if (proceed) {\n this.chosenGame = game;\n }\n this.show();\n }", "handleInteraction(button){\n button.disabled = true;\n if(!this.activePhrase.checkLetter(button.textContent)){\n button.classList.add('wrong');\n this.removeLife();\n } else {\n button.classList.add('chosen');\n this.activePhrase.showMatchedLetter(button.textContent);\n let gameWon = this.checkForWin();\n if(gameWon){\n this.gameOver(gameWon);\n };\n }\n}", "function disableCards() {\n firstCard.removeEventListener('click', flipCard);\n secondCard.removeEventListener('click', flipCard);\n pairs++;\n document.getElementById('pairs').innerHTML = pairs;\n resetBoard();\n setTimeout(() => {\n if (pairs == num_matches) {\n postToServer();\n }\n }, 2000);\n}", "function handleChoiceCardNo(e) {\n if (currentPage == \"cardservice/create/visa/card-unlock\") {\n handleChoiceCardNoClose();\n if ((e.selectedValue1 != undefined) && (e.selectedValue1 != null)) {\n pCardNoSelected = e.selectedValue1;\n var tagAccNo = document.getElementById(\"open-card-lock-no\");\n if (tagAccNo.nodeName == \"INPUT\") {\n tagAccNo.value = e.selectedValue1;\n }\n else {\n tagAccNo.innerHTML = e.selectedValue1;\n }\n }\n }\n }", "function disable(){\n Array.prototype.filter.call(cards, function(card){\n card.classList.add(\"disabled\");\n });\n}", "function clickTurnBtn() {\n passBtn.addEventListener(\"click\", function () {\n document.getElementsByClassName(\"dice-btn\")[0].disabled = false;\n document.getElementsByClassName(\"dice-btn\")[1].disabled = true;\n if (rd === 6) {\n diceSix.classList.add(\"hidden\");\n } else if (rd === 5) {\n diceFive.classList.add(\"hidden\");\n } else if (rd === 4) {\n diceFour.classList.add(\"hidden\");\n } else if (rd === 3) {\n diceThree.classList.add(\"hidden\");\n } else if (rd === 2) {\n diceTwo.classList.add(\"hidden\");\n } else {\n diceOne.classList.add(\"hidden\");\n }\n changePlayer();\n });\n }", "function enable() {\n Array.prototype.filter.call(cards, function(card) {\n card.classList.remove(\"disabled\");\n for (var i = 0; i < matchedCard.length; i++) {\n matchedCard[i].classList.add(\"disabled\");\n }\n });\n}", "selectTwoPlayerMode() {\n this.setState({ isCPUMode: false });\n this.reset();\n }", "function enable() {\n Array.prototype.filter.call(cards, function (card) {\n card.classList.remove(\"disabled\");\n for (var i = 0; i < matchedCard.length; i++) {\n matchedCard[i].classList.add(\"disabled\");\n }\n });\n}", "handleInteraction(button) {\n\n const checkTrueOrFalse = this.activePhrase.checkLetter(button.textContent);\n console.log(checkTrueOrFalse);\n\n if (checkTrueOrFalse === false) {\n\n this.removeLife();\n button.disabled = true;\n button.className = 'wrong';\n\n }\n\n if (checkTrueOrFalse === true) {\n\n button.disabled = true;\n button.className = 'chosen'\n this.activePhrase.showMatchedLetter(button.textContent);\n this.checkForWin();\n this.gameOver();\n\n }\n\n this.resetGame();\n\n }", "function getUserChoice() {\n var choice;\n userBtns.forEach((userBtn) =>\n userBtn.addEventListener(\"click\", (e) => {\n choice = userBtn.attributes[\"data-player-choice\"].value;\n userBtns.forEach((userBtn) => {\n if (choice != userBtn.attributes[\"data-player-choice\"].value) {\n userBtn.classList.add(\"disabled\");\n }\n });\n if (userSc === 5 || computerSc === 5) {\n endGame();\n return;\n }\n getComputerChoice(choice);\n setTimeout(resetRound, 2000);\n })\n );\n}", "promptPlayerForLostChallengeChoice() {\n if (this.currentPlayer.isComputer) {\n let announcement = computerPlayerMessage(`Lost Challenge`);\n this.currentPlayer.renderControls(announcement);\n setTimeout(() => {\n this.playerLostChallenge = true;\n this.playerLostChallengeIdx = this.currentPlayer.randKillIdx();\n this.settled = true;\n this.endTurn();\n }, 1000);\n } else {\n let announcement = computerPlayerMessage(`Won Challenge`);\n this.currentTarget.renderControls(announcement);\n this.playerLostChallenge = true;\n let lostChallengeForm = loseCardSelector('challenge', this.currentPlayer);\n this.currentPlayer.renderControls(lostChallengeForm);\n lostChallengeForm.addEventListener('submit', (e) => {\n e.preventDefault();\n lostChallengeForm.remove();\n this.domState = this.domState.refresh();\n this.playerLostChallengeIdx = this.domState.playerLostChallengeIdx;\n this.settled = true;\n this.endTurn();\n })\n }\n }", "function startPlayerTurn() {\n setTimeout(function () {\n msgEl.innerHTML = `Press the correct colors!`;\n }, 500);\n for (let i = 0; i < simonButtons.length; i++) {\n simonButtons[i].removeAttribute(\"disabled\");\n }\n}", "function changePlayer(){\r\n if (shotTracker == 1){\r\n shotTracker = 0;\r\n shotTrackerField.innerHTML = \"P2 take your shot\";\r\n shotTrackerField.classList.remove(\"P1Colour\");\r\n shotTrackerField.classList.add(\"P2Colour\");\r\n punchButton.classList.add(\"P2:hover\", \"P2\");\r\n kickButton.classList.add(\"P2:hover\", \"P2\");\r\n punchButton.classList.remove(\"P1:hover\", \"P1\");\r\n kickButton.classList.remove(\"P1:hover\", \"P1\");\r\n punchButton.disabled = true;\r\n kickButton.disabled = true;\r\n } else {\r\n shotTracker = 1;\r\n shotTrackerField.innerHTML = \"P1 take your shot\";\r\n shotTrackerField.classList.remove(\"P2Colour\");\r\n shotTrackerField.classList.add(\"P1Colour\");\r\n punchButton.classList.remove(\"P2:hover\", \"P2\");\r\n kickButton.classList.remove(\"P2:hover\", \"P2\");\r\n punchButton.classList.add(\"P1:hover\", \"P1\");\r\n kickButton.classList.add(\"P1:hover\", \"P1\");\r\n punchButton.disabled = false;\r\n kickButton.disabled = false;\r\n }\r\n}", "handleInteraction(button) {\n const letter = button.innerHTML; \n const checkLetter = this.activePhrase.checkLetter(letter); \n button.setAttribute('disabled',true);\n if (checkLetter) { \n button.classList.add('chosen');\n game.activePhrase.showMatchedLetter(letter);\n if (this.checkForWin()) {\n this.gameOver(true);\n }\n } else { \n button.classList.add('wrong');\n this.removeLife();\n }\n\n }", "function disableButton(str) {\r\n let mark = document.getElementById('turn').value;\r\n if (mark != undefined) {\r\n document.getElementById(str).disabled = true;\r\n}\r\n}", "handleInteraction(button) {\r\n let clicked = button\r\n //console.log(clicked);\r\n clicked.disabled = true;\r\n\r\n if (this.activePhrase.checkLetter(clicked.textContent)) {\r\n //console.log('checked Letter');\r\n this.activePhrase.showMatchedLetter(clicked.textContent);\r\n clicked.className = 'chosen';\r\n this.checkForWin();\r\n if (this.checkForWin()) {\r\n this.gameOver(true);\r\n \r\n }\r\n \r\n \r\n } else {\r\n clicked.className = 'wrong';\r\n this.removeLife();\r\n \r\n \r\n }\r\n }", "setupCardAbilities(ability) {\n this.play({\n condition: (context) => !!context.player.opponent,\n target: {\n controller: 'opponent',\n revealTargets: true,\n location: 'hand',\n gameAction: ability.actions.returnToDeck()\n }\n });\n }", "function toggleRecommencerBtn()\n {\n if (polylineForSelectSelectedArray.length > 0)\n btnRecommencer.disabled = false; \n else\n btnRecommencer.disabled = true;\n }", "function enable() {\n for (let shuffledCard of shuffledCards) {\n shuffledCard.classList.remove('disable');\n };\n for (let matchedCard of matchedCards) {\n matchedCard.classList.add('disable');\n }\n}", "function turnOn() {\n $buttons.prop('disabled', false);\n updateScore();\n }", "function disable() {\n cardsArray.forEach(function(card) {\n card.classList.add('disabled');\n });\n}", "disableCards() {\n this.matchCount = this.matchCount + 1;\n this.counter.innerHTML = this.matchCount;\n this.firstCard.removeEventListener('click', this.flipCard);\n this.secondCard.removeEventListener('click', this.flipCard);\n this.resetBoard();\n }", "function match() {\n let selected = document.querySelectorAll('.selected');\n selected.forEach(function(card) {\n card.classList.add('match');\n disable();\n });\n}", "function reset() {\n choices.splice(0, 2);\n $els.rock.style.backgroundColor = 'goldenrod';\n $els.paper.style.backgroundColor = 'goldenrod';\n $els.scissors.style.backgroundColor = 'goldenrod';\n $els.winner.textContent = '';\n $els.container.addEventListener('click', checkChoiceAndCompare);\n}", "handleInteraction(button) {\r\n button.setAttribute('disabled', '');\r\n\r\n const letter = button.textContent;\r\n const letterInPhrase = game.activePhrase.checkLetter(letter);\r\n\r\n if (letterInPhrase) {\r\n button.classList.add('chosen');\r\n this.activePhrase.showMatchedLetter(letter);\r\n if (this.checkForWin()) this.gameOver(true);\r\n \r\n } else {\r\n button.classList.add('wrong');\r\n this.removeLife();\r\n }\r\n\r\n }", "function disableAnswers(userSelectedAnswer) {\n if (userSelectedAnswer) {\n $('.answer_input').attr('disabled', true);\n $('.answer_div').addClass('no_hover');\n handleKeyPress();\n\n console.log('choices disabled');\n }\n}", "setPlayerX() {\n\n this.modelGame.save(this.modelGame.resources[0], {playerOne: \"X\"});\n setTimeout(() => {\n this.modelGame.save(this.modelGame.resources[0], {disabledX: true});\n }, 50);\n this.showGrid();\n\n if (this.state.currentPlayer === \"C\"){\n this.setState({currentPlayer: \"X\"});\n }else{\n return alert(\"You already have chosen your role, \" + this.state.currentPlayer);\n }\n }", "function enableOne() {\n $(\"#attackOne\").prop(\"disabled\", false);\n $(\"#strAttackOne\").prop(\"disabled\", false);\n $(\"#defendOne\").prop(\"disabled\", false);\n $(\"#counterOne\").prop(\"disabled\", false);\n\n //Stores Player One's Action\n actionOne = \"\";\n //Stores Player Two's Action\n actionTwo = \"\";\n}", "function disableClick() {\n for (let x = 0; x < allCards.length; x++) {\n allCards[x].classList.add(\"stop-event\");\n }\n}", "function playerOneMadeChoice() {\n console.log(\"this is the player 1 choice: \", player1.choice);\n player1.choice ? true : false;\n }", "function togglePlayer(thing) {\r\n console.log(thing.value);\r\n thing.value *= -1;\r\n console.log('document.player',thing.value);\r\n // make the status toggle reflect the select. \r\n document.player = document.getElementById('player_select').value;\r\n setEvents(runningBoard);\r\n // tied in with the select between black and white , but its \r\n // a button \r\n}", "function disableBet() {\n amountBet(\"#place-bet\").attr(\"disabled\", true);\n}", "handleInteraction(letter) {\n if ($(letter).data('clicked', true)) {\n $(letter).prop('disabled', true);\n\n if (this.activePhrase.checkLetter($(letter).text()) === true) {\n game.activePhrase.showMatchedLetter($(letter).text());\n $(letter).attr('class','chosen');\n game.checkForWin();\n if (game.checkForWin() === true) {\n game.gameOver(true);\n }\n \n } else if (this.activePhrase.checkLetter($(letter).text()) === false) {\n $(letter).attr('class','wrong');\n game.removeLife();\n }\n }\n}", "function disableCards() {\n\n\tfirstCard.removeEventListener('click', flipCard);\n\tsecondCard.removeEventListener('click', flipCard);\n}", "function ifNotMatching() {\n playAudio(tinyWhip);\n // hide cards that are open\n for (c of open) {\n c.card.classList.remove('open', `level${currentLevel}`); // flip cards back over\n }\n resetOpen();\n}", "function disabled(){\n $('#number').prop('disabled', true);\n $('#guessButton').prop('disabled', true);\n }", "selectCard(e) {\n if (this.state.time.s > 0 && this.state.isIdle === false) {\n this.setState({\n prevCard: '',\n p1Select: e})\n }\n }", "function noMatch() {\n\t\tfor (card of chosenCards) {\n\t\t\t\tcard.classList.remove('open', 'show');\n\t\t};\n\t\tempty();\n}", "function resumeGame() {\r\n id(\"submit-btn\").disabled = false;\r\n id(\"skip-btn\").disabled = false;\r\n }", "function deselectCard(cardElem) {\n cardElem.classList.remove(FLIP);\n\n // Update aria label to face down\n cardElem.setAttribute('aria-label', FACE_DOWN);\n }", "function disableMatchedCards() {\n firstCard.removeEventListener('click', flipCard);\n secondCard.removeEventListener('click', flipCard);\n resetBoard();\n }", "promptTargetForLostChallengeChoice() {\n if (this.currentPlayer.isComputer) {\n let announcement = computerPlayerMessage(`Won Challenge`);\n this.currentPlayer.renderControls(announcement);\n this.targetLostChallenge = true;\n let lostChallengeForm = loseCardSelector('challenge', this.currentTarget);\n this.currentTarget.renderControls(lostChallengeForm);\n lostChallengeForm.addEventListener('submit', (e) => {\n e.preventDefault();\n lostChallengeForm.remove();\n this.domState = this.domState.refresh();\n this.targetLostChallengeIdx = this.domState.targetLostChallengeIdx;\n this.settled = true;\n setTimeout(this.targetAllowedPlayer, 10);\n })\n } else {\n let announcement = computerPlayerMessage(`Lost Challenge`);\n this.currentTarget.renderControls(announcement);\n setTimeout(() => {\n this.targetLostChallenge = true;\n this.targetLostChallengeIdx = this.currentTarget.randKillIdx();\n this.settled = true;\n this.targetAllowedPlayer();\n }, 1000);\n }\n }" ]
[ "0.68734705", "0.680857", "0.6636066", "0.6599548", "0.6596022", "0.6585438", "0.6512607", "0.650694", "0.64482456", "0.6443079", "0.6438787", "0.6417244", "0.63575923", "0.63459194", "0.6343458", "0.63352144", "0.6319061", "0.6315705", "0.6285187", "0.62676185", "0.6257512", "0.6222807", "0.62098765", "0.6205584", "0.6185723", "0.61408895", "0.61317956", "0.6131728", "0.61310744", "0.61206704", "0.60893846", "0.6085192", "0.6071286", "0.6059169", "0.60467964", "0.6030836", "0.6027294", "0.6024211", "0.6023052", "0.6021437", "0.6018618", "0.6016857", "0.60153383", "0.60050935", "0.59921277", "0.5989677", "0.5988136", "0.5986885", "0.59819174", "0.5976118", "0.5974138", "0.59715027", "0.5967035", "0.5965069", "0.5963211", "0.5961929", "0.5956024", "0.5955247", "0.5955036", "0.595392", "0.59444255", "0.59425706", "0.5941384", "0.59410423", "0.59372556", "0.59324527", "0.5931018", "0.5913717", "0.5912157", "0.590843", "0.59070504", "0.59053254", "0.59037876", "0.58947384", "0.58845234", "0.5883005", "0.5878042", "0.5877211", "0.5871072", "0.5858405", "0.58576226", "0.58543205", "0.5846742", "0.5846231", "0.5840377", "0.5835467", "0.5830206", "0.5829203", "0.58062416", "0.5800964", "0.57993805", "0.5796906", "0.57949257", "0.57948023", "0.5791443", "0.5788644", "0.5787445", "0.577987", "0.5777962", "0.57756126" ]
0.7814878
0
flip a card over to the desired face side
transitionCardToFace(face) { let cardIsOnFace = this.card.nativeElement.classList.contains('flip'); //switch statement on which card face we would like to end up at after some fancy flipping switch (face) { case ("front"): { console.log('to front'); if (cardIsOnFace) { setTimeout(() => this.card.nativeElement.classList.toggle('flip'), this.cardFlipTime); this.card.nativeElement.classList.toggle('flip'); } else { this.card.nativeElement.classList.toggle('flip'); } break; } // NOTE: setTimeout is an asynchronous function, so toggling nativeElement outside of // a setTimeout will always execute faster regardless of position in code case ("back"): { console.log('to back'); if (cardIsOnFace) { this.card.nativeElement.classList.toggle('flip'); } break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "flipDown() {\n if (this.isActive && !this.isFaceDown) {\n // flip card face down\n this.queueVisualEffect(\n () => {\n this.el.classList.toggle('flip');\n },\n true\n );\n // make card clickable only when it is completely flipped face down\n this.queueVisualEffect(\n () => {\n this.isFaceDown = true;\n },\n false\n );\n }\n }", "function flipCard(event) {\n\t// when the card is clicked it flips to the other side\n\t// have the definition side be hidden (toggle) and on click/flip hide the term\n\tterm.classList.toggle('hidden');\n\tdefinition.classList.toggle('hidden');\n}", "function flip() {\n cardContainerRef.current.classList.toggle(style.is_flipped);\n }", "function flipCard() {\n if (lockBoard) return;\n if (this === firstCard) return;\n this.classList.add('flip');\n if (!hasFlippedCard) {\n //first card clicked\n hasFlippedCard = true;\n firstCard = this;\n return;\n }\n //second card clicked\n hasFlippedCard = false;\n secondCard = this;\n checkForMatch();\n\n if (checkWin()){\n stopCheck.stop(`/memory-solution-saver/${gameId}`);\n }\n\n\n }", "function flip(card) {\n card.classList.toggle('open');\n card.classList.toggle('show');\n}", "cardFlip(card) {\n if (this.allowedToFlip(card)) {\n this.soundControl.flip();\n this.totalClicks++;\n this.ticktok.innerText = this.totalClicks;\n card.classList.add('visible');\n\n if(this.verifyCard) {\n this.checkForCardMatch(card);\n } else {\n this.verifyCard = card;\n }\n }\n }", "function flipCard(elem) {\n elem.style = \"transform: rotateY(180deg);\";\n\n}", "function flip(card){\r\ncard.target.classList.add(\"open\");\r\ncard.target.classList.add(\"show\");\r\n\r\n}", "function flip(event){\n\tvar element = event.currentTarget;\n\tif (element.className === \"flip-card\") {\n if(element.style.transform == \"rotateX(180deg)\") {\n element.style.transform = \"rotateX(0deg)\";\n }\n else {\n element.style.transform = \"rotateX(180deg)\";\n }\n }\n}", "function flipFlashcard() {\n console.log(CURRENT_CARD);\n if (CURRENT_CARD.showingFront) return showBack();\n return showFront();\n}", "function flippCard(){\n\n /* Flipp is a boolean variable that stores whether we need to flip the card or to not. */\n flipp = !flipp;\n\n /* save the tranform attribute value to rotate the card in temp variable */\n let temp = \"rotateY(180deg)\";\n\n /* If the flipp stores false that means User dont want to flip the card or want to undo it so remove the attribute from temp */\n if(!flipp){\n temp = \"\"; /* Overwriting the temp to forget prev value */\n }\n\n /* As decided: update the transform attribute of the front-card element to temp */\n document.getElementById(\"front-card\").style.transform = temp;\n}", "flipCard(card) {\n if(this.canFlipCard(card)) {\n this.AudioFiles.flip();\n this.totalClicks++;\n this.ticker.innerText = this.totalClicks;\n card.classList.add('visible');\n\n if(this.cardToCheck) {\n this.checkForCardMatch(card);\n } else {\n this.cardToCheck = card;\n }\n }\n }", "function flipCard() {\n if (lockBoard) return;\n if (this === firstCard) return;\n\n this.classList.add('flip');\n\n if (!hasFlippedCard) {\n hasFlippedCard = true;\n firstCard = this;\n\n return;\n }\n\n secondCard = this;\n checkForMatch();\n}", "function flipCard() { // flip card function, flips card on click, only applies when board not locked and flipping 1st or 2nd card\n if (lockBoard) return;\n if (this === firstCard) return;\n\n this.classList.add(\"flip\");\n\n if (!hasFlippedCard) {\n hasFlippedCard = true;\n firstCard = this;\n\n return;\n }\n\n secondCard = this;\n checkCards();\n}", "function flipCard(){\n if(cardSide == \"QuestionSide\"){\n cardSide = \"AnswerSide\";\n $(\".card-title-question\").hide();\n $(\".card-text-answer\").show();\n console.log(\"show Q\")\n }else{\n $(\".card-title-question\").show();\n $(\".card-text-answer\").hide();\n console.log(\"show A\");\n cardSide = \"QuestionSide\"\n }\n }", "function flipCard()\n\t{\n\t\tvar cardId = this.getAttribute('data-id');\n\t\tcardsInPlay.push(cards[cardId].rank);\n\t\t//console.log(\"User flipped \" + cards[cardId].rank+ \"\"+cards[cardId].cardImage);\n\t\tthis.setAttribute('src',cards[cardId].cardImage);\n\n\t\t//to check if two card are the same\n\t\tif(cardsInPlay.length===2)\t\n\t\tif (cardsInPlay[0] === cardsInPlay[1])\n\t\t { \n\t\t \t alert(\"You found a match!\"); \n\t\t //update score\n\t\t score = ++score; \n\t\t }\n\t\t // if user did not flip the same cards\n\t\telse \n\t\t {\n\t\t \talert(\"Sorry, try again.\");\n\n\t\t }\n\t}", "function flipCard() {\n if (cardsLocked) return;\n if (this === firstCard) return;\n this.classList.add('flip');\n if(!hasCardFlipped) {\n hasCardFlipped = true;\n firstCard = this;\n return;\n };\n secondCard = this;\n // hasCardFlipped = false;\n doCardsMatch(); \n}", "function flipCard() {\n\n\tvar cardID = this.getAttribute('data-id');\n\tthis.setAttribute('src', cards[cardID].cardImage);\n\n\tconsole.log(\"User flipped \" + cards[cardID].rank);\n\tconsole.log(cards[cardID].cardImage);\n\tconsole.log(cards[cardID].suit);\n\tcardsInPlay.push(cards[cardID].rank);\n\n\tcheckForMatch();\n\n}", "function flipCard() {\n if (lockBoard) return;\n if (this === firstCardFlip) return;\n this.classList.add('flip');\n if (!cardHasFlipped) {\n cardHasFlipped = true;\n firstCardFlip = this;\n return;\n }\n secondCardFlip = this;\n\n checkForMatch();\n}", "function flipCardOver (clickedCard) {\n clickedCard.classList.toggle('open');\n clickedCard.classList.toggle('show'); \n}", "function flipCard(element) {\r\n element.toggleClass(\"card-front card-back\");\r\n setTimeout(function(){\r\n if (element.hasClass(\"card-front\")) {\r\n element.attr(\"src\", images[element.attr(\"id\").slice(3)]);\r\n } else if (element.hasClass(\"card-back\")) {\r\n element.attr(\"src\", \"images/lotus.png\");\r\n }\r\n },200);\r\n}", "function flipCard() {\n if (app.lockBoard) return;\n if (event.target === document.getElementById('game-panel')) return;\n if (event.target === app.firstCard) return;\n event.target.classList.add(\"flip\");\n cardFlipSound();\n\n if (!app.hasFlippedCard) {\n app.hasFlippedCard = true;\n app.firstCard = event.target;\n return;\n }\n\n app.secondCard = event.target;\n moveCounter();\n checkMatch();\n}", "function flipCard() {\r\n //this - whatever card we have clicked \r\n //we're getting the card clicked id and store to the cardsArray arrayChosen but only the name \r\n let cardId = this.getAttribute('data-id')\r\n cardsChosen.push(cardsArray[cardId].name)\r\n cardsChosenIds.push(cardId)\r\n\r\n //flip the card when clicked\r\n this.setAttribute('src', cardsArray[cardId].img)\r\n\r\n //revert if two selected aren't the same\r\n if (cardsChosen.length === 2) {\r\n setTimeout(checkForMatch, 500)\r\n\r\n }\r\n\r\n }", "flipCard(card) {\n if (this.canFlipCard(card)) {\n this.totalClicks++;\n this.moveTicker.innerText = this.totalClicks;\n card.classList.add('visible');\n if (this.cardToCheck) {\n this.checkForCardMatch(card);\n } else {\n this.cardToCheck = card;\n };\n }\n }", "function flipCard(card_index) \n{\n if(speelveld[card_index].classList.contains('flipped')) {\n speelveld[card_index].classList.remove('flipped');\n speelveld[card_index].children[CARD_FRONT].innerHTML = \"\";\n } else {\n speelveld[card_index].children[CARD_FRONT].innerHTML = getCardImageTag(card_index);\n speelveld[card_index].classList.add('flipped');\n }\n}", "function flipCard() {\n var i = this.getAttribute('data-id');\n var c = cards[i];\n cardsInPlay.push(c);\n this.setAttribute('src', c.cardImage)\n console.log('User flipped ' + c.rank + ' of ' + c.suit);\n checkMatch();\n}", "function front_flip() {\n var $Cube = $(\"#cube\")[0];\n $Cube.style.webkitTransform = \"rotateY(-35deg)\";\n $(\"#front_flip\").addClass(\"active\");\n $(\"#back_flip\").removeClass(\"active\");\n }", "function flipCard() {\n if (lockBoard) return;\n if (this === firstCard) return;\n\n this.classList.add('flip');\n\n if (!hasFlippedCard) {\n// click 1 when the player selects the card the flip card function fires\n hasFlippedCard = true;\n firstCard = this;\n\n return;\n }\n\n// click 2 sets the second card as this\n secondCard = this;\n\n checkForMatch();\n}", "function flipCard(element, id) {\n // make flip sound\n myAudio.volume = 0.3;\n myAudio.play();\n\n element.parentElement.classList.add(\"open\");\n\n // in order to not show solution at first sight in the html code, the backside of card is\n // appended if user clicks on card\n var nodeBackDiv = document.createElement(\"div\");\n nodeBackDiv.classList.add(\"back\");\n\n var img = document.createElement(\"IMG\");\n img.src = \"assets/images/pool/1x/\" + cardArr[id][\"img\"] + \".png\";\n img.setAttribute(\"alt\", \"Train your Brain\");\n\n nodeBackDiv.appendChild(img);\n element.appendChild(nodeBackDiv);\n }", "function flipCard(card, flipDirection) {\n if(flipDirection != 'reverse') {\n card.setAttribute('class', 'card open show');\n } else {\n card.setAttribute('class', 'card');\n }\n}", "function flipCard(num) {\n\tTweenMax.set(\".board\", {transformPerspective: 600});\n\tTweenMax.staggerFrom(\".cards\", 1.5, {\n\t\trotationX: 40 * num,\n\t\trotationY: 180 * num,\n\t\tz: 100,\n\t\tease:Back.easeInOut,\n\t\trepeatDelay:0.2, \n\t\t// onComplete: tellFortune(num, color),\n\t\t// onCompleteParams:[num, color]\n\t\t// transformPerspective:300,\n\t\t// transformOrigin: \"left 20%\"\n\t});\n\ttellFortune(num);\n}", "function flipCard(card) {\n\tif (card.getAttribute('data-card') === 'queen') {\n\t\tcard.innerHTML = '<img src=\"queen.png\" alt=\"queen\" />';\n\t\t// cardElement.innerHTML = '<img src=\"my_king.png\" alt=\"King of Spades\" />';.\n\t} else {\n\t\tcard.innerHTML = '<img src= \"king.png\" alt=\"king\"/>';\n\t}\n}", "function flipCard() {\n //get data-id attribute of card clicked and store in var cardId\n let cardId = this.getAttribute('data-id');\n console.log(\"User flipped \"+cards[cardId].rank);\n console.log(cards[cardId].cardImage);\n console.log(cards[cardId].suit);\n cardsInPlay.push(cards[cardId].rank);\n //update src attribute to image of card that was just clicked\n this.setAttribute('src', cards[cardId].cardImage);\n //checking if player picked two cards\n if (cardsInPlay.length === 2) {\n checkForMatch();\n }\n}", "function flipCard(self) {\r\n $(self).toggleClass('active');\r\n }", "function flipCard() {\r\n if (lockBoard) return;\r\n if (this === firstCard) return;\r\n\r\n this.classList.add(\"flip\");\r\n\r\n if (!hasFlippedCard) {\r\n hasFlippedCard = true;\r\n firstCard = this;\r\n\r\n return;\r\n }\r\n\r\n secondCard = this;\r\n checkForMatch();\r\n if (correct_flips >= 6) {\r\n endGame();\r\n }\r\n}", "function flipCard() {\n\tvar cardId = this.getAttribute('data-id');\n\t/* Debug --------\n\tconsole.log(\"You flipped \" + shuffleCards[cardId].rank + \".\");\n\tconsole.log(shuffleCards[cardId].suit);\n\tconsole.log(shuffleCards[cardId].cardImage); */\n\tcardsInPlay.push(shuffleCards[cardId].rank); \n\tthis.setAttribute('src', shuffleCards[cardId].cardImage);\n\tcheckForMatch();\n}", "function flipCard(){\n\n\tif(trackedCards.length < 2){\n\n\tvar flippedCardId = this.getAttribute(\"id\");\n\n\tif(flippedCardId != trackedCards[0]){\n\n\t\ttrackedCards.push(flippedCardId);\n\t\tcardsInPlay.push(cards[flippedCardId].value);\n\t\tvar cardId = this.setAttribute('src', cards[flippedCardId].cardImage)\n\n\t\tif(cardsInPlay.length == 2){\n\n\t\t\tvar cardOne = cardsInPlay[0];\n\t\t\tvar cardTwo = cardsInPlay[1];\n\n\t\t\tif(cardOne == cardTwo){\n\n\t\t\t\t\tplayerScoreTracking();\n\n\t\t\t\t\toutOfPlay();\n\n\t\t\t\t} \telse { \n\n\t\t\t\t\t\tplayerSwitch();\t\n\n\t\t\t\t\t}\n\t\t}\n\t}\n\twhoWon();\n\t}\n}", "function flipCard() {\n\tvar cardId = this.getAttribute('data-id');\n\tconsole.log(\"User flipped \" + cards[cardId].rank + \" of \" + cards[cardId].suit);\n\tconsole.log(cards[cardId].cardImage);\n\tconsole.log(cards[cardId].suit);\n\tthis.setAttribute('src',cards[cardId].cardImage);\n\tcardsInPlay.push(cards[cardId].rank);\n\tcheckForMatch();\n\t// remove eventListener for cards that have already been flipped\n\tthis.removeEventListener('click',flipCard);\n}", "function animateCardFlip(card) {\n\tif (card.classList.contains('card--hovering-left')) {\n\t\tcard.classList.add('card--flipped');\n\t\tcard.classList.add('card--flipped-left');\n\t} else {\n\t\tcard.classList.add('card--flipped');\n\t\tcard.classList.add('card--flipped-right');\n\t}\n}", "function flipEasyCard() {\n var easyCardId = this.getAttribute('data-id'); \n easyCardsSelected.push(kittenCardsEasy[easyCardId].name);\n easyCardsSelectedId.push(easyCardId);\n this.setAttribute('src', kittenCardsEasy[easyCardId].img);\n this.setAttribute('alt', kittenCardsEasy[easyCardId].name);\n if (easyCardsSelected.length === 2) {\n checkEasyMatch(); \n } else if (easyCardsSelected.length > 2) {\n this.setAttribute('src', './assets/images/kitten-card-back.png');\n }\n easyCardsSelected.length = Math.min(easyCardsSelected.length, 2);\n}", "function flipCard(card) {\n //Change the question (for now)\n if (card.className !== \"card flipped\") {\n card.children[1].textContent = BTQuestions[counter++];\n if (counter === BTQuestions.length) {\n BTQuestions = shuffle(BTQuestions);\n counter = 0\n }\n }\n card.classList.toggle(\"flipped\");\n}", "function flipCards(){\n\t\tcardsFliped = true;\n\t\tvar img = new Image(218,310);\n\t\timg.src = \"animal-grab-back.jpg\";\n\t\tctx = Canvas[0].getContext(\"2d\");\n\t\tvar cardWidth = Canvas.width()/5;\n\t\timg.onload = function() {\n\t\t\tfor(var i = 0; i < 5;i++){\n\t\t\t\tctx.drawImage(img,0,0,img.width,img.height,i*cardWidth,0,cardWidth,Canvas.height());\n\t\t\t}\n\t\t}\n\t}", "function flipCard(){\n if(lockBoard) return; \n if(this === firstCard) return; \n \n this.classList.toggle('flip');\n \n if(!hasFlippedCard){\n //First card flip action\n hasFlippedCard = true;\n firstCard = this; \n return;\n }\n // second card flip action\n secondCard = this;\n\n checkForMatch(); //Runs the match checker function\n}", "function flipCard() {\n\tif (twoCards) return;\n\tif (this === firstCard) return;\n\tthis.classList.add('flip');\n\n\tif (!flipStatus) {\n\t\tflipStatus = true;\n\t\tfirstCard = this;\n\t\treturn;\n\t};\n\tsecondCard = this;\n\tturns++;\n\t// console.log(turns);\n\tdocument.getElementById(\"turns\").innerHTML = turns;\n\n\tcheckMatch();\n}", "function flipCard (){\n\t//getAttribute method to get the data-id attribute of the card that was just clicked and store it in a variable cardId.\n\tvar cardId = this.getAttribute('data-id');\n\tcardsInPlay.push(cards[cardId].rank); //add the card that the user flipped to the cardsInPlay array.\n\t//log into the console the flipped card details.\n\tconsole.log(\"User flipped \" + cards[cardId].rank);\n\tconsole.log(cards[cardId].cardImage);\n\tconsole.log(cards[cardId].suit);\n\t//use the setAttribute method to update the src attribute to the image of the card that was just clicked\n\tthis.setAttribute('src', cards[cardId].cardImage);\n\n\t//if statement that checks to see if the length of the cardsInPlay array is 2 to call checkForMatch.\n\tif (cardsInPlay.length === 2){\n\t\tcheckForMatch();\n\t}\n}", "function flipCard(){\n\n\tif(trackedCards.length < 2){\n\n\t\t$(this).addClass(\"flipped\");\n\t\tvar flippedCard = $(this).find(\"img\")[0];\n\t\tvar flippedCardId = flippedCard.id;\n\n\t\tif(flippedCardId != trackedCards[0]){\n\n\t\t\ttrackedCards.push(flippedCardId);\n\t\t\tcardsInPlay.push(cards[flippedCardId].value);\n\n\t\t\tif(cardsInPlay.length == 2){\n\n\t\t\t\tvar cardOne = cardsInPlay[0];\n\t\t\t\tvar cardTwo = cardsInPlay[1];\n\t\t\t\tif(cardOne == cardTwo){\n\n\t\t\t\t\tplayerScoreTracking();\n\n\t\t\t\t\toutOfPlay();\n\t\t\t\n\t\t\t\t} \t\n\n\t\t\t\telse { \n\n\t\t\t\t\tplayerSwitch();\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\twhoWon();\n\t}\n\n}", "function flipCard(card) {\n card.style.backgroundColor = card.className;\n card.id = \"flipped\";\n card.removeEventListener(\"click\", handleCardClick);\n}", "function filpCard() {\r\n if (lockBoard) return;\r\n if (this === firstCard) return;\r\n this.classList.add('flip');\r\n\r\n if (!hasFlippedCard) {\r\n //First card clicked\r\n hasFlippedCard = true;\r\n firstCard = this;\r\n return;\r\n }\r\n //Second card clicked\r\n secondCard = this;\r\n checkForMatch();\r\n}", "function flipCard() {\n /* lockBoard is true then return nothing.\n If this clicked card is the firstCard then when it is clicked again return firstCard \n so that it is not set as the second card.*/\n if (lockBoard) return;\n if (this === firstCard) return;\n // when card is click add flip class\n this.classList.toggle('flip');\n // add to flips counter\n flips++;\n flips_p.textContent = flips;\n // if any cards has not been flipped then set has been flipped to true and set firstCard to the card that was clicked and return.\n if (!hasFlippedCard) {\n hasFlippedCard = true;\n firstCard = this;\n return;\n }\n // if any card has been flipped then set clicked card to secondCard\n secondCard = this;\n // check to see if both cards match\n checkMatch();\n}", "function flipCard(card_index)\n{\n if(speelveld[card_index].classList.contains('flipped')) {\t// Bevat de kaart al de css class flipped?\n /*\n Ja!\n Dan gaan de kaart weer terugdraaien door de css class flipped weer weg te halen\n */\n speelveld[card_index].classList.remove('flipped');\t\t\t// Hier halen we de css class flipped weg\n speelveld[card_index].children[CARD_FRONT].innerHTML = \"\";\t// We gaan de img-tag ook weer verwijderen\n } else {\n /*\n Nee!\n Dan draaien we de kaart om zodat de afbeelding zichtbaar wordt.\n Dit doen we door de css class flipped toe te voegen aan de kaart en de tweede div\n in de kaart te vullen met de img-tag van de echte afbeelding\n */\n speelveld[card_index].children[CARD_FRONT].innerHTML = getCardImageTag(card_index);\t// Toon de afbeelding\n speelveld[card_index].classList.add('flipped');\t\t\t\t\t\t\t\t\t\t// Voeg de css class flipped toe.\n }\n}", "function flipCard(i) {\r\tcreateDrag(i,2);\r\t$('#card'+i).addClass('front');\r\t$('#card'+i).removeClass('back');\r}", "function flipCard(id) {\n this.cards[id].flip();\n if (this.open.length > 1) {\n this.checkMatch() ? this.matchFound() : this.matchNotFound();\n };\n /* Render the scoreboard */\n this.render();\n }", "function flipCard(e) {\n\t\tlet chosen = e.target;\n\t\t// Checks if clicked element is a card, is not open, and if there are already 2 open cards\n\t\tif (chosen.nodeName === 'LI' && !chosen.classList.contains('open', 'show', 'match') && chosenCards.length !== 2) {\n\t\t\t\tchosen.classList.add('open');\n\t\t\t\taddChosenCard(chosen);\n\t\t\t\tif (timer === false && pairsRemain > 0) {\n\t\t\t\t\t\ttimerOn();\n\t\t\t\t}\n\t\t\t\tsetTimeout(showCard, 300, chosen);\n\t\t}\n}", "function flipCard(cardElem) {\n // Count flip\n data.flips += 1;\n\n cardElem.classList.add(FLIP);\n\n // Update aria label to symbol\n cardElem.setAttribute('aria-label', cardElem.dataset.symbol);\n }", "function flipcard(i) {\r\n if ( newdeal ) // If it's the end of a hand, we can't flip, so just return\r\n {\r\n\t$(\"#deal\").effect('pulsate').effect( \"highlight\", {color:'lightgreen'}, 800 );\r\n return;\r\n }\r\n\r\n\tsetWait(true);\r\n if ( !flipped[i] ) { // Either flip card over...\r\n document.images[i+imgoffset].src = back.src;\r\n flipped[i] = 1;\r\n }\r\n else { // ...or flip it back\r\n document.images[i+imgoffset].src = cards[i].src;\r\n flipped[i] = 0;\r\n }\r\n setWait(false);\r\n}", "flipCard() {\n if (this.value >= 90) {\n Animated.spring(this.animatedValue, {\n toValue: 0,\n friction: 8,\n tension: 10\n }).start();\n } else {\n Animated.spring(this.animatedValue, {\n toValue: 180,\n friction: 8,\n tension: 10\n }).start();\n }\n }", "function cardF () {\n dCard.classList.toggle('is-flipped')\n}", "function flipCard(event) {\n \n//counter for the moves\n moves++;\n counter.innerHTML= 'Moves '+ moves;\n\n if (!firstCard || !secondCard) {\n event.target.classList.toggle('front');\n //lock the bord \n if (lockBord) return; \n if (this === firstCard) return;\n\n if (!hasFlippedCard) {\n hasFlippedCard = true;\n firstCard = this; \n return; \n }\n secondCard = this;\n checkForMatch();\n }\n }", "function flipCard(item) {\n debug(\"flipCard\", item);\n item.setAttribute(\"class\", \"card open show\");\n }", "function flipCard() {\n if (timeOutBoard) return;\n if (this === firstCard) return;\n this.classList.add('visible');\n if (!turnedCards) {\n turnedCards = true;\n firstCard = this;\n\n return;\n } else {\n turnedCards = false;\n secondCard = this;\n countMoves();\n checkForMatch();\n }\n}", "function flipCard() {\n if (lockBoard) return;\n if (this === firstCard) return; \n\n this.classList.toggle('flip');\n //first click\n if(!hasFlippedCard) {\n hasFlippedCard = true; \n firstCard = this; \n counter++; \n score.innerHTML = counter; \n return; \n }\n //second click\n hasFlippedCard = false; \n secondCard = this; \n counter++; \n score.innerHTML = counter; \n checkForMatch();\n}", "function flipCard(card, cards_list){\n cardOpen.push(card)\n\n var crd = cards_list.filter(cards =>{\n return cards.id == card.id\n })\n\n card.src = crd[0].src\n\n if(cardOpen.length == 2){\n disable()\n check()\n count()\n }\n}", "function flip(e) {\n const vas = e.path[0];\n if (vas.classList == 'card') {\n e.target.classList.toggle('open');\n e.target.classList.toggle('show');\n } else if (vas.classList.contains('fa')) {\n if (vas.parentElement.classList == 'card') {\n vas.parentElement.classList.toggle('open');\n vas.parentElement.classList.toggle('show');\n\n }\n }\n}", "setFlip(dir) {\n var localScale;\n if (this.cameraSnapped){\n if ( dir == \"right\" ) {\n localScale = -Math.abs(this.scale);\n this.scale = -Math.abs(this.scale);;\n this.flip = \"right\";\n }\n else if ( dir == \"left\") {\n localScale = Math.abs(this.scale);\n this.scale = Math.abs(this.scale);\n this.flip = \"left\";\n }\n this.animations.forEach(function (value) {\n value.scale.x = localScale;\n }) \n }\n \n }", "flip(event){\n event.currentTarget.querySelector(\"img\").src = (\n event.currentTarget.querySelector(\"img\").src === this.sFront ? this.sBack : this.sFront\n ) // the function above creates a \"flip\" event handler that handles current target, query selects the img tag.\n }", "function flipCard() {\n this.classList.add('back');\n }", "function flipCard(index) {\n setOpenedCard((prevState) =>\n prevState.map((item, idx) => (idx === index ? !item : item))\n );\n // setOpenedCard((opened) => [...opened, index]);\n // cardFlipStatus[index] = !cardFlipStatus[index];\n // console.log(cardFlipStatus[index]);\n }", "function flipCards(){\n\t\t\t\n\tfor(var i = 0;i<16;i++){\n\t\t\t\t\n\t\tcards[i].className += ' down';\n\t\t\t\t\n\t}\n\t\n\t//enable all cards\n\tfor(var i = 0;i<16;i++){\n\t\t\t\n\t\tdocument.getElementById(i).style.pointerEvents = 'auto';\n\t\t\t\n\t}\n\t\t\t\n}", "function flipCard(card){ //flip card function\n\tcard.target.className = 'card open show';\n\tif(firstClick){\n\t\ttimerId = setInterval(startTimer, 1000); //id for clearInterval and sets interval to 1 second\n\t\tfirstClick = false; //have the game initialize with firstClick to be false so the game would start once a card has been clicked.\n\t}\n}", "function FLdown(){\n console.log(\"In face l arrow clicked\");\n face.destroy();\n faceindex--;\n if(faceindex<=0)\n {\n faceindex = 0;\n face = game.add.image(1015, 415, images.face[faceindex].name);\n face.scale.setTo(0.1);\n bf = bb.create(600, 55, images.face[faceindex].name);\n bf.scale.setTo(0.1);\n }\n else if (faceindex >= images.face.length)\n {\n faceindex = images.face.length -1;\n face = game.add.image(1015, 415, images.face[faceindex].name);\n face.scale.setTo(0.1);\n bf = bb.create(600, 55, images.face[faceindex].name);\n bf.scale.setTo(0.1);\n }\n else\n {\n face = game.add.image(1015, 415, images.face[faceindex].name);\n face.scale.setTo(0.05);\n bf = bb.create(600, 55, images.face[faceindex].name);\n bf.scale.setTo(0.11);\n }\n player.appearance.head.face = images.face[faceindex].name;\n\n}", "function flipOver(globals, id) {\n var cards = globals.cards;\n // Only do something if it was already revealed\n if (globals.cards[id].flipped) {\n globals.totFlip--;\n $('#' + id).css({\n backgroundImage:'url(' + cards[id].normalBack + ')'\n }); \n }\n\n cards[id].flipped = false;\n}", "function flipCard(card) {\n // change background color to classname\n card.style.backgroundColor = card.className;\n}", "function flip(obj){\n if(player.motion == motionType.LEFT && direction == motionType.RIGHT){\n obj.setAttribute(\"transform\", \"translate(\"+PLAYER_SIZE.w+\",0) scale(-1, 1)\");\n obj.setAttribute(\"transform\", \"scale(1, 1)\");\n direction = motionType.LEFT;\n }\n else if(player.motion == motionType.RIGHT && direction == motionType.LEFT){\n obj.setAttribute(\"transform\", \"translate(\"+PLAYER_SIZE.w+\",0) scale(-1, 1)\");\n direction = motionType.RIGHT;\n }\n}", "function flipCard() {\n\n\tfor(var i = 0; i <= 5; i++)\n\t{\n\t\tif($('#card' + (i + 1)).text() == 'L') {\n\t\t\tvar c = Math.floor((Math.random() * largeValues.length));\n\t\t\tcards.push(largeValues[c]);\n\t\t}else {\n\t\t\tvar c = Math.floor((Math.random() * smallValues.length));\n\t\t\tcards.push(smallValues[c]);\n\t\t}\n\t\t$('#card' + (i + 1)).text(cards[i]);\n\t}\n}", "function flipCard() {\n\n\tconsole.log('clicked')\n\n\tconsole.log(this.getAttribute(\"data-id\"))\n\tvar cardsId = this.getAttribute(\"data-id\")\n\n\tconsole.log(\"User flipped \" + cards[cardsId].rank)\n\n\tconsole.log(cards[cardsId].cardImage)\n\tconsole.log(cards[cardsId].suit)\n\n\tconsole.log('this:', this)\n\tthis.setAttribute(\"src\", cards[cardsId].cardImage)\n\n\tcardsInPlay.push(cards[cardsId].rank)\n\tconsole.log(cardsInPlay)\n\n\n\tif(cardsInPlay.length ===2) {\n\t\tcheckForMatch()\n\n\t}\n\n\n}", "function flipCard(card) {\n if(gameLock) return;\n \n\n // assign card1 and card 2 to eventually be compared\n if(!card1 && !card2){\n card1 = card;\n \n return; \n } else if (card1 && !card2 && card !== card1){\n card2 = card;\n gameLock = true;\n \n // compare the two cards, if match keep flipped, if not, unflip them! \n\n // if a match, remove ability to click, update score and refresh hand \n if(card1.getAttribute(\"data-color\") === card2.getAttribute(\"data-color\")){\n card1.removeEventListener(\"click\", handleCardClick);\n card2.removeEventListener(\"click\", handleCardClick)\n gameLock = false;\n score++\n resetHand();\n updateScore()\n return;\n\n // if not a match\n } else {\n unFlipCard(card1);\n unFlipCard(card2);\n resetHand();\n return;\n }\n }\n}", "function flipNeutralCard (cardRank) {\n lastNeutralCard = cardRank;\n $('.upcard').empty();\n $( ` <div class=\"card rank-${cardRank} diams\">\n <span class=\"rank\">${cardRank}</span>\n <span class=\"suit\">&diams;</span>\n </div>` ).appendTo( \".upcard\" );\n }", "_flipCard () {\r\n // Don't flip if tile is hidden or inactive.\r\n if (this.hasAttribute('inactive') || this.hasAttribute('hidden')) {\r\n return\r\n }\r\n\r\n // Toggle the flip attribute.\r\n if (this.hasAttribute('flip')) {\r\n this.removeAttribute('flip')\r\n this._addFlippedEvent('back')\r\n } else {\r\n this.setAttribute('flip', '')\r\n this._addFlippedEvent('front')\r\n }\r\n }", "function flipTil(side){\n clearCoins();\n disableButtons(true);\n \n wait(1).addCallback(function (res){\n while (side != flip()){\n }\n disableButtons(false);\n });\n}", "function flipCard() {\n let cardId = this.getAttribute('data-id')\n cardsChosen.push(cardArray[cardId].name)\n cardsChosenId.push(cardId)\n this.setAttribute('src', cardArray[cardId].img)\n if (cardsChosen.length === 2) {\n setTimeout(checkForMatch, 720) // ask how I can set this to increase for level two and 3\n }\n }", "function drawFlipCard(cards) {\n\n _.each(cards, function(card) {\n\n var $tmplFlipCard = $($(\"#templateFlipCard\").html());\n\n // Set the name of the card for Google Analytics\n $(\"#data-cardname\", $tmplFlipCard).html(card.name);\n\n // Set the question for the front of the card\n $(\".question\", $tmplFlipCard).html(card.question)\n\n // Set the back content of the card\n $(\".back1\", $tmplFlipCard).html(card.back1);\n $(\".back2\", $tmplFlipCard).html(card.back2);\n $(\".back3\", $tmplFlipCard).html(card.back3);\n $(\".back4\", $tmplFlipCard).html(card.back4);\n $(\".back5\", $tmplFlipCard).html(card.back5);\n\n\n\n\n $(\"img.background-image\", $tmplFlipCard).attr(\"src\", \"img/training/\" + card.image);\n\n // _NOW_ we add this template to the training page\n $(\"#flipCardList\").append($tmplFlipCard);\n\n });\n\n // Flip Cards Flipping Script\n // ====================================\n $('.flip').on('click', function(event) {\n $(event.target).parents('.card').toggleClass('flipped');\n });\n\n}", "handleFlip(event) {\n\n\t}", "function flipCards() {\n if (wrongAnswer) {\n openCards[0].removeClass('open show fail bounce locked');\n openCards[1].removeClass('open show fail bounce locked');\n }\n}", "function flipCards(target) {\n $(target).toggleClass('active');\n }", "function flipCard () {\n//Trigger check for match first\nthis.getAttribute('data-id');\ncheckForMatch();\nconsole.log(\"User flipped \" + cards[cardId].rank)\nif (cardsInPlay.length === 2 && cardsInPlay[0] !== cardsInPlay[3]) {\n\talert(\"Nope.\");\n} else if (cardsInPlay.length === 2 && cardsInPlay[0] === cardsInPlay[3]) {\n\talert(\"Match!\");\n}\ncardsInPlay.push(cards[cardId.rank]);\n\n}", "function flipCard(e) {\n if (e.target.nodeName === 'LI' || e.target.nodeName === 'I') {\n if (currentOpenCards.length % 2) {\n moves++;\n tally.textContent = moves;\n if (moves === 15 || moves === 20 || moves === 25 || moves === 30) {\n stars.firstElementChild.remove();\n }\n }\n }\n if (e.target.nodeName === 'LI') {\n const card = e.target;\n loadCard(card);\n } else if (e.target.nodeName === 'I') {\n const card = e.target.parentNode;\n loadCard(card);\n }\n}", "function flipFlashCard(el) {\n el.parentNode.parentNode.querySelector(\".answer\").style.opacity = \"1\";\n el.parentNode.querySelector(\".correct-answer\").disabled = false;\n el.parentNode.querySelector(\".wrong-answer\").disabled = false;\n\n textToSpeech();\n}", "function flipCard(cardID) {\n //Set front facing card image when clicked\n this.setAttribute('src', cards[this.getAttribute('data-id')].cardImage);\n //console log card rank, suite, and img src\n console.log(\"User flipped \" + cards[this.getAttribute('data-id')].rank + \" of \" + cards[this.getAttribute('data-id')].suite + \" \" + cards[this.getAttribute('data-id')].cardImage);\n //add rank of flipped card to cardsInPlay array\n cardsInPlay.push(cards[this.getAttribute('data-id')].rank);\n //If there are 2 cards flipped, check if thier ranks match\n if (cardsInPlay.length === 2) {\n checkForMatch();\n }\n}", "function flipAllCards(){\n Array.from(cards).forEach(card => card.classList.remove('flip'));\n Array.from(cards).forEach(card => card.style.cursor = \"pointer\");\n}", "function flipCards(clickTarget) {\n\tclickTarget.toggleClass('open');\n\tclickTarget.toggleClass('show');\n}", "function turnCard(card) {\n card.classList.toggle('open');\n card.classList.toggle('show');\n}", "function turnFace(face) {\n var x,y,z;\n var direction,value;\n var mainAxis;\n var oldMat;\n switch (face) {\n case \"L\":\n mainAxis = 0; value = -1; direction = \"L\";\n break;\n case \"R\":\n mainAxis = 0; value = 1; direction = 0;\n break;\n case \"U\":\n mainAxis = 1;value = 1;direction = 0;\n break;\n case \"D\":\n mainAxis = 1;value = -1;direction = \"D\";\n break;\n case \"F\":\n mainAxis = 2;value = 1;direction = 0;\n break;\n case \"B\":\n mainAxis = 2;value = -1;direction = \"B\";\n break;\n case \"M\":\n mainAxis = 0;value = 0; direction = \"M\";\n break;\n case \"E\":\n mainAxis = 1;value = 0;direction = \"E\";\n break;\n case \"S\":\n mainAxis = 2;value = 0;direction = 0;\n break;\n case \"l\":\n mainAxis = 0; value = -1; direction = 0;\n break;\n case \"r\":\n mainAxis = 0; value = 1; direction = \"r\";\n break;\n case \"u\":\n mainAxis = 1;value = 1;direction = \"u\";\n break;\n case \"d\":\n mainAxis = 1;value = -1;direction = 0;\n break;\n case \"f\":\n mainAxis = 2;value = 1;direction = \"f\";\n break;\n case \"b\":\n mainAxis = 2;value = -1;direction = 0;\n break;\n case \"m\":\n mainAxis = 0;value = 0;direction = 0;\n break;\n case \"e\":\n mainAxis = 1;value = 0;direction = 0;\n break;\n case \"s\":\n mainAxis = 2;value = 0;direction = \"s\";\n break;\n }\n for (x = -1; x < 2; x++) {\n for (y = -1; y < 2; y++) {\n for (z = -1; z < 2; z++) {\n if (cubeState[x+1][y+1][z+1][mainAxis] === value) {\n oldMat = getRotationMatrix(x,y,z);\n if (!direction) \n oldMat = mult(oldMat,rotate(rotationAngle,getRotationAxes(x,y,z)[mainAxis]));\n else \n oldMat = mult(oldMat,rotate(rotationAngle,negateVec(getRotationAxes(x,y,z)[mainAxis])));\n setRotationMatrix(x,y,z,oldMat);\n }\n }\n }\n }\n}", "function flip() {\n // console.log(\"Card flipped\");\n // console.log(this);\n this.classList.add(\"flip\"); // this will add the \"class flip\" to the \"querySelected variable\"\n if (!isFlipped) { // the \"flipping action\" is being shown by the \"CSS\" display for \n isFlipped = true; // the \"card\" selected as it changes the appearance of that \"card\"\n firstCard = this; // in the browser as a new \"class flip\" with different properties \n } else { // gets added to it and then the appearance of that \"card\" changes \n secondCard = this;\n console.log(firstCard);\n console.log(secondCard);\n\n checkIt();\n }\n}", "function card_flipback() {\n $(first_card_back).removeClass('flipped');\n $(second_card_back).removeClass('flipped');\n}", "function flipCard() {\n\tif (firstMove) {\n\t\tgameTimer = setInterval(setTime, 1000);\n\t\tfirstMove = false;\n\t\tresetButton.classList.add('active');\n\t}\n\n\tif (activeCards.length < 2) {\n\t\tactiveCards.push(this);\n\t\tanimateCardFlip(this);\n\t\tthis.removeEventListener('click', flipCard);\n\t}\n\n\tif (activeCards.length === 2) {\n\t\tgameBoard.classList.add('game-board--disabled');\n\t\tcheckCardMatch();\n\t}\n}", "function handleCardFlipped(card) {\n // first card flipped in a pair, save it\n if (firstFaceupCard === null) {\n firstFaceupCard = card;\n return;\n }\n\n // second card flipped\n //check if the colors of the first and the second match\n if (firstFaceupCard.colorClass === card.colorClass) {\n // mark cards matched\n firstFaceupCard.matchFound();\n card.matchFound();\n firstFaceupCard = null; //forget the first card clicked to allow creating a new pair\n correctPairs++;\n console.log(`correct pairs: ${correctPairs}`);\n\n //your code for managing scores must go here\n document.getElementsByClassName(\"score\")[0].innerHTML = `Score : ${correctPairs}/${numberOfCards / 2}`;\n if (correctPairs === numberOfCards / 2) {\n stopTimer();\n //game is won, show the total time\n alert(\n `You won! Time taken- ${\n document.getElementById(\"minutes\").innerHTML}:${\n document.getElementById(\"seconds\").innerHTML\n }`\n );\n }\n\n } else {\n // if no match, save the pair for the timeout to flip them back\n card1Clicked = firstFaceupCard;\n card2Clicked = card;\n\n firstFaceupCard = null; //forget the first, to make new attempt possible\n\n setTimeout(resetCards, 400); //wait 400 ms and flip both face down\n }\n}", "function unFlipCard() {\n firstCard.style.backgroundColor = \"\";\n secondCard.style.backgroundColor = \"\";\n clearCardVars();\n}", "flip(axis, around) {\n return this.clone().flipO(axis, around);\n }", "function unFlipCard(str) {\n document.getElementById(\"chosen-one\").style = \"transform: rotateY(180);\";\n document.getElementById(\"chosen-two\").style = \"transform: rotateY(180);\";\n\n document.getElementById(\"chosen-one\").id = \"\";\n document.getElementById(\"chosen-two\").id = \"\";\n clickCount = 0;\n}", "function flip() {\n var skipFlip = !script.doneFirstFlip && global.scene.getCameraType() == \"back\";\n script.doneFirstFlip = true;\n if (skipFlip) {\n return;\n }\n \n var sceneObject = script.getSceneObject();\n var transform = sceneObject.getTransform();\n var scale = transform.getLocalScale();\n scale.x = -scale.x;\n transform.setLocalScale(scale);\n var visitedMaterials = [];\n flipMaterials(sceneObject, visitedMaterials);\n}" ]
[ "0.7663158", "0.73939055", "0.7360192", "0.7335991", "0.7271707", "0.7264502", "0.7262538", "0.72207475", "0.7162209", "0.7128635", "0.71278775", "0.7118793", "0.70941424", "0.70846605", "0.70786315", "0.7062652", "0.70494026", "0.703777", "0.70366997", "0.7016113", "0.70143044", "0.70140487", "0.69995826", "0.6991546", "0.6984395", "0.6968982", "0.69373566", "0.69288903", "0.692114", "0.69111747", "0.68923116", "0.6891255", "0.687409", "0.68726236", "0.68704015", "0.68455", "0.68450856", "0.68433315", "0.68405956", "0.6835377", "0.6833768", "0.6827355", "0.6826725", "0.6798138", "0.67887557", "0.677691", "0.67740715", "0.6772228", "0.6761611", "0.6757125", "0.6751983", "0.674244", "0.6731277", "0.6731021", "0.67221475", "0.66910154", "0.6683683", "0.66692376", "0.6653368", "0.6634876", "0.66296655", "0.66277283", "0.6626471", "0.6609571", "0.6590627", "0.6576098", "0.6575521", "0.6562746", "0.6556597", "0.6547202", "0.65454507", "0.6543161", "0.6514038", "0.6507804", "0.6503633", "0.6493398", "0.64667475", "0.6454956", "0.6452719", "0.6433543", "0.6430534", "0.64301944", "0.64195436", "0.6407492", "0.6402689", "0.6392528", "0.6389707", "0.6386913", "0.63844043", "0.6383146", "0.6377043", "0.63764644", "0.63749385", "0.63748485", "0.63679373", "0.6365452", "0.6365077", "0.6361621", "0.63592553", "0.63502336" ]
0.7276004
4
get list of all players excluding this current one
getAllOtherPlayersList(allPlayers) { console.log("all players: " + allPlayers); var output = []; allPlayers.forEach((player) => { if (player.Id != this.socket.id) { output.push(player); } }); console.log("all other players: " + output); return output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBluePlayers() {\r\n\treturn room.getPlayerList().filter(p => p.team == 2);\r\n}", "function getRedPlayers() {\r\n\treturn room.getPlayerList().filter(p => p.team == 1);\r\n}", "getAllPlayers() {\n return Player.find({}).exec();\n }", "function removeAllPlayers() {\n listPlayers.splice(0, listPlayers.length);\n saveListPlayers();\n buildPlayerPanel();\n rebuilt_list_player();\n hideGame(false);\n}", "function getOthers(id) {\n var players = [];\n Object.keys(io.sockets.connected).forEach(function (socketID) {\n var player = io.sockets.connected[socketID].player;\n if (player && player.id != id) {\n players.push(player);\n }\n })\n return players;\n}", "getAllPlayers(){\n var allPlayers = [];\n for(var i = 0; i < this.teams.length; i++){\n var team = this.teams[i];\n for(var j = 0; j < team.players.length; j++){\n var player = team.players[j];\n allPlayers.push(player);\n }\n }\n return allPlayers;\n }", "fetchPlayers() {\n if(this.players.length === 0) { return []; }\n return this.players.map((value) => value._player);\n }", "playersAdressed() {\n let senderID = parseFloat(this.transfer.senderID);\n let players = [];\n if (!isNaN(senderID)) {\n players = this.bank.players.filter(p => p.id !== senderID);\n }\n\n return players.sort((a, b) => a.name.localeCompare(b.name));\n }", "getFilteredPlayers() {\n const {players, filter} = this.state;\n if (players.length < 1 || filter.length < 1) {\n return players;\n } else {\n return players.filter(player=>{\n return (player.first_name + \" \" + player.last_name).toLowerCase()\n .indexOf(filter.toLowerCase()) > -1;\n })\n }\n }", "remove(player) {\n this.players = this.players.filter(p => p.id !== player.id);\n }", "getDisqualifiedPlayerIds() {}", "function getPlayers() {\n $.get(\"/api/standardPlayers\", function (data) {\n console.log(\"get\");\n players = _.filter(data, function (player) {\n return player.TeamId === null \n });\n\n createPlayerRow(null);\n\n });\n }", "function removePlayer(){\r\n\tfor(player of allPlayers.values()){\r\n\t\tif(player.remove){\r\n\t\t\tallPlayers.delete(player.id);\r\n\t\t}\r\n\t}\r\n}", "static findPlayersStillAlive() {\n return Character.instances.filter((player) => {\n player.state === \"Playing\";\n });\n }", "remoteNonMembers() {\n if (!this.data) {\n return [];\n }\n\n return (this.data.out_of_channel || []).\n filter((profile) => this.filterProfile(profile)).\n map((profile) => ({\n type: Constants.MENTION_NONMEMBERS,\n ...profile,\n }));\n }", "getPlayers() {\n\t\treturn this.lobbyPlayers;\n\t}", "getPlayers () {\n return this.#players\n }", "function getPlayers(filter) {\n currentPlayers = []\n\n var endpoint = \"/player\";\n switch (filter.timespan) {\n case \"This month\": endpoint += \"/month\"; break;\n case \"This week\": endpoint += \"/week\"; break;\n case \"Today\": endpoint += \"/today\"; break;\n }\n\n getPlayersFilter(endpoint);\n\n var aux = [];\n\n if (filter.search) {\n currentPlayers.forEach(function (current) {\n if (current.username.toLowerCase().includes(filter.search.toLowerCase())) {\n aux.push(current);\n return;\n }\n });\n\n currentPlayers = aux;\n }\n}", "function compactPlayers() {\n\tfor (var id in players) {\n\t\tvar compactPlayers = {}\n\t\tif (players[id] == null || players[id] == undefined) continue\n\t\tcompactPlayers[id] = players[id]\n\t\tplayers = compactPlayers\n\t}\n}", "function stopAndHidePlayers(except){\n\t\t\n\t\tvar arrPlayers = [\"youtube\", \"vimeo\", \"html5\", \"soundcloud\", \"wistia\"];\n\t\tfor(var index in arrPlayers){\n\t\t\tvar player = arrPlayers[index];\n\t\t\tif(player == except)\n\t\t\t\tcontinue;\n\t\t\tswitch(player){\n\t\t\t\tcase \"youtube\":\t\t\t\t\t\n\t\t\t\t\tg_youtubeAPI.pause();\n\t\t\t\t\tg_youtubeAPI.destroy();\t\n\t\t\t\t\tg_objYoutube.hide();\n\t\t\t\tbreak;\n\t\t\t\tcase \"vimeo\":\n\t\t\t\t\tg_vimeoAPI.pause();\n\t\t\t\t\tg_vimeoAPI.destroy();\n\t\t\t\t\tg_objVimeo.hide();\n\t\t\t\tbreak;\n\t\t\t\tcase \"html5\":\n\t\t\t\t\tg_html5API.pause();\n\t\t\t\t\tg_objHtml5.hide();\n\t\t\t\tbreak;\n\t\t\t\tcase \"soundcloud\":\n\t\t\t\t\tg_soundCloudAPI.pause();\n\t\t\t\t\tg_soundCloudAPI.destroy();\n\t\t\t\t\tg_objSoundCloud.hide();\n\t\t\t\tbreak;\n\t\t\t\tcase \"wistia\":\n\t\t\t\t\tg_wistiaAPI.pause();\n\t\t\t\t\tg_objWistia.hide();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t}", "getPlayers() {\n\t\treturn this.players;\n\t}", "function removeAllPlayer() {\n //hide all player name\n $('#rightPlayerName').css(\"display\", \"none\");\n $('#leftPlayerName').css(\"display\", \"none\");\n $('#topPlayerName').css(\"display\", \"none\");\n\n //hide all player card\n $('#rightPlayerCards').css(\"display\", \"none\");\n $('#leftPlayerCards').css(\"display\", \"none\");\n $('#topPlayerCards').css(\"display\", \"none\");\n\n //remove all ready\n $('#rightPlayerReady').css(\"display\", \"none\");\n $('#leftPlayerReady').css(\"display\", \"none\");\n $('#topPlayerReady').css(\"display\", \"none\");\n\n //remove all uno\n $('#rightPlayerUno').css(\"display\", \"none\");\n $('#leftPlayerUno').css(\"display\", \"none\");\n $('#topPlayerUno').css(\"display\", \"none\");\n}", "function _getThePeople() {\n\tconst match = _storage.getState().Match;\n\tconst { uid } = _storage.getState().Main.user;\n\treturn Object.keys(match.players).map(_pid => {\n\t\tconst pl = match.players[_pid];\n\t\tif (pl.status !== 'D') {\n\t\t\treturn Div({className: 'player-box'}, [\n\t\t\t\t(match.id === uid && _pid !== uid)\n\t\t\t\t? Div({ className: 'delete-btn', onclick: kick })\n\t\t\t\t: Div(),\n\t\t\t\tSpan({}, pl.displayName),\n\t\t\t\tDiv({ className: 'score' }, [Span({}, `x${pl.score}`), Span({className: 'score-coin'})])\n\t\t\t])\n\t\t}\n\t\treturn;\n\t})\n}", "getAlivePlayers(id) {\n return this.getRoom(id).players.filter((player) => player.alive === true);\n }", "function players() {\n return Object.assign({}, homeTeam().players, awayTeam().players);\n}", "function getAllDevsExceptThoseInActiveDevGroup() {\n \n //holds the developers who are NOT in the current active developer group \n var inactiveDevs = [];\n \n //grab each of the developer objects from the hash table\n for (var devId in allDevelopers) {\n \n //if this is a developer property\n if (allDevelopers.hasOwnProperty(devId)) {\n \n //if the dev is not in the active dev group\n if(!currentDeveloperGroup.memberIds.includes(devId)) {\n \n //add the inactive dev to the list\n inactiveDevs.push(allDevelopers[devId]);\n } \n }\n }\n \n return inactiveDevs;\n}", "get players() {\n return this._players;\n }", "function stopPlayers() {\n\tgroupPlayer.forEach(\n\t\tfunction(player) {\n\t\t\tplayer.body.velocity.x = 0;\n\t\t\tplayer.body.velocity.y = 0;\n\t\t\tplayer.body.gravity.y = 0;\n\t\t}\n\t)\n}", "getOtherPlayer(basePlayer = this.currentPlayer) {\n return this.players.find((player) => player.color !== basePlayer.color);\n }", "function getPlayersFilter(endpoint) {\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", endpoint, false);\n xhr.onreadystatechange = function () {\n if (this.status === 200 && this.readyState === 4) {\n JSON.parse(this.responseText).players.forEach(function (r) {\n currentPlayers.push(r);\n });\n }\n }\n xhr.send();\n}", "function refreshPlayersList(){\n $http.get(\"Players?online_status=1\")\n .then(\n (response) => {\n $scope.playersOnlineList = response.data.filter( (p)=>(p.username != $rootScope.username));\n },\n (error) => console.error(error)\n );\n }", "async function playerFiltered (room, player) {\n return rooms.doc(room)\n .get()\n .then(doc => {\n return {\n filtered: doc.data().players.filter(p => p !== player),\n room\n }\n })\n}", "getAllNamesPlayers()\n {\n return this.players.map(player => player.getName());\n }", "get_player_cards() {\n return this.player_cards.slice();\n }", "get_player_cards() {\n return this.player_cards.slice();\n }", "exclude(bet_id) {\n this._child.send({\n cmd: 'exclude',\n data: bet_id\n });\n }", "who(currentPlayer, channel){\n let map = this.maps[currentPlayer.position]\n let nearbyPlayers = new Array()\n this.players.forEach(player => {\n if(player !== currentPlayer && player.position === currentPlayer.position){\n nearbyPlayers.push(player)\n }\n })\n return nearbyPlayers\n }", "removePlayer(player)\n {\n\n for(let i = 0;i<this.joueurs.length;i++)\n if(player.name === this.joueurs[i].name)\n this.joueurs.splice(i,1);\n\n }", "function getAllPlayers(id) {\n console.log(id);\n const players = [];\n Object.keys(io.sockets.connected).map((socketID) => {\n const player = io.sockets.connected[socketID].player; // eslint-disable-line\n if (player) players.push(player);\n return null;\n });\n console.log('server || running allPlayers\\n', players);\n return players;\n}", "getLista() {\n return this.lista.filter(usuario => usuario.nombre !== 'sin-nombre');\n }", "get players() {\n return this._players;\n }", "get players() {\n return this._players;\n }", "removePlayer(playerId) {\n // Find the player's room\n var room = this.rooms.filter((room) => {\n return room.players.filter((player) => player.id === playerId)[0];\n })[0];\n\n // Select the players\n var players = this.getPlayers(room.id);\n\n // Select the player from this room\n var cur = players.filter((user) => user.id === playerId)[0];\n\n // If the player exists, remove it from the array\n if (cur) {\n room.players = room.players.filter((user) => user.id !== playerId);\n }\n\n // Return the removed player\n return cur;\n }", "get activePlayers() {\n return this._activePlayers;\n }", "STRIP_SECRETS(G, ctx, playerID) {\n const r = { ...G };\n\n if (r.secret !== undefined) {\n delete r.secret;\n }\n\n if (r.players) {\n r.players = {\n [playerID]: r.players[playerID],\n };\n }\n\n return r;\n }", "stopAllPlayers() {\n return __awaiter(this, void 0, void 0, function* () {\n for (let i in this._players) {\n if (this._players[i].pipMode) {\n var doc = document;\n if (doc.pictureInPictureElement) {\n yield doc.exitPictureInPicture();\n }\n }\n if (!this._players[i].videoEl.paused)\n this._players[i].videoEl.pause();\n }\n return Promise.resolve({\n method: 'stopAllPlayers',\n result: true,\n value: true,\n });\n });\n }", "function Players(props) {\n var loggedInPlayerId = props.ui.playerId;\n var els = [];\n for (var i = 0; i < props.players.length; ++i) {\n var subprops = Object.assign(\n {key: 'player-' + props.players[i].id,\n playerId: props.players[i].id},\n props);\n if (props.players[i].id === loggedInPlayerId) {\n els.push(e(LoggedInPlayerPanel, subprops));\n } else {\n els.push(e(PlayerPanel, subprops));\n }\n }\n return e('div', {className: 'players clearfix'}, els);\n}", "function filterByPosition(pos) {\n var pl = [];\n let c = 0;\n for (let i of players) {\n if (i.position == pos) {\n pl[c++] = i;\n }\n }\n return pl;\n}", "notFainted(){\n return this.pokemons.filter(pokemon => {\n return !pokemon.fainted\n })\n }", "getPlayers(id) {\n return this.getRoom(id).players;\n }", "function getPlayersInEntirePoint(point) {\n if (point.line) {\n if (point.substitutions) {\n var players = point.line.slice();\n for (var i = 0; i < point.substitutions.length; i++) {\n var fromPlayer = point.substitutions[i].fromPlayer;\n var toPlayer = point.substitutions[i].toPlayer;\n // drop both players that are part of a substitution\n removePlayerName(players, fromPlayer);\n removePlayerName(players, toPlayer);\n }\n return players;\n } else {\n return point.line\n }\n } else {\n return [];\n }\n }", "function removePlayerName() {\n for (let i = 0; i < player.length; i++) {\n player[i].innerHTML = \"\";\n }\n}", "getRevenge(opponentTeamId, players) {\n return players.filter(player => {\n for (const team of player.teams) {\n if (team.teamId === opponentTeamId) return true;\n }\n return false;\n })\n }", "function splitOffOpponentSearches() {\n oppSearches = [];\n var i = searches.length;\n while (i--) {\n if (searches[i].PlayerId != window.player.PlayerId) {\n oppSearches.push(copySearch(searches[i]));\n searches.splice(i, 1);\n }\n }\n}", "function getPlayers() {\n $.get(\"/api/players\", function(data) {\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createPlayerRow(data[i]));\n }\n renderPlayerList(rowsToAdd);\n nameInput.val(\"\");\n passInput.val(\"\");\n steamID.val(\"\");\n });\n }", "function CleanUpPlayer(netPl : NetworkPlayer){ \n\tfor(var i : int = 0; i < playerList.Count; i++){ \n \tif(netPl == playerList[i].netPlr){\n \t\tif(gameManager.gameFields.gameStarted)gameManager.CleanUpPlayer(playerList[i]);\n \t\tplayerList.RemoveAt(i); \n \t\tbreak;\n \t}\n }\t\t\n}", "function discardSettings(){\n\n // Number of players setting\n $(\".player-option\").removeClass(\"active\");\n $(\"#player-option-\"+setting.players).addClass(\"active\");\n }", "getRemovedUsers () {\n\t\treturn [this.currentUser.user];\n\t}", "getRemovedUsers () {\n\t\treturn [this.currentUser.user];\n\t}", "deletUser(user){\n users=users.filter(u=>{\n return u.name !=user.name\n })\n }", "function getPlayers(players, playername) {\n if ((players.indexOf(playername) === -1)) {\n players.push(playername);\n }\n}", "function listPlayersIds () {\n return [roles[PLAYER_ROLE], roles[HOUSE_PLAYER_ROLE]]\n }", "ladders(){\n return Game.find({ladder: {\"$ne\": null}});\n }", "function activePlayer(players) {\n return players.find(player => player.isActive === false).name; // === !player.isActive\n}", "users() {\n return Meteor.users.find().fetch().filter(user => user._id !== Meteor.userId());\n }", "getRemovedUsers () {\n\t\treturn [this.users[2].user];\n\t}", "allGamesOfUser(userID) {\n let games = [];\n for (var [key, value] of this.games) {\n if (\n (value.player1 !== null && value.player1.user.id == userID) ||\n (value.player2 !== null && value.player2.user.id == userID)\n ) {\n games.push(value);\n }\n }\n return games;\n }", "getOpponent(id) {\n let opponent = null;\n\n this.players.forEach((player) => {\n if (player.id !== id) {\n opponent = player;\n }\n });\n\n return opponent;\n }", "function getUnwanted(members) {\n return members.filter(item => !checkIntensity(getPersonProfile(item.decData[1])));\n }", "async function getPlayers () {\n const players = await db.player.find({}, { password: 0 })\n // .sort({ ladderPosition: 1 })\n // .toArray()\n\n for (const player of players) {\n player.lastPlayedSingles = await lastPlayedSingles(player._id)\n player.daysSincePlayedSingles = daysSince(player.lastPlayedSingles)\n player.lastPlayedDoubles = await lastPlayedDoubles(player._id)\n player.daysSincePlayedDoubles = daysSince(player.lastPlayedDoubles)\n }\n\n return players\n }", "removePlayers(data){\n for(let playerId in data){\n delete this.playerView[data[playerId]];\n }\n }", "function updateOtherPlayers(p, t, n)\n{\n\tconsole.log(\"update other players except \" + p + \" for \" + n + \" \" + t);\n\tfor(var i = 0; i < Np; i++)\t// iterate through players array\n\t{\n\t\tif(i != p)\t// if index is not equal to the player to be excluded\n\t\t{\n\t\t\tvar noPlayer = players[i];\n\t\t\tif(t == \"suspect\")\n\t\t\t{\n\t\t\t\tif(removeElement(noPlayer.suspects.maybe,n))\t// remove from maybe & if card is in maybe array\n\t\t\t\t\tnoPlayer.suspects.no.push(n);\t// add to no vector\n\t\t\t\t\tremoveElement(noPlayer.suspects.maybeGuessed,n);\t// remove from maybeGuessed array\n\t\t\t}\n\t\t\telse if(t == \"weapon\")\n\t\t\t{\n\t\t\t\tif(removeElement(noPlayer.weapons.maybe,n))\t// remove from maybe\n\t\t\t\t\tnoPlayer.weapons.no.push(n);\t// add to no vector\n\t\t\t\t\tremoveElement(noPlayer.weapons.maybeGuessed,n);\n\t\t\t}\n\t\t\telse if(t == \"room\")\n\t\t\t{\n\t\t\t\tif(removeElement(noPlayer.rooms.maybe,n))\t// remove from maybe\n\t\t\t\t\tnoPlayer.rooms.no.push(n);\t// add to no vector\n\t\t\t\t\tremoveElement(noPlayer.rooms.maybeGuessed,n);\n\t\t\t}\n\t\t}\n\t}\n}", "get bossPokemonList() {\n // Filtering out Trainers\n return this.bossList.filter((enemy) => {\n return enemy instanceof DungeonBossPokemon;\n }).map((enemy) => {\n return enemy.name;\n });\n }", "filterAllUsers(allUsers) {\n return allUsers.filter(user => user.username !== this.state.username);\n }", "revokeUntilThis(players) {\n this.commandsRoot.advancement.revoke(players).until(this.name);\n }", "function PlayerList(name) {\r\n this.name = name;\r\n this.list = [];\r\n this.get();\r\n}", "function loadPlayerList() {\n Player_v.all({order: 'id'}, function(err, results) {\n var players = [];\n var player = {};\n player.player_name = 'Not Selected';\n player.id = \"\";\n players[0] = player;\n\n if(results.length > 0) {\n for (var i = 0; i < results.length; i++) {\n // create a brand new instance of player object for every record. One cannot reuse the same player variable.\n var player = { player_name: results[i].first_name + \" \" + results[i].last_name + \"-\" + results[i].city + \"/\" + results[i].state_or_province,\n id: results[i].id};\n players.push(player);\n }\n } // end of if.\n\n this.player_list = players;\n\n next(); // process the next tick.\n }.bind(this));\n}", "async allUsernames(parent, args, ctx, info) {\n if (!ctx.request.userId) {\n throw new Error(\"You must be logged in to do that!\");\n }\n const users = await ctx.db.query.profiles({}, info);\n const notParticipants = users.filter(\n (user) =>\n user.permissions.includes(\"TEACHER\") ||\n user.permissions.includes(\"STUDENT\") ||\n user.permissions.includes(\"SCIENTIST\")\n );\n return notParticipants;\n }", "function GetPlayersByRoomName(_RoomName) {\r\n var _Players = _mData.Players.filter(function(_Player){\r\n return _Player.CurrRoomName === _RoomName;\r\n });\r\n\r\n return _Players;\r\n}", "function displayplayer(usernamelist){\n console.log(usernamelist)\n for (let a in usernamelist){\n if (!(document.querySelector(\"#playerlist\").contains(document.querySelector(\"#\"+a)))) {\n let element = document.createElement(\"p\");\n element.innerHTML = a;\n element.id = a;\n document.querySelector(\"#playerlist-list\").prepend(element)\n cursors[a] = new Cursor(a);\n }\n };\n $(\"#playerlist-list > p\").each((index, elem) => {\n if (!(elem.id in usernamelist)){\n document.getElementById(elem.id).remove()\n };\n });\n}", "listPlayers() {\n\t\tvar list = [];\n\t\tvar mySet = new Set(); // set used to remove duplicates\n \t\n\t\tfor (var j = 0; j <= (this.props.players).length-1; j++) {\n\t\t\tif (j != this.state.playerNumber) {\n\t\t\t\tif (!(mySet.has(this.props.players[j]))) {\n\t\t\t\t\tmySet.add(this.props.players[j]);\n\t\t}}}\n\t\tfor (let i of mySet) {\n\t\t\t\tif (i === 0) {\n\t\t\t \tlist.push(<Button onClick= {() => this.handleAttackZero()}> {i} </Button>);\n\t\t\t\t}\n\t\t\t\tif (i === 1) {\n\t\t\t\t\tlist.push(<Button onClick= {() => this.handleAttackOne()}> {i} </Button>);\n\t\t\t\t}\n\t\t\t\tif (i === 2) {\n\t\t\t\t\tlist.push(<Button onClick= {() => this.handleAttackTwo()}> {i} </Button>);\n\t\t\t\t}\n\t\t\t\tif (i === 3) {\n\t\t\t\t\tlist.push(<Button onClick= {() => this.handleAttackThree()}> {i} </Button>);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\n\t\tconsole.log(this.props.playerList + \"Fight Array\");\n\t\tconsole.log(mySet + \"my set\");\n\t\treturn list;\n \t}", "getPlayersPIDs() {\n\t\treturn this.lobbyPlayers.map(player => player.pid);\n\t}", "@api \n get playersJoinedListData() {\n return this._playersJoinedListData;\n }", "getLobbyGamesOf(userID) {\n let games = [];\n for (var [key, value] of this.games) {\n if (!value.gameStarted && !value.gameEnded) {\n if (\n value.player1 !== null &&\n value.player1.user.id != userID &&\n value.player2 === null\n ) {\n games.push({\n gameID: value.gameID,\n player1: {\n id: value.player1.user.id,\n name: value.player1.user.name\n }\n });\n }\n }\n }\n return games;\n }", "static selectRandomPlayer() {\n let newTeamPlayers = Character.instances.filter((player) => {\n player.state != LOSER;\n });\n return newTeamPlayers.sort(() => Math.random() - 0.5);\n }", "function getWinners() {\n $scope.winners = filterFilter($scope.participants, {winner: 1});\n }", "function filterByAward(awardName) {\n var pl = [];\n let k = 0;\n for (let i of players) {\n for (let j = 0; j < i.awards.length; j++) {\n if (i.awards[j].name == awardName) {\n pl[k++] = i;\n break;\n }\n }\n }\n return pl;\n}", "get pokemonList() {\n // Filtering out Trainers\n return this.enemyList.filter((enemy) => {\n return !enemy.hasOwnProperty('name');\n }).map((enemy) => {\n // Collapsing DetailedPokemon\n if (typeof enemy === 'string') {\n return enemy;\n }\n else if (enemy.hasOwnProperty('pokemon')) {\n return enemy.pokemon;\n }\n });\n }", "get allPitchers() {\n return _.uniq(this.pitches.map(pitch => pitch.pitcher))\n }", "function destroyer(...args) {\n return arguments[0].filter(arg => !args.slice(1).includes(arg));\n}", "removePlayer(player){\n this.roster.splice(roster.indexOf(player), roster.lastIndesOf(player));\n }", "function nonFriends(name, array) {\n let notFriends = [];\n for(let i = 0; i < array.length; i ++) {\n if (array[i].friends.includes(name) === false && array[i].name !== name) {\n notFriends.push(array[i].name);\n } \n } return notFriends;\n}", "function get_all_contributors_except(id) {\n var contributors = get_all_contributors();\n\n var fields = sample_contributor_fields[id];\n for (var i = 0; i < fields.length; i++) {\n var field = fields[i];\n var contributor = field.children('input').val();\n\n if (contributor != '' && contributor != null) {\n var index = contributors.indexOf(contributor);\n\n if (index > -1) {\n contributors.splice(index, 1);\n }\n }\n }\n\n return contributors;\n}", "function ignoredUsers() {\n try {\n return JSON.parse(localStorage['beta-ignoredusers'])\n\n } catch(e){\n debu(e.toString())\n return []\n }\n}", "get players() { return this.#runtime_.players; }", "function getNonScar(props){\n const nonScar = props.filter(monster=>monster.position !== 'Scarer')\n return nonScar\n}", "subscriberPlayerRemove(EventName, player){\n let array = this.state.players;\n let index = array.indexOf(player.player)\n array.splice(index, 1);\n this.setState({players: array });\n this.setState({currentPlayer: null});\n PubSub.publish('currentPlayer', null);\n }", "getPlayers(){\n let players = fetch(API_URL + '/api/players',\n {method: 'GET'}).then((response) => response.json())\n return players;\n }", "function availablePlayers(jwt) {\n const activeGamesURL = BASE_URL + '/player/available_players'\n return httpRequestJWT(activeGamesURL, 'get', jwt)\n}", "function getProfiles(ignoreIDs) {\n return profileDB.find({_id: {$nin: ignoreIDs}});\n}" ]
[ "0.660605", "0.6592557", "0.6487351", "0.64639515", "0.64142793", "0.636623", "0.6298725", "0.627018", "0.6214694", "0.61836666", "0.61701465", "0.61569387", "0.6130434", "0.61053574", "0.6086726", "0.6076323", "0.60375464", "0.59678966", "0.5960814", "0.59538", "0.5928698", "0.58566946", "0.58263505", "0.58261114", "0.58043104", "0.58023524", "0.57515854", "0.57421565", "0.5739148", "0.573053", "0.57292104", "0.5725746", "0.5719546", "0.57188445", "0.57188445", "0.5712117", "0.5664338", "0.56464374", "0.56268054", "0.56138885", "0.55829644", "0.55829644", "0.5582238", "0.55646193", "0.55278397", "0.55265796", "0.55214286", "0.55183285", "0.55104214", "0.54996055", "0.5491303", "0.5491158", "0.54845345", "0.5478751", "0.5462466", "0.54622483", "0.5461493", "0.5436772", "0.5436772", "0.5435451", "0.54286444", "0.5405155", "0.5402296", "0.5401752", "0.5399008", "0.53937113", "0.5377033", "0.53752625", "0.53597736", "0.53550136", "0.53544813", "0.5343106", "0.5333796", "0.5332734", "0.5332156", "0.5331749", "0.5323594", "0.5314258", "0.52935684", "0.52846724", "0.5282951", "0.52799547", "0.5277049", "0.5272328", "0.5270996", "0.5256759", "0.523803", "0.52324075", "0.52291435", "0.5223209", "0.5213298", "0.5209151", "0.52059937", "0.52037466", "0.5196697", "0.5193913", "0.51929206", "0.5191087", "0.5188138", "0.5185155" ]
0.70125395
0
a round is cancelled if it is someone's turn to pick a card and collect votes, but they disconnect
getRoundIsCancelled() { let observable = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"](observer => { this.socket.on('roundCancelled', (idNextRoundHost) => { var isNewHost; isNewHost = false; if (this.socket.id == idNextRoundHost) { isNewHost = true; } observer.next(isNewHost); }); return () => { this.disconnectSocket(); }; }); return observable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cancelMyBid() {\n\n}", "function cancelBids () {\n}", "function cancel() {\n transition(DELETE, true);\n\n props.cancelInterview(props.id)\n .then(response => {\n transition(EMPTY);\n })\n .catch(error => {\n transition(ERROR, true);\n })\n }", "function Cancellation() { }", "function cancelGame(){\n\t\t\n\t\t//show a warning message before cancelling \n\t\t $('<div>').simpledialog2({\n\t\t\t mode: 'button',\n\t\t\t headerText: 'Sure?',\n\t\t\t headerClose: true,\n\t\t\t buttonPrompt: 'This will reset all the images selected till now',\n\t\t\t buttons : {\n\t\t\t 'Yes': {\n\t\t\t click: function () { \n\t\t\t resetcreategamepage();\n\t\t\t }\n\t\t\t },\n\t\t\t 'No': {\n\t\t\t click: function () { \n\t\t\t //$('#buttonoutput').text('Cancel');\n\t\t\t // do nothing\n\t\t\t },\n\t\t\t icon: \"delete\",\n\t\t\t theme: \"b\"\n\t\t\t }\n\t\t\t }\n\t\t });\n\t}", "function cancelout() {\n setAddResponse(null);\n setchosenmed(null);\n setExistingPrescription(null);\n }", "canceled() {}", "function handleCard() {\n playerTries++;\n if (activeCards.length == 2) {\n if (getCardName(activeCards[0].id) != getCardName(activeCards[1].id)) {\n turnBackCards(activeCards);\n }\n else {\n foundPairs++;\n if (foundPairs == (cards.length / 2)) {\n clearInterval(countdown);\n winner = true;\n popupFinalResults(\"Congratulations! You Won!\");\n }\n }\n }\n else {\n turnBackCards(activeCards);\n }\n clearTimeout(timer);\n activeCards.splice(0);\n}", "function cancelOffers () {\n}", "cancelPairing() {\n if(this.discover) {\n this.discover.stop();\n this.discover.removeAllListeners();\n this.discover = undefined;\n }\n }", "cancel() {\n console.log('[cancel]');\n // now request that Journey Builder closes the inspector/drawer\n connection.trigger('requestInspectorClose');\n }", "cancel(){\n this.game.activeNPC.action=null;\n this.game.activeNPC=null;\n }", "function onDealCardsClicked(){\n\t\tif(poker._bet > 0){\n\t\t\t$(\"#commandbutton_2\").off(\"click\").addClass(\"disabled\");\n\t\t\t$(\"#commandbutton_3\").off(\"click\").addClass(\"disabled\");\n\t\t\t$(\"#commandbutton_4\").off(\"click\").addClass(\"disabled\");\n\t\t\tcardsFliped = false;\n\t\t\tswitch (draw){\n\t\t\t\tcase 0:\n\t\t\t\t\t\n\t\t\t\t\tpoker.cards.shuffle();\n\t\t\t\t\tresetHeld();\n\t\t\t\t\tfirstCard = poker.cards.dealCard();\n\t\t\t\t\tsecondCard = poker.cards.dealCard();\n\t\t\t\t\tthirdCard = poker.cards.dealCard();\n\t\t\t\t\tfourthCard = poker.cards.dealCard();\n\t\t\t\t\tfifthCard = poker.cards.dealCard();\n\t\t\t\t\tdraw++;\n\t\t\t\t\tWinner.html(\"Draw \" + draw);\n\t\t\t\t\tbreak;\n\t\t\t\t/*case 1:\n\t\t\t\t\tif(!_firstCardHold)\n\t\t\t\t\t\tfirstCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_secondCardHold)\n\t\t\t\t\t\tsecondCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_thirdCardHold)\n\t\t\t\t\t\tthirdCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_fourthCardHold)\n\t\t\t\t\t\tfourthCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_fifthCardHold)\n\t\t\t\t\t\tfifthCard = poker.cards.dealCard();\n\t\t\t\t\tdraw++;\n\t\t\t\t\tWinner.html(\"Draw \" + draw);\n\t\t\t\t\tbreak;*/\n\t\t\t\tcase 1:\n\t\t\t\t\tcardsFliped = false;\n\t\t\t\t\tif(!_firstCardHold)\n\t\t\t\t\t\tfirstCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_secondCardHold)\n\t\t\t\t\t\tsecondCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_thirdCardHold)\n\t\t\t\t\t\tthirdCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_fourthCardHold)\n\t\t\t\t\t\tfourthCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_fifthCardHold)\n\t\t\t\t\t\tfifthCard = poker.cards.dealCard();\n\t\t\t\t\tdraw = 0;\n\t\t\t\t\tresetHeld();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\trefresh();\n\t\t}else{\n\t\t\talert(\"no bet\");\n\t\t}\n\t}", "terminateGame(winner) {\n const message = {\n key: \"terminate\",\n data: {\n winner\n }\n };\n this.messagePlayers(message);\n this.terminateCallback(this.privateId);\n }", "function onPublisherCredOfferCancel() {\n socket.emit(\"publisher-cred-offer-unsub\", uuid);\n setPublisherCredentialOffer(false);\n }", "function onLeavingChallengesAdvertising() {\n $timeout.cancel(updaterHndl);\n }", "toggle() {\n const maxRounds = this.state.maxRounds;\n // eslint-disable-next-line\n this.state.round == maxRounds ? this.endSession() : this.break();\n }", "function result(){\t\n\tif(noOpenCard>=16){\n\t\tsetTimeout(function(){\t\n\t\t\tif (confirm(\"Congratulations! You won! \\nStars \"+ noStar+'\\nMoves '+noMoves+'\\nTime '+ \n\t\t\t\tFormatMe(hr)+':'+FormatMe(min)+':'+FormatMe(sec)+'\\n Do you want to try again?'\n\t\t\t\t)) {\n\n\t\t\t}\n\t\t\tdocument.querySelector(\".deck\").remove();\n\t\t\tnoOpenCard=0;\n\t\t\tinitialization();\n\t \thr=0;min=0;sec=-1;\n\t\t},1000)\n\t}\n}", "cancel() {\n\n }", "cancel() {}", "cancel() {\n this.logout();\n this.isCancelled = true;\n }", "cancel() {\n this.cancelled = true;\n }", "function onCanceled(cancelSender, cancelReason) {\n cancel = true;\n }", "cancel(silent) {\n // Update database\n app.database.finishGame(this);\n\n if(this.staff_alert != null){\n clearInterval(this.staff_alert);\n this.staff_alert = null;\n }\n // Delete channels\n app.discordClient.channels.fetch(this.category).then(category => {\n (async ()=>{\n for(const channel of category['children']){\n await channel[1].delete()\n }\n category.delete().then(null);\n })();\n })\n\n // Remove object\n app.gamemap = removeItemAll(app.gamemap,this);\n\n // Message players\n if(silent === undefined || silent === false) {\n this.players.forEach(player => {\n // Give queue priority for 5 minutes\n app.queuemap[this.guild['id']].priority.push({\n player: player,\n expires: (new Date()).getTime()+60000\n });\n\n // Direct message player\n app.discordClient.users.resolve(player).send(new MessageEmbed().setColor(\"RED\").setTitle(\"Your match has been cancelled\").setDescription(`The game ${this.id} has been cancelled. You have been returned to the queue.\\n\\n**If you re-queue within a minute you will be at the top**`)).then(null);\n });\n }\n\n delete this;\n }", "winner() {\n clearInterval(this.timeCount);\n this.soundControl.winner();\n document.getElementById('winner-msg').classList.add('visible');\n this.hideCards();\n }", "loseTurn(){\n this.playerTurn = (this.playerTurn % 2) + 1;\n this.scene.rotateCamera();\n this.previousBishops = ['LostTurn'];\n this.activeBishop = null;\n }", "card_startStopCommenting(card){\n card.commenting=!card.commenting;\n }", "cancel() {\n return this.channel.basicCancel(this.tag)\n }", "function RoundWin()\n{\n wonCurrentRound = true;\n container.classList.add(\"no_click\");\n RoundResultAfterDelay(1);\n}", "cancel() {\n cancel();\n }", "promptTargetForKillChoice() {\n if (this.currentTarget.cards.length <= 0) {\n this.endTurn();\n return\n }\n if (this.currentPlayer.isComputer) {\n let announcement = computerPlayerMessage(`${this.action}`);\n this.currentPlayer.renderControls(announcement);\n let killForm = loseCardSelector('action', this.currentTarget);\n this.currentTarget.renderControls(killForm);\n killForm.addEventListener('submit', (e) => {\n e.preventDefault();\n killForm.remove();\n this.domState = this.domState.refresh();\n this.killIdx = this.domState.killIdx;\n this.endTurn();\n })\n } else {\n let announcement = computerPlayerMessage(`Choosing influence to lose`);\n this.currentTarget.renderControls(announcement);\n setTimeout(() => {\n this.killIdx = this.currentTarget.randKillIdx()\n this.endTurn();\n }, 1000)\n }\n }", "function disableVoting() {\n imgOneEl.removeEventListener('click', voting);\n imgTwoEl.removeEventListener('click', voting);\n imgThreeEl.removeEventListener('click', voting);\n alert('Thank you for your participation, you are no longer needed.');\n}", "cancel () {\n this._fetching = false\n }", "cancel () {\n this._fetching = false\n }", "function winLose() {\n\t\tvar ul = $('.pastGuess').eq(guessLog);\n\t\tvar cloud = '-='+50*turn;\n\t\tif(correct === 5) {\n\t\t\tsetTimeout(function() {\n\t\t\t\t$('.win').removeClass('disable');\n\t\t\t\t$('body').css('backgroundColor', 'rgb(69, 130, 166)');\n\t\t\t\t$(ul).children().css('backgroundColor', 'transparent');\n\t\t\t\t$('#glowcloud').addClass('disable');\n\t\t\t}, 3000);\n\t\t} else if (turn === 5 && user.toString() != computer.toString()) {\n\t\t\tsetTimeout(function() {\n\t\t\t\t$('.lose').removeClass('disable');\n\t\t\t\t$('body').css('backgroundColor', '#000000;')\n\t\t\t\t}, 3000);\n\t\t\t}\n\n\t}", "promptPlayerForLostChallengeChoice() {\n if (this.currentPlayer.isComputer) {\n let announcement = computerPlayerMessage(`Lost Challenge`);\n this.currentPlayer.renderControls(announcement);\n setTimeout(() => {\n this.playerLostChallenge = true;\n this.playerLostChallengeIdx = this.currentPlayer.randKillIdx();\n this.settled = true;\n this.endTurn();\n }, 1000);\n } else {\n let announcement = computerPlayerMessage(`Won Challenge`);\n this.currentTarget.renderControls(announcement);\n this.playerLostChallenge = true;\n let lostChallengeForm = loseCardSelector('challenge', this.currentPlayer);\n this.currentPlayer.renderControls(lostChallengeForm);\n lostChallengeForm.addEventListener('submit', (e) => {\n e.preventDefault();\n lostChallengeForm.remove();\n this.domState = this.domState.refresh();\n this.playerLostChallengeIdx = this.domState.playerLostChallengeIdx;\n this.settled = true;\n this.endTurn();\n })\n }\n }", "function user_disconnect() {\n\n console.log(\"User disconnected.\");\n\n\n if (consumer.paymentTx.amount - consumer.paymentTx.paid <= min_initial_payment)\n {\n console.log(\"User tried to disconnect but the channel is almost done\");\n jQuery('#repayment_prompt').html(\"Channel already depleted. Please wait one moment.\");\n }\n else\n {\n // we send an error message here to allow for possibility of reopening channel.\n // this should probably be made more robust in future\n var msg = new Message({\n \"type\": Message.MessageType.ERROR,\n \"error\": {\n \"code\": ChannelError.ErrorCode.OTHER\n }\n });\n send_message(msg);\n cancel_payments();\n\n // set this to false so websockets don't automatically reopen the channel\n open_channel = false;\n\n set_channel_state(CHANNEL_STATES.SENT_ERROR);\n set_ui_state(UI_STATES.USER_DISCONNECTED);\n }\n}", "@on('actionCancelled')\n async actionCancelled(action)\n {\n for (const player of this.players) {\n // disconnceted played\n if (!player.client) {\n continue;\n }\n\n this._sendAction(player, action, true);\n }\n }", "function voteForSelfToDie() {\n voteForUser(getParticipantID());\n stopTimer();\n}", "function setPlayerNotReadyForNextRound() {\n GameLobby.unreadyPlayers();\n}", "function choiceClick(e){\n var buttonId = e.target;\n\n if(buttonId.id === 'confirm'){\n btnContainer.removeEventListener('click', choiceClick);\n eventCardAction(currentEvent);\n planetZoomOut();\n\n } else if(buttonId.id === 'accept'){\n btnContainer.removeEventListener('click', choiceClick);\n eventCardAction(currentEvent);\n var eventResult = currentEvent.success;\n\n if(eventResult === true){\n successCard();\n\n } else {\n failureCard();\n\n }\n\n } else if(buttonId.id === 'reject'){\n btnContainer.removeEventListener('click', choiceClick);\n planetZoomOut();\n\n }\n\n tabulatePoints();\n totalStatCheckLeave();\n\n if(userLost == true){\n planetZoomOut();\n loseGame();\n returnLeaderBoardLs();\n new HighScore(userName,totalPoints);\n leaderBoardStoreLs();\n }\n\n removeChart();\n generateChart();\n}", "disconnectedCallback () {\n this.removeEventListener('click', this._cardClicked)\n }", "function cancelFinding() {\n\t//send request to server to make sure that the user doesn't show up for other clients\n\t$.ajax({\n\t\turl: 'api.php',\n\t\tmethod: 'POST',\n\t\tdata: 'action=remove&userid='+userID,\n\t\tsuccess: function(data) {\t\n\t\t\t//go back to the online menu\n\t\t\t$(\"#findingModal\").hide();\n\t\t\t$(\"#startOnline\").on(\"click\",function(){startOnline()}).one();\n\t\t\t$('#startOnline').addClass('startButton').removeClass('startButtonDisabled');\n\t\t\t$('#pNameInput').prop('disabled',false);\n\t\t}\n\t});\n}", "function cancel() {\n if (props.interview) {\n return transition(SHOW);\n }\n return transition(EMPTY);\n }", "function resign() {\n\n // Update the timing properties if we're using time control.\n var moveEnd = new Date().getTime();\n if (stats.timeControl != -1) {\n if (stats.future[0] == \"r\") {\n stats.redTime -= moveEnd - stats.moveStart;\n }\n else {\n stats.bluTime -= moveEnd - stats.moveStart;\n }\n stats.moveStart = moveEnd;\n }\n\n // Update the winning properties.\n if (stats.iAmRed) {\n stats.winner = \"Blue\";\n }\n else {\n stats.winner = \"Red\";\n }\n stats.winBy = \"resignation\";\n }", "startNextRound() {\n let chosen = this.chooseNextChaser();\n if (chosen !== undefined) {\n this.broadcast({\n type: 9, properties: this.gameProperties\n });\n this.gameStarted = true;\n this.broadcast({\n type: 12, id: chosen\n });\n this.currentlyChosen = chosen;\n //+500 to make up for fade in/out transitions\n setTimeout(this.startNextRound.bind(this), (this.gameProperties.roundLength * 1000)+500);\n } else {\n this.broadcast({\n type: 15, scores: this.getScores()\n });\n this.delete();\n }\n }", "function disableCards() {\n firstCard.removeEventListener('click', flipCard);\n secondCard.removeEventListener('click', flipCard);\n resetBoard();\n winner();\n }", "function cancel(){\n scope.permission.planMode = false;\n angular.element('.plan-overlay').css('visibility','hidden');\n scope.plan.current = [];\n scope.plan.selected = [];\n }", "onClickDenial() {\n Meteor.call('removeFromParticipate', this.props.pizzaDayId, this.props.loggedUser);\n }", "acceptCancel() {}", "function cancelBox() {\n\tvar cancelDiv=$('cancelPetFeeder');\n\tif (!cancelDiv && (GM_getValue('feeding',false)||GM_getValue('feedEquip',false))) {\n\t\tvar cancelDiv=makeBox('PotatoPetFeeder: ','cancelPetFeeder');\n\t\t\n\t\tvar cancelButton=makeButton('Let them starve!');\n\t\tcancelButton.addEventListener('click', \n\t\t\t\tfunction() {\n\t\t\t\t\tstopFeeding();\n\t\t\t\t\tdocument.body.removeChild($('cancelPetFeeder'));\n\t\t\t\t}, true);\n\t\tcancelDiv.appendChild(cancelButton);\n\t\tdocument.body.insertBefore(cancelDiv, document.body.firstChild);\n\t}\n\telse if (cancelDiv && !(GM_getValue('feeding',false)||GM_getValue('feedEquip',false)) ) {\n\t\tdocument.body.removeChild(cancelDiv);\n\t}\n}", "function endTurn() {\n holder.forEach((el) => {\n el.removeEventListener(\"click\", optSelect);\n el.style.backgroundColor = \"#ffffff05\";\n el.style.color = \"#565656\";\n el.style.cursor = \"default\";\n });\n cur++;\n if (cur >= questions.length) {\n next.innerHTML = \"View Score\";\n } else {\n next.innerHTML = \"Next Question\";\n }\n}", "function OnCancelAndUnlockPressed()\n{\n\t// Unlock the team selection, allowing the players to change teams again\n\tGame.SetTeamSelectionLocked( false );\n\n\t// Stop the countdown timer\n\tGame.SetRemainingSetupTime( -1 ); \n}", "function cancelInterview(id) {\n console.log(\"in cancel interview\")\n \n return axios.delete(`/api/appointments/${id}`)\n .then(() => {\n const appointment = {\n ...state.appointments[id],\n interview: null\n };\n \n const appointments = {\n ...state.appointments,\n [id]: appointment\n };\n \n setState(updateSpots({\n ...state,\n appointments: appointments\n }))\n })\n \n }", "function cancelAskingTime(user, channel) {\n controller.storage.teams.get('askingtimes', function(err, askingTimes) {\n\n if (!askingTimes || !askingTimes[channel] || !askingTimes[channel][user]) {\n return;\n } else {\n delete askingTimes[channel][user];\n controller.storage.teams.save(askingTimes); \n }\n }); \n}", "onCardClosed(cardNum) {\n if (cardNum === this.openCard) this.openCard = null\n }", "function startRound() {\n printGameScreen();\n printPlayer(activePlayer)\n rl.question(\"Command: \", function(answer) {\n\n //draw phase\n //play hand phase\n //buy components\n //play action\n\n //if final person has reached then do the cycle update round\n\n //check to see if anyone has reached the winning amount\n\n\n //need to cycle between players\n\n if (/^[d]/.test(answer)) {\n console.log('someone pressed the d')\n players[activePlayer].drawCard(deck);\n playerActionCount++;\n }\n\n if (/^[x]/.test(answer)) {\n console.log('someone pressed x')\n let pred = answer.split(' ');\n let temp = pred[1];\n let cardsList = temp.split(\",\");\n var result = cardsList.map(function (x) {\n return parseInt(x, 10);\n });\n //need to draw that many cards for this player\n //error handling make sure not allowed take more than allowed\n\n players[activePlayer].board.exchangeForComponent(result);\n playerActionCount++;\n }\n\n if (/^[t]/.test(answer)) {\n let pred = answer.split(' ');\n let cardNum = pred[1];\n players[activePlayer].board.addNewTask(cardNum);\n playerActionCount++\n }\n\n if (answer == \"help\" || answer == \"h\") {\n console.log('>d //to draw a card');\n console.log('>x 1,2,3 //to exchange cards for components, the number in csv will be the number of the card in your hand');\n console.log('>t n // to add a card from your hand to the tasks');\n }\n\n if (answer == \"exit\"){\n rl.close();\n } else {\n if(playerActionCount == maxActionPerTurn) {\n activePlayer = nextPlayer(activePlayer);\n playerActionCount = 0;\n }\n\n\n\n startRound();\n }\n });\n}", "_isPokerRoundRelevant(pokerRound, roundContext) {\n\t\treturn true;\n\t}", "cancel() {\n\t\tif (!this.state.executing) {\n\t\t\tthis.opts.cancel && this.opts.cancel();\n\t\t}\n\t}", "cancel() {\n\t\tif (!this.state.executing) {\n\t\t\tthis.opts.cancel && this.opts.cancel();\n\t\t}\n\t}", "cancel() {\n\n if (this.requestRunning === false) return;\n\n this.requestRunning = false;\n\n this._resetAdsLoader();\n\n // Hide the advertisement.\n this._hide(\"cancel\");\n\n // Send event to tell that the whole advertisement thing is finished.\n let eventName = \"AD_SDK_CANCELED\";\n let eventMessage = \"Advertisement has been canceled.\";\n this.eventBus.broadcast(eventName, {\n name: eventName,\n message: eventMessage,\n status: \"warning\",\n analytics: {\n category: this.eventCategory,\n action: eventName,\n label: this.gameId\n }\n });\n }", "function whosTurn() {\n var player = players[turns % players.length];\n io.emit('message', player.username + \"'s turn.\");\n io.emit('disable new game button');\n io.emit('disable draw buttons');\n io.emit('hide drawTotal button');\n io.to(player.id).emit('enable draw buttons');\n io.to(player.id).emit('notify');\n if (lastCardDrawX && drawTotal > 4) {\n io.to(player.id).emit('show drawTotal button', drawTotal);\n }\n}", "function cancelInterview(id) {\n const appointment = {\n ...state.appointments[id],\n interview: null\n };\n const appointments = {\n ...state.appointments,\n [id]: appointment\n };\n const selectedDay = state.days.filter(currentDay => { \n return currentDay.name === state.day;\n })\n\n return axios\n .delete(`/api/appointments/${id}`)\n .then(() => { \n const spotCount = selectedDay[0].spots + 1;\n const updatedDays = state.days.map(day => {\n if (day.name !== state.day) {\n return day;\n }\n return {\n ...day,\n spots: spotCount\n };\n });\n\n setState({\n ...state,\n appointments,\n days : updatedDays\n }); \n })\n\n }", "cancelHoldExit() {\n this.state = HoldsDirectorState.INBOUND;\n }", "function evaluateClues() {\n\tvar game;\n \tgame = Game.instance;\n\tif (game.clueDataB == null) {\n\t\tgame.clueDataA = null;\n\t\tgame.clueDataB = null;\n\t\tplaceClues();\n\t} else if (game.clueDataA.partner == game.clueDataB.id) {\n\t\tupdateClueAvailability(game.clueDataA.revealed);\n\t\tgame.assets['res/sounds/tone.mp3'].play();\n\t\tplaceClues();\n\t} else {\n\t\tgame.assets['res/sounds/slap.mp3'].play();\n\t\tgame.clueMistakesMade++;\n\t\t//gameend for making too many mistakes\n\t\tif (game.clueMistakesMade > 4) {\n\t\t\tgame.specialScenesTriggered[0].status = '1';\n\t\t}\n\t}\n}", "function reject(){\n\tconsole.log('call rejected');\n\tsocket.emit('reject',$callerName.innerHTML);\n\t$acceptButtons.style.display = 'none';\n\t$addToConferenceButtons.style.display = 'none';\n\t$caller.style.display = 'none';\n\t$ringingSound.pause();\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 end_turn(){\n\tif(dbg){\n\t\tdebug(\"ending turn\");\n\t}\n\tupdate_hand();\n\tvar x = document.getElementsByClassName(\"actions\");\n\tfor (i=0; i < x.length; i++){\n\t\tx[i].disabled = true;\n\t}\n}", "lose(opponent) {}", "cancel() {\n if (!this._flying) {\n return;\n }\n this._flying = false;\n this._time1 = null;\n this._time2 = null;\n if (this._callback) {\n this._callback = null;\n }\n this.fire(\"canceled\", true, true);\n }", "function disableCards() {\n firstCard.removeEventListener('click', flipCard);\n secondCard.removeEventListener('click', flipCard);\n ++score;\n checkForWin();\n resetBoard();\n}", "playerLoses() {\n this.roundEnds('LOSER');\n }", "async _cancelCurrentConnectionAttempt() {\n if (this.state.isConnected || !this.state.currentConnectionAttempt) {\n return;\n }\n\n try {\n this.state.currentConnectionAttempt.cancelConnectionAttempt();\n } catch (err) {\n // When the disconnect fails, we free up the ui and we can\n // silently wait for the timeout if it's still attempting to connect.\n }\n\n this.setState({\n currentConnectionAttempt: null\n });\n }", "function takeAwayGuesses() {\n numOfGuesses--;\n if (numOfGuesses <= 0) {\n nonWinner();\n }\n }", "promptTargetForLostChallengeChoice() {\n if (this.currentPlayer.isComputer) {\n let announcement = computerPlayerMessage(`Won Challenge`);\n this.currentPlayer.renderControls(announcement);\n this.targetLostChallenge = true;\n let lostChallengeForm = loseCardSelector('challenge', this.currentTarget);\n this.currentTarget.renderControls(lostChallengeForm);\n lostChallengeForm.addEventListener('submit', (e) => {\n e.preventDefault();\n lostChallengeForm.remove();\n this.domState = this.domState.refresh();\n this.targetLostChallengeIdx = this.domState.targetLostChallengeIdx;\n this.settled = true;\n setTimeout(this.targetAllowedPlayer, 10);\n })\n } else {\n let announcement = computerPlayerMessage(`Lost Challenge`);\n this.currentTarget.renderControls(announcement);\n setTimeout(() => {\n this.targetLostChallenge = true;\n this.targetLostChallengeIdx = this.currentTarget.randKillIdx();\n this.settled = true;\n this.targetAllowedPlayer();\n }, 1000);\n }\n }", "cancel() {\n if (this.isCloseable_) {\n this.userActed('cancel');\n }\n }", "cancel() {\n debug('TimedPolicyThread.cancel called.');\n this.cancelled = true;\n\n if (this.timer) {\n clearInterval(this.timer.id);\n }\n }", "function cancelBox() {\n\t\n\tvar cancelDiv=$('cancelOutfitter');\n\tvar outfitting;\n\tif (GM_getValue('getEquip',false) || GM_getValue('collectStripInfo',false) ||\n\t\t\tGM_getValue('stripping',false) || GM_getValue('dressing', false))\n\t\toutfitting=true;\n\telse outfitting=false;\n\tif (!cancelDiv && outfitting) {\n\t\tvar cancelDiv=makeBox('Outfitter: ','cancelOutfitter');\n\t\t\n\t\tvar cancelButton=makeButton('For the love of Montresor, stop!');\n\t\tcancelButton.addEventListener('click', \n\t\t\t\tfunction() {\n\t\t\t\t\tGM_setValue('getEquip',false);\n\t\t\t\t\tGM_setValue('collectStripInfo',false);\n\t\t\t\t\tGM_setValue('collectSlotInfo',false);\n\t\t\t\t\tGM_setValue('stripping',false);\n\t\t\t\t\tGM_setValue('dressing', false);\n\t\t\t\t\tdocument.body.removeChild($('cancelOutfitter'));\n\t\t\t\t}, true);\n\t\tcancelDiv.appendChild(cancelButton);\n\t\tdocument.body.insertBefore(cancelDiv, document.body.firstChild);\n\t}\n\telse if (cancelDiv && !outfitting ) {\n\t\tdocument.body.removeChild(cancelDiv);\n\t}\n}", "function unAnswered() {\n unansweredQuestions++;\n $('.timeRemaining').text(\"YOU FAILED TO CHOOSE AN OPTION\").css({\n 'color': '#3D414F'\n });\n resetRound();\n}", "function voting() {\n let chan = bot.guilds\n .get(get('config.discord.serverID'))\n .channels.find('name', get('config.discord.channelName'));\n chan\n .send(votestart('...', 'Loading...'))\n .then(message => {\n requ()\n .then(arr => {\n tweets = arr;\n round = get('round');\n round++;\n db.set('round', round).write();\n let choices = tweets\n .map((cur, ind) => `${ind + 1}: ${cur}`)\n .join('\\n');\n message.edit(votestart(round, choices)).then(() => {\n go = true;\n e.once('complete', res => {\n chan\n .send(\n 'https://twitter.com/' +\n twitterUser.screen_name +\n '/status/' +\n res.id_str,\n {\n embed: {\n description: res.text,\n timestamp: moment()\n .add(get('options.cooldown.toNextVote'), 'minutes')\n .toISOString(),\n author: {\n name: `${twitterUser.name} (@${\n twitterUser.screen_name\n })`,\n icon_url: twitterUser.profile_image_url_https,\n url: 'https://twitter.com/' + twitterUser.screen_name\n },\n footer: {\n icon_url:\n 'https://abs.twimg.com/icons/apple-touch-icon-192x192.png',\n text: 'Next round is'\n }\n }\n }\n )\n .catch(error => {\n console.log(new Error(error));\n process.exit(1);\n });\n let wait = get('options.cooldown.toNextVote') * 60000;\n let currentRound = get('round');\n setTimeout(() => {\n if (!go && get('round') == currentRound) {\n voting();\n }\n }, wait);\n });\n });\n })\n .catch(error => {\n console.log(new Error(error));\n process.exit(1);\n });\n })\n .catch(error => {\n console.log(new Error(error));\n process.exit(1);\n });\n}", "function unansweredNoti() {\n clearDivs();\n $('#timer').html(\"<p>Pick</p>\");\n unanswered++; // number of unaswered goes up\n showAnswers();\n stopCounting();\n setTimeout(playGame, 5000);\n }", "function cancel() {\r\n click(getCancel());\r\n waitForElementToDisappear(getCancel());\r\n }", "_confirm_cancel(event) {\n const order = event.detail;\n if (order.pcode == this.pcode) {\n this.$.log.info(`You canceled your ${msg.is_bid ? 'bid' : 'ask'}`);\n }\n }", "cancelPoll() {\n this.props.cancelCallback();\n }", "function cancel(event, response, model) {\n const pb = model.getPlaybackState();\n if (playbackState.isValid(pb) && !playbackState.isFinished(pb)) {\n response.audioPlayerStop();\n }\n else {\n response.speak(speaker.get(\"Goodbye\"));\n }\n\n response.send();\n}", "function cancel() {\n // history.goBack();\n history.push(`/decks/${deckId}`)\n }", "function closeCards() {\n if (k < 5)\n inquirer\n .prompt([\n {\n type: \"input\",\n message: eval(\"cloze\"+k+\".partial\"),\n name: \"response\"+ k,\n }\n ]).then(function(inquirerResponse) {\n if (eval(\"inquirerResponse.response\"+k) === eval(\"cloze\"+k+\".cloze\")) { \n console.log(\"Correct!\"); \n } else {\n console.log(\"Incorrect!\");\n }\n k++;\n closeCards();\n }); \n\n }", "handleReject(){\n this.newClock = false;\n this.editMode = false;\n }", "function game(e) {\n var roundResult;\n var winner;\n\n //update interface based on round result \n roundResult = (singleRound(this.id,computerPlay()));\n if(roundResult.charAt(0) == 'C'){\n cWin++;\n round++;\n document.getElementById(\"cScore\").innerText =cWin;\n document.getElementById(\"roundNum\").innerText =round;\n }\n else if (roundResult.charAt(0) == 'P'){\n pWin++;\n round++;\n document.getElementById(\"pScore\").innerText = pWin;\n document.getElementById(\"roundNum\").innerText =round;\n }\n else {\n draw++;\n round++;\n document.getElementById(\"dScore\").innerText = draw;\n document.getElementById(\"roundNum\").innerText =round;\n }\n console.log('P:'+pWin + ' C:' + cWin + ' ' +roundResult);\n\n //game result\n if (cWin == 5){\n document.getElementById(\"message\").innerHTML = `Sorry, you lost. [Auto reset in 3 second]`;\n };\n if (pWin == 5){\n document.getElementById(\"message\").innerHTML = `Congratulations, you win. [Auto reset in 3 second]`;\n };\n\n if (cWin == 5 || pWin == 5) {\n setTimeout(() => { reset(); }, 3000);\n\n\n }\n\n\n \n}", "function checkAccepted() {\n\t\t\t\t\t\t\tvar accepted = $(\".issue-boards\").data(\"accepted\");\n\t\t\t\t\t\t\tif (accepted != undefined) {\n\t\t\t\t\t\t\t\tif (!accepted) {\n\t\t\t\t\t\t\t\t\t$card.removeClass(\"issue-dragging\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonedev.server.ajaxRequests.count--;\n\t\t\t\t\t\t\t\t$(\".issue-boards\").removeData(\"accepted\");\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tsetTimeout(checkAccepted, 100);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "function onSelectWinningCard(socket, clientId, move) {\n\tconst gameId = clientGameMap[clientId];\n\tconst game = games[gameId];\n\tconst winningVote = game._selectWinningCard(move.playerId, move.voterId, move.cardId);\n\n\t// Handle end of turn and end of game events\n\tif (!winningVote) return;\n\tsetTimeout(function() {\n\t\t\t// If max score has been reached\n\t\t\tif (winningVote.player.points.length >= Game.maxScore()) {\n\t\t\t\tconsole.log('Max turns reached. End of game.');\n\t\t\t\tgame.endGame();\n\t\t\t\tsocket.emit('sync', game);\n\t\t\t\tsocket.broadcast.to(gameId).emit('sync', game);\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tgame.reinit();\n\t\t\t\t\tinitGame(game);\n\t\t\t\t\tsocket.emit('sync', game);\n\t\t\t\t\tsocket.broadcast.to(gameId).emit('sync', game);\n\t\t\t\t\tstartAutovoteTimer(game, socket);\n\t\t\t\t},\n\t\t\t\t3000);\n\t\t\t} else {\n\t\t\t\tgame._nextTurn();\n\n\t\t\t\tstartAutovoteTimer(game, socket);\n\t\t\t\tsocket.emit('sync', game);\n\t\t\t\tsocket.broadcast.to(gameId).emit('sync', game);\n\t\t\t}\n\t\t},\n\t\t3000);\n}", "function stopOpponentCheckTimer() {\n clearInterval(nIntervId);\n }", "function resetTurn() {\n try {\n clearTimeout(timeout);\n document.querySelector('.temp').classList.remove('open', 'show', 'temp');\n document.querySelector('.temp').classList.remove('open', 'show', 'temp');\n }\n catch(err) {\n }\n tempArray = [];\n tempArray.push(event.target);\n cardClicks = 1;\n clickedCard();\n}", "function selWinnerFin(){\n mainCard.src = \"images/card.svg\";\n gameData.win = Math.round(Math.random());\n console.log(`${gameData.win}`);\n if (gameData.win == 0) {\n turn.innerHTML = `The computer chooses: ${gameData.players[0]}`;\n deck1.remove();\n deck2.remove();\n gameData.score[0]++;\n }\n else if (gameData.win == 1) {\n turn.innerHTML = `The computer chooses: ${gameData.players[1]}`;\n deck1.remove();\n deck2.remove();\n gameData.score[1]++;\n }\n setTimeout(function(){showWinner();}, 1000);\n}", "function checkDrawRound(){\r\n\talert('Do you won\"t to create another draw?');\r\n\t\t\tif(confirm){\r\n\t\t\t\t\tenterPlayer();\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\t\r\n}", "function rpsGame(yourChoice){\nconsole.log(yourChoice);\nlet humanChoice, botChoice;\nhumanChoice = yourChoice.id;\nbotChoice = numTberoChoice(ranToRpsInt());\nconsole.log('Computer choice:' + botChoice);\nresults = desideWinner(humanChoice, botChoice);\nconsole.log(results);\nmessage = finalMessage(results);\nconsole.log(message);\nrspFrontEnd(yourChoice.id, botChoice, message);\n}", "function disableCLick() {\n openCards.forEach(function (card) {\n card.off('click');\n });\n}", "function endGame(){\n let message = \"\";\n if(pScore > cScore){\n message+= \"You won the game!\\n\";\n } else if (cScore > pScore){\n message += \"The computer won the game!\\n\"\n } else {\n message+= \"It was a tie!\\n\";\n }\n message+=`Final Scores--> Player: ${pScore} | Computer: ${cScore}\\n`;\n message+=\"Thanks for playing.\";\n displayWinner.setAttribute('style', \"font-size:20px\");\n displayWinner.innerText = message;\n choices.forEach((choice)=> choice.removeEventListener('click',startRound));\n}", "resetSateOfAuction(game) {\n this.allowToMove = false;\n this.winnerOfAuction = game.winnerOfAuction;\n }", "disconnect() {\n this.emit('closing');\n this.sendVoiceStateUpdate({\n channel_id: null,\n });\n\n this._disconnect();\n }", "function completeExchangePhase () {\n detectCheat();\n /* exchange the player's chosen cards */\n exchangeCards(HUMAN_PLAYER);\n \n /* disable player cards */\n for (var i = 0; i < $cardButtons.length; i++) {\n $cardButtons[i].attr('disabled', true);\n }\n $gameLabels[HUMAN_PLAYER].removeClass(\"current\");\n allowProgression(eGamePhase.REVEAL);\n}" ]
[ "0.6405195", "0.6382384", "0.6030974", "0.5992885", "0.59616435", "0.59570885", "0.5893065", "0.58822864", "0.5874092", "0.5828822", "0.5714946", "0.5705814", "0.56973666", "0.5690748", "0.5683877", "0.5664352", "0.56468314", "0.5638386", "0.5623588", "0.5616252", "0.55944306", "0.55935663", "0.55901706", "0.55710465", "0.55704", "0.5562606", "0.5561938", "0.555661", "0.5554003", "0.5550897", "0.55488336", "0.554403", "0.5538694", "0.5538694", "0.5535508", "0.55331963", "0.5533128", "0.5523645", "0.5521109", "0.5520416", "0.5505868", "0.5496895", "0.5487548", "0.54823124", "0.54665166", "0.5454245", "0.5452652", "0.5449954", "0.5448054", "0.5431215", "0.5427205", "0.5423896", "0.54173017", "0.54136115", "0.5401041", "0.53806216", "0.5371414", "0.5370272", "0.53687274", "0.53687274", "0.53679913", "0.53636736", "0.53597945", "0.5359444", "0.5354895", "0.5347483", "0.53474253", "0.53467786", "0.53437716", "0.53394604", "0.53391546", "0.53331274", "0.5332963", "0.5329546", "0.53286237", "0.5327599", "0.5321121", "0.5318342", "0.5318202", "0.5312872", "0.5309672", "0.53086257", "0.53077865", "0.5303499", "0.5302668", "0.5300883", "0.52982384", "0.5297688", "0.5297076", "0.5289156", "0.5286413", "0.52769357", "0.5273667", "0.52710474", "0.5266749", "0.5264032", "0.52626467", "0.52556187", "0.5254406", "0.5252894", "0.52524626" ]
0.0
-1
signal to the server that a card was picked
pickCard(card) { this.socket.emit('clientPickedCard', this.connectedRoom, card); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "moveCardFromHandToDiscard(card) {\n this.socket.emit(\"moveCardFromHandToDiscard\", card.uniqueName);\n }", "function playercardturn(player){\n //show cards\n //ask to select cards to play\n //push them into action slot\n }", "function selectCard(evt) {\n console.log(\"select card\", evt);\n // retrieve .card element\n var card = $(evt.target);\n if(card.hasClass(\"symbol\")) {\n card = card.parent(\".card\");\n }\n // toggle selected state\n card.toggleClass(\"selected\");\n // if 3 selected cards: stop selection mode and send selection action\n var selection = $.map($(\".card.selected\"), function(e) {return Number.parseInt(e.id.substr(5))});\n if(selection.length == 3) {\n stopTrioSelection(\"Wait\", null);\n send({'type': 'select_trio', 'selection': selection});\n }\n}", "function selectCard (card) {\n humanPlayer.hand.tradeIns[card] = !humanPlayer.hand.tradeIns[card];\n \n if (humanPlayer.hand.tradeIns[card]) {\n dullCard(HUMAN_PLAYER, card);\n } else {\n fillCard(HUMAN_PLAYER, card);\n }\n}", "getPickedCard() {\n let observable = new rxjs__WEBPACK_IMPORTED_MODULE_2__[\"Observable\"](observer => {\n this.socket.on('serverSendCardPicked', (cardObject) => {\n if (cardObject) {\n observer.next(cardObject.card_text);\n }\n else {\n observer.next(null);\n }\n });\n return () => {\n this.disconnectSocket();\n };\n });\n return observable;\n }", "function pickupBeforeStage(event) {\n\tvar pickUpLink = event.data.replace(\"pickupBeforeStage\", \"\");\n\t$(\"#extra1\").attr(\"src\", \"http://\"+ ip + pickUpLink);\n\tgetCurrHand();\n\tvar cardTracker = 0;\n\tfor (var i = 0; i < handCardSRC.length; i++) {\n\t\tvar tempCardLink = handCardSRC[i].replace(\"http://\"+ip,\"\");\n\t\ttempCardLink = tempCardLink.split('%20').join(' ');\n\t\tif (tempCardLink != \"/resources/images/all.png\")\n\t\t\tcardTracker++;\n\t}\n\t\n\tnumCards = cardTracker;\n\tif (cardTracker > 12) {\n\t\tdocument.getElementById(\"doneEquipment\").disabled = true;\n\t\tvar serverMsg = document.getElementById(\"serverMsg\");\n\t\tserverMsg.value += \"\\n> you must choose a card to continue (or right-click to discard) when it is your turn\";\n\t}\n}", "function firstcardselected() {\n var cardposition = memory_tile_ids[0]; //change position later\n // ADD FUNCTION FROM FRONTEND TO GET CARD POSITION\n socket.emit('firstcardselected', {cardposition: cardposition} //CHANGE TO VAR SELECTEDPOSITION\n );\n}", "function onScan(card, req) {\n recordAccess(req);\n if (card.secure && card.deactivate) {\n email.sendDeactivated(card);\n secure.deactivateCard(card);\n }\n else if (card.deactivate) {\n let res = moveId(card);\n let id = res.id;\n email.sendMoved(id, card);\n }\n}", "function grab(boolean) {\n if (boolean) {\n socket.emit(\"grab\", { grabbedCard: currentGrabbedCard});\n }\n else {\n // keep cards selected until menu is closed\n if (isBattleMenuOpen === false) {\n socket.emit(\"release\");\n }\n }\n }", "function pickCard(numberSent) {\n if (cardsontable > 0) {\n hideCard(numberSent);\n deck.push(numberSent);\n cardsontable--;\n table[numberSent] = false; //remember that card is no longer on the table\n }\n}", "function pick(playerClicked){\r\n pPick = playerClicked;\r\n cPick = computerChooses();\r\n countdown();\r\n}", "function PickupCards(newCards) {\n\tvar testBonus = false;\n\tgetCurrHand();\n\tif (newCards.startsWith(\"PickupCardsProsperity\")) {\n\t\twhichEvent = \"Prosperity\";\n\t\tnewCards = newCards.replace(\"PickupCardsProsperity\", \"\");\n\t}\n\tif(newCards.startsWith(\"PickupCardsTestBonus\")) {\n\t\tnewCards = newCards.replace(\"PickupCardsTestBonus\",\"\");\n\t\ttestBonus = true;\n\t}\n\tif(newCards.startsWith(\"PickupCardsQueensFavor\")) {\n\t\twhichEvent = \"Queens Favor\";\n\t\tnewCards = newCards.replace(\"PickupCardsQueensFavor\",\"\");\n\t}\n\tif(newCards==\"null\") return;\n\tnewCards = newCards.split(\";\");\n\tnewCards.pop();\n\tvar numNewCards = newCards.length;\n\tfor (var i = 0; i < handCardID.length; i++) {\n\t\tif (handCardSRC[i] == \"http://\"+ip+\"/resources/images/all.png\") {\n\t\t\tvar imageId = handCardID[i];\n\t\t\tif(testBonus) { var tempLink = getLinkFromName(newCards.pop()) } else {\n\t\t\t\tvar tempLink = newCards.pop();\n\t\t\t}\n\t\t\t\n\t\t\t$(\"#\" + imageId).attr(\"src\",\n\t\t\t\t\t\"http://\"+ ip + tempLink);\n\t\t\tif (newCards.length == 0)\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tvar cardTracker = 0;\n\tfor (var i = 0; i < handCardSRC.length; i++) {\n\t\tvar tempCardLink = handCardSRC[i].replace(\"http://\"+ip, \"\");\n\t\ttempCardLink = tempCardLink.split('%20').join(' ');\n\t\tif (tempCardLink != \"/resources/images/all.png\")\n\t\t\tcardTracker++;\n\t}\n\n\tcardTracker += numNewCards;\n\tnumCards = cardTracker;\n\tif (cardTracker > 12) {\n\t\tvar serverMsg = document.getElementById('serverMsg');\n\t\tserverMsg.value += \"\\n> right click to remove extra cards to continue (for discard)\";\n\t\tif (isAI == true) {\n\t\t\tvar data = JSON.stringify({\n\t\t\t\t'AICommand' : 'DiscardChoice',\n\t\t\t\t'numCards' : (cardTracker - 12),\n\t\t\t\t'name' : PlayerName\n\t\t\t})\n\t\t\tsocketConn.send(data);\n\t\t\treturn;\n\t\t}\n\n\t\tdiscard();\n\t}\n\t\n\tif(numCards <= 12 && whichEvent == \"Queens Favor\") {\n\t\tconsole.log(\"sending queens favor\");\n\t\tvar data = JSON.stringify({\n\n\t\t\t'doneEventQueensFavor' : 0\n\t\t})\n\t\tsetTimeout(function(){ socketConn.send(data); }, 1000);\n\t}\n\t\n\tif(numCards <= 12 && whichEvent == \"Prosperity\") {\n\t\tconsole.log(\"sending prosperity\");\n\t\tvar data = JSON.stringify({\n\n\t\t\t'doneEventProsperity' : 0\n\t\t})\n\t\tsetTimeout(function(){ socketConn.send(data); }, 1000);\n\t}\n\n}", "function handleDeckCardClick(id) {\n setCardInUse(id)\n console.log(cardInUse)\n setCardAddStatus(cardAddStatus + 1)\n }", "function hit(e) {\n\n if (BlackJack['isStand'] === false) {\n BlackJack['turnsOver'] = false;\n let card = randomCards();\n showCard(YOU, card);\n updateResult(YOU, card);\n showCount(YOU);\n BlackJack[\"isHit\"] = true;\n }\n\n}", "function selectCard() {\n chosenCard = $(this).text();\n $(\"#selectCardMenu\").text(chosenCard);\n choseCardType = true;\n}", "function onSelectImageCard(socket, clientId, move) {\n\tconst gameId = clientGameMap[clientId];\n\tconst game = games[gameId];\n\n\tgame._selectImageCard(move.playerId, move.cardId);\n\n\tsocket.emit('sync', game);\n\tsocket.broadcast.to(gameId).emit('sync', game);\n}", "function myCard(response) {\n pokeSelect = response.name;\n pokeHP = response.hp;\n fillCard(response,\"#my-card\");\n $(\"start-btn\").classList.remove(\"hidden\");\n $(\"start-btn\").onclick = gameRequest;\n }", "function makeChoice(sign) {\n if(sign === 'o' || sign === 'x')\n socket.emit('choose', { sign: sign })\n else\n console.log('makeChoice error: podano zly znak!');\n}", "function selectCard(e){\n selectedId = e.id;\n var card=null;\n for (var i=0; i<cardList.length; i++){\n if (cardList[i].id==selectedId) card=cardList[i];\n }\n if (card!=null){\n $( \"#paramForm .carNumber\").val( card.car.carNumber );\n $( \"#paramForm .ttnNumber\").val( card.car.ttnNumber );\n $( \"#paramForm .culture\").val( card.car.nomenclature );\n $( \"#paramForm .firstName\").val( card.car.driver.firstName );\n $( \"#paramForm .lastName\").val( card.car.driver.lastName );\n $( \"#paramForm .organization\").val( card.car.driver.organization );\n $( \"#paramForm .mobileNumber\").val( card.car.driver.mobileNumber );\n $( \"#paramForm .sampleName\").val( card.car.cargo.sample.name );\n $( \"#paramForm .nomenclature\").val( card.car.cargo.sample.nomenclature );\n $( \"#paramForm .class\").val( card.car.cargo.sample.cultureClass );\n $( \"#paramForm .siloNumber\").val( card.car.siloNumber );\n $( \"#paramForm .humidity\").val( card.car.cargo.sample.humidity );\n $( \"#paramForm .cardId\").val( card.id );\n //alert($( \"#paramForm .queueId option:selected\").text());\n $( \"#paramForm .queueId\").val(-1); \n if (card.car.destination!=\"\" && card.car.destination!=null) {\n $(\"#paramForm .queueId :contains('\" + card.car.destination + \"')\").prop(\"selected\", true);\n }\n }\n $(\".selected\").removeClass(\"selected\");\n e.classList.add(\"selected\");\n}", "handleCopyCard(listId, cardId) {}", "exchangeGainCard(card) {\n this.cards.push(card);\n ++this.numCards;\n }", "pickUp() {\n if(this.addToInventory(this.Target)) {\n this.emit(\"Player.Environment.Interacted\", \"You picked up a \"+this.Target.name+\".\");\n this.generateEnvironment();\n this.save();\n } else {\n this.emit(\"Player.Environment.Interacted\", \"You do not have room in your inventory.\");\n }\n }", "takeCard(deck){\n this.hand.push(deck.dealCard());\n }", "async function drawCard(event){\n //console.log(\"Drawing x1 card\");\n\n var request = {\n \"player\" : null\n }\n\n let drawCardUrl = '/game/' + gameId + '/drawCard';\n const response = await fetch(drawCardUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n // body data type must match \"Content-Type\" header\n body: JSON.stringify({ msg: 'drawing a card' }) \n });\n\n let { playedCard } = await response.json();\n //console.log('playedCard:', playedCard);\n\n if(playedCard == undefined){\n notify('err', 'error', ('Error drawing the card'));\n return;\n }\n\n addCard({ \n id: playedCard.id,\n number: playedCard.number,\n color: playedCard.color,\n type: playedCard.type\n });\n\n}", "function get_card(newCard){\n if(dbg){\n\t\tdebug(\"Get card\");\n\t}\n\tcard4 = newCard;\n\tupdate_hand();\n\tenable_discard();\n}", "handlepick() {\n\t\talert('i was clicked');\n\t}", "selectCard(e) {\n if (this.state.time.s > 0 && this.state.isIdle === false) {\n this.setState({\n prevCard: '',\n p1Select: e})\n }\n }", "gainCard(card) {\n this.cards.push(card);\n this.out = false;\n if (this.numCards < 2) {\n ++this.numCards;\n }\n }", "async function selectTops(e) {\r\n //Will not let the player change cards once the game has started\r\n if (!game_started) {\r\n var this_value = $(e).attr(\"alt\");\r\n if (this_value !== \"deck\") {\r\n $(\".start-menu\").css(\"display\", \"none\");\r\n var temp = players[0].top.filter(val => val !== this_value);\r\n players[0].top = temp;\r\n players[0].hand.push(this_value);\r\n $(e).attr(\"src\", \"images/deck_01.svg\");\r\n $(e).attr(\"alt\", \"deck\");\r\n newCards();\r\n }\r\n }\r\n }", "function handleChoiceCardNo(e) {\n if (currentPage == \"cardservice/create/visa/card-unlock\") {\n handleChoiceCardNoClose();\n if ((e.selectedValue1 != undefined) && (e.selectedValue1 != null)) {\n pCardNoSelected = e.selectedValue1;\n var tagAccNo = document.getElementById(\"open-card-lock-no\");\n if (tagAccNo.nodeName == \"INPUT\") {\n tagAccNo.value = e.selectedValue1;\n }\n else {\n tagAccNo.innerHTML = e.selectedValue1;\n }\n }\n }\n }", "card_update(card) {}", "function handleChoiceCardType(e) {\n if (currentPage == \"cardservice/create/visa/card-unlock\") {\n handleChoiceCardTypeClose();\n if ((e.selectedValue1 != undefined) && (e.selectedValue1 != null)) {\n var tagAccNo = document.getElementById(\"open-card-lock-type\");\n if (tagAccNo.nodeName == \"INPUT\") {\n tagAccNo.value = e.selectedValue1;\n }\n else {\n tagAccNo.innerHTML = e.selectedValue1;\n }\n }\n if ((e.selectedValue2 != undefined) && (e.selectedValue2 != null)) {\n if(pCardTypeSelected != e.selectedValue2) {\n document.getElementById(\"open-card-lock-no\").value = CONST_STR.get('COM_TXT_SELECTION_PLACEHOLDER');\n }\n pCardTypeSelected = e.selectedValue2;\n\n //disable if do not card\n document.getElementById(\"open-card-lock-no\").disabled = 'disable';\n for(var i=0; i< gTrans.carUnLockArr.length; i++) {\n var tmpCard = gTrans.carUnLockArr[i];\n if(tmpCard.LOAI_THE == pCardTypeSelected) {\n document.getElementById(\"open-card-lock-no\").disabled = '';\n break;\n }\n }\n }\n }\n }", "function give_feedback_on_selected_hand(){\n $('.feedback').text( game_instance.determine_feedback_for_selected_hand() );\n }", "changeCard(card) {\n console.log(\"Changing card to \\\"\" + card.question + \"\\\"\");\n Dispatcher.handleViewAction({\n type: Constants.ActionTypes.CARD_CHANGED,\n card: card\n });\n }", "function setHand() {\n\tvar serverMsg = document.getElementById('serverMsg');\n\tserverMsg.value += \"\\n> setting player hand, flipping story deck, wait for your turn- \";\n\tvar handString = event.data.replace('setHand', '');\n\tvar handStringArray = handString.split(\":\");\n\t$(\"#card1\").attr(\"src\", handStringArray[0]);\n\t$(\"#card2\").attr(\"src\", handStringArray[1]);\n\t$(\"#card3\").attr(\"src\", handStringArray[2]);\n\t$(\"#card4\").attr(\"src\", handStringArray[3]);\n\t$(\"#card5\").attr(\"src\", handStringArray[4]);\n\t$(\"#card6\").attr(\"src\", handStringArray[5]);\n\t$(\"#card7\").attr(\"src\", handStringArray[6]);\n\t$(\"#card8\").attr(\"src\", handStringArray[7]);\n\t$(\"#card9\").attr(\"src\", handStringArray[8]);\n\t$(\"#card10\").attr(\"src\", handStringArray[9]);\n\t$(\"#card11\").attr(\"src\", handStringArray[10]);\n\t$(\"#card12\").attr(\"src\", handStringArray[11]);\n}", "tryAnotherCard() {\n $(\".spinner\").removeClass(\"spinner\"); // remove animation class\n let newCard = selectRandomCard(this.props.cards);\n // prevent duplicate card\n if(newCard === this.state.selectedCard) {\n this.tryAnotherCard();\n return;\n }\n this.setState({selectedCard: newCard});\n }", "function accept(){\n\tvar connectToUser = $callerName.innerHTML;\n\tconsole.log(connectToUser + ' call accepted');\n\tsocket.emit('accept',connectToUser);\n\t$caller.style.display = 'none';\n\t$acceptButtons.style.display = 'none';\n//\t$mediaSelection.style.display = \"none\";\n\t$ringingSound.pause();\n}", "function chooseCard(event) {\n const choice = event.target.id;\n const gameMessage = document.querySelector('.hl-msg');\n const cards = document.querySelectorAll('.card');\n const secondCard = cards[Math.round(Math.random() * 50)];\n secondCard.id = 'hl-second';\n // Updates game message to show result based on the data value of the two cards dealt\n const firstCard = document.getElementById('hl-first');\n const cardDiff = secondCard.attributes[0].nodeValue - firstCard.attributes[0].nodeValue;\n if (\n (cardDiff > 0 && choice === 'higher')\n || (cardDiff < 0 && choice === 'lower')\n ) {\n gameMessage.innerText = 'Correct!';\n } else if (\n secondCard.attributes[0].nodeValue === firstCard.attributes[0].nodeValue\n ) {\n gameMessage.innerText = 'Draw!';\n } else {\n gameMessage.innerText = 'Wrong!';\n }\n // Removes ids from the two current game cards to 'return' them to the deck, invokes\n // function to deal the first card after timeout to account for animation of cards moving.\n setTimeout(() => {\n firstCard.id = null;\n secondCard.id = null;\n dealFirstCard();\n }, 1500);\n}", "pickCard() {\n //logit('PICK CARD MARKER');\n index1 = Math.floor(this.cardsLeft.length * Math.random());\n let card1 = this.cardsLeft.splice(index1,1)[0];\n this.playedCards.push(card1);\n return card1;\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 }", "pressResend() {\n alert(this.state.otpCode + \" Resending the code..\");\n }", "function newGame(){\n var cards = resetCards();\n socket.emit('CardNewGameReceived', cards); // Send message to sender\n socket.broadcast.emit('CardNewGameReceived', cards); // Send message to everyone BUT sender\n }", "function select (Ucardid,activateCard,status)\r\n\r\n{\r\n \r\n\tvar activenum= activateCard;\r\n\t\r\n\tvar cardId= Ucardid;\r\n\t\r\n\t\r\n\tif ( status==\"active\")\r\n{\r\n\t\tswal ( \"Congratulation!\", \"Card is already Activated\")\r\n\t\t\r\n\t\t\r\n}\r\nelse if ( status==\"locked\")\r\n{\r\n\t\tswal ( \"OOPS!\", \"Your Card is Locked\")\r\n\t\t\r\n\t\t\r\n}\r\n\t\r\n\telse if(status==\"pending activation\" || status==\"inactive\" )\r\n\t{\r\n\t\r\n\t $.ajax({\r\n\t \t type : \"POST\",\r\n\t \t url : \"/activatephycard\",\r\n\t \t data : {activenum:activenum,cardId:cardId},\r\n\t \t timeout : 100000,\r\n\t \t \r\n\t \t success : function(data) {\t\r\n\t \t \t \r\n\t \t \tswal.close() \r\n\t \t \t \r\n\t \t \tvar obj = JSON.parse(data);\r\n\t \t \t\r\n\t \t \t if (obj['isError'] == true ) { \r\n\t \t\t\t\t\r\n\t\t\t \t swal(\"Failed\")\t\r\n\t\t\t\r\n\t\t}\r\n\t \t \t else{\r\n\t \t \t\r\n\t \t \t\r\n\t \t\t\tswal(\"Physical Card Activate Successfully\",{\r\n\t\t\t \t buttons: false,\r\n\t\t\t \t timer: 12000,\r\n\t\t\t \t})\r\n\t\t\t \tsetTimeout(function(){\r\n\t\t\t \t\treturn getcustomercards();\r\n\t\t \t\t\t}, 2000);\r\n\t \t \t }\r\n\t \t \t\r\n\t \t \t},\r\n\t \t \r\n\t \t });\r\n\r\n\t}\r\n\r\n}", "function selectCard(event) {\n let recipeCard = event.target.closest(\".recipe-card\")\n if (event.target.className === \"card-apple-icon\") {\n let cardId = parseInt(event.target.closest(\".recipe-card\").id)\n domUpdates.changeHeartImageSrc(cardId, user, event)\n } else if (event.target.className === \"card-mixer-icon\") {\n let cardId = parseInt(event.target.closest(\".recipe-card\").id)\n domUpdates.changeMixerImageSrc(cardId, user, event)\n } else if (event.target.id === \"exit-recipe-btn\") {\n exitRecipe(event);\n } else if (isDescendant(recipeCard, event.target)) {\n let recipeId = $(recipeCard).attr('id')\n openRecipeInfo(recipeId);\n }\n}", "function sendPrepareMediaEjection(cardchar) {\n\n\t//collect data\n\tvar GUID = $(\"#GUID\"+cardchar).html();\n\t//console.log(\"sendPrepareMediaEjection GUID=\"+GUID);\n\n\t//clear error message area\n\tclearCardErrorMsg(cardchar);\n\n\t//send command\n\tPrepareMediaForEjection(GUID);\n\n}", "function onItemChosen(callback) {\n events.itemChosen.push(callback);\n }", "onSaveDeck() {\n if (this.state.cardFront && this.state.cardBack) {\n this.addCardToDeck();\n }\n axios.post(`http://${LOCAL_IP}:3000/momento/decks`, this.props.deck)\n .then(() => this.sendChromeMessage('background', 'returnHome', 'Home'))\n .catch(err => console.error(err));\n }", "function storeCard(e) {\n\tlet clickedCard = this.id;\n\tstoreArray.unshift(clickedCard);\n\tstoreArray.pop();\n\t//check condition if two diffrent card are uncovered\n\tif (storeArray[0] !== storeArray[1] & storeArray[1] !== undefined) {\n\t\ttoCountMoves(); // to add move to counter\n\t\trating(); // to set 'star rating'\n\t\tcompareCards(storeArray[0], storeArray[1]); // call to function to compare\n\t\tstoreArray = new Array(2); // to erase array\n\t} else {\n\t\t\n\t}\n}", "function userPick(evt) {\r\n userChoice = this.id;\r\n console.log(userChoice);\r\n playGame();\r\n}", "function chooseItem(type, choice) {\n socket.emit('shift-'+type, choice);\n socket.emit('touch', choice);\n}", "function pick(holeclick, holeValue){\r\n //put the pebbles in hand if hand was empty.\r\n pebblesInHand = holeValue;\r\n //update the GUI.\r\n newPic = 'pebbles_0.png';\r\n holeclick.address(newPic);\r\n document.querySelector('.hand_pebbles').src = 'pebbles_'+pebblesInHand+'.png';\r\n takePebbles(holeValue, holeclick);\r\n val = holeValue;\r\n PonP_sound.play();\r\n}", "function onFinishPick(pc, results, energy, mood, xp) {\r\n\tvar announcement_msg = \"You picked \";\r\n\t\r\n\tvar x = this.x;\r\n\tvar y = this.y; \r\n\t\r\n\tvar num_results = utils.lengthOfObj(results);\r\n\tvar count = 0;\r\n\tfor (var i in results) { \r\n\t\tif (announcement_msg != \"You picked \") { \r\n\t\t\r\n\t\t\tif (num_results - count > 1) {\r\n\t\t\t\tannouncement_msg += \", \";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tannouncement_msg += \" and \";\r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// If more than 7 items, then use a second row.\r\n\t\t// (There are only 13 crops, so there will never be more than 2 rows)\r\n\t\tif (!(count % 7)) { \r\n\t\t\ty -= 80;\r\n\t\t}\r\n\t\t\r\n\t\t//log.info(\"MG calling createItem for \"+i+\" \"+x+\" \"+y);\r\n\t\tvar remaining = this.createItemForPlayer(pc, i, results[i].num, x, y);\r\n\t\t\r\n\t\tif (remaining > 0) { \r\n\t\t\tvar on_ground = true;\r\n\t\t}\r\n\t\t\r\n\t\tif (results[i].num > 1) { \r\n\t\t\tannouncement_msg += results[i].num+\" \"+results[i].name_plural;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tannouncement_msg += \"a \"+results[i].name_single;\r\n\t\t}\r\n\t\t\r\n\t\tcount ++;\r\n\t}\r\n\t\r\n\tif (this.container && this.isDepleted() && !this.countEmptyPlots()){\r\n\t\tthis.replaceWithDepleted();\r\n\t}\r\n\t\r\n\tannouncement_msg += \".\";\r\n\t\r\n\r\n\tif (on_ground) { \r\n\t\tannouncement_msg += \" Your pack was full, so some of the produce ended up on the ground.\";\r\n\t}\r\n\t\r\n\tvar announce = {\r\n\t\t\t'type'\t\t: 'harvest',\r\n\t\t\t'energy'\t: energy,\r\n\t\t\t'mood'\t\t: mood,\r\n\t\t\t'xp'\t\t: xp,\r\n\t\t\t'msg'\t\t: announcement_msg\r\n\t\t};\r\n\t\r\n\t//log.info(\"MG harvest calling doFinishGardenAction\");\r\n\tthis.doFinishGardenAction(pc, announce);\r\n\t\r\n\tthis.clearFlags();\r\n}", "function handleIceCandidate(event) {\r\n if (event.candidate) {\r\n Signalling.sendMessage({\r\n type: 'candidate',\r\n label: event.candidate.sdpMLineIndex,\r\n id: event.candidate.sdpMid,\r\n candidate: event.candidate.candidate\r\n });\r\n } else {\r\n //console.log('End of candidates.');\r\n }\r\n }", "function eventKing(event) {\n\tvar serverMsg = document.getElementById(\"serverMsg\");\n\tKingsCallToArms = true;\n\tnumCards = 12;\n\n\tif(event.data.startsWith(\"KingsCallToArmsWeapon\")){\n\t\tserverMsg.value += \"\\n> must discard 1 weapon card to continue\";\n\t\tnumCards++;\n\t}\n\t\n\tif(event.data.startsWith(\"KingsCallToArms1Foe\")){\n\t\tserverMsg.value += \"\\n> must discard 1 foe card to continue\";\n\t\tnumCards++;\n\t}\n\tif(event.data.startsWith(\"KingsCallToArmsFoes\")){\n\t\tserverMsg.value += \"\\n> must discard 2 foe cards to continue\";\n\t\tnumCards+=2;\n\t}\n\tdiscard();\n}", "function onCardNew (newCard) {\n return {\n id: Date.now,\n ...newCard\n }\n}", "function clickResponse() {\n const card = this;\n // check for game start on first click\n if (!gameStarted) {\n gameStarted = true;\n stopWatch();\n }\n setTimeout(function() {\n showCard(card);\n}, 200);\n}", "function prim_click(e) {\n var user = document.querySelector('#select_value').value;\n browser.runtime.sendMessage({ 'name': 'set_change_card_for_site', 'user': user }, function (response) { });\n window.close();\n}", "function pickUp(item){\n\tif(!item.obtained){\n\t\tuser.inventory.splice(-1, 0, item)\n\t\titem.obtained = true;\n\t\tdocument.getElementById('outputDiv').innerHTML= 'You recieved ' + item.name + '! You put it in your inventory. You now have ' + user.inventory.length + ' out of a possible ' + maximumItems + ' items in your inventory!';\n\t\t\n\t\t//Check to see if user meets the maximum items\n\t\tif(user.inventory.length >= maximumItems){\n\t\t\tend();\n\t\t\treturn;\n\t\t}\n\t}else{\n\t\tdocument.getElementById('outputDiv').innerHTML= 'You already have that item!';\n\t}\n}", "function chooseEquipmentTournie() {\n\tvar serverMsg = document.getElementById(\"serverMsg\");\n\tif(isAI) {\n\t\tgetCurrHand();\n\t\tvar data = JSON.stringify({\n\t\t\t'AICommand' : \"chooseEquipmentTournie\",\n\t\t\t'name' : PlayerName,\n\t\t\t'currHand': handCardSRC,\n\t\t}) \n\t\tsetTimeout(function(){ socketConn.send(data); \n\t\tserverMsg.value = \"\\n> choosing equipment, please wait for other players\"; \n\t\t}, 1000);\t\t\n\t\treturn;\n\t}\n\tserverMsg.value = \"It is now time to choose equipment for tournament (right-click to discard)\";\n\t$('body').on('click', '#card1, #card2, #card3, #card4, #card5, #card6, #card7, #card8, #card9, #card10, #card11, #card12, #extra1, #extra2, #extra3, #extra4, #extra5, #extra6, #extra7, #extra8', function() {\n\t\tvar cardId = this.src.replace('http://'+ip, '');\n\t\tcardId = cardId.split('%20').join(' ');\n\t\tif (checkForEquipment(this.src) != \"card not found\") {\n\t\t\tfor (var i = 0; i < tournieEquipment.length; i++) {\n\t\t\t\tif ((checkForEquipment(this.src)) == tournieEquipment[i]) {\n\t\t\t\t\tvar serverMsg = document.getElementById('serverMsg');\n\t\t\t\t\tserverMsg.value += \"\\n> cannot choose repeat weapons\";\n\t\t\t\t\tvar data = JSON.stringify({ \n\t\t\t\t\t\t'logInfo' : \"RepeatWeaponTournieP\",\n\t\t\t\t\t\t'name' : PlayerName\n\t\t\t\t\t\t});\n\t\t\t\t\tsocketConn.send(data);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttournieEquipment.push(checkForEquipment(this.src))\n\t\t\tvar changeImageId = \"#\" + this.id;\n\t\t\tnumCards--;\n\t\t\t$(changeImageId).attr(\"src\", \"/resources/images/all.png\");\n\t\t\tif (numCards <= 12) {\n\t\t\t\tdocument.getElementById(\"doneTournie\").style.display = \"inline\";\n\t\t\t}\n\t\t}\n\n\t})\n}", "function selectCard(e) {\n let cardNode = e.target;\n let match;\n\n // only activate if card is clicked (not the deck)\n if (cardNode.getAttribute('class') === 'card') {\n\n // determin whether this is the first card selected\n if (cardSelected === false) {\n // show icon of card\n card1 = cardNode;\n flipCard(card1);\n\n // indicate that the first card has been selected\n cardSelected = true;\n } else {\n // show icon of card\n card2 = cardNode;\n flipCard(card2);\n\n // update the turn counter\n turns++;\n updateTurns(turns);\n\n // check whether the star need to be reduced\n reduceStars();\n\n // prevent other cards from being selected\n cardNode.parentNode.removeEventListener('click', selectCard);\n\n // check if selected cards are a match\n match = checkMatch(card1, card2);\n if (match) {\n // reinstate ability to select cards\n cardNode.parentNode.addEventListener('click', selectCard);\n\n // indicate that a pair has been found\n cardsMatched=cardsMatched+2;\n\n // determine if cards\n if (cardsMatched == CARDS) {\n // show congratulations panel and end game\n endGame();\n }\n } else {\n window.setTimeout(function(){\n flipCard(card1, 'reverse');\n flipCard(card2, 'reverse');\n // reinstate ability to select cards (after cards have been flipped)\n cardNode.parentNode.addEventListener('click', selectCard);\n }, 500);\n }\n\n // reset so that new card pairs can be selected\n cardSelected = false;\n }\n }\n}", "function sndRecPairClick() {\n if (buttonChecked == button_options.SENDREC) {\n //Clear colours\n buttonChecked = button_options.NONE;\n }\n else {\n //Clear button method, change to selected\n buttonChecked = button_options.SENDREC;\n }\n consoleAdd(\"Button Selected: \" + buttonChecked);\n}", "function selectNextCard() {\n\tcurrentCard = cardList[1];\n\tdisplayCard(eleId, currentCard);\n}", "function signalingMessageCallback(message) {\n if (message.type === 'offer') {\n console.log('Got offer. Sending answer to peer.');\n peerConn.setRemoteDescription(new RTCSessionDescription(message), function() {},\n logError);\n peerConn.createAnswer(onLocalSessionCreated, logError);\n\n } else if (message.type === 'answer') {\n console.log('Got answer.');\n peerConn.setRemoteDescription(new RTCSessionDescription(message), function() {},\n logError);\n\n } else if (message.type === 'candidate') {\n peerConn.addIceCandidate(new RTCIceCandidate({\n candidate: message.candidate\n }));\n\n }\n }", "function onCardClick(_event) {\n // starten den Timer für die Zeitmessung\n if (setTheStartTime) {\n // Date() = Datums Klasse, man kann Anfragen bspw. zum loken Tag/Woche/Monat und Jahr || .getTime() = gibt die momentane Zeit in Millisek. aus\n startTime = new Date().getTime(); // https://stackoverflow.com/questions/313893/how-to-measure-time-taken-by-a-function-to-execute\n // muss gesetzt werden damit, diese if-Abfrage nicht nochmal ausgeführt wird --> wird nur bei der ersten Karte ausgeführt, die angegeklickt wird\n setTheStartTime = false;\n }\n // selectedCards = ein array in dem die ausgewählten Karten sind (am Anfang leeres array)\n if (selectedCards.length < 2) {\n // target = HTML Element was angeklickt wurde || target ist hier immer ein Bild, da diese Funktion nur HTMLImageElemente hinzugefügt wurde\n let cardImage = _event.target;\n // id der Karte ist die Position im cardPool array, der angeklickten Karte\n let cardPoolIndex = Number(cardImage.id);\n // url der angeklickten Karte wird in selectedCardUrl gespeichert\n let selectedCardUrl = cardPool[cardPoolIndex];\n // die url und das HTML Element wird in das Interface gegeben, damit dieses in das selectedCards array gespeichert wird\n let card = { url: selectedCardUrl, element: cardImage };\n // sagt ob das selectedCards array die angeklickte Karte bereits enthält || Anfangs wird ausgegangen, dass die geklickte Karte noch nicht in selectedCards[] drin ist\n let hasArraySelectedCard = false;\n // Falls selectedCards array leer ist, kann die angeklickte Karte direkt dem selectedCards array hinzugefügt werden\n if (selectedCards.length == 1) {\n let arrayZeroPos = Number(selectedCards[0].element.id);\n // wenn weimal die selbe Karte angeklickt wurde\n if (arrayZeroPos == cardPoolIndex) {\n // geklickte Karte wird auf true gesetzt, damit man weiß, dass die Karte im selectedCards[] enthalten ist\n hasArraySelectedCard = true;\n }\n }\n // wenn die Karte noch nicht vorhanden ist wird sie in selectedCards[] hinzugefügt (push())\n if (!hasArraySelectedCard) {\n selectedCards.push(card);\n }\n // cardPool[cardPoolIndex] = url der angeklickten Karte im cardPool[] --> wird angezeigt || .src = aus HTML (<img src=...)\n cardImage.src = cardPool[cardPoolIndex];\n // setTimeout() = wird gemacht damit beide Karten angezeigt bevor sie wieder umgedreht werden\n setTimeout(validateSelectedCards, 2000); // https://www.w3schools.com/jsref/met_win_settimeout.asp\n }\n }", "dealDealerCard() {\n let randDealerNum = this.randomDealerCard();\n this.dealerHand.push(this.cardsInDeck[randDealerNum]);\n this.cardsInDeck.splice(randDealerNum, 1);\n }", "function Card1click(){\n console.log(\"card 1 clickt\");\n if(currentplayer)\n setcardstate(0, 0, 1);\n else\n setcardstate(0, 0, 2);\n}", "function chooseEquipment() {\n\tvar serverMsg = document.getElementById(\"serverMsg\");\n\tserverMsg.value += \"\\n> it is now time to choose equipment for quest\";\n\t\n\tif(totalStages == stageTracker) {\n\t\tvar data = JSON.stringify({\n\t\t\t'outOfStages' : 0\n\t\t})\n\t\tsocketConn.send(data);\n\t\treturn;\n\t}\n\tif(questSetupCards[stageTracker][0].includes(\"Test\")) {\n\t\tvar oldHandSRC = handCardSRC;\n\t\tgetCurrHand();\n\t\tif(isAI) {\n\t\t\tvar data = JSON.stringify({\n\t\t\t\t'AICommand' : \"nextBid\",\n\t\t\t\t'name' : PlayerName,\n\t\t\t\t'stage' : stageTracker,\n\t\t\t\t'currHand': handCardSRC,\n\t\t\t\t'oldHand' : oldHandSRC,\n\t\t\t\t'minBid' : minBid\n\t\t\t}) \n\t\t\tsetTimeout(function(){ socketConn.send(data); \n\t\t\tserverMsg.value = \"\\n> placing bids, please wait for other players\"; \n\t\t\t}, 1000);\t\t\n\t\t\treturn;\n\t\t}\n\t\tgetTestBids();\n\t} else {\n\t\tif(isAI) {\n\t\t\tvar data = JSON.stringify({\n\t\t\t\t'AICommand' : \"chooseEquipment\",\n\t\t\t\t'name' : PlayerName,\n\t\t\t\t'stage' : stageTracker,\n\t\t\t\t'currHand': handCardSRC,\n\t\t\t}) \n\t\t\tsetTimeout(function(){ \n\t\t\t\tsocketConn.send(data); \n\t\t\t\tserverMsg.value += \"\\n> going into battle - wait for other players to finish for results\";\n\t\t\t}, 1000);\n\t\t\treturn;\n\t\t}\n\t\tgetBattleEquipment();\n\t\t\n\t}\n\t\n}", "Hit() {\n //Get the player's next card\n this.pHand.cards.push(this.deck.NewCard(GetRandomCardNumber()));\n\n //Update the hand's total.\n this.pHand.CalculateTotal();\n\n //Evaluate the totals.\n this.Evaluate(false);\n }", "function checkCardSelected(card) {\n if (card === cardSelected) {\n return true;\n } else {\n return false;\n }\n }", "function handleIceCandidate(evt) {\n console.log('New ICE candidate: ', evt);\n \n if(evt.candidate) {\n sendMessage({\n type: 'candidate',\n label: evt.candidate.sdpMLineIndex,\n id: evt.candidate.sdpMid,\n candidate: evt.candidate.candidate\n });\n } else {\n console.log('End of candidates');\n }\n }", "async function handleCandidates (msg) {\n var peer = peers.get(msg.from);\n var pc = peer.conn;\n var pid = msg.from;\n await pc.addIceCandidate(msg.data);\n document.getElementById('status').value = pc.signalingState\n console.log('added candidate ', pc.signalingState);\n}", "function handleGetCardRequest(intent, session, response) {\n \n var repromptText = \"I'm awaiting your interest. Which card would you like to learn about?\";\n \n var repromptOutput = {\n speech: repromptText ,\n type: AlexaSkill.speechOutputType.PLAIN_TEXT\n };\n \n //store the requested card name in the session so that we may pull a history on it if requested\n \n if(session.attributes.cardName && !session.attributes.wantsToChangeCards){\n session.attributes.wantsToChangeCards = true;\n var speechOutput = {\n speech: \"Hey we're supposed to be talking about card details right now. If you're done with \" + session.attributes.cardName + \" then say a different card and we can start over.\" ,\n type: AlexaSkill.speechOutputType.PLAIN_TEXT\n };\n response.ask(speechOutput, repromptOutput);\n return;\n }else{\n \n //gets the card from a database query, then with that new card, tells the user about it. store the card in session\n retrieveCardByName(intent.slots.card.value).then(function(card){\n if (card && session.attributes.wantsToChangeCards){\n session.attributes.currentCardObject = card;\n var speechOutput = {\n speech: card.name + \"'s mana cost is \" + updateManaCost(card.manaCost) + \", type is \" + card.type + \".. card text is \" + updateManaCost(card.text) + \" ...You can say a different card now if you'd like. Otherwise: would you like to hear more details about this card?\" ,\n type: AlexaSkill.speechOutputType.PLAIN_TEXT\n };\n \n }else{\n var speechOutput = {\n speech: \"I'm not familiar with that card. Which card would you like to know about?\",\n type: AlexaSkill.speechOutputType.PLAIN_TEXT\n };\n \n }\n if (card){\n session.attributes.cardName = intent.slots.card.value;\n response.ask(speechOutput, repromptOutput);\n }else{\n session.attributes.cardName = null;\n response.ask(speechOutput, repromptOutput);\n }\n \n });\n \n \n } \n \n\n}", "function cardDrawHandler() {\n console.log(\"Draw Card Button Clicked -- Server\");\n if (unoDeck.length < 1) {\n unoDeck = deckHandler();\n }\n var tempCard = unoDeck.pop();\n console.log(\"The drawn card was -- \" + JSON.stringify(tempCard));\n return tempCard;\n}", "function hit() {\n let newCard = round.cards[Math.round(Math.random() * round.cards.length)];\n round.playerCards.push(newCard);\n display.innerHTML += ` ${newCard}`;\n round.checkResult(false, true);\n console.log(round.playerCards);\n }", "function playACard(){\n const randomIdx = Math.floor(Math.random() * game.state.home.decks.length);\n const randomCard = game.state.home.decks[randomIdx];\n game.state.home.cards.push(randomCard);\n game.trigger('update');\n }", "playCard(card) {\n this.removeCards([card]);\n }", "function addChosenCard(card){\n\t\tchosenCards.push(card);\n\t\tif (chosenCards.length === 2) {\n\t\t\t\tcheckMatch();\n\t\t\t\tmoveCount();\n\t\t}\n}", "function onIceCandidate(event) {\n if (event.candidate) {\n messaggio_da_inviare(event.candidate);\n } \n}", "function pickUpItem(item) {\n inventory.push(items[currentLocation].name);\n updateDisplay(\"Taken \" + items[currentLocation].name + \".\");\n items[currentLocation].isTaken = true;\n }", "function dealCard(whichCard, whichHand){ // begin function dealCard()\n\t\twhichHand.push(whichCard);\n\t\treturn whichHand;\n\t} // end function dealCard()", "dealPlayerCard() {\n let randPlayerNum = this.randomPlayerCard();\n this.playerHand.push(this.cardsInDeck[randPlayerNum]);\n this.cardsInDeck.splice(randPlayerNum, 1);\n }", "onNextCard() {\n this.props.store.dispatch(ACTIONS.NEXT_CARD);\n }", "function selectItem(){\n\n inquirer.prompt([\n {\n type: \"list\",\n message: \"What would you like to purchase?\",\n choices: idArray,\n name: \"selectItem\"\n }\n ]).then(function(response){\n itemID = response.selectItem;\n quantity();\n });\n}", "addCard(card) {\n this.hand.push(card);\n }", "handlePick() {\n const randomNumber = Math.floor(Math.random() * this.state.options.length);\n const option = this.state.options[randomNumber];\n }", "function select_player(){\n \t\t//Right now just drafts the last player available, probably fine but could be based on rank or user preference\n \t\t//Figure out how to randomize that\n \t\t\n \t\tplayer_id = $('input:radio[name=player_id]').last().val()\n \t\t$.post('/bizarro/draft/{{draft_id}}/', {'player_id':player_id})\n \t\t}", "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 }", "giveCard(reqCard) {\n let cardFound = this.hand.find(card => card.value === String(reqCard));\n if (cardFound) {\n this.hand.splice(this.hand.indexOf(cardFound), 1);\n return cardFound;\n }\n return null;\n }", "_callAccepted () {\n const { updateConnected } = this._initiator.props\n // we have to set the time started for the call\n this.callStart = new Date()\n // make sure that inCallmanager starts here.\n InCallManager.start()\n // force to use speaker\n InCallManager.setForceSpeakerphoneOn(true)\n\n // let the call initialize page that we accepted the call\n updateConnected(true)\n }", "function processAnswer( signal )\n{\n if( peerConnections.has( uuid ) )\n {\n let ourOfferedConnection = peerConnections.get(uuid);\n ourOfferedConnection.ontrack = (event) => {\n createVideoElement(event, signal.uuid);\n };\n\n ourOfferedConnection.setRemoteDescription( new RTCSessionDescription(signal.sdp) )\n .catch(errorHandler);\n\n }\n}", "function use_card(num_card)\n{\n\tthis.carte[num_card].use();\n}", "function takeSelectedApplicant() {\n\tofferToApplicant = getURLParameter(\"AID\");\n\n\tvar username = tmpApplicantUserName; // wird in function\n\t// markOfferSelected(id)\n\t// initialisiert\n\n\t// alert(\"username: \"+username);\n\n\tconnect(\"/hiwi/Provider/js/takeSelectedApplicant\", \"aid=\"\n\t\t\t+ offerToApplicant + \"&usernameTakenApplicant=\" + username,\n\t\t\thandleTakeSelectedApplicantResponse);\n\n}", "function handlePicked() {\n displayFile(this.files);\n}", "function shareDeck(){\n\tif(selectedDeck == null){alert(\"No Deck Selected.\"); return;}\n\tif(Object.keys(selectedDeck).length < 1){alert(\"No Deck Selected.\"); return;}\n\n\tvar deckData = $(\"#deckListSelect\").val() + \">\";\n\t$.each(selectedDeck, function(index, card){\n\t\tdeckData += getGlobalCardIndex(card) + \"|\";\n\t});\n\tvar encodedDeck = btoa(deckData);\n\twindow.prompt(\"Press Ctrl+C to copy!\", documentRoot + \"cards.html?d=\" + encodedDeck);\n}", "function setTheirCard(data) {\n\t\tgameID = data.guid;\n\t\tplayerID = data.pid;\n\t\tupdateTheirCard(data);\n\t}", "function hitMe() {\r\n playerCards();\r\n checkBlackJack();\r\n checkOver();\r\n }", "function newRndCard() {\n $.getJSON('https://api.scryfall.com/cards/random?q=-type%3Aland+legal%3Alegacy+not%3Atoken+not%3Asplit+not%3Atransform', function (data) {\n saveCard(data);\n })\n }", "playCard(redisDb, userId, roomId, cardId) {\r\n return this._getPendingCard(redisDb, roomId)\r\n .then((pendingCardInfo) => {\r\n if (!pendingCardInfo) {\r\n // there is no pending card so we set it\r\n return this._setPendingCard(redisDb, userId, roomId, cardId);\r\n }\r\n\r\n throw new Error('There is already a card waiting for validation');\r\n })\r\n ;\r\n }", "function handlePickSong (songId) {\n props.receiveQueue(props.songs, songId)\n }", "function on_select_client(serial) {\n clear_div();\n //hide_div();\n $('#life_police_flg').val(\"\");\n $('#documents_flg').val(\"\");\n $('#communication_flg').val(\"\");\n // $('#conversation_follow_flg').val(\"\");\n $('#kupa_gemel_flg').val(\"\");\n client_details(serial);\n }" ]
[ "0.6337688", "0.623733", "0.62235826", "0.6184626", "0.6156489", "0.5931886", "0.592926", "0.5880617", "0.5833592", "0.57898045", "0.5785704", "0.57522863", "0.5659242", "0.5627489", "0.5591926", "0.55628574", "0.5544106", "0.5543729", "0.5534355", "0.5523758", "0.5520991", "0.5516832", "0.54873925", "0.54828686", "0.54657555", "0.545432", "0.5441748", "0.5414297", "0.54142463", "0.5408802", "0.54021436", "0.540132", "0.5397597", "0.5393867", "0.5387955", "0.538182", "0.5380854", "0.5369281", "0.53643876", "0.5363222", "0.5347959", "0.5346142", "0.53432834", "0.53284127", "0.5325227", "0.53225595", "0.5317133", "0.5316376", "0.53118336", "0.53056717", "0.53002", "0.52995807", "0.5298313", "0.52894396", "0.52795005", "0.52794296", "0.5278037", "0.52709013", "0.5270777", "0.52692443", "0.525684", "0.5255273", "0.52510905", "0.5249327", "0.523464", "0.52318347", "0.523104", "0.5227257", "0.5222225", "0.5219213", "0.52181643", "0.52114195", "0.5210876", "0.5208326", "0.5191607", "0.51809376", "0.5179509", "0.51733893", "0.51611227", "0.5135179", "0.5132833", "0.5127797", "0.5120338", "0.51191443", "0.5116677", "0.51124", "0.5108709", "0.51044863", "0.51015854", "0.5098022", "0.50970834", "0.5084993", "0.50845486", "0.5084205", "0.5083647", "0.5071873", "0.5069407", "0.5065368", "0.5062059", "0.50612074" ]
0.80335593
0
wait for the card picked by player with the turn
getPickedCard() { let observable = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"](observer => { this.socket.on('serverSendCardPicked', (cardObject) => { if (cardObject) { observer.next(cardObject.card_text); } else { observer.next(null); } }); return () => { this.disconnectSocket(); }; }); return observable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function selectCard(event) {\n let card = $(this);\n let invalidCard = card.attr('class') === 'card open show' || card.attr('class') === 'card match';\n // Will return if the card clicked is already opened or the game is already matching another pair of cards\n if (invalidCard || matching) {\n return;\n }\n // The timer will start running if this is the first move of the game\n if (firstMove) {\n firstMove = false;\n startTimer();\n }\n card.toggleClass('open show');\n // Will do the matching if there's already a card flipped\n if (cardFlipped) {\n matching = true;\n let openedCards = $('.open');\n if (cardFlipped == card.children('i').attr('class')) {\n openedCards.toggleClass('open show match');\n cardFlipped = null;\n if ($('.match').length === cards.length) {\n endGame();\n }\n } else {\n await wait(2000);\n openedCards.toggleClass('open show');\n cardFlipped = null;\n }\n moves += 1;\n movesDisplayer.html(moves);\n if (moves === 16 || moves === 20){\n ratePlayer();\n }\n matching = false;\n } else {\n cardFlipped = card.children('i').attr('class');\n }\n}", "function playercardturn(player){\n //show cards\n //ask to select cards to play\n //push them into action slot\n }", "function matchCheck(c) {\n selectedCards.push(c.target);\n if (openedCards.length < 2) {\n openedCards.push(c.target.className);\n if (openedCards.length === 2) {\n if (openedCards[0] === openedCards[1]) {\n console.log(\"Its a match dude!\");\n incrementMovement();\n guessCards(c);\n } else {\n console.log(\"Keep trying dude!\");\n incrementMovement();\n setTimeout(function wait(){\n console.log(\"wait for it\");\n hideCards(c);\n },delay);\n }\n }\n }\n}", "function selectCard (card) {\n humanPlayer.hand.tradeIns[card] = !humanPlayer.hand.tradeIns[card];\n \n if (humanPlayer.hand.tradeIns[card]) {\n dullCard(HUMAN_PLAYER, card);\n } else {\n fillCard(HUMAN_PLAYER, card);\n }\n}", "function compareCards() {\n if (cardMatch[0] === cardMatch[1]) {\n assignMatch();\n cardMatch=[];\n } else {\n setTimeout(function(){\n turnOver();\n cardMatch=[];\n }, 500);\n }\n}", "function handleCard() {\n playerTries++;\n if (activeCards.length == 2) {\n if (getCardName(activeCards[0].id) != getCardName(activeCards[1].id)) {\n turnBackCards(activeCards);\n }\n else {\n foundPairs++;\n if (foundPairs == (cards.length / 2)) {\n clearInterval(countdown);\n winner = true;\n popupFinalResults(\"Congratulations! You Won!\");\n }\n }\n }\n else {\n turnBackCards(activeCards);\n }\n clearTimeout(timer);\n activeCards.splice(0);\n}", "async function dealerPlay() {\n if (BlackJack[\"isHit\"] === true) {\n\n BlackJack[\"isHit\"] = false;\n BlackJack[\"isStand\"] = true;\n\n while ((DEALER[\"score\"] < 16) && (BlackJack[\"isStand\"] === true)) {\n let card = randomCards();\n showCard(DEALER, card);\n updateResult(DEALER, card);\n showCount(DEALER);\n\n await sleep(1000);\n }\n\n BlackJack[\"turnsOver\"] = true;\n let decide = decideWinner();\n showResult(decide);\n }\n\n}", "function chooseCard(event) {\n const choice = event.target.id;\n const gameMessage = document.querySelector('.hl-msg');\n const cards = document.querySelectorAll('.card');\n const secondCard = cards[Math.round(Math.random() * 50)];\n secondCard.id = 'hl-second';\n // Updates game message to show result based on the data value of the two cards dealt\n const firstCard = document.getElementById('hl-first');\n const cardDiff = secondCard.attributes[0].nodeValue - firstCard.attributes[0].nodeValue;\n if (\n (cardDiff > 0 && choice === 'higher')\n || (cardDiff < 0 && choice === 'lower')\n ) {\n gameMessage.innerText = 'Correct!';\n } else if (\n secondCard.attributes[0].nodeValue === firstCard.attributes[0].nodeValue\n ) {\n gameMessage.innerText = 'Draw!';\n } else {\n gameMessage.innerText = 'Wrong!';\n }\n // Removes ids from the two current game cards to 'return' them to the deck, invokes\n // function to deal the first card after timeout to account for animation of cards moving.\n setTimeout(() => {\n firstCard.id = null;\n secondCard.id = null;\n dealFirstCard();\n }, 1500);\n}", "async function selectTops(e) {\r\n //Will not let the player change cards once the game has started\r\n if (!game_started) {\r\n var this_value = $(e).attr(\"alt\");\r\n if (this_value !== \"deck\") {\r\n $(\".start-menu\").css(\"display\", \"none\");\r\n var temp = players[0].top.filter(val => val !== this_value);\r\n players[0].top = temp;\r\n players[0].hand.push(this_value);\r\n $(e).attr(\"src\", \"images/deck_01.svg\");\r\n $(e).attr(\"alt\", \"deck\");\r\n newCards();\r\n }\r\n }\r\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 }", "checkIfPair() {\n let card1 = this.pickedCards[0];\n let card2 = this.pickedCards[1];\n\n this.pairsClicked += 1;\n if(card1.dataset.cardName == card2.dataset.cardName) {\n this.pairsGuessed += 1;\n this.pickedCards = [];\n \n $('.card').removeClass('blocked')\n return true\n } else {\n \n setTimeout(() => {\n $(this.pickedCards[0]).children().toggleClass('front back');\n $(this.pickedCards[1]).children().toggleClass('front back'); \n this.pickedCards = [];\n $('.card').removeClass('blocked')\n }, 600)\n return false\n }\n }", "function result(){\t\n\tif(noOpenCard>=16){\n\t\tsetTimeout(function(){\t\n\t\t\tif (confirm(\"Congratulations! You won! \\nStars \"+ noStar+'\\nMoves '+noMoves+'\\nTime '+ \n\t\t\t\tFormatMe(hr)+':'+FormatMe(min)+':'+FormatMe(sec)+'\\n Do you want to try again?'\n\t\t\t\t)) {\n\n\t\t\t}\n\t\t\tdocument.querySelector(\".deck\").remove();\n\t\t\tnoOpenCard=0;\n\t\t\tinitialization();\n\t \thr=0;min=0;sec=-1;\n\t\t},1000)\n\t}\n}", "function clickCard(row, col) {\n var card = window.board.cards[row][col];\n\n card.flip();\n window.board.cardsVisible.push(card); // add to visible cards (the ones the user sees on the board)\n\n if ((window.computerWillMatch)) { // skip computerPlays when computer already has a matching pair\n window.computerWillMatch = false;\n } else if ((window.turn == 'com') && (window.board.cardsVisible.length == 1)) {\n computerPlays();\n }\n\n // 2 visible cards means end of turn\n if (window.board.cardsVisible.length == 2) {\n\n // timeout so user has time to see what the last card was\n setTimeout(function(){\n\n if (cardsMatch()) {\n updateScore(window.turn);\n window.board.removeCardsFromBoard();\n window.board.resetCardsVisible();\n\n if (window.turn == 'com') { // computer plays again if it finds a match\n computerPlays();\n }\n } else {\n // if no match, turn cards over and switch turn\n window.board.hideCards();\n switchTurn();\n }\n }, 1000);\n }\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 clickResponse() {\n const card = this;\n // check for game start on first click\n if (!gameStarted) {\n gameStarted = true;\n stopWatch();\n }\n setTimeout(function() {\n showCard(card);\n}, 200);\n}", "function acceptAnswer() {\n // if this was the last card, don't replace it (must be done on client side, to avoid Async DB inconsistencies.)\n lookupCardsRemainingInCurrentLevel()\n .then(cardsRemaining => {\n rankUpCard();\n\n /// only load another card, if there are still cards left.\n if (cardsRemaining == 0)\n window.location.href = \"/polyglot/\";\n else {\n animateReplace();\n loadCard();\n }\n });\n}", "function checkCard(){\n \n if(!this.flipped){ // check if the clicked card is not flipped yet\n\n this.classList.toggle(\"flipped\"); // flip the card\n this.flipped = true; // set the flipped state\n choices.push(this.dataset.value, this.id); // push the card ids into the array \n flips++; \n }\n\n if(flips == 2){ \n\n if(choices[0] == choices[2]){ // check if card values are equal\n pairs++; \n if(pairs == 8){alert(\"Gewonnen\");} // check if the end of the game is reached \n choices = []; // empty the card array\n flips = 0; \n tries++; \n moves.innerHTML = tries + \" Züge\"; // update the move counter\n }\n\n else{\n setTimeout(() => {\n for(let i = 1; i < choices.length; i+=2){ \n let remove = document.getElementById(choices[i]); // select flipped cards in last move \n remove.classList.toggle(\"flipped\"); // unflip cards\n remove.flipped = false; // remove flipped state\n }\n choices = []; // empty the card array\n flips = 0; \n tries++;\n moves.innerHTML = tries + \" Züge\";\n }, 700);\n }\n }\n\n }", "dealerPlay() {\n let winner = false;\n let delay = 50;\n const dealerHit = () => {\n setTimeout(\n () => {\n winner = this.dealCards(true, false, 1, 0, 0);\n if (!winner) { // if nobody has one yet\n //delay = 2000; // slow down dealer play\n dealerHit(); // hit dealer hand again (a tie on 21 is a win for both)\n }\n }, // dealer's turn, deal 1 card to dealer\n delay // dealer hits every second until dealer busts or ties at 21\n );\n }\n dealerHit();\n }", "function ComputerPlay()\n {\n let randomChance = Math.random();\n if(randomChance<0.20)\n {\n dealerCardPlayed = dealerHand.cards[0].choice;\n }\n else if(randomChance<0.4&&randomChance>0.2)\n {\n dealerCardPlayed = dealerHand.cards[1].choice;\n }\n else if(randomChance<0.6&&randomChance>0.4)\n {\n dealerCardPlayed =dealerHand.cards[2].choice;\n }\n else if(randomChance<0.8&&randomChance>0.6)\n {\n dealerCardPlayed =dealerHand.cards[3].choice;\n }\n else \n {\n dealerCardPlayed =dealerHand.cards[4].choice;\n }\n }", "function dealCard() {\n\n // If the deck is disabled, warn users\n if (isDeckDisabled || cardPurchased) {\n\n if (actingPlayer !== turnOf) {\n showModal('not your turn');\n return;\n\n } else {\n\n if (cardPurchased) {\n showModal('phase two');\n return;\n } else {\n showModal('deck disabled');\n return;\n }\n }\n\n } else {\n\n // If there are no more cards in the deck...\n if (deck.length <= 0) {\n shuffleCards(discardPile); // Shuffle the discard pile\n deck.push(...discardPile); // Copy discard pile cards into deck\n discardPile.length = 0; // Clear discard pile\n getDiscardCount.innerHTML = discardPile.length; // Update the discard pile count\n }\n\n // ...if there ARE cards in the deck:\n\n board.push(deck.pop());\n\n let dealtCard = board[board.length - 1];\n console.log('card dealt: ' + dealtCard.name);\n\n // Render and animate the added card\n getBoard.innerHTML += composeCard(dealtCard);\n tippy('[data-tippy-content]');\n \n oneCardDrawn = true;\n isNewTurn = false;\n calcPlayerSwords();\n updateCardsRemaining();\n\n if (dealtCard.type === 'expedition') {\n // Move it to expedition array\n expeditions.push(board.pop());\n displayBoards();\n }\n\n if (dealtCard.type === 'tax') {\n collectTaxes(dealtCard);\n discardPile.push(board.pop());\n displayBoards();\n taxCard = dealtCard;\n showModal('tax');\n }\n\n if (dealtCard.type === 'ship') {\n\n // If player has enough swords, trigger modal\n if (players[actingPlayer].getSwords() >= dealtCard.swords) {\n shipToDefeat = dealtCard;\n showModal('defeat ship'); // Trigger modal\n\n // Need to put something here that waits for the result of the modal\n } else {\n checkForDuplicates(board);\n }\n }\n\n checkForAdmiralBonus();\n // displayBoards();\n calcMovesBonus();\n shipToDefeat = null;\n\n anime({\n targets: `#board-card-${dealtCard.id}`,\n translateX: -50,\n direction: 'reverse',\n opacity: 0,\n duration: 500,\n easing: 'easeInQuad'\n });\n }\n}", "async function clickHandler(event) {\n const currentCard = getCard(event);\n if (!currentCard || currentCard.isFlipped()) return;\n\n if (!timer.isRunning()) {\n timer.start();\n }\n\n let allCardsMatched = false;\n\n clickedCards.push(currentCard);\n\n if (clickedCards.length == 2) {\n numberOfMoves++;\n updateScore();\n const previousCard = clickedCards[0];\n clickedCards = [];\n if (currentCard.id() === previousCard.id()) {\n numberOfMatched++;\n if (numberOfMatched === NUMBER_OF_CARDS) {\n timer.stop();\n allCardsMatched = true;\n }\n await currentCard.show();\n await Promise.all([\n currentCard.markAs('matched'),\n previousCard.markAs('matched')\n ]);\n if (allCardsMatched) {\n updateWinMessage(numberOfMoves);\n showModal('win');\n }\n } else {\n await currentCard.show();\n await Promise.all([\n currentCard.markAs('not-matched'),\n previousCard.markAs('not-matched')\n ]);\n currentCard.hide();\n previousCard.hide();\n }\n } else {\n currentCard.show();\n }\n }", "function playCard(data) {\n var ownCards = $('#ownCards');\n var playedCard = $('#' + data['card'].id);\n //remove the played card\n ownCards.remove(playedCard);\n //play card effect\n playCardEffect(data['card'].id, data['card'].color, data['card'].card_type,\n data['card'].img_src, \"bounceInUp\");\n document.getElementById(\"currentColor\").removeAttribute(\"class\");\n $('#currentColor').addClass(data['card'].color);\n globalCurrentColor = data['card'].color;\n //action card and wild card effect\n actionAndWildCardEffect(data['card'].card_type);\n //reorganize own cards\n ownCards.html(\"\");\n document.getElementById('minEmptyIndex').value = 0;\n var cards = data['own_cards'];\n if (cards.length < 10) {\n $('#cardDistance').val(\"60\");\n }\n for (var i = 0; i < cards.length; i++) {\n getOneCard(cards[i], \"\");\n }\n waitUNO = true;\n // console.log(\"waiting uno..\");\n\n setTimeout(function () {\n waitUNO = false;\n // console.log(\"remove waiting uno..\");\n }, 4000);\n}", "userSet() {\n // Bot has found one before\n if (ai.foundSet) return false;\n\n // Waiting for user to pick three cards\n game.waiting = true;\n\n // Start a 10 seconds clock\n clock.countdown(10);\n\n // Stop bot tests\n ai.foundSet = true;\n\n // Change button text\n $('button.main').html('<div class=\"count\">10</div><span>Select 3 cards</span>').attr('disabled', true).addClass('waiting');\n\n // Make cards clickable\n $('main').addClass('waiting');\n }", "function checkCard(){\n\tdidSomeoneWin();\n\tif(weHaveAWinner === true || (weHaveAWinner === false && shuffledDeck.length === 0)){\n\t\tchangeDiscard();\n\t}else{\n\t\tif(cardPlayed[0].color === discardPile[0].color || cardPlayed[0].value === discardPile[0].value && cardPlayed[0].value !== \"wild\" && cardPlayed[0].value !== \"+4wild\"){\n\t\t\tif(cardPlayed[0].value === \"skip\"){\n\t\t\t\tplayerTurnIs();\n\t\t\t\tnextTurn();\n\t\t\t}else if(cardPlayed[0].value === \"reverse\"){\n\t\t\t\treverseCard();\n\t\t\t\tnextTurn();\n\t\t\t}else if(cardPlayed[0].value === \"plusTwo\"){\n\t\t\t\tnextTurn();\n\t\t\t\tdrawCard(2);\n\t\t\t}else{\n\t\t\t\tnextTurn();\n\t\t\t};\n\t\t}else if(cardPlayed[0].value === \"wild\"){\n\t\t\tstartPlayWildCard();\n\t\t}else if(cardPlayed[0].value === \"+4wild\"){\n\t\t\tstartPlayWildCard();\n\t\t\tdrawCard(4);\n\t\t}else{\n\t\t\tplayerArr[turn].playerHand.push(cardPlayed[0]);\n\t\t}\n\t}\n}", "_checkIfComplete() {\n\n\t\tif(this._matchedCards === this.rows*this.cols) {\n\n\t\t\t// Delay for the animations\n\t\t\tsetTimeout(() => {\n\n\t\t\t\talert(`You have scored ${this._score} points`);\n\n\t\t\t\tclearInterval(this._timer);\n\n\t\t\t\tthis.initGame();\n\t\t\t}, 400);\n\t\t}\n\t}", "function turnCard(item){\n\tif (!is_blocked){\n\titem.src = memoryCards[item.id].src;\n\tmemoryCards[item.id].turned = true;\n\t/** Verify if its a pair click; if isnt a pair click, may be two same cards turned */\n\tif (count % 2 !== 0){\n\t\tis_blocked = true;\n\t\tvar check = hasAnotherCardWithSameIdTurned(item);\n\t\tif (!check){\n\t\t\tsleep(2000).then(function(){\n\t\t\t\tunturnAllCardsTurned(item);\n\t\t\t\tis_blocked = false;\n\t\t\t})\n\t\t}\n\t} else {\n\t\tidOfHtmlCards.push(item.id);\n\t\tis_blocked = false;\n\n\t}\n\tcount++;\n\t}\n}", "async function dealerlogic(){\r\n blackjackgame['isstand'] = true;\r\n\r\n while(DEALER['score']<16 && blackjackgame['isstand'] === true){\r\n\r\n let card = randomcard();\r\n showcard(card,DEALER); \r\n updatescore(card,DEALER);\r\n showscore(DEALER); \r\n await sleep(1000); // sleep time\r\n\r\n }\r\n \r\n \r\n blackjackgame['turnsover'] = true;\r\n let winner = computewinner();\r\n showresult(winner);\r\n \r\n\r\n}", "function compareCards(numOfCards) {\n if (firstPickedCard.imgSrc === secondPickedCard.imgSrc) {\n\n setTimeout(function() {\n firstPickedCard.dubblett();\n firstPickedCard = null;\n }, 1100);\n setTimeout(function() {\n secondPickedCard.dubblett();\n secondPickedCard = null;\n }, 1100);\n\n // Updating the score on the DOM.\n updateCurrentScore(currentPlayer, numOfCards);\n } else {\n setTimeout(function() {\n firstPickedCard.flipback();\n firstPickedCard = null;\n }, 1100);\n setTimeout(function() {\n secondPickedCard.flipback();\n secondPickedCard = null;\n }, 1100);\n\n switch (currentPlayer) {\n case 1:\n currentPlayer = 2;\n break;\n case 2: \n currentPlayer = 1;\n break;\n }\n\n showCurrentPlayer(currentPlayer);\n }\n}", "pickCard(card) {\n this.socket.emit('clientPickedCard', this.connectedRoom, card);\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}", "tryAnotherCard() {\n $(\".spinner\").removeClass(\"spinner\"); // remove animation class\n let newCard = selectRandomCard(this.props.cards);\n // prevent duplicate card\n if(newCard === this.state.selectedCard) {\n this.tryAnotherCard();\n return;\n }\n this.setState({selectedCard: newCard});\n }", "function check(){\n if(cardOpen[0].id == cardOpen[1].id){\n cardMatch.push(cardOpen[0])\n cardMatch.push(cardOpen[1])\n setTimeout(function(){\n cardOpen = []\n enable()\n },1000);\n }\n else{\n setTimeout(function(){\n cardOpen[0].src = \"cards/card.png\"\n cardOpen[1].src = \"cards/card.png\"\n cardOpen = []\n enable()\n },1000);\n }\n}", "async function hit() {\n // draw card from API\n const playerPile = await fetch(`/game/${game.deckId}/draw/player`);\n // update player pile with the pile retrieved from the API\n // note that playerPile.json() is an async function, so we have to await it before asking for .piles.player\n game.playerPile = await playerPile.json();\n\n // update display with new card\n updateGameDisplay();\n\n // recalculate score\n game.scores[PLAYER] = scorePlayer(PLAYER);\n\n // use setTimeout to allow browser to re-draw cards before checking for a loss\n // don't worry about this workaround, it's probably beyond the scope of what you need to care about\n setTimeout(() => {\n\n // determine if player automatically wins or loses\n if (game.scores[PLAYER] > 21) {\n alert(`You lose, score = ` + game.scores[PLAYER]);\n endGame(DEALER);\n } else if (game.scores[PLAYER] == 21) {\n alert('You win, score = 21');\n endGame(PLAYER);\n }\n\n }, 1);\n}", "function checkCardClickChoice(currentCardId, event) {\n var currentElement = event.target.parentElement.parentElement;\n\n if (goToSecondMove == true) {\n showCardClickCounter.innerText = cardClickCounter++ + 1;\n // if it is the second card which is openend ...\n clickDisabled = true;\n\n flipCard(currentElement, currentCardId);\n\n if (cardArr[oldId].matchingPair == cardArr[currentCardId].matchingPair) {\n setTimeout(function () {\n // cards matching is passed, set to both cards on matched status\n cardArr[oldId].isMatching = true;\n cardArr[currentCardId].isMatching = true;\n\n // search for opened cards, remove class open and set it to matching\n var matchingPair = document.querySelectorAll(\".open\");\n for (var i = 0; i < matchingPair.length; i++) {\n matchingPair[i].classList.remove(\"open\");\n matchingPair[i].classList.add(\"matching\");\n }\n oldId = 999;\n clickDisabled = false;\n }, 1000);\n\n // pairmatching was passed, next move is again the first of two cards to open\n goToSecondMove = false;\n checkIfCompleted();\n } else {\n setTimeout(function () {\n if (oldId != 999) {\n cardArr[oldId].isOpen = false;\n }\n cardArr[currentCardId].isOpen = false;\n\n // card wasn't matching, remove the class open from both opened cards\n var pairs = document.querySelectorAll(\".open\");\n for (var i = 0; i < pairs.length; i++) {\n pairs[i].classList.remove(\"open\");\n }\n oldId = 999;\n clickDisabled = false;\n }, 1500);\n\n // pairmatching was not passed, next move is again the first of two cards to open\n goToSecondMove = false;\n }\n } else {\n // if it is the first card of two which is openen .....\n //\n // set status of current card to open\n cardArr[currentCardId].isOpen = true;\n\n flipCard(currentElement, currentCardId);\n\n // store current Id in oldId\n oldId = currentCardId;\n\n // allow next time to go to test of pairmatching\n goToSecondMove = true;\n }\n }", "function handleCardClick(evt) {\n let cards = document.getElementById(\"game\").getElementsByTagName(\"div\")\n\n if (evt.target.id != \"matched\" & flipped != evt.target) {\n flipCard(evt.target);\n setTimeout(function() {\n if (pairs == 5) {\n alert(\"You win!\");\n pairs++;\n }\n }, FOUND_MATCH_WAIT_MSECS);\n if (flipped) {\n if (flipped.className == evt.target.className) {\n flipped.id = \"matched\";\n evt.target.id = \"matched\";\n pairs++;\n flipped = null;\n }\n else {\n timeoutCards(cards);\n setTimeout(function() {\n unFlipCard(evt.target);\n unFlipCard(flipped);\n flipped = null;\n timeinCards(cards);\n }, FOUND_MATCH_WAIT_MSECS);\n }\n\n }\n else {\n flipped = evt.target;\n }\n }\n \n}", "async takeTurn() {\n let takingInput = true\n let shot\n\n while (takingInput) {\n shot = await this.getPlayerShot()\n\n try {\n shot = this.translateInput(shot)\n takingInput = false\n }\n catch(e) {\n console.log(\"Please enter a valid format : \", e)\n }\n\n }\n \n if(shot == 'Q') {\n this.quit()\n } else {\n this.Players[1].recieveShot(shot);\n this.endTurn()\n }\n }", "function playCard(id){\n if(gameStarted){\n if(!lock){\n clickFirstAudio.pause();\n clickFirstAudio.currentTime = 0.0;\n clickFirstAudio.play();\n let getSrc = sCards[id].src;\n\n // First reveal the card\n document.getElementById(id).style.transform = 'rotate(35deg)';\n setTimeout(function(){\n document.getElementById(id).style.backgroundImage = `url(cards/${getSrc}.png)`;\n document.getElementById(id).style.transform = 'rotate(0deg)';\n }, 60);\n\n // Isn't waiting\n if(!isWaiting){\n firstCard.src = getSrc;\n firstCard.id = id;\n isWaiting = true;\n return;\n }\n\n // Is waiting\n else {\n secondCard.src = getSrc;\n secondCard.id = id;\n\n // Match\n if(firstCard.src == secondCard.src){\n if(firstCard.id != secondCard.id){\n matches++;\n\n // These cards need to be renewed later\n renewCards.push(firstCard.id);\n renewCards.push(secondCard.id);\n \n // Game over\n if(matches == cardsAmount/2){\n setTimeout(function(){\n HTMLstop.innerHTML = 'Restart';\n HTMLendMessage.style.display = 'block';\n setTimeout(function(){\n HTMLendMessage.style.opacity = '1';\n }, 20);\n }, 1000);\n\n gameStarted = false;\n\n collectData(matches, faults, timeOutput);\n\n // Reset faults\n faults = 0;\n\n clearTimers();\n }\n\n lock = true;\n timerMatch = setTimeout(function(){\n\n // Play audio\n cardsMatchAudio.play();\n\n document.getElementById(firstCard.id).style.transform = 'skew(-0.06turn, 18deg)';\n document.getElementById(secondCard.id).style.transform = 'skew(-0.06turn, 18deg)';\n\n setTimeout(function(){\n document.getElementById(firstCard.id).style.opacity = '0';\n document.getElementById(secondCard .id).style.opacity = '0';\n }, 30);\n\n setTimeout(function(){\n document.getElementById(firstCard.id).style.visibility = 'hidden';\n document.getElementById(secondCard.id).style.visibility = 'hidden';\n\n // Update matches in HTML\n HTMLmatches.innerHTML = `<h1>${matches}/${cardsAmount/2}</h1>`;\n }, 150);\n \n\n }, 700);\n\n setTimeout(function(){\n lock = false;\n }, 850);\n }\n\n else return;\n }\n\n // not match\n else {\n lock = true;\n faults++;\n var fC = document.getElementById(firstCard.id),\n sC = document.getElementById(secondCard.id);\n \n timerNotMatch = setTimeout(function(){\n // Play audio\n cardsFaultAudio.play();\n\n fC.style.transform = 'rotate(35deg)';\n sC.style.transform = 'rotate(35deg)';\n\n setTimeout(function(){\n fC.style.backgroundImage = `url(cards/${defCard})`;\n sC.style.backgroundImage = `url(cards/${defCard})`;\n fC.style.transform = 'rotate(0deg)';\n sC.style.transform = 'rotate(0deg)';\n }, 60);\n \n lock = false;\n }, 700);\n }\n\n isWaiting = false;\n }\n }\n\n else return;\n }\n\n else return;\n}", "function handleCardClick(event) {\n if(isCardShown(event.target) || tempFaceUp.length >= CARDS_TO_MATCH){\n return;\n }\n\n tempFaceUp.push(event.target);\n showCard(event.target);\n\n\n\n if(tempFaceUp.length >= CARDS_TO_MATCH){\n\n if(hasFoundMatch()){\n tempFaceUp = [];\n\n if(gameIsWon()){\n endGame();\n }\n \n }\n else{\n score ++;\n document.querySelector(\"#score\").innerText = score;\n\n setTimeout(() => {\n shown = 0;\n tempFaceUp.forEach( card => {\n hideCard(card);\n });\n tempFaceUp = [];\n }, 1000);\n }\n }\n}", "function selectCard(id,current){\n let cardId = `#card${id}`;\n if(!$(cardId).hasClass('flipCard180') && flipIndex!=2){\n $(cardId).addClass('flipCard180');\n flip_Sound.play();\n\n flipIndex++;\n\n if(flipIndex == 1){\n firstFlippedCard = current;\n previousCard = cardId;\n }\n if(flipIndex == 2){\n secondFlippedCard = current;\n if(firstFlippedCard == secondFlippedCard){\n score++;\n // call the showResult function if a player matches all cards\n if (score == 10){\n clearTimeout(countDown);\n setTimeout(function(){showResult();},1000);\n return; \n }\n\n scoreRecord.text(score+\"/10\");\n flip_Sound.pause();\n match_Sound.play();\n setTimeout(function(){\n flipIndex = 0;\n }, 500);\n }else{\n setTimeout(function(){\n $(cardId).removeClass('flipCard180');\n $(previousCard).removeClass('flipCard180');\n flipIndex = 0;\n }, 500);\n }\n }\n }\n}", "function onCardClick(_event) {\n // starten den Timer für die Zeitmessung\n if (setTheStartTime) {\n // Date() = Datums Klasse, man kann Anfragen bspw. zum loken Tag/Woche/Monat und Jahr || .getTime() = gibt die momentane Zeit in Millisek. aus\n startTime = new Date().getTime(); // https://stackoverflow.com/questions/313893/how-to-measure-time-taken-by-a-function-to-execute\n // muss gesetzt werden damit, diese if-Abfrage nicht nochmal ausgeführt wird --> wird nur bei der ersten Karte ausgeführt, die angegeklickt wird\n setTheStartTime = false;\n }\n // selectedCards = ein array in dem die ausgewählten Karten sind (am Anfang leeres array)\n if (selectedCards.length < 2) {\n // target = HTML Element was angeklickt wurde || target ist hier immer ein Bild, da diese Funktion nur HTMLImageElemente hinzugefügt wurde\n let cardImage = _event.target;\n // id der Karte ist die Position im cardPool array, der angeklickten Karte\n let cardPoolIndex = Number(cardImage.id);\n // url der angeklickten Karte wird in selectedCardUrl gespeichert\n let selectedCardUrl = cardPool[cardPoolIndex];\n // die url und das HTML Element wird in das Interface gegeben, damit dieses in das selectedCards array gespeichert wird\n let card = { url: selectedCardUrl, element: cardImage };\n // sagt ob das selectedCards array die angeklickte Karte bereits enthält || Anfangs wird ausgegangen, dass die geklickte Karte noch nicht in selectedCards[] drin ist\n let hasArraySelectedCard = false;\n // Falls selectedCards array leer ist, kann die angeklickte Karte direkt dem selectedCards array hinzugefügt werden\n if (selectedCards.length == 1) {\n let arrayZeroPos = Number(selectedCards[0].element.id);\n // wenn weimal die selbe Karte angeklickt wurde\n if (arrayZeroPos == cardPoolIndex) {\n // geklickte Karte wird auf true gesetzt, damit man weiß, dass die Karte im selectedCards[] enthalten ist\n hasArraySelectedCard = true;\n }\n }\n // wenn die Karte noch nicht vorhanden ist wird sie in selectedCards[] hinzugefügt (push())\n if (!hasArraySelectedCard) {\n selectedCards.push(card);\n }\n // cardPool[cardPoolIndex] = url der angeklickten Karte im cardPool[] --> wird angezeigt || .src = aus HTML (<img src=...)\n cardImage.src = cardPool[cardPoolIndex];\n // setTimeout() = wird gemacht damit beide Karten angezeigt bevor sie wieder umgedreht werden\n setTimeout(validateSelectedCards, 2000); // https://www.w3schools.com/jsref/met_win_settimeout.asp\n }\n }", "game(id) {\n let selected_pairs = this.state.selected_pairs;\n let current_selection = this.state.current_selection;\n const messageWin = [\"Well done !\", \"Awesome !\", \"Great !\", \"Perfectenschlag !\", \"Splendid !\"];\n const messageLose = [\"Lost !\", \"Too bad !\", \"Almost !\", \"You can do better !\", \"Missed !\"];\n let index = this.state.cards.findIndex((card) => {\n return card.id == id;\n });\n\n let cards = this.state.cards;\n\n if(cards[index].is_open == false && selected_pairs.indexOf(cards[index].nameCard) === -1) { // when only one card is open\n cards[index].is_open = true;\n current_selection.push({\n index: index,\n name: cards[index].nameCard\n });\n\n if(current_selection.length == 2) { // when two cards are open\n if(current_selection[0].name == current_selection[1].name) { // when the two cards are identical\n selected_pairs.push(cards[index].nameCard);\n this.message = messageWin[Math.floor(Math.random() * messageWin.length)];\n } else {\n this.message = messageLose[Math.floor(Math.random() * messageLose.length)];\n this.fail++;\n cards[current_selection[0].index].is_open = false;\n setTimeout(() => {\n cards[index].is_open = false;\n this.setState({\n cards: cards\n });\n }, 500);\n }\n current_selection = [];\n }\n\n this.setState({\n cards: cards,\n current_selection: current_selection\n });\n }\n if (selected_pairs.length == (this.cards.length/2)) { // Win\n this.SCORE += 500;\n this.gameWon();\n }\n if (this.fail == this.MAX_FAIL) { // Lose\n this.gameLost();\n }\n }", "function hitMe() {\r\n playerCards();\r\n checkBlackJack();\r\n checkOver();\r\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 Card1click(){\n console.log(\"card 1 clickt\");\n if(currentplayer)\n setcardstate(0, 0, 1);\n else\n setcardstate(0, 0, 2);\n}", "function click ( e ) {\r\n \r\n //If a user click the next card while the timer is set, the two clicked cards will be judged right away\r\n if ( timer ) {\r\n clearTimeout( timer );\r\n judge();\r\n }\r\n \r\n let elm = e.target;//The clicked card\r\n elm.innerHTML = cards[ elm.index ];//Turn up the clicked card\r\n \r\n if ( !firstCard ) {\r\n //If a user didn't select any card yet, the clicked card is the first card.\r\n firstCard = elm;\r\n \r\n } else if ( firstCard.index == elm.index ) {\r\n //If a user selected the same card two times, exit if() loop\r\n return;\r\n \r\n } else {\r\n //If a user selected the different two cards\r\n secondCard = elm;//The second card is the newly clicked card\r\n timer = setTimeout( judge, 1000 );//Judge the clicked cards a second later\r\n \r\n }\r\n}", "function pick(playerClicked){\r\n pPick = playerClicked;\r\n cPick = computerChooses();\r\n countdown();\r\n}", "function playCard() {\n\t// bepalen of de AI-player aan de beurt is om een kaart te spelen\n\tif (playAI && turnVisitor && checkPlayAIFlag) {\n\t\tconsole.log('[playCard] AI-Player plays');\n\t\tplayerAI();\n\t} else {\n\t\t// Human-plays\n\t\tif ((checkFaceCardsFlag == true) && (atBatStatus == 'pitch')) { checkNumFaceCards(objHand) };\n\n\t\tif ((checkRelieverFlag == true) && hitsInning >= 2) { // controle of RP mag worden ingezet\n\t\t\tif (vAtBat === true && hReliever == false ) {\n\t\t\t\tcheckReliever();\n\t\t\t} else if ( hAtBat === true && vReliever === false) {\n\t\t\t\tcheckReliever();\n\t\t\t}\t\t\n\t\t}\n\t\t// bepalen welke kaart door de HUMAN-player wordt geclickt om te spelen\n\t\tobjHand.click(function (card) {\n\t\t\tdocument.getElementById(\"messageboard\").innerHTML = \"\";\n\t\t\tconsole.log('[playCard] Human plays: ', card);\n\t\t\t\n\t\t\t// testen of de geklikte card van de play-Hand is\n\t\t\tlet playable = false\n\t\t\tfor (i = 0; i < objHand.length; i++) {\n\t\t\t\tif (card === objHand[i]) { // komt de geklikte kaart uit de actuele speel Hand?\n\t\t\t\t\tplayable = true;\n\t\t\t\t};\n\t\t\t} // end test voor playable\n\t\t\t\n\t\t\tif (playable === true) { //valid card-player \n\t\t\t\tobjPlay.addCard(card);\n\t\t\t\tobjPlay.render();\n\t\t\t\tobjHand.render();\n\t\t\t\tdeck.render();\n\n\t\t\t\t// de nieuwe versie(s)\n\t\t\t\tdetEquals(); //voordat validateCard wordt aangeroepen\n\t\t\t\t[outcome, outcomeText, rating, optionResult] = validateCard(card);\n\t\t\t\tconsole.log('[playCard] =====================================>>>> vCard ' + [outcome, outcomeText, rating, optionResult]);\n\t\t\t\texecutePlay(outcome);\n\t\t\t} else { // not a valid card-player \n\t\t\t\tlet msgBeurt = \"WACHTEN !\";\n\t\t\t\tif (turnHome) {\n\t\t\t\t\t$(\"#visitor\").val(msgBeurt);\n\t\t\t\t} else {\n\t\t\t\t\t$(\"#home\").val(msgBeurt);\n\t\t\t\t}\n\t\t\t}\n\t\t}); // end click objHand (of objOtherHand)\n\t} // end Human-plays\n}", "function handleCardClick(event) {\n\t// you can use event.target to see which element was clicked\n\tconsole.log('you just clicked', event.target);\n\tconst pick = event.target;\n\n\tif (card1 != '' && !pick.classList.contains('picked')) {\n\t\tif (numPick === 1) {\n\t\t\tnumPick++;\n\t\t\tcard2 = pick;\n\t\t\tconsole.log('card2');\n\t\t\tcard2.style.backgroundColor = card2.style.color;\n\t\t\tcard2.classList.add('picked');\n\t\t}\n\n\t\tif (numPick === 2 && card1.style.backgroundColor != card2.style.backgroundColor) {\n\t\t\tsetTimeout(function() {\n\t\t\t\tcard1.style.removeProperty('background-color');\n\t\t\t\tcard2.style.removeProperty('background-color');\n\t\t\t\tcard1.classList.remove('picked');\n\t\t\t\tcard2.classList.remove('picked');\n\t\t\t\tcard1 = '';\n\t\t\t\tcard2 = '';\n\t\t\t\tnumPick = 0;\n\t\t\t}, 1000);\n\t\t}\n\t\tif (numPick === 2 && card1.style.backgroundColor === card2.style.backgroundColor) {\n\t\t\tcard1.classList.add('matched');\n\t\t\tcard2.classList.add('matched');\n\t\t\tmatchedPairs++;\n\t\t\tconsole.log(matchedPairs);\n\t\t\tsetTimeout(function() {\n\t\t\t\tcard1 = '';\n\t\t\t\tcard2 = '';\n\t\t\t\tnumPick = 0;\n\t\t\t}, 1000);\n\t\t}\n\t}\n\tif (numPick === 0) {\n\t\tnumPick++;\n\t\tcard1 = pick;\n\t\tcard1.style.backgroundColor = card1.style.color;\n\t\tevent.target.classList.add('picked');\n\t\tconsole.log('card1');\n\t\tconsole.log(numPick);\n\t}\n\tlet allDivs = document.getElementsByClassName('back');\n\tif (matchedPairs === pushColorCounter) {\n\t\tsetTimeout(function() {\n\t\t\twhile (allDivs.length > 0) {\n\t\t\t\tallDivs[0].parentNode.removeChild(allDivs[0]);\n\t\t\t}\n\t\t\tCOLORS = [];\n\t\t\tpushColorCounter = 0;\n\t\t\tmatchedPairs = 0;\n\t\t\tnumPick = 0;\n\t\t\tcard1 = '';\n\t\t\tcard2 = '';\n\t\t}, 1000);\n\t}\n}", "function afterPushHit(shuffleCards) {\n addCardsToPlayerAfterHit(shuffleCards);\n countResultPlayer();\n changeAsValue(playerResult, playerCardsTable);\n checkIfBlackJack(playerCardsTable, 'Player');\n if (playerResult > 21) {\n setTimeout(function(){endOfRound();}, 1000);\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 dealerTurn() {\n // darken hit and stand buttons\n $('#hit-button').off('click');\n $('#hit-button').addClass('subdued');\n $('#stand-button').off('click');\n $('#stand-button').addClass('subdued');\n\n let timeout = 0;\n\n while (dealer.total < 17) {\n hitMe(dealer);\n };\n\n // sets timing for new dealer card animations\n for(let i = 2; i <= dealer.hand.length; i++) {\n setTimeout(function() {\n $(`#dealer-hand div:nth-child(${i})`).removeClass('removed');\n $(`#dealer-hand div:nth-child(${i})`).addClass('flyin');\n }, timeout);\n timeout += 250;\n }\n\n // checks win conditions after animations are done playing\n setTimeout(function() {\n checkWinConditions();\n }, timeout + 250);\n\n}", "async function stand() {\n\n // most basic AI possible- dealer should draw if they have less than 17 points\n while(game.scores[DEALER] < 17) {\n // request new card for dealer from API\n const dealerPile = await fetch(`/game/${game.deckId}/draw/dealer`);\n\n // update dealer pile\n game.dealerPile = await dealerPile.json();\n\n // update dealer score\n game.scores[DEALER] = scorePlayer(DEALER);\n\n updateGameDisplay();\n }\n\n\n // determine game winner\n setTimeout(() => {\n\n if (game.scores[DEALER] > 21 || game.scores[DEALER] < game.scores[PLAYER]) {\n alert(`You win. ${game.scores[PLAYER]} to ${game.scores[DEALER]}`);\n endGame(PLAYER);\n } else {\n alert(`You lose. ${game.scores[PLAYER]} to ${game.scores[DEALER]}`);\n endGame(DEALER);\n }\n\n }, 1);\n}", "function checkSelectedCards(){\n if (selectedCards.length === 2) {\n canSelectCard = false;\n if ($(selectedCards[0]).attr('class') === $(selectedCards[1]).attr('class')) {\n score += 1234;\n pairsCorrect += 1;\n CheckIfCardsAreFrozenAndFreeze();\n $('.odometer').html(score);\n disableCorrectCards();\n checkIfAllCardsCorrect();\n }\n else {\n flipCardsBackDown();\n incorrectGuesses +=1;\n $('#incorrect-flips').html(incorrectGuesses);\n updateStars();\n }\n }\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 checkGuess() {\r\n setTimeout(function(){\r\n if (userGuesses.length === 2){\r\n if (images[userGuesses[0]] === images[userGuesses[1]]) {\r\n $(\"#img\" + userGuesses[0]).addClass(\"frozen-card\");\r\n $(\"#img\" + userGuesses[1]).addClass(\"frozen-card\");\r\n checkScore();\r\n } else {\r\n flipCard($(\"#img\" + userGuesses[0]));\r\n flipCard($(\"#img\"+ userGuesses[1]));\r\n }\r\n userGuesses = [];\r\n firstClick = true;\r\n $(\".card-back\").css(\"pointer-events\", \"\");\r\n }\r\n }, 1000);\r\n}", "function wait() {\n\t\tsetTimeout(getPlayer() ? attach : wait, 100);\n\t}", "function checkCardsMatch() {\n\n if (firstCard.dataset.names === secondCard.dataset.names) {\n firstCard.classList.add('matched');\n secondCard.classList.add('matched');\n\n checkForVictory();\n\n } else {\n\n lockGameArea = true;\n \n\n setTimeout(() => {\n firstCard.classList.remove('visible');\n secondCard.classList.remove('visible');\n\n lockGameArea = false;\n }, 1500);\n }\n}", "function card_clicked() {\n if (board_clickable != true){\n return;\n }\n $(this).find('.back').hide();\n // $(this).find('.back').css({'transform' : \"perspective(600px) rotateY(180deg)\"});\n // $(this).find('.face').css({'transform' : \"perspective(600px) rotateY(0deg)\"});\n\n $(this).off('click');\n// check to find out if its the first card\n if (first_card_clicked === null) {\n first_card_clicked = this;\n console.log('first card clicked');\n //turns off first card click so you cant match same card\n var src = $(first_card_clicked).find('img').attr('src');\n cardInfo[src].onClick();\n return;\n }\n// Its the second card\n else {\n second_card_clicked = this;\n console.log('second card clicked');\n attempts++;\n display_stats();\n var first_card = $(first_card_clicked).find('img').attr('src');\n var second_card = $(second_card_clicked).find('img').attr('src');\n\n// compare the two cards\n //cards match\n if (first_card === second_card) {\n board_clickable = false;\n match_counter++;\n display_stats();\n console.log('card 1: ', first_card_clicked, 'card 2: ', second_card_clicked);\n console.log('first_card : ', first_card, 'second_card : ',second_card);\n setTimeout(function(){\n $(first_card_clicked).find('.front').hide();\n $(second_card_clicked).find('.front').hide();\n board_clickable = true;\n first_card_clicked = null;\n second_card_clicked = null;\n }, 1000);\n\n var src = $(second_card_clicked).find('img').attr('src');\n cardInfo[src].onMatch();\n\n if (match_counter == total_possible_matches) {\n mainTheme_song.volume = .7;\n mainTheme_song.play();\n $('#win').html(\"YOU WIN!!!\");\n $(\"#win\").show();\n $('#reset').show();\n pauseGameMusic();\n mainTheme_song.currentTime = 0;\n $('.music_on').show();\n }\n }\n //cards don't match\n else {\n board_clickable = false;\n resetCardsAfterNoMatch();\n }\n }\n}", "checkMatch (card)\r\n {\r\n if (this.getCardType (card) == this.getCardType (this.cardToCheck))\r\n {\r\n //console.log (\"checked\");\r\n this.matchedCards.push(card);\r\n this.matchedCards.push(this.cardToCheck);\r\n //card.classList.add(\"revealed\");\r\n //this.cardToCheck.classList.add(\"revealed\");\r\n if (this.matchedCards.length == 16)\r\n {\r\n this.overlayOn ();\r\n }\r\n }\r\n else\r\n {\r\n //console.log (\"busy: \" + this.busy);\r\n this.misMatched (card, this.cardToCheck);\r\n //setTimeout (function () {console.log (\"go!\");}, 500);\r\n }\r\n }", "function boardCheck() {\n setTimeout(() => {\n if (cardOne.classList.contains(\"game-card-en\")) {\n enCardInPlay++;\n freezeEnBoard();\n } else if (cardOne.classList.contains(\"game-card-fr\")) {\n frCardInPlay++;\n freezeFrBoard();\n } else if (cardOne.classList.contains(\"game-card-it\")) {\n itCardInPlay++;\n freezeItBoard();\n }\n }, 100);\n }", "function gameAfterPlay() {\n countCurrentBalance();\n let shuffledCards = shuffleCards();\n addCroupierCardsToCroupierArea(shuffledCards, 2);\n addPlayerCardsToPlayerArea(shuffledCards,2);\n checkIfBlackJack(playerCardsTable, 'Player');\n countResultPlayer();\n getButtonHit(shuffledCards);\n getButtonStand(shuffledCards);\n\n}", "function compareCards(element) {\n const split = element.id.split('_')\n const id = split[1]\n quitOpacity(element)\n if (cardsToCompare.length <= 0 || cardsToCompare.length < 2) {\n cardsToCompare.push(id)\n }\n if (cardsToCompare.length > 1) {\n const firstCardId = parseInt(cardsToCompare[0])\n const firstCard = cards[firstCardId]\n const secondCardId = parseInt(cardsToCompare[1])\n const secondCard = cards[secondCardId]\n if (firstCard.id + 6 === secondCard.id || firstCard.id - 6 === secondCard.id) {\n firstCard.active = true\n secondCard.active = true\n cardsToCompare = []\n win = win + 2\n if (win === cardsNumber) { winGame() }\n }\n else {\n if (firstCard.id === secondCard.id) {\n if (!firstCard.active) {\n const element = document.querySelector(`#${firstCard.elementId}`)\n addOpacity(element)\n }\n cardsToCompare = []\n }\n else if (firstCard.active && secondCard.active) {\n cardsToCompare = []\n }\n else if (firstCard.active && !secondCard.active) {\n setTimeout(function () {\n const element = document.querySelector(`#${secondCard.elementId}`)\n addOpacity(element)\n }, 200)\n cardsToCompare = []\n }\n else if (!firstCard.active && secondCard.active) {\n setTimeout(function () {\n const element = document.querySelector(`#${firstCard.elementId}`)\n addOpacity(element)\n }, 200)\n cardsToCompare = []\n }\n else {\n setTimeout(function () {\n const firstElement = document.querySelector(`#${firstCard.elementId}`)\n addOpacity(firstElement)\n const secondElement = document.querySelector(`#${secondCard.elementId}`)\n addOpacity(secondElement)\n }, 500)\n cardsToCompare = []\n }\n }\n }\n}", "function blackJackPlayer1(){\n if(blackjackGame.player_1 === true){\n let card = randomCard();\n showCard(card,P1);\n updateScore(card,P1);\n showScore(P1);\n }\n}", "async function blackjackStand() {\n blcakjackGame[\"isStand\"] = true;\n\n while (DEALER[\"score\"] < 16 && blcakjackGame[\"isStand\"] === true) {\n let card = randomCard();\n showCard(card, DEALER);\n updateScore(card, DEALER);\n showScore(DEALER);\n await sleep(800);\n }\n\n blcakjackGame[\"turnsOver\"] = true;\n let winner = computeWinner();\n //console.log(winner);\n showResult(winner);\n}", "function handleCardClick(e) {\n var elem = findCard(e.target);\n if (clickCount === 1 && !traversedArr.includes(elem.getAttribute(\"name\"))) {\n\n if (elem != chosenArr[0]) {\n var cardColor = elem.getAttribute(\"name\");\n elem.id = \"chosen-two\";\n console.log('SECOND card choice -->', cardColor, elem.id);\n chosenArr.push(elem);\n flipCard(elem);\n clickCount++\n console.log('click count', clickCount);\n }\n else {\n console.log('Same Box Chosen')\n }\n }\n\n if (clickCount === 0 && !traversedArr.includes(elem.getAttribute(\"name\"))) {\n elem.id = \"chosen-one\";\n var cardColor = elem.getAttribute(\"name\");\n console.log('FIRST card choice -->', cardColor, elem.id);\n chosenArr.push(elem);\n flipCard(elem);\n clickCount++\n console.log('click count', clickCount);\n\n }\n if (clickCount === 2) {\n if (chosenArr[0].getAttribute(\"name\") === chosenArr[1].getAttribute(\"name\")) {\n for (let elem of chosenArr) {\n elem.id = \"\";\n traversedArr.push(elem.getAttribute(\"name\"));\n }\n console.log('MATCH FOUND');\n\n chosenArr = [];\n clickCount = 0;\n console.log('clickCount reset to', clickCount);\n if (traversedArr.length === 10) {\n setTimeout(function () { displayWin() }, 1000);\n console.log('game won!');\n }\n }\n\n else {\n console.log('NO MATCH', chosenArr[0].getAttribute(\"name\"), chosenArr[1].getAttribute(\"name\"))\n setTimeout(function () { unFlipCard() }, 1000);\n\n console.log('clickCount reset to', clickCount);\n chosenArr = [];\n }\n }\n e.preventDefault;\n // ... you need to write this ...\n}", "function flipped()\n{\n \n let flip = this.getAttribute(\"data-id\");\n pickedCard.push(cardsArr[flip].name);\n\n cardPickId.push(flip);\n //this.classList.replace(\"back\",\"front\");\n this.classList.add(\"flip\");\n this.setAttribute(\"src\",cardsArr[flip].img);\n \n \n if(pickedCard.length ===2){\n \n setTimeout(checkCard,500)\n }\n}", "function completeExchangePhase () {\n detectCheat();\n /* exchange the player's chosen cards */\n exchangeCards(HUMAN_PLAYER);\n \n /* disable player cards */\n for (var i = 0; i < $cardButtons.length; i++) {\n $cardButtons[i].attr('disabled', true);\n }\n $gameLabels[HUMAN_PLAYER].removeClass(\"current\");\n allowProgression(eGamePhase.REVEAL);\n}", "function checkForMatch(card1, card2){\n CARDS.canFlip = false;\n setTimeout(()=> { \n if(card1.dataset.id === card2.dataset.id){ \n card1.classList.add('matched');\n card2.classList.add('matched'); \n CARDS.paired++;\n } else {\n card1.classList.remove('visible');\n card2.classList.remove('visible');\n } \n CARDS.canFlip = true;\n }, 1000);\n CARDS.currentCardToPair = null;\n}", "function waitForTurn() {\n\t// return a Promise which is resolved when \"/multiplayer/turn\" increases\n\treturn new Promise((resolve, reject) => {\n\t\t// listen for changes to \"/multiplayer\"\n\t\tfirebase.listen(\"/multiplayer\", (event) => {\n\t\t\t// resolves when \"/multiplayer/\" is changed\n\t\t\tif(event.index > 0 && event.path != \"/hit\") {\n\t\t\t\tresolve(event.data.hit)\n\t\t\t}\n\t\t})\n\t})\n}", "function card_clicked() {\n card_flip(this);\n if (first_card_clicked === null) {\n first_card_clicked = this;\n first_card_back = first_card_clicked;\n first_card = $(this).find('.back').find('img').attr('src');\n attempts++;\n disable_flip(this);\n\n }\n else {\n second_card_clicked = this;\n second_card_back = second_card_clicked;\n second_card = $(this).find('.back').find('img').attr('src');\n disable_flip(this);\n\n // First and second card comparison\n if (first_card === second_card) {\n match_counter++;\n first_card_clicked = null;\n second_card_clicked = null;\n accuracy = ((match_counter / attempts) * 100).toFixed(0);\n\n // Match counter to win\n if (match_counter === total_possible_matches) {\n window.alert(\"You Win!\")\n }\n else {\n return \"Keep Going.\"\n }\n }\n // If cards do not match\n else {\n allow_flip(first_card_clicked, second_card_clicked);\n setTimeout(card_flipback, 700);\n first_card_clicked = null;\n second_card_clicked = null;\n }\n display_stats();\n }\n}", "function handleGamePlay(event) {\n event.preventDefault();\n\n var cardPlayed = event.target;\n var id = cardPlayed.id;\n\n divHand = document.getElementById(id);\n divHandSet = id;\n divHand.setAttribute('id', 'discarded');\n\n var players = selectPlayer();\n\n sleep(1000).then(() =>{\n gameScreen.setAttribute('id','gameScreen');\n playCard(players[0], players[1], players[2]);\n });\n\n sleep(2000).then(() =>{setGameScreen();});\n sleep(3000).then(() =>{\n playCard(Player.allPlayers[1], Player.allPlayers[0]);\n gameScreen.setAttribute('id','gameScreen');\n blackOut.setAttribute('id','blackout');\n });\n\n sleep(5000).then(() =>{setGameScreen();});\n if (Player.allPlayers[0].remainingHealthPoints <= 0 || Player.allPlayers[1].remainingHealthPoints <= 0) {\n storeObjects();\n location.href = './result.html';\n }\n\n sleep(2000).then(() =>{\n assignHand(players[3]);\n });\n}", "function checkForMatch() {\n\tif (\n\t\ttoggledCards[0].firstElementChild.className === toggledCards[1].firstElementChild.className\n\t) {\n\t\t// if the cards do match, lock the cards in the open position (put this functionality in another function that you call from this one)\n\t\ttoggleMatchCard(toggledCards[0]);\n\t\ttoggleMatchCard(toggledCards[1]);\n\t\ttoggledCards = [];\n\t\tmatched++;\n\t\t// stop the game if TOTAL_PAIRS reached with a timeout of 1000\n\t\tsetTimeout(() => {\n\t\t\tif (matched === TOTAL_PAIRS) {\n\t\t\t\tgameOver();\n\t\t\t}\n\t\t}, 1000);\n\t}else{\n\t\t//setTimeOut is a callback function that runs after the designated time expires.\n\t\tsetTimeout(() => {\n\t\t\t// if the cards do not match, remove the cards from the list and hide the card's symbol (put this functionality in another function that you call from this one)\n\t\t\ttoggleCard(toggledCards[0]);\n\t\t\ttoggleCard(toggledCards[1]);\n\t\t\ttoggledCards = [];\n\t\t}, 1000);\n\n\t}\n}", "function notMatch() {\n setTimeout(function() {\n toggleCard(openCards[0]);\n toggleCard(openCards[1]);\n openCards = [];\n }, 700)\n}", "function handleCardClick(event) {\n // you can use event.target to see which element was clicked\n console.log(\"you just clicked\", event.target);\n if (faceUpPair.length < 2) {\n if (!event.target.style.backgroundColor){\n // reveal card\n event.target.style.backgroundColor = event.target.getAttribute('data-color');\n if (!faceUpLock){\n // synchronize on write\n faceUpLock = true;\n faceUpPair.push(event.target); // add card to array\n faceUpLock = false;\n }\n // increment score\n score++;\n currScore.innerText = score;\n //console.log(faceUpPair);\n }\n }\n if (faceUpPair.length == 2) {\n //console.log(faceUpPair);\n if (faceUpPair[0].style.backgroundColor !== faceUpPair[1].style.backgroundColor) {\n if (!faceUpLock){\n // lock faceUpPair until after timeout\n faceUpLock = true;\n setTimeout(() => {\n // hide cards\n for (let card of faceUpPair){\n card.style.backgroundColor = \"\";\n }\n faceUpPair = [];\n faceUpLock = false;\n }, 1000);\n }\n } else {\n if (!faceUpLock){\n // synchronize on write\n faceUpLock = true;\n faceUpPair = [];\n faceUpLock = false;\n }\n }\n }\n //console.log(\"Game Over: \", isGameOver());\n // show restart button if game over\n if (isGameOver() && !gameSetup.querySelector(\"#restart\")){\n if (localStorage.bestScore){\n const lowestScore = score < localStorage.bestScore ? score : localStorage.bestScore;\n localStorage.setItem(\"bestScore\", lowestScore);\n }\n else {\n localStorage.setItem(\"bestScore\", score);\n }\n bestScore.innerText = localStorage.bestScore; // update display\n gameSetup.querySelector('#setup-restart').appendChild(createRestartBtn());\n }\n}", "function onDealCardsClicked(){\n\t\tif(poker._bet > 0){\n\t\t\t$(\"#commandbutton_2\").off(\"click\").addClass(\"disabled\");\n\t\t\t$(\"#commandbutton_3\").off(\"click\").addClass(\"disabled\");\n\t\t\t$(\"#commandbutton_4\").off(\"click\").addClass(\"disabled\");\n\t\t\tcardsFliped = false;\n\t\t\tswitch (draw){\n\t\t\t\tcase 0:\n\t\t\t\t\t\n\t\t\t\t\tpoker.cards.shuffle();\n\t\t\t\t\tresetHeld();\n\t\t\t\t\tfirstCard = poker.cards.dealCard();\n\t\t\t\t\tsecondCard = poker.cards.dealCard();\n\t\t\t\t\tthirdCard = poker.cards.dealCard();\n\t\t\t\t\tfourthCard = poker.cards.dealCard();\n\t\t\t\t\tfifthCard = poker.cards.dealCard();\n\t\t\t\t\tdraw++;\n\t\t\t\t\tWinner.html(\"Draw \" + draw);\n\t\t\t\t\tbreak;\n\t\t\t\t/*case 1:\n\t\t\t\t\tif(!_firstCardHold)\n\t\t\t\t\t\tfirstCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_secondCardHold)\n\t\t\t\t\t\tsecondCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_thirdCardHold)\n\t\t\t\t\t\tthirdCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_fourthCardHold)\n\t\t\t\t\t\tfourthCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_fifthCardHold)\n\t\t\t\t\t\tfifthCard = poker.cards.dealCard();\n\t\t\t\t\tdraw++;\n\t\t\t\t\tWinner.html(\"Draw \" + draw);\n\t\t\t\t\tbreak;*/\n\t\t\t\tcase 1:\n\t\t\t\t\tcardsFliped = false;\n\t\t\t\t\tif(!_firstCardHold)\n\t\t\t\t\t\tfirstCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_secondCardHold)\n\t\t\t\t\t\tsecondCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_thirdCardHold)\n\t\t\t\t\t\tthirdCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_fourthCardHold)\n\t\t\t\t\t\tfourthCard = poker.cards.dealCard();\n\t\t\t\t\tif(!_fifthCardHold)\n\t\t\t\t\t\tfifthCard = poker.cards.dealCard();\n\t\t\t\t\tdraw = 0;\n\t\t\t\t\tresetHeld();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\trefresh();\n\t\t}else{\n\t\t\talert(\"no bet\");\n\t\t}\n\t}", "function startRound() {\n handoutCards();\n\n if (actualPlayer.order === 1) {\n showTrickCallModal();\n }\n}", "function hit() {\n let newCard = round.cards[Math.round(Math.random() * round.cards.length)];\n round.playerCards.push(newCard);\n display.innerHTML += ` ${newCard}`;\n round.checkResult(false, true);\n console.log(round.playerCards);\n }", "function checkIfCompleted() {\n matchingCards++;\n\n if (matchingCards >= Math.floor(fieldSize / 2)) {\n gameCompleted = true;\n timerStop();\n gratulation();\n }\n }", "onCardSelect(card) {\n // ignore if card is already displayed\n if (card.displayed) return;\n\n if (this.card1 === null) {\n this.card1 = card;\n this.card1.display();\n return;\n }\n this.card2 = card;\n this.card2.display();\n\n const self = this;\n const card1 = this.card1;\n const card2 = this.card2;\n\n self.card1 = null;\n self.card2 = null;\n \n setTimeout(function() {\n if (card1.isEqual(card2)) {\n } else {\n card1.hide();\n card2.hide();\n }\n self.setState({ tries: self.state.tries+1 });\n }, 1000);\n }", "function maybeMatch (card) {\n if (click % 2 === 0){\n incrementMove();\n changeScore();\n symbol2 = card.children[0].className;\n if (symbol1 === symbol2){\n console.log('you find it');\n maybeEndGame(card); \n } else {\n preventClick = true;\n console.log('try again');\n setTimeout(function(){\n card.classList.remove(\"shown-card\");\n firstCard.classList.remove(\"shown-card\");\n preventClick = false;\n }, 700); \n }\n } else {\n symbol1 = card.children[0].className;\n firstCard = card;\n }\n}", "Match() {\n // if there are two cards with the classes clicked\n if ($('.clicked').length === 2) {\n// Than seeing if they match\n if ($('.clicked').first().data('value') == $('.clicked').last().data('value')){\n $('.clicked').each(function() {\n $(this).css({\"background-color\": \"green\",}).animate({ opacity: 0 }).removeClass('unmatched');\n });\n $('.clicked').each(function() {\n $(this).removeClass('clicked');\n });\n\n game.checkWin();\n // using a time out function to make the to flip the cards back \n } else {\n setTimeout(function() {\n $('.clicked').each(function() {\n $(this).html('').removeClass('clicked');\n \n });\n }, 1000);\n }\n }\n }", "function pickupBeforeStage(event) {\n\tvar pickUpLink = event.data.replace(\"pickupBeforeStage\", \"\");\n\t$(\"#extra1\").attr(\"src\", \"http://\"+ ip + pickUpLink);\n\tgetCurrHand();\n\tvar cardTracker = 0;\n\tfor (var i = 0; i < handCardSRC.length; i++) {\n\t\tvar tempCardLink = handCardSRC[i].replace(\"http://\"+ip,\"\");\n\t\ttempCardLink = tempCardLink.split('%20').join(' ');\n\t\tif (tempCardLink != \"/resources/images/all.png\")\n\t\t\tcardTracker++;\n\t}\n\t\n\tnumCards = cardTracker;\n\tif (cardTracker > 12) {\n\t\tdocument.getElementById(\"doneEquipment\").disabled = true;\n\t\tvar serverMsg = document.getElementById(\"serverMsg\");\n\t\tserverMsg.value += \"\\n> you must choose a card to continue (or right-click to discard) when it is your turn\";\n\t}\n}", "function playCard(cardID, userStatus, targetStatus) {\n // detect which card is played (clicked)\n const cardToPlay = handCards.find(card => card.id == cardID)\n // take action according to the card\n // console.log(characterInfo)\n // console.log(characterInfo[0])\n // console.log(userStatus.max_HP) \n // console.log(targetStatus)\n // console.log(userStatus.max_hp)\n // if win/lose condition is met, let the player win/lose\n // update character data to the database\n }", "function handleCardClick(event) {\n\t// you can use event.target to see which element was clicked\n\n\t// prevent selecting additional cards during no match delay\n\tif (selection1 !== 0 && selection2 !== 0) return;\n\n\t// console.log('you just clicked', event.target);\n\tconst cardClass = event.target.className;\n\n\tif (event.target.className === 'matched') {\n\t\tconsole.log('Cannot reselect this card!');\n\t\treturn;\n\t}\n\n\tattempts++;\n\tdisplayAttempts();\n\n\tevent.target.style.backgroundColor = `${colorMapObject[cardClass]}`;\n\n\tif (selection1 === 0) {\n\t\tselection1 = cardClass;\n\t\telement1 = event.target;\n\t} else if (selection2 === 0) {\n\t\tif (event.target === element1) return;\n\t\tselection2 = cardClass;\n\t\telement2 = event.target;\n\n\t\tif (selection1 === selection2) {\n\t\t\tmatch = true;\n\t\t\tselection1 = 0;\n\t\t\tselection2 = 0;\n\t\t\telement1.className = 'matched';\n\t\t\telement2.className = 'matched';\n\t\t\tmatches += 2;\n\t\t\tdisplayMatches();\n\t\t} else {\n\t\t\tmatch = false;\n\t\t\tlet noMatchTimeout = setTimeout(function() {\n\t\t\t\telement1.style.backgroundColor = defaultCardColor;\n\t\t\t\telement2.style.backgroundColor = defaultCardColor;\n\t\t\t\tselection1 = 0;\n\t\t\t\tselection2 = 0;\n\t\t\t}, noMatchDelay);\n\t\t}\n\t}\n}", "function selectCard(e) {\n let cardNode = e.target;\n let match;\n\n // only activate if card is clicked (not the deck)\n if (cardNode.getAttribute('class') === 'card') {\n\n // determin whether this is the first card selected\n if (cardSelected === false) {\n // show icon of card\n card1 = cardNode;\n flipCard(card1);\n\n // indicate that the first card has been selected\n cardSelected = true;\n } else {\n // show icon of card\n card2 = cardNode;\n flipCard(card2);\n\n // update the turn counter\n turns++;\n updateTurns(turns);\n\n // check whether the star need to be reduced\n reduceStars();\n\n // prevent other cards from being selected\n cardNode.parentNode.removeEventListener('click', selectCard);\n\n // check if selected cards are a match\n match = checkMatch(card1, card2);\n if (match) {\n // reinstate ability to select cards\n cardNode.parentNode.addEventListener('click', selectCard);\n\n // indicate that a pair has been found\n cardsMatched=cardsMatched+2;\n\n // determine if cards\n if (cardsMatched == CARDS) {\n // show congratulations panel and end game\n endGame();\n }\n } else {\n window.setTimeout(function(){\n flipCard(card1, 'reverse');\n flipCard(card2, 'reverse');\n // reinstate ability to select cards (after cards have been flipped)\n cardNode.parentNode.addEventListener('click', selectCard);\n }, 500);\n }\n\n // reset so that new card pairs can be selected\n cardSelected = false;\n }\n }\n}", "function autoPick() {\n cardspickedthistime = 0;\n var cardsatatime = parseInt(document.getElementById(\"deal-number\").value); //get the value from the drop down as an integer\n while (cardspickedthistime < cardsatatime && cardsontable > 0) {\n var myRandomNumber = Math.floor(Math.random() * 50);\n if (table[myRandomNumber + 1] == true) {\n pickCard(myRandomNumber + 1);\n cardspickedthistime++;\n }\n }\n}", "function blackjackCheck() {\n // console.log(\"Player blackjack!\")\n // console.log('Dealer flips his hidden card. It is a ' + describeDealtCard(dealerCards[1]) + \".\")\n // console.log('Dealer ' + currentHand(dealerCards));\n\n if (totalValue(playerCards) > totalValue(dealerCards))\n setTimeout(function () {\n blackjack();\n }, bigSignTimeout)\n else if (totalValue(playerCards) == totalValue(dealerCards))\n setTimeout(function () {\n blackjackPush();\n }, bigSignTimeout)\n}", "function takeTurn () {}", "function blackjackCheck() {\n if (playerPointTotal === 21 && dealerPointTotal === 21) {\n console.log(\"player and dealer got blackjack\");\n setTimeout(function(){ alert(\"The game is a tie! You and the dealer both got Blackjack.\"); }, 1000);\n }\n else if (playerPointTotal === 21) {\n console.log(\"player got blackjack\");\n setTimeout(function(){ alert(\"Congratulations! You have Blackjack and have beat the dealer!\"); }, 400);\n setTimeout(function() {document.getElementById(\"win\").play(); }, 500);\n }\n else if (dealerPointTotal === 21) {\n console.log(\"dealer got blackjack\");\n setTimeout(function(){ alert(\"I'm sorry! The dealer has Blackjack. You've lost the game.\"); }, 1000);\n }\n }", "function clickAction (event) {\n console.log(\"now Here I am\")\n // Select cards\n gameOn.selectCard(event);\n\n // When 3 cards are selected, the set is checked by CheckIfSet:\n if (gameOn.selectedCards.length === 3) {\n\n const result = gameOn.checkIfSet(gameOn.selectedCards);\n // If the 3 cards are a set, cards are removed and replaced, rendered again, and click event is added.\n if (result) { //careful I have to change that to result\n gameOn.isASet();\n gameOn.renderCards();\n addClickToCards();\n } \n // It the 3 cards are not a set, the cards are deselected\n if (result === false) {\n setTimeout(gameOn.isNotASet.bind(gameOn), 1000)\n gameOn.renderCards();\n addClickToCards();\n } \n }\n //Update final score displayed in div #game-over\n let finalScore = document.querySelector(\"#game-over > p > span\");\n finalScore.innerText = gameOn.foundSets;\n console.log(gameOn.foundSets)\n}", "function checkResult(playerChoice) {\r\n resetSelected()\r\n computerRandomChoice()\r\n displayComputerChoice()\r\n updateScore(playerChoice)\r\n}", "function playCard(){\n\tcardPlayed = playerArr[turn].playerHand.splice($(this).index(), 1);\n\tcheckCard();\n}", "dealCardToPlayer() {\n let theCards = $(\".playerCard\");\n for (let i = 0; i < theCards.length; i++) {\n if ($(\".playerCard\")[i].style.backgroundImage === \"\") {\n this.giveCard($(\".playerCard\")[i], \"player\");\n //TODO: do the ace\n }\n }\n }", "function flipCard(){\n let cardId = this.getAttribute('data-id')\n cardChosen.push(cardArray[cardId].name)\n cardChosenId.push(cardId)\n this.setAttribute('src', cardArray[cardId].img)\n if(cardChosen.length ===2){\n setTimeout(checkForMatch, 500)\n }\n}", "function rockChoice() {\n var compChoice = showCompResult();\n // Check for win\n if (compChoice === 0) {\n playerDraws();\n } else if (compChoice === 1) {\n playerLoses();\n } else {\n playerWins();\n }\n}", "function wait(fturn = turn) {\n\tttt = Date.now(); // for debugging\n\n\tcsmPull('recvAttack', (data) => {\n\t\tif (data) {\n\t\t\t// handle outdated data\n\t\t\tvar state = allyGameBoard[data.row][data.col];\n\t\t\tif (state == states.sunk || state == states.miss) {\n\t\t\t\tconsole.log(`Received wrong attack coordinates: ${data.row}${data.col}\\nState: ${state}`);\n\t\t\t\tif (stop_resend(fturn)) return;\n\t\t\t\tsetTimeout(wait, interval);\n\t\t\t\treturn;\n\t\t\t} else if (stop_resend(fturn)) return;\n\n\t\t\t++turn;\n\t\t\tconsole.log('a' + data.row + data.col + ' was hit');\n\t\t\tconsole.log('Your turn!');\n\t\t\tsetTimeout(() => {\n\t\t\t\t$('#turn-indicator')[0].innerText = 'Your turn';\n\t\t\t\t$('#turn-indicator')[0].style.color = $('#ally-gameboard-text').css('color');\n\t\t\t}, animationTime);\n\t\t\tvar row = data.row;\n\t\t\tvar col = data.col;\n\t\t\tswitch (allyGameBoard[row][col]) {\n\t\t\t\tcase states.empty:\n\t\t\t\t\tallyGameBoard[row][col] = states.miss;\n\t\t\t\t\t$('#a' + row + col)[0].className = 'miss';\n\t\t\t\t\tenemyGameBoardContainer.addEventListener('click', fireTorpedo);\n\t\t\t\t\tbreak;\n\t\t\t\tcase states.ship:\n\t\t\t\t\tallyGameBoard[row][col] = states.sunk;\n\t\t\t\t\t$('#a' + row + col)[0].className = 'sunk';\n\t\t\t\t\tenemyGameBoardContainer.addEventListener('click', fireTorpedo);\n\n\t\t\t\t\tenemyHitCount++;\n\t\t\t\t\tif (enemyHitCount >= totalShipCount) {\n\t\t\t\t\t\t// let enemy know the game is over before alerting\n\t\t\t\t\t\tcsmPush('sendReveal', {\n\t\t\t\t\t\t\trow: row,\n\t\t\t\t\t\t\tcol: col,\n\t\t\t\t\t\t\tstate: allyGameBoard[row][col],\n\t\t\t\t\t\t});\n\t\t\t\t\t\tgame_over(false);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tconsole.log(`Invalid state: allyGameBoard[${row}][${col}]=${allyGameBoard[row][col]}, expected ${states.empty} or ${states.ship}.`);\n\t\t\t}\n\t\t\t// wait for transition animation, then go to enemy gameboard\n\t\t\tif (!isGameOver()) {\n\t\t\t\tsetTimeout(() => scroll_to('enemy'), animationTime);\n\t\t\t}\n\n\t\t\t// resend until enemy receives it\n\t\t\t(function resendReveal() {\n\t\t\t\tif (Date.now() - ttt > interval * 10) {\n\t\t\t\t\tconsole.log('resendReveal triggered debugger');\n\t\t\t\t\tdebugger;\n\t\t\t\t\tttt = Date.now();\n\t\t\t\t} // debug if game stuck\n\t\t\t\tif (stop_resend(fturn)) return;\n\n\t\t\t\tcsmPush('sendReveal', {\n\t\t\t\t\trow: row,\n\t\t\t\t\tcol: col,\n\t\t\t\t\tstate: allyGameBoard[row][col],\n\t\t\t\t});\n\t\t\t\tsetTimeout(resendReveal, interval);\n\t\t\t})();\n\n\t\t} else {\n\t\t\tif (stop_resend(fturn)) return;\n\t\t\tsetTimeout(wait, interval);\n\t\t}\n\t});\n}", "function cardClicked(elCard) {\n // do nothing if busy\n if (busy){\n return;\n }\n\n if (!insideGame){\n insideGame = true;\n timeStart = Date.now();\n }\n\n // do nothing, if user clicked an already flipped card\n if (elCard.classList.contains('flipped')) {\n return;\n }\n\n // start doing function task\n busy = true;\n\n // Flip it\n elCard.classList.add('flipped');\n\n // This is a first card, only keep it in the global variable\n if (elPreviousCard === null) {\n elPreviousCard = elCard;\n clearBusy();\n } else {\n // get the data-card attribute's value from both cards\n var card1Type = elPreviousCard.getAttribute('cardType');\n var card2Type = elCard.getAttribute('cardType');\n\n // A match?\n if (card1Type !== card2Type){\n // No match... Play audio, then flip both cards back\n AUDIO_WRONG.play();//asynchronously plays 1 second\n setTimeout(function () {//do after audio duration time\n elCard. classList.remove('flipped');\n elPreviousCard.classList.remove('flipped');\n elPreviousCard = null;\n clearBusy();\n }, 1100);\n } else {\n // Yes! a match! :-)\n\n //handle flipped cards pair - leave them flipped\n flippedCouplesCount++;\n elPreviousCard = null;\n\n // All card pairs flipped?\n if (flippedCouplesCount !== TOTAL_COUPLES_COUNT) {\n // Not all cards flipped yet...\n AUDIO_RIGHT.play();//asynchronously plays 2 seconds\n setTimeout(function(){//do after audio duration time\n clearBusy();\n }, 2100);\n } else {\n // All cards flipped!!!!\n measureGameTime();\n AUDIO_WIN.play();//asynchronously plays 5 seconds\n setTimeout(function(){//do after audio duration time\n unhideItem('idBtnPlayAgain');\n }, 5100);\n }\n }\n }\n}", "function checkMatch(){\n\t\tplay = false;\n\t\tif (checking[0] == checking[1]){\n\t\t\tlet t1 = setTimeout(function(){\n\t\t\t\topenMatched();\n\t\t\t\tplay = true;\n\t\t\t}, 500);\n\t\t\tif (matches <= 7){\n\t\t\t\tmatches++;\t\t\t\t\n\t\t\t}\n\t\t\tif (matches == 8){\n\t\t\t\tlet t2 = setTimeout(function(){\n\t\t\t\t\talert(\"Well Done. Please Play Again!! \\nYou have won in \" + total_time + '\\nUsing ' + moves + ' Moves' + '\\nHaving ' + gstars + ' Stars');\n\t\t\t\t\tupdateCards();\n\t\t\t\t\tplay = true;\n\t\t\t\t}, 500);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tlet t3 = setTimeout(function(){\n\t\t\t\tparents[0].className = 'card';\n\t\t\t\tif (parents[1] != null || parents[1] == undefined){\n\t\t\t\t\tparents[1].className = 'card';\n\t\t\t\t}\n\t\t\t\tplay = true;\n\t\t\t}, 500);\n\t\t}\n}", "function handleClickCard(event) {\n $(event.currentTarget).find('.backOfCard').addClass('hidden');\n console.log(event.currentTarget);\n if (firstCardClicked === null) {\n firstCardClicked = $(event.currentTarget);\n } else {\n secondCardClicked = $(event.currentTarget);\n attempts++;\n var firstPick = firstCardClicked.find('.revealCard').css('background-image');\n var secondPick = secondCardClicked.find('.revealCard').css('background-image');\n turnClickHandlerOff();\n if (firstPick === secondPick) {\n console.log('The cards match!');\n matches++;\n firstCardClicked = null;\n secondCardClicked = null;\n turnClickHandlerOn();\n } else {\n setTimeout(function () {\n firstCardClicked.find('.backOfCard').removeClass('hidden');\n firstCardClicked = null;\n secondCardClicked.find('.backOfCard').removeClass('hidden');\n secondCardClicked = null;\n turnClickHandlerOn();\n }, 500);\n }\n displayStats();\n }\n}", "pickCard(card, domId) {\r\n let picked = document.getElementById('gameplayCard-' + domId);\r\n if (this.state.selectedCard.length === 0) {\r\n picked.classList.add('flipped')\r\n this.setState({ selectedCard: [card, domId] });\r\n } else {\r\n picked.classList.add('flipped')\r\n if (this.state.selectedCard[0] === card) {\r\n this.setState({ selectedCard: [] })\r\n } else {\r\n let previousCard = document.getElementById('gameplayCard-' + this.state.selectedCard[1]);\r\n this.setState({ selectedCard: [] }, () => {\r\n setTimeout(() => {\r\n picked.classList.remove('flipped');\r\n previousCard.classList.remove('flipped');\r\n }, 1000);\r\n })\r\n }\r\n }\r\n }", "function limiter() {\n if (card.length == 2) {\n setTimeout(compare, 500)\n }\n}" ]
[ "0.7446441", "0.72535795", "0.67397904", "0.67022634", "0.66978", "0.6647856", "0.6637127", "0.6608728", "0.6590938", "0.65778035", "0.6565351", "0.6546388", "0.6540696", "0.65369606", "0.6536344", "0.65274936", "0.64892983", "0.6469878", "0.6463676", "0.6457025", "0.6433829", "0.6426644", "0.64194125", "0.6410771", "0.6395201", "0.63696766", "0.63666093", "0.6357048", "0.63514215", "0.63512564", "0.6345957", "0.63416547", "0.6338607", "0.6336303", "0.6329819", "0.6324648", "0.631955", "0.6316603", "0.6314785", "0.62995315", "0.62890214", "0.6276496", "0.62736213", "0.6273103", "0.62721574", "0.62684107", "0.6262963", "0.625971", "0.62518793", "0.62468284", "0.6242516", "0.6238372", "0.6231599", "0.6227675", "0.62260044", "0.62233126", "0.62177664", "0.62167305", "0.62101257", "0.62090576", "0.6199431", "0.61968523", "0.61912537", "0.6180356", "0.6175027", "0.617191", "0.61666274", "0.6165089", "0.6162798", "0.6160894", "0.61578035", "0.61553764", "0.6155188", "0.6154885", "0.6148731", "0.61466587", "0.6146212", "0.6146043", "0.61452526", "0.61358637", "0.6133278", "0.61204785", "0.6116521", "0.61136687", "0.6110704", "0.6109618", "0.61043483", "0.61034155", "0.61033803", "0.6101651", "0.6101365", "0.61008275", "0.60949266", "0.60938025", "0.60922617", "0.6090674", "0.60905135", "0.60864425", "0.608394", "0.60832506", "0.6081581" ]
0.0
-1
wait for the voting results for the round
getVoteResults() { let observable = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"](observer => { this.socket.on('serverSendVoteResults', (results, winners, cardVotingOn) => { observer.next([results, winners, cardVotingOn]); }); return () => { this.disconnectSocket(); }; }); return observable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function voting() {\n let chan = bot.guilds\n .get(get('config.discord.serverID'))\n .channels.find('name', get('config.discord.channelName'));\n chan\n .send(votestart('...', 'Loading...'))\n .then(message => {\n requ()\n .then(arr => {\n tweets = arr;\n round = get('round');\n round++;\n db.set('round', round).write();\n let choices = tweets\n .map((cur, ind) => `${ind + 1}: ${cur}`)\n .join('\\n');\n message.edit(votestart(round, choices)).then(() => {\n go = true;\n e.once('complete', res => {\n chan\n .send(\n 'https://twitter.com/' +\n twitterUser.screen_name +\n '/status/' +\n res.id_str,\n {\n embed: {\n description: res.text,\n timestamp: moment()\n .add(get('options.cooldown.toNextVote'), 'minutes')\n .toISOString(),\n author: {\n name: `${twitterUser.name} (@${\n twitterUser.screen_name\n })`,\n icon_url: twitterUser.profile_image_url_https,\n url: 'https://twitter.com/' + twitterUser.screen_name\n },\n footer: {\n icon_url:\n 'https://abs.twimg.com/icons/apple-touch-icon-192x192.png',\n text: 'Next round is'\n }\n }\n }\n )\n .catch(error => {\n console.log(new Error(error));\n process.exit(1);\n });\n let wait = get('options.cooldown.toNextVote') * 60000;\n let currentRound = get('round');\n setTimeout(() => {\n if (!go && get('round') == currentRound) {\n voting();\n }\n }, wait);\n });\n });\n })\n .catch(error => {\n console.log(new Error(error));\n process.exit(1);\n });\n })\n .catch(error => {\n console.log(new Error(error));\n process.exit(1);\n });\n}", "function voting_start() {\n jQuery(\"#vote-page\").show();\n jQuery.getJSON(command_url(\"game_status\"), function(data) {\n\tgame_id=data.id;\n\tjQuery(\".action-butt\").each(function (n) {\n\t this.innerHTML = data.choices[n];\n\t});\n });\n}", "function showResults(){\n \n // SHOW RESULTS OF WHO WAS KILLED OR IF PEOPLE ARE SAFE - Then - SET NEXT TIMER:\n $(\"#questionArea\").show();\n // $(\"#resultsPlaceholder\").show();\n $(\"#pleaseWait\").hide();\n \n // $(\"#displayImage2\").hide();\n\n $(\"#deadArea\").hide();\n $(\"#deadTable\").hide();\n \n // $(\"#displayImage1\").hide();\n $(\"#saveArea\").hide();\n $(\"#saveTable\").hide();\n\n // $(\"#displayImage3\").hide();\n // $(\"#displayWaiting\").hide();\n\n\n\n var countDown = 30;\n var interval = setInterval(function() { \n countDown--;\n $(\"#timeRemaining\").html(\"<h1>Time Remaining: \" + countDown + \"</h1>\");\n\n \n \n if (countDown == 0) {\n //startTimer();\n displayVotes();\n clearInterval(interval);\n\n }\n \n }, 1000);\n\n }", "roomFinishedVoting() {\n if(this.state.vote_poll)\n {\n console.log(\"Polling to see if voting finished\")\n axios.get('http://localhost:3000/roomDoneVoting', {\n headers: {'Content-Type': 'application/json'},\n withCredentials: true\n }).then(res => {\n if(res.data.done)\n {\n this.state.vote_poll = false;\n this.getVotingResults();\n }\n });\n }\n }", "function submitVotes(){\n encryptVotes();\n sendVotes();\n}", "function results() {\n selectedAnswers = $(displayTest.find(\"input:checked\"));\n //if user is correct\n if (\n selectedAnswers[0].value === testSetup[currentQuestion - 1].questionAnswer\n ) {\n //add to correct score and display on element\n correct++;\n $(\"#correct\").text(\"Answers right: \" + correct);\n } else {\n //if user is wrong then add to wrong score and display on element\n wrong++;\n $(\"#incorrect\").text(\"Wrong answers: \" + wrong);\n }\n //check to see if the user has reached the end of the test\n if (currentQuestion === 10) {\n //toggle finalize modal at end of test to display score\n $(\"#modalMatch\").modal(\"toggle\");\n $(\"#testScore\").text(\n \"End of test! You scored a \" + (parseFloat(correct) / 10) * 100 + \"%\"\n );\n //show postTest element\n $(\"#postTest\").show();\n $(\"#submitTest\").hide();\n }\n }", "doneVoting(){\n console.log(\"done voting\")\n this.setState({roomState: 2});\n //adding code here to retrieve results and display winner\n let dict = {}\n for(let i = 0; i<this.state.cardResults.length; i++){\n dict[this.state.cardResults[i].name] = this.state.cardResults[i].result\n }\n console.log(dict)\n try { //get options here if its not a cutsom room\n console.log(\"Attempting to send swipe results\");\n axios.post(\n 'http://localhost:3000/option/results', \n {roomCode: roomCode, results: dict}, \n {\n headers: {'Content-Type': 'application/json'},\n withCredentials: true\n }\n ).then(res => {\n console.log(res);\n console.log(\"Successfully finished result post request\")\n });\n } catch (err) {\n console.log(err);\n console.log(\"Failed to send results\");\n }\n\n this.forceUpdate()\n }", "function checkMissionApprovalVotes(){\n var mission = clientGame.missions[clientGame.missionNumber]; \n \n if(mission.acceptMissionVotes.length == clientGame.users.length){\n if(mission.acceptVotes > mission.rejectVotes){\n //send results to users\n //socket.emit(\"emitToSpecificUsers\", \"triggerMissionVote\", mission.selectedUsers);\n mission.approved = true;\n socket.emit('syncMasterGamestate', clientGame);\n generateView();\n console.log(\"MISSION ACCEPTED\");\n } else {\n clientGame.numMissionRejects++;\n\n clientGame.leaderIndex++;\n\n if(clientGame.leaderIndex >= clientGame.users.length){\n clientGame.leaderIndex = 0;\n }\n\n mission.leader = clientGame.users[clientGame.leaderIndex];\n mission.acceptVotes = 0;\n mission.rejectVotes = 0;\n mission.selectedUsers = [];\n\n mission.approved = false;\n socket.emit('syncMasterGamestate', clientGame);\n generateView();\n console.log(\"MISSION REJECTED\");\n }\n }\n\n console.log(mission.acceptMissionVotes);\n console.log(\"Accept votes \" + mission.acceptVotes);\n console.log(\"Fail votes \" + mission.rejectVotes);\n}", "function tally_votes() {\n Logger.log(\"Running Init\");\n clear_voting(); // start clean\n\n InitConfig();\n\n Logger.log(\"Running Filter Step\");\n filter_votes();\n\n Logger.log(\"Running tally\");\n var success = true;\n for (const vote_detail of VOTE_TYPE_ARRAY) {\n if(!tally_single_vote(vote_detail)) {\n success = false;\n break;\n }\n }\n\n Logger.log(\"Displaying output message\");\n // if(success)\n // Browser.msgBox(\"Vote Tallying complete - see Results tab.\");\n // else\n // Browser.msgBox(\"Vote Tallying failed.\");\n}", "async function renderVotes() {\n Votes.get();\n}", "function done() {\r\n\tif (verbose) console.log('done function')\r\n\tcurrentSong = tallyVotes()\r\n\tvotes = []\r\n}", "function checkMissionVotes(){\n var mission = clientGame.missions[clientGame.missionNumber]; \n \n if((mission.passVotes + mission.failVotes) == mission.selectedUsers.length){\n if(mission.failVotes < mission.requiredFails){\n //send results to users\n //socket.emit(\"emitToSpecificUsers\", \"triggerMissionVote\", mission.selectedUsers);\n mission.status = 1;\n mission.approved = null;\n clientGame.missionsPassed++;\n console.log(\"MISSION PASSED\");\n } else {\n clientGame.missionsFailed++;\n //anything else is a fail\n mission.approved = null; \n mission.status = 2;\n \n console.log(\"MISSION Failed\");\n }\n\n clientGame.leaderIndex++;\n if(clientGame.leaderIndex >= clientGame.users.length){\n clientGame.leaderIndex = 0;\n }\n clientGame.missions[clientGame.missionNumber + 1].leader = clientGame.users[clientGame.leaderIndex];\n\n //END GAME\n if(clientGame.missionNumber < 4 && clientGame.missionsPassed < 3 && clientGame.missionsFailed < 3){\n clientGame.missionNumber++;\n } else {\n //game over\n if(clientGame.missionsPassed > clientGame.missionsFailed){ //good wins\n clientGame.gameResult = true;\n\n var assassin;\n \n for(var i=0; i<clientGame.users.length; i++){\n if(clientGame.users[i].role == \"assassin\"){\n assassin = clientGame.users[i];\n break;\n }\n }\n\n socket.emit('emitToSpecificClient', 'attemptAssassination', assassin.clientId);\n\n } else {\n clientGame.gameResult = false; \n endGame(clientGame.gameResult);\n }\n }\n\n socket.emit('syncMasterGamestate', clientGame);\n generateView();\n }\n\n console.log(mission.acceptMissionVotes);\n console.log(\"Accept votes \" + mission.acceptVotes);\n console.log(\"Fail votes \" + mission.rejectVotes);\n}", "function results(){\n gameStart=false;\n correct=0;\n //checking if selected answer is correct\n var yes1=$(\"input#qb\").prop(\"checked\");\n var yes2=$(\"input#qf\").prop(\"checked\");\n var yes3=$(\"input#qg\").prop(\"checked\");\n //increase correct total with correct answer\n if(yes1===true){\n correct++;\n }\n if(yes2===true){\n correct++;\n }\n if(yes3===true){\n correct++;\n }\n if (correct===3){\n $(\"#timeRemain\").html(\"<h1>Right. Off you go.</h1>\");\n }\n else{\n $(\"#timeRemain\").html(\"<h1>Auuuuuuuugh!</h1>\"+\"YOU ONlY GOT \"+correct+\" CORRECT!\");\n }\n correct=0;\n clearTimeout(timerEnd);\n clearInterval(timerCount);\n $(\"#start\").prop(\"disabled\",false);\n }", "function wait() {\n game.sendMessage('Too few players. Resetting round...', 'info');\n reset();\n io.to(game.id).emit('roundStatus', status());\n }", "function wait(){\n $(\"#showAnswer\").hide().empty();\n if(questionCounter<8){\n stepforward();\n \n } else {\n console.log(\"gameover!\");\n finalResults();\n \n }\n}", "function results() {\n targetAnswer = triviaKey[questionCount].options[triviaKey[questionCount].answer];\n console.log(\"index of target: \" + triviaKey[questionCount].answer);\n console.log(\"target answer: \" + targetAnswer);\n console.log(\"results loaded\");\n // clear question, options and timer\n $(\"#question\").empty();\n $(\"#options\").empty();\n $(\"#timer\").empty();\n $(\"#result\").empty();\n\n // show results\n if (choice === triviaKey[questionCount].answer) {\n $('#result').html(\"You got it! The answer was <BR><BR>\" + targetAnswer);\n numAnsRight++;\n } else if (secsLeft < 1) {\n $('#result').html(\"Time's up! The answer was <BR><BR> \" + targetAnswer);\n numTimedOut++;\n } else {\n $('#result').html(\"Sorry, the answer was <BR><BR>\" + targetAnswer);\n numAnsWrong++;\n }\n\n // go to next question if there are more\n if (questionCount < triviaKey.length - 1) {\n questionCount++;\n secsLeft = 10;\n setTimeout(nextQuestion, 2000);\n }\n\n // finish game if no more questions\n else {\n secsLeft = 10;\n setTimeout(endGame, 2000);\n }\n }", "function voteForUser() {\n\n console.log(\"entering\");\n // sanity check\n // if (isDead)\n//\treturn;\n \n var participantName = $('#voteBox').value\n var reverseMap = getNameToIDMap();\n var participantID = reverseMap[participantName];\n console.log(\"Voting function entered\");\n\n\n // Locals\n var votesNeeded;\n var deadList = getDeadList();\n\n var newVoteCount;\n var deadListStringified;\n\n \n //////////////////////////////////////////////////\n /// Update the voting list \n /////////////////////////////////////////////////\n var votingList = getVotingList();\n\n console.log(\"Adding vote for participant: \", participantID);\n if (participantID in votingList) { \n\tcount = votingList[participantID];\n\tvotingList[participantID] = count + 1;\n } else {\n\tvotingList[participantID] = 0;\n }\n\n ///////////////////////////////////////////////////\n /// Check number of votes\n //////////////////////////////////////////////////\n if (timeOfDay == \"Night\") { \n\tif (participantRole != \"Mafia\") {\n\t // TODO: Throw an error of some kind\n\t return false;\n\t} \n\tvotesNeeded = liveMafia;\n } else { // Daytime\n\n\tvotesNeeded = getAlive();\n }\n\n \n\n if (_state[voteCountKey]) {\n\tnewVoteCount = parseInt(_state[voteCountKey]) + 1;\n } else {\n\tnewVoteCount = 1;\n }\n console.log(\"New vote count: \", newVoteCount);\n\n \n /////////////////////////////////////////////////\n // Push the dead list if necessary\n /////////////////////////////////////////////////\n if (newVoteCount == votesNeeded) {\n\n\tconsole.log(\"Number of votes needed to kill reached by participant: \", getParticipantID(), \" with vote number: \", newVoteCount);\n\n\tvar deadParticipant = findDeadPerson(votingList);\n\tconsole.log(\"Dead participant: \", deadParticipant);\n\tdeadList.push(deadParticipant);\n\tconsole.log(\"New dead list: \", deadList);\n\tnewVoteCount = 0;\n\tdeadListStringified = JSON.stringify(deadList);\n\tgapi.hangout.data.submitDelta( { deadListKey: deadListStringified\n\t\t\t\t });\n }\n\n ////////////////////////////////////////////////////////////\n /// Always update the new vote count and new voting list\n /////////////////////////////////////////////////////////////\n console.log(\"Participant: \", getParticipantID(), \" pushing new vote count: \", newVoteCount);\n stringVoteCount = \"\" + newVoteCount;\n serializedVotingList = JSON.stringify(votingList);\n gapi.hangout.data.submitDelta( { \"voteCount\" : stringVoteCount,\n\t\t\t\t \"votingList\" : serializedVotingList}\n\t\t\t\t\t );\t\t\t\t \n \n console.log(\"New vote count submitted\");\n // Post method cleanup\n //stopTimer();\n}", "function updateVote(result, status) {\n console.log(result);\n $('p.votes').text(result.voted); // update the current display value\n current_popup.find('p.votes').text(result.voted); // update the saved display value\n}", "async function showPeerEnableVote2() {\n // Log the justification from this student\n let mess = document.getElementById(\"messageText\").value;\n\n await logPeerEvent({\n sid: eBookConfig.username,\n div_id: currentQuestion,\n event: \"sendmessage\",\n act: `to:system:${mess}`,\n course: eBookConfig.course,\n });\n\n // send a request to get a peer response and display it.\n let data = {\n div_id: currentQuestion,\n course: eBookConfig.course,\n };\n let jsheaders = new Headers({\n \"Content-type\": \"application/json; charset=utf-8\",\n Accept: \"application/json\",\n });\n let request = new Request(\"/runestone/peer/get_async_explainer\", {\n method: \"POST\",\n headers: jsheaders,\n body: JSON.stringify(data),\n });\n let resp = await fetch(request);\n if (!resp.ok) {\n alert(`Error getting a justification ${resp.statusText}`);\n }\n let spec = await resp.json();\n let peerMess = spec.mess;\n let peerNameEl = document.getElementById(\"peerName\");\n // iterate over responses\n let res = \"\";\n for (let response in spec.responses) {\n res += `User ${response} answered ${answerToString(\n spec.responses[response]\n )} <br />`;\n }\n //peerNameEl.innerHTML = `User ${spec.user} answered ${answerToString(spec.answer)}`;\n peerNameEl.innerHTML = res;\n let peerEl = document.getElementById(\"peerJust\");\n peerEl.innerHTML = peerMess;\n let nextStep = document.getElementById(\"nextStep\");\n nextStep.innerHTML =\n \"Please Answer the question again. Even if you do not wish to change your answer. After answering click the button to go on to the next question.\";\n $(\".runestone [type=radio]\").prop(\"checked\", false);\n $(\".runestone [type=checkbox]\").prop(\"checked\", false);\n studentVoteCount += 1;\n studentSubmittedVote2 = false;\n let checkme = document.querySelector(\".runestone button\");\n if (checkme.innerHTML === \"Check Me\") {\n checkme.addEventListener(\"click\", function (event) {\n studentSubmittedVote2 = true;\n });\n }\n}", "function checkForNewVotes(){\r\n //trigger updates\r\n for (var i = 0; i < friendLists.length; i++ ){\r\n displayLatestMovies(i,0); //this temporarily shows the old votes\r\n fetchMovieList(i, 1);\r\n }\r\n}", "function vote() {\n\t$.post(\"servlets/VoteServlet\", \n\t\t{\n\t\t\tfacebook_id: user.id, \n\t\t\timage: $(\"#selectedPictureImg\").attr(\"src\"), \n\t\t\tname: user.name\n\t\t}, function(response) {\n\t\t\thideAll();\n\t\t\tif (response === 'already_voted') {\n\t\t\t\ttoLocation(\"#alreadyVoted\");\n\t\t\t} else {\n\t\t\t\ttoLocation(\"#thanksForVoting\");\n\t\t\t}\n\t\t\tif (tutorialMode) {\n\t\t\t\tfadeOut($(\"#votePopup\"));\n\t\t\t\tshowPopup($(\"#explorePopup\"), \"fadeInRightBig\");\n\t\t\t}\n\t\t\tgetChartData();\n\t\t}\n\t);\n}", "function checks(){\n\t\t// check if all players have voted.\n\n\t\t$.post('./handle/heartbeat.php',{},\n\t\t\tfunction(data){\n\t\t\t\tvar array = JSON.parse(data);\n\t\t\t\t// if the player is inactive, send them back to home screen\n\t\t\t\tif (array['checkPlayer'] == 1){\n\t\t\t\t\twindow.location.href= \"http://\"+location.host+\"/game\";\n\t\t\t\t}\n\t\t\t\telse{}\n\t\t\t\t\n\t\t\t\t// if everybody has voted, set a new black card and refresh the screen\n\t\t\t\tif (array['checkVote'] == 1){\n\t\t\t\t\t$('.player').removeClass('played');\n\t\t\t\t}\n\t\t\t\telse{}\n\t\t});\n\t}", "EndVoting() {\n this.votes = [];\n this.hasVoted = [];\n this.isVoting = false;\n this.queue = [];\n // Clear timeouts\n for (let value of this.timeouts.values()) {\n clearTimeout(value);\n }\n this.timeouts = new Map();\n }", "onVoteCandidate(id){\n this.props.contractInstance.vote(this.state.pollIndex, id,\n {gas:300000},(err,result) => {console.log(result);})\n }", "function voteForCandidate() {\n candidateName = $(\"#candidate\").val();\n contractInstance.IncrementVote(candidateName, {from: web3.eth.accounts[0]}, function() {\n let div_id = candidates[candidateName];\n $(\"#\" + div_id).html(contractInstance.NumVotes.call(candidateName).toString());\n });\n}", "finishQuestion() {\n this.stoptimer();\n this.allowAnwsers = false;\n this.scorePlayers();\n //show results\n this.generateRoundup().then((state) => {\n this.masters.forEach((socket) => {\n socket.emit('roundup', state);\n });\n });\n\n //nextquestion\n if (this.timer === null) {\n this.timer = setTimeout(() => {\n this.nextQuestion();\n }, 10 * 1000); //after 10s\n }\n }", "function _checkResults() {\n\t\t// decrement number of moves\n\t\t_numOfMoves--;\n\t\t\n\t\t// check if moves have expired and winner has not been found\n\t\tif(_numOfMoves === 0 && !_winnerFound) {\n\t\t\t_cat = true;\n\t\t\t$(\"#outcome\").html('Cat! Click on board to start new game.');\n\t\t}\n\t\t\n\t\tif(_winnerFound) {\n\t\t\t$(\"#outcome\").html(_winner + \" is the winner! Click on board to start new game.\");\n\t\t}\n\t}", "function readyForNextRound(id) {\n return storage.part.read(id).then((part) => {\n if (part.stage != stage.VIEW_RESULT) {\n return false;\n }\n return storage.exp.read(part.experimentId).then((exp) => {\n ++part.finishedRound;\n if (part.finishedRound == exp.settings.numRounds) \n part.stage = stage.FINAL;\n else if (exp.settings.kickEnabled)\n if (part.excluded) {\n part.exclusionVotes.push('None');\n part.stage = stage.WAIT;\n } else \n part.stage = stage.EXCLUSION_VOTE;\n else\n part.stage = stage.SELECT_CONTRIBUTION;\n return storage.part.update(part);\n }).then(() => {\n return true;\n });\n });\n}", "function refreshVotes() {\r\n $.ajax({\r\n url: './api.php',\r\n type: 'POST',\r\n data: {'cmd': 'getVotes'},\r\n success: function (data) {\r\n data = JSON.parse(data);\r\n if (!_.isEqual(data,voteData)) {\r\n var source = $('#vote-table-template').html();\r\n var template = Handlebars.compile(source);\r\n var html = template(data);\r\n voteData = data;\r\n\r\n var selected = $('input[name=vote]:checked').val();\r\n $('#vote-table').html(html);\r\n $('.radio #' + selected).prop('checked', true);\r\n console.log('votes refreshed!');\r\n } else {\r\n console.log('no new votes to update');\r\n }\r\n }\r\n })\r\n }", "function updateVotes(tag) {\n var c = tag.className;\n var id1 = $(tag).parent().parent().parent().parent().parent().attr('id');\n console.log(\"ID1 in Upvotes: \"+id1);\n var user, u;\n console.log(\"PURE ID: \"+id1);\n if(!id1.includes(\"and\"))\n \t{\n \tuser = $(tag).parent().parent().parent().parent().parent().next().next().children().next().next().next().children().attr('id');\n \tu = user.split(\"question\")[0];\n console.log(\"IN UPVOTES section, TRACING TO USERNAME; \"+u);\n \n \t} else{\n \t\tu = $(tag).parent().parent().parent().parent().parent().next().next().children().next().children().text();\n \t\tconsole.log(\"ITS AN ANSWER! :\"+ u);\n \t}\n id1 = id1+\"user\" +u +\"from\"+getUserId();\n console.log(\"CONTINUING IN UPVOTES, ID: \"+id1);\n var actualid;\n var type;\n var r = 0;\n var up, down;\n if (c.includes('top')) {\n\tr = parseInt($(tag).parent().parent().next().first().first().text()) + 1;\n\t$(tag).parent().parent().next().children().text(r);\n\tconsole.log(\"In UPVOTE section, r: \"+r);\n\t$.get(\"MainServlet\", {\n\t\ttype : \"upvote\",\n\t\tup : r,\n\t\tid : id1.split(\"votes\")[1]\n\t }, function(response){\n\t \tif(response === \"0\")\n\t \t\t{\n\t \t\t$(tag).parent().parent().next().children().text(r-1);\n\t \t\twindow.alert(\"You have already upvoted this item!\");\n\t \t\t}\n\t \tif(response === \"2\"){\n\t \t\t$(tag).parent().parent().next().children().text(r-1);\n\t \t\twindow.alert(\"You need to have at least 5 reputation points in this technology to vote!\");\n\t \t}\n\t });\n } else {\n\tr = parseInt($(tag).parent().parent().prev().first().first().text()) - 1;\n\t$(tag).parent().parent().prev().children().text(r);\n\t$.get(\"MainServlet\", {\n\t\ttype : \"downvote\",\n\t\tdown : r,\n\t\tid : id1.split(\"votes\")[1]\n\t }, function(response){\n\t \tif(response === \"0\")\n \t\t{\n\t \t$(tag).parent().parent().prev().children().text(r+1);\n \t\twindow.alert(\"You have already downvoted this item!\");\n \t\t} \n\t \tif(response === \"2\"){\n\t \t\t$(tag).parent().parent().prev().children().text(r+1);\n\t \t\twindow.alert(\"You need to have at least 5 reputation points in this technology to vote!\");\n\t \t}\n });\n }\n}", "TryEndVoting() {\n var [b_count, r_count, c_count] = this.GetVoteCounts();\n\n // If enough votes, end voting.\n if (b_count == 3) {\n var vote = \"b\";\n }\n else if (r_count == 3) {\n var vote = \"r\";\n }\n else if (c_count == 3) {\n var vote = \"c\";\n }\n else {\n // If 2 of each type, remove the last vote\n // Shouldn't ever reach this point\n if (this.votes.length == 6) {\n this.votes.pop();\n }\n return [false, null, null];\n }\n var players = this.queue.slice();\n this.EndVoting();\n return [true, vote, players];\n\n }", "voting() {\n return __awaiter(this, void 0, void 0, function* () {\n const deployed = this.requireDeployed();\n return yield deployed.methods.voting().call();\n });\n }", "function loadVotes(that) {\n var voteBox = $(that).find(\".votes\");\n\n var item = $(voteBox).closest(\".listItem\");\n var eind = $(\".list .listItem\").index(item);\n $.ajax({\n url: \"/api/vote\",\n method: 'POST',\n data: {\n listid: listid,\n entryind: eind,\n vote: 100\n },\n success: function(data, status, jqxhr) {\n $(voteBox).html(\"<div><b>\" + data.score + \"</b>&#9829;</div>\");\n // default is 0, so only change if 1\n if (parseInt(data.current_vote) === 1) {\n $(voteBox).next().css(\"background-position\", \"-10.5em 0\");\n }\n return data.cur_score;\n }\n });\n}", "function getReward()\n\n{\n //Reset Votes\n cb.tipOptions(function(user) {\n return;\n });\n \n //Initalize Highest Vote\n var highestVotes = 0;\n \n //List All Players\n for (var i=0;i<players.length;i++\n )\n {\n //If the player has more votes\n if (players[i].votes > highestVotes\n )\n {\n //YES\n //Save the High Vote User\n cbWinner = players[i].cbuser;\n \n //Update High Vote\n highestVotes = players[i].votes;\n \n }\n else\n {\n //NO\n }; //end of IF [If the player has more votes]\n \n }; //end of FOR [List All Players]\n \n //Check if anyone voted\n if (highestVotes != 0\n )\n {\n //YES\n //Did the broadcaster win?\n if (cbWinner == cb.room_slug\n \n )\n {\n //YES\n //Get Prize\n lastPrize = 'Nothing';\n \n //Announce Winner And Prize\n cb.chatNotice(cb.room_slug + ' just won. Better luck next time.\\n Next round will start in 10 seconds.', '', 'gold','red', 'bold');\n \n }\n else\n {\n //NO\n //Get a real prize\n getPrize();\n \n //Announce Winner And Prize\n cb.chatNotice(cbWinner + ' just won ' + lastPrize + '\\n Next round will start in 10 seconds.', '', 'gold','red', 'bold');\n \n }; //end of IF [Did the broadcaster win?]\n \n }\n else\n {\n //NO\n //Get Prize\n lastPrize = 'Nothing';\n \n //Announce Winner And Prize\n cb.chatNotice('No one voted. ' + cb.room_slug + ' wins by default.\\n Next round will start in 10 seconds.', '', 'gold','red', 'bold');\n \n }; //end of IF [Check if anyone voted]\n \n //Allow Setup Again\n setupComplete = false;\n \n //Reinitialize\n cb.setTimeout(init2, 10000);\n \n}", "function checkResult(playerChoice) {\r\n resetSelected()\r\n computerRandomChoice()\r\n displayComputerChoice()\r\n updateScore(playerChoice)\r\n}", "function processOutcome() {\n if (userObject.currentSelection && opponentObject.currentSelection) {\n let playerSelections = {\n user: userObject.currentSelection,\n opponent: opponentObject.currentSelection\n };\n let result = determineOutcome(playerSelections);\n currentRound++;\n if (result == \"win\") {\n userWins({ playerSelections: playerSelections, source: \"selections\" });\n } else if (result == \"tie\") {\n userTies({ playerSelections: playerSelections, source: \"selections\" });\n } else if (result == \"lose\") {\n userLoses({ playerSelections: playerSelections, source: \"selections\" });\n }\n }\n }", "function waitForOpponent() {\n\t$.ajax({\n\t\ttype : 'GET',\n\t\turl : '/api/update_matches',\n\t\tsuccess: checkForBattles\n\t});\n}", "function wait() {\n if (questionsFinished < 9) {\n questionsFinished++;\n timeCounter = 20;\n clearGameArea();\n setTimeLimit();\n whatsInTheBox();\n }\n else {\n scoreScreen();\n }\n}", "function correctAnswerClicked() {\n console.log(\"correct answer\");\n correctAnswerCount++;\n $(\"#correct-answers-view\").html(correctAnswerCount);\n $(\".footer\").html(\"Correct!!! <br>Waiting 5 seconds to go next!\");\n \n stop();\n waitBeforeGoingNextAutomatically();\n\n}", "function checkIfDone(){\n\tif(remainingSlides === 0 | remainingSlides < 0){\n\t\tconsole.log(\"DONE\");\n\t\t$(\"#quiz\").css(\"display\", \"none\");\n\t\t$(\"#results\").css(\"display\", \"block\");\n\t\tvar totalAgainstNN = liked/totalSlides*100;\n\t\tif (totalAgainstNN >= 50.0){\n\t\t\t$(\"#foragainst\").text(\"for\");\n\t\t\t$(\"#foragainst2\").text(\"for\");\n\t\t\t$(\"#magicNum\").text(Math.round(totalAgainstNN));\n\t\t\t$(\"#folksAgainstNN\").css(\"display\", \"block\");\n\t\t} else {\n\t\t\t$(\"#foragainst\").text(\"against\");\n\t\t\t$(\"#foragainst2\").text(\"against\");\n\t\t\t$(\"#magicNum\").text(Math.round(100-totalAgainstNN));\n\t\t\t$(\"#folksForNN\").css(\"display\", \"block\");\n\t\t}\n\t}\n}", "function handleUserVote(event) {\n console.log('Round = ' + votingRounds);\n votingRounds++;\n\n var userSelection = event.target;\n console.log('The user clicked ' + userSelection.id);\n\n if (userSelection.id === 'left-catalog-image') {\n imgLeft.votes++;\n } else if (userSelection.id === 'center-catalog-image') {\n imgCenter.votes++;\n } else {\n imgRight.votes++;\n }\n\n // Stop listening for click events and render results to the DOM after the 25th round\n if (votingRounds > 25) {\n leftCatalogImage.removeEventListener('click', handleUserVote);\n centerCatalogImage.removeEventListener('click', handleUserVote);\n rightCatalogImage.removeEventListener('click', handleUserVote);\n\n // Sorts CatalogItem instances by votes\n CatalogItem.sortVotes();\n\n // Stores results on local machine\n localStorage.setItem('results', JSON.stringify(CatalogItem.allItems));\n }\n\n CatalogItem.pickNewCatalogItems();\n}", "function wait() {\n if (position < 9) { //this number can be changed depending on how many qustion we have.\n position++;\n generateQuestions();\n counter = 30;\n timerWrapper();\n } else {\n finalScreen()\n };\n\n }", "function _submitAnswer() {\n // checks if answer is correct\n if (vm.answerSelected == vm.questionSelected.Correct) {\n toastr.success(\"Correct!\");\n // add +1 to correct\n vm.answerScore.Correct++;\n } else {\n toastr.error(\"Wrong!\");\n // add +1 to incorrect\n vm.answerScore.Incorrect++;\n }\n // waits then runs _next question \n setTimeout(_nextQuestion, 1000);\n }", "function gameStatus() {\n\tpairsToGuess--;\n\tif (pairsToGuess == 0) {\n\t\ttoStopWatch(); //stop the stopwatch\n\t\tsetTimeout(function() { //display result popup\n\t\t\tdisplayResult(); //to put results to the modal\n \t\tmodalResult(); // to show modal with results\n \t\t}, 500); \n\t} else {\n\t\t\n\t}\n}", "async function sendResults(){\n\n //I create a basic array of highlights to send\n let dataToSend = filterVotes.map((filterVote, index) => {\n if(filterHighlights[index].length === 1 && filterHighlights[index][0].type === \"not_highlighted\"){\n return {...filterVote, filterHighlights: []};\n }else{\n return {...filterVote, filterHighlights: filterHighlights[index]};\n }\n });\n\n //I create the object to send\n let screeningData = {\n project_paper_id: paperData.id,\n vote:{\n metadata: {type: \"multi-predicate\", highlights: dataToSend, tags: tagsData}\n }\n };\n\n //I check if all filter have been screened\n if(filterVotes.findIndex((vote) => (vote.outcome === \"\")) === -1){\n //I set the vote submission to true so this way the form will be disabled while it sends data\n setVoteSubmission(true);\n\n //call the dao\n let resx = await projectScreeningDao.submitVote(screeningData);\n \n //error checking\n if (mountRef.current && resx && resx.message) {\n //pass error object to global context\n appConsumer.setError(resx); \n }\n //if successfull submission\n else if(mountRef.current && resx.data){\n //I trigger the effect to get a new paper\n setNextPaper(!nextPaper);\n //I reset all votes so they're ready for the new paper\n setFilterVotes(filtersList.map((filter) => ({filter_id: filter.id, filter_predicate: filter.data.predicate, outcome: \"\"})));\n setVoteSubmission(false);\n } \n }\n }", "function getUserVoting(){\n\tMongoClient.connect(url, (err, db) => {\n\t\tsumVoting(db, (result) => {\n\t\t\tdb.close();\n\t\t\tconsole.log(\"getUserVoting\", result);\n\t\t});\n\t});\n\tvar sumVoting = (db, callback) => {\n\t\tvar tod = Date.now() - 1000*60*60*24;\n\t\tvar tod1 = Date.now();\n\t\tvar agr = [\n\t\t\t{$match: {account: {$exists:true, $ne: null}}},\n\t\t\t{$match : {date : {$gt:tod, $lt:tod1} }},\n\t\t\t{$group: {_id:\"$account\", vote : { $sum : \"$voting\"}}}];\n\t\tvar dbo = db.db(\"heroku_dg3d93pq\");\n\t\tvar cursor = dbo.collection('board').aggregate(agr).toArray( (err, res) => {\n\t\t\t//console.log(res);\n\t\t\ttotalUser = res.length;\n\t\t\t//update each users token in their wallet\n\t\t\tgetTotalVoting(res);\n\t\t\tfor(i = 0; i < res.length;i++){\n\t\t\t\tsetWallet(res[i]._id, res[i].vote, distributionForDay);\n\t\t\t}\n\t\t});\n\t};\n}", "function loopVotes() {\n addToConsole(\"Database generated\");\n var votes = $('#list-of-votes').val().split('\\n');\n addToConsole(\"Vote list generated\");\n while (votes.length > 0) {\n addToConsole('Getting information for ' + votes[0]);\n for (var x = 0; x < delegateDatabase.length; x++) {\n if (delegateDatabase[x]['username'] === votes[0]) {\n publicKeys.push(\"+\" + delegateDatabase[x]['publicKey']);\n addToConsole('Public key for ' + votes[0] + ' is found.');\n votes.splice(0, 1);\n break;\n }\n }\n if (votes.length == 0) split();\n }\n}", "function pollGetTotalVotes(e, optionid) {\n\n e.preventDefault();\n\n var $el = ga(e.target);\n var pollId = $el.attr('id').split('pollmiv|')[1];\n\n var poll_participants = '';\n var poll_u_markup_schel = '<div id=\"modal_cnt\" class=\"modal_cnt\">\\\n\t\t\t\t\t<div data-block=\"ShowLikers\" class=\"loader-container\">\\\n\t\t\t\t\t<ul class=\"cardsList jbpop\"></ul></div></div>';\n\n var p_u_markup = '<li class=\"cardsList_li show-on-hover\">\\\n <div class=\"userCard\">\\\n <div class=\"card_main\">\\\n <div class=\"card_wrp\">\\\n <div class=\"photoWrapper\">\\\n <a class=\"photoWrapper\" href=\"/user/%uid\" hrefattr=\"true\"><img src=\"/getPhoto?p=%pid&sz=thumb&g=%gender\" alt=\"%uname\" width=\"128\" height=\"128\">%online</a>\\\n </div>\\\n </div>\\\n </div>\\\n <div class=\"card_add\">\\\n <div class=\"ellip\"><a href=\"/user/%uid\" class=\"o\" hrefattr=\"true\">%uname</a></div>\\\n </div>\\\n </div>\\\n </li>';\n\n\n var jb_ = new jBox('Modal', {\n id: 'forpoll' + pollId,\n title: lang.poll_participants,\n fade: false,\n closeButton: 'box',\n 'fixed': true,\n height: 'auto',\n width: '818px',\n minHeight: '100px',\n position: {\n x: 'center', // Horizontal Position (Use a number, 'left', 'right' or 'center')\n y: 'top' // Vertical Position (Use a number, 'top', 'bottom' or 'center')\n },\n offset: {\n x: 0,\n y: 30\n },\n onClose: function() {\n ga('#forpoll' + pollId).remove();\n\n }\n });\n jb_.open()\n .ajax({\n type: 'POST',\n url: '/cmd.php',\n data: {\n cmd: 'pollParticipants',\n sondageid: pollId,\n optionid: optionid ? optionid : 0,\n view_as: 'json'\n },\n\n reload: true,\n setContent: false,\n success: function(data) {\n var d = validateJson(data);\n\n if(d.succ == 1) {\n\n ga('#forpoll' + pollId).find('.jBox-content').html(poll_u_markup_schel);\n\n for(var i = 0; i < d.data.length; i++) {\n var b = d.data[i];\n poll_participants += p_u_markup.replace(/%uid/g, b.uid).replace(/%pid/g, b.uphoto).replace(/%uname/g, b.uname).replace('%gender', b.ugender).replace('%online', b.online ? '<span class=\"ic-online\"></span>' : '');\n\n }\n\n\n ga('#forpoll' + pollId).find('ul.cardsList').html(poll_participants);\n } else {\n\n displayErr(d.err);\n\n }\n\n }\n });\n}", "function voteResults(opts) {\n bot.editMessageText(\"Получаем список, вашему запросу присвоен ID: \" + transactionId, opts);\n\n showCandidatesListResponse(opts);\n}", "function waitForReturn() {\n // console.log(\"waiting: \" + $(\"body\").data(\"dblReturn\"));\n if($(\"body\").data(\"dblReturn\") == 1)\n return;\n setTimeout(waitForReturn, 50);\n }", "function getBallot(address) {\n if(gapi.client.civicinfo == null) {\n alert(\"Please make sure you're logged in with your Packer email\");\n return logout();\n }\n return gapi.client.civicinfo.elections.voterInfoQuery({\n \"address\": address,\n \"electionId\": electionId\n })\n .then(function(response) {\n let data = response.result;\n // Handle the results here (response.result has the parsed body).\n $('.container').hide();\n let ballot = $('#ballot');\n ballot.empty();\n ballot.show();\n\n // console.log(\"Response\", response);\n electionName = data.election.name\n $(\"#ballot\").append($(\"<div class='row'><h1>\" + electionName + \"</h1></div>\"));\n for(let r in data.contests) {\n let race = data.contests[r];\n let row = $(\"<div><h3>\" + race.ballotTitle + \"</h3></div>\");\n row.append($(\"<div><h6>\" + race.district.name + \"</h6></div>\"));\n\n for(let candidate of race.candidates) {\n let div = $('<div class=\"form-check\"></div>');\n let input = $('<input class=\"form-check-input\" race=\"' + race.district.name + '\" name=\"' + race.ballotTitle + '\" type=\"radio\" value=\"' + candidate.name + '\">');\n let label = $('<label class=\"form-check-label\">' + candidate.name + ' (' + candidate.party + ') </label><br>');\n div.append(input, label);\n row.append(div);\n }\n ballot.append(row, $(\"<br>\"));\n }\n ballot.append($('<button type=\"button\" class=\"btn btn-dark\" onclick=\"vote()\">Vote</button>'));\n\n let votingInfo = $('#realVoting');\n let earlyVoting = $('#earlyVoting');\n let electionDay = $('#electionDay');\n if(data.earlyVoteSites != null) {\n let evs = data.earlyVoteSites[0];\n earlyVoting.append($(\"<br><h3>Early Voting</h3>\"));\n earlyVoting.append($(\"<p>Your early voting site is:</p>\"));\n earlyVoting.append($(\"<p>\" + evs.address.locationName + \"<br>\" + evs.address.line1 + \"<br>\" + evs.address.city + \", \" + evs.address.state + \"<br>\" + evs.address.zip + \"</p>\"));\n earlyVoting.append($(\"<p>\" + evs.pollingHours.replace(/\\n/g, \"<br>\") + \"</p>\"));\n }\n if(data.pollingLocations != null) {\n let pl = data.pollingLocations[0];\n electionDay.append($(\"<br><h3>Election Day</h3>\"));\n electionDay.append($(\"<p>Your election day pollsite is:</p>\"));\n electionDay.append($(\"<p>\" + pl.address.locationName + \"<br>\" + pl.address.line1 + \"<br>\" + pl.address.city + \", \" + pl.address.state + \"<br>\" + pl.address.zip + \"</p>\"));\n electionDay.append($(\"<p>\" + pl.pollingHours.replace(/\\n/g, \"<br>\") + \"</p>\"));\n }\n votingInfo.show();\n },\n function(err) { console.error(\"Execute error\", err); });\n}", "onVote(candidate) {\n console.log(`Vote for ${candidate.name}`);\n candidate.votes++;\n this.candidates.sort(function (a, b) {\n return a.votes - b.votes;\n });\n this.candidates.reverse();\n const reducer = ((accumulator, currentValue) => ({ votes: accumulator.votes + currentValue.votes }));\n const totalVotes = this.candidates.reduce(reducer);\n console.log(totalVotes);\n this.findPercentage(totalVotes);\n }", "async roundRun() {\n\n\n this.pushTextSimulation(\"<p>----- Round: \" + this.round + \"-------------\" + \"</p>\")\n var _this = this;\n var i = 0;\n var flag = false;\n await Promise.all(this.players.map(async item => {\n var dice = [];\n var temp = [];\n dice = await _this.requestRandom();\n temp.push(dice)\n // waiting for request api\n Promise.all(temp).then(result => {\n var dice_random = result[0]\n var element_log = {\n come: false,\n current: item.player_current_position,\n become: \"\",\n comeValue: \"\",\n player: item.player_name\n }\n if (_this.flag_loop == true) {\n\n if (dice_random < 0) {\n element_log.come = true\n }\n element_log.comeValue = dice_random\n item.player_current_position = _this.getComeGoal(this.target, dice_random, item.player_current_position)\n element_log.become = item.player_current_position;\n if (dice_random < 0) {\n\n _this.pushTextSimulation(\"<p>Player: <span class='player_name'>\" + item.player_name + \"</span> back <span class='back'>\" + Math.abs(dice_random) + \"</span> step\" + \" current step is: <span class='current'>\" + item.player_current_position + \"</span></p>\");\n } else if (dice_random > 0) {\n _this.pushTextSimulation(\"<p>Player: <span class='player_name'>\" + item.player_name + \"</span> come <span class='come'>\" + Math.abs(dice_random) + \"</span> \" + \" step\" + \" current step is: <span class='current'>\" + item.player_current_position + \"</span></p>\");\n\n } else if (dice_random == 0) {\n _this.pushTextSimulation(\"<p>Player: <span class='player_name'>\" + item.player_name + \"</span> Still here at step <span class='current'>\" + item.player_current_position + \"</span></p>\");\n }\n\n if (item.player_current_position == this.target) {\n _this.text_log.logs.push(element_log)\n _this.flag = false;\n _this.pushTextSimulation(\"<p>************✨✨ <b style='color:#f70000'>PLAYER: \" + item.player_name + \" winner \" + \"</b>✨✨*****************\" + \"</p>\")\n _this.flag_loop = false;\n _this.text_log.player_winner = item.player_name\n //handle save log\n if (localStorage.getItem(\"logs\")) {\n var logs = localStorage.getItem(\"logs\");\n logs = JSON.parse(logs);\n logs.push(_this.text_log)\n localStorage.setItem(\"logs\", JSON.stringify(logs));\n } else {\n var logs = [];\n logs.push(_this.text_log)\n localStorage.setItem(\"logs\", JSON.stringify(logs));\n }\n\n } else {\n _this.text_log.logs.push(element_log)\n _this.flag = true;\n\n }\n\n\n }\n\n })\n }))\n\n await this.checkContinue(this.flag);\n\n }", "async vote(arg) {\n const userVote = await this.validateData(arg.voteId);\n if (userVote == null) {\n this.totalVoted += 1;\n await this._db();\n return { message: \"VoteTimePassed\" };\n }\n const input = {\n function: \"vote\",\n voteId: arg.voteId,\n userVote: userVote\n };\n let receipt;\n let tx;\n if (arg.direct)\n tx = await this._interactWrite(input);\n else {\n const caller = await this.getWalletAddress();\n // Vote must be a string when indirect voting through bundler\n input.userVote = userVote.toString();\n const payload = {\n vote: input,\n senderAddress: caller\n };\n receipt = await this._bundlerNode(payload);\n }\n if (tx) {\n this.totalVoted += 1;\n await this._db();\n return { message: \"justVoted\" };\n }\n if (!receipt)\n return null;\n if (this.db !== undefined && receipt.status === 200) {\n if (receipt.data.message == \"success\") {\n this.totalVoted += 1;\n const data = receipt.data.receipt;\n const id = await this._db();\n await this.db.update({ _id: id }, { $push: { receipt: data } });\n this.receipts.push(data);\n return { message: \"success\" };\n }\n else if (receipt.data.message == \"duplicate\") {\n this.totalVoted += 1;\n await this._db();\n return { message: \"duplicatedVote\" };\n }\n }\n else {\n this.totalVoted += 1;\n await this._db();\n return { message: receipt.data.message };\n }\n // Status 200, but message doesn't match.\n return null;\n }", "submitQuiz() {\n let totalCorrect = 0\n let hasSelection = false\n for (let mcq of this.mcqs) {\n let isCorrect = true\n for (let choice of mcq.choices) {\n if (choice.isSelected) {\n hasSelection = true\n if (!choice.isCorrect) {\n isCorrect = false\n break\n }\n }\n }\n\n if (isCorrect && hasSelection) {\n totalCorrect++\n }\n }\n\n console.log()\n console.log(\n `Your score for ${this.category} quiz is: ${totalCorrect}/${this.mcqs.length}`\n )\n\n // Call promise's resolve to end the quiz\n this.onEndQuiz()\n }", "function checkMyAnswer(){\n if (number === (spot)){\n isCorrect=true; \n $(\"#gradeCorrect\").find($(\"#gradeCorrectTitle\")).text(\"Congratulations\"); \n let giphyUrl= `https://api.giphy.com/v1/gifs/search?q=${favoriteAnimal}&api_key=${apiKey}&limit=1&offset=${giphyCount}&rating=g&lang=en`; \n let imgUrl=null; \n $.ajax({\n url: giphyUrl,\n method: \"GET\"\n }).then(function(response){\n giphyCount++; \n imgUrl= response.data[0].images.original.url;\n $(\"#gradeCorrect\").find($(\".modal-body\")).html(`You are right!<br> <img class=\"celebrate\" src=\"${imgUrl}\"> <br>Good job.`); \n answerSound(\"correct\");\n $(\"#gradeCorrect\").find($(\".results\")).attr(\"id\", \"tryAgain\");\n $(\"#gradeCorrect\").find($(\".results\")).text(\"Play Again!\");\n $(\"#gradeCorrect\").find($(\".results\")).on(\"click\", function(){\n if (isCorrect){\n generateNumber();\n moveAllBeadsLeft();\n }\n }); \n }); \n } else {\n isCorrect=false; \n $(\"#gradeCorrect\").find($(\"#gradeCorrectTitle\")).text(\"On No!\"); \n $(\"#gradeCorrect\").find($(\".modal-body\")).html(\"Your count is not right<br> <br>Make sure the number of beads is the same as the number of stars.\");\n answerSound(\"incorrect\"); \n $(\"#gradeCorrect\").find($(\".results\")).attr(\"id\", \"goBack\");\n $(\"#gradeCorrect\").find($(\".results\")).text(\"Let me try again!\"); \n }\n}", "function verdict(pickedID,houseID, gameMode){\n let scores= parseInt(document.querySelector('#scores').textContent);\n \n setTimeout(() => {\n // if(houseID == 2 && pickedID==3|| houseID==3&&pickedID==1||houseID==1&&pickedID==2){\n // verdictDisplay.textContent='YOU WIN';\n // scores+=1;\n // // document.querySelector('#scores').textContent = 8\n \n \n // }\n if(pickedID>houseID&& houseID!=1||pickedID==1&&houseID==gameMode||houseID==1&&1<pickedID<=gameMode){\n verdictDisplay.textContent='YOU WIN';\n scores+=1;\n }\n // if(pickedID>houseID&& houseID!=1||pickedID>houseID&&pickedID!=2||pickedID==1&&houseID==gameMode){\n // verdictDisplay.textContent='YOU WIN';\n // scores+=1;\n // }\n \n else if(houseID==pickedID){\n verdictDisplay.textContent= 'A DRAW';\n scores+=0;\n } else{\n verdictDisplay.textContent= 'YOU LOSE';\n scores-=1;\n }\n document.querySelector('#scores').textContent= scores;\n \n }, 1000);\n}", "completeRound(winner) {\n var setJudge = true;\n const playerInfo = this.state.playerInfo;\n for(var i = 0; i < playerInfo.length; i++) {\n if(playerInfo[i].name === winner) {\n playerInfo[i].score++;\n }\n if(playerInfo[i].isJudge && setJudge) {\n playerInfo[i].isJudge = false;\n if(i < playerInfo.length - 1) {\n playerInfo[i + 1].isJudge = true;\n } else {\n playerInfo[0].isJudge = true;\n }\n setJudge = false\n }\n }\n }", "stepShowdown(votingPlayer, votedPlayer) {\n // check for handshake completion\n if (votingPlayer.showdownVotes[this.getNameFromPlayer(votedPlayer)]) {\n if (votingPlayer.role === Player.MAFIA || votedPlayer.role === Player.MAFIA) {\n this.gameState = MAFIA_WIN;\n }\n else {\n this.gameState = TOWN_WIN;\n }\n }\n }", "function voteForCandidate(userId, voteNum, opts) {\n voteNum += 1;\n //call api method vote(num, userData, callBack)\n bot.editMessageText(\"Вы выбрали кандидата с номером \" + (voteNum) + \", вашему запросу присвоен ID: \" + transactionId, opts);\n bot.sendMessage(opts.chat_id, \"[\" + transactionId + \"]: \" + \"Проверяем кошелек, ожидайте...\");\n\n getUserKeys(userId, opts, function(userKeys) {\n userKeys.address = '0x' + userKeys.address;\n bot.sendMessage(opts.chat_id, \"[\" + transactionId + \"]: \" + \"Голосуем с адреса \" + userKeys.address);\n vote(voteNum, userKeys, function(err, transactionHash) {\n if(err) {\n bot.sendMessage(opts.chat_id, \"[\" + transactionId + \"]: \" + \"Error occurred: \" + err);\n console.log(err);\n } else {\n var initialText = \"Голос отправлен за кандидата №\" + voteNum + \"\\r\\n\" +\n \"Транзакция: https://rinkeby.etherscan.io/tx/\" + transactionHash + \"\\r\\n\";\n var waitingText = initialText + \"Ожидайте результатов ...\";\n bot.sendMessage(opts.chat_id, \"[\" + transactionId + \"]: \" + waitingText);\n\n //now wait for transaction\n confirmVote(transactionHash, initialText, opts);\n }\n });\n });\n}", "function afterWait(vArgs) {\r\n\t\tvar quest = vArgs[0];\r\n\t\tvar actor = vArgs[1];\r\n\t\tvar unlockedQuests = actor.getUnlockedQuests(quest.name);\r\n\t\tif (unlockedQuests && unlockedQuests.length > 0) {\r\n\t\t\tvar end = \"\";\r\n\t\t\tif (unlockedQuests.length > 1) {\r\n\t\t\t\tend = \"s\";\r\n\t\t\t}\r\n\t\t\tvar masterVnums = [];\r\n\t\t\tvar questNames = [];\r\n\t\t\tfor (var _autoKey in unlockedQuests) {\r\n\t\t\t\tvar quest = unlockedQuests[_autoKey];\r\n\t\t\t\tif (quest.ownerVnums.length > 0) {\r\n\t\t\t\t\tfor (var _autoKey in actor.isQuestAvailable(quest.name)[1]) {\r\n\t\t\t\t\t\tvar num = actor.isQuestAvailable(quest.name)[1][_autoKey];\r\n\t\t\t\t\t\tif (arrContains(masterVnums, num) == false) {\r\n\t\t\t\t\t\t\tmasterVnums.push(num);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tquestNames.push(quest.name);\r\n\t\t\t}\r\n\t\t\tactor.send(bld + \"You have unlocked the following quest\" + end + \": \" + nrm + grn + questNames.join(nrm + bld + \", \" + nrm + grn) + nrm + bld + \".\\n\" + nrm);\r\n\t\t\tfor (var _autoKey in unlockedQuests) {\r\n\t\t\t\tvar quest = unlockedQuests[_autoKey];\r\n\t\t\t\tif (quest.ownerVnums.length == 0) {\r\n\t\t\t\t\tactor.journalEdit(\"ADD\", quest.name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (var _autoKey in masterVnums) {\r\n\t\t\t\tvar vnum = masterVnums[_autoKey];\r\n\t\t\t\tvar count = 0;\r\n\t\t\t\tfor (var _autoKey in unlockedQuests) {\r\n\t\t\t\t\tvar quest = unlockedQuests[_autoKey];\r\n\t\t\t\t\tif (arrContains(quest.ownerVnums, vnum))\r\n\t\t\t\t\t\t++count;\r\n\t\t\t\t}\r\n\t\t\t\tvar mobName = getMobName(vnum);\r\n\t\t\t\tif (count == 1)\r\n\t\t\t\t\tactor.send(bld + cyn + capFirstLetter(mobName) + nrm + bld + \" has a new quest for you.\" + nrm);\r\n\t\t\t\telse if (count > 1)\r\n\t\t\t\t\tactor.send(bld + cyn + capFirstLetter(mobName) + nrm + bld + \" has new quests for you.\" + nrm);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function check() {\n if (done) {\n /* \n \n Place your code here!\n \n */\n console.log(holders)\n } else {\n setTimeout(check, 50)\n }\n}", "async pollState() {\n while (this.state == \"theirturn\" || this.state == \"waiting\") {\n await this.wait(1000);\n await this.fetchCurrentGame();\n }\n }", "function voter() {\n var idVotes= $(this).parentsUntil('blockquote').find('u').attr('name');\n console.log(idVotes);\n var data = {'idVotes': idVotes}; \n $.ajax({\n data: data,\n url: '../inc/Votes.inc.php', \n type: 'Post',\n success: function (responseText) { \n if(responseText===\"Error\"){\n $('button[name='+idVotes+']').addClass(\"disabled\"); \n }\n else{\n $('u[name='+idVotes+']').text(responseText);\n }\n },\n error: function () {\n }\n });\n}", "stepVotingState(votedPlayer, gs) {\n // only apply vote effect if there are actually votes (ie the round was not skipped)\n if (votedPlayer.voteCountInGameState(gs) > 0) {\n votedPlayer.finalizeVoted(gs);\n votedPlayer.clearAllVotes();\n }\n // votes should only pass game through voting stages, MAFIA is first, TOWN is last\n this.gameState = (gs % TOWN_TIME) + MAFIA_TIME;\n // transition to TOWN_TIME should should apply mafia votes\n if (this.gameState === TOWN_TIME) {\n this.applyMafiaVote();\n this.clearAllVotesAndResetTargets();\n }\n this.updateRoleCounts();\n // if two innocents left, it's time for a showdown\n if (this.getInnocentPlayerCount() <= 2) {\n this.gameState = SHOWDOWN;\n }\n }", "function checkResult() {\n var valCounts = [0,0,0];\n _.each($('.slot-boxes'), function(el) {\n if ($(el).position().top <= 38 && $(el).position().top > -94) {\n valCounts[1]++;\n } else if ($(el).position().top <= -94 && $(el).position().top > -216) {\n valCounts[2]++;\n } else if ($(el).position().top <= -216 && $(el).position().top > -338) {\n valCounts[0]++;\n } else {\n valCounts[1]++;\n }\n });\n\n var result;\n var beverageNames = ['coffee', 'espresso', 'tea'];\n for(var i = 0; i < valCounts.length; i++) {\n if (valCounts[i] >= 3) {\n result = beverageNames[i];\n }\n }\n\n if (result) {\n handleWinner(result);\n }\n }", "function updateVotingProgress (progress) {\n var quorum = progress.quorum\n var total = progress.total\n var collected = progress.collected * 100 / total\n var missing = quorum - collected\n if (missing > 0) {\n document.getElementById('prog').title = progress.collected +\n ' collected slips out of ' + total + ' eligible members \\n' +\n 'Quorum at ' + Math.ceil(total * quorum / 100) + ' votes.'\n document.getElementById('prog-collected').style.width = collected + '%'\n document.getElementById('prog-collected').class = 'progress-bar'\n document.getElementById('prog-missing').style.width = missing + '%'\n document.getElementById('prog-missing').class = 'progress-bar'\n document.getElementById('prog-missing').classList.add('progress-bar')\n document.getElementById('prog-missing').classList.add('progress-bar-warning')\n document.getElementById('prog-missing').classList.add('progress-bar-striped')\n } else {\n document.getElementById('prog').title = progress.collected +\n ' collected slips out of ' + total + ' eligible members; \\n' +\n 'Quorum at ' + Math.ceil(total * quorum / 100) + ' votes is reached.'\n document.getElementById('prog-collected').style.width = quorum + '%'\n // document.getElementById('prog-collected').class = \"progress-bar-success\"\n document.getElementById('prog-collected').classList.remove('progress-bar-warning')\n document.getElementById('prog-collected').classList.add('progress-bar-success')\n // prog-missing now means \"extra votes after quorum has been reached.\"\n document.getElementById('prog-missing').style.width = -missing + '%'\n document.getElementById('prog-missing').class = 'progress-bar'\n document.getElementById('prog-missing').classList.add('progress-bar')\n document.getElementById('prog-missing').classList.remove('progress-bar-warning')\n // document.getElementById('prog-missing').classList.add('progress-bar-success')\n document.getElementById('prog-missing').classList.remove('progress-bar-striped')\n }\n}", "function votedown(){\n unsafeWindow.vote(getItem(\"voteDown\"));\n}", "function checkSelection() {\n console.log(\"check selection function reached\");\n \n // hide the questionAsked board and stop the timer\n $(\"#questionAsked\").hide();\n clearInterval(counter);\n $(\"#timerDiv\").html(\"&nbsp;\");\n \n // if answer was right\n if (userGuess.data(\"value\") == allQuestionsArray[gameVariables.currentQuestion].correctAnswer) {\n console.log(userGuess.data(\"value\"));\n console.log(\"correct\");\n // run the correctAnswer function\n correctAnswer();\n }\n // else if answer was wrong\n else {\n console.log(userGuess.data(\"value\"));\n console.log(\"incorrect\");\n // run the incorrectAnswer function\n incorrectAnswer();\n }\n \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 sleepQuiz() {\n startQuiz();\n choiceVal();\n nextQuestionIndex();\n restartQuiz();\n}", "function doNewPoll()\r\n{\r\n\tvar max = VACATIONS.length - 1;\r\n\tvar choice1, choice2;\r\n\r\n\t//Select a random vacation for first choice\r\n\tchoice1\t= VACATIONS[randomNumber(0, max)];\r\n\t\r\n\t//Select a different random vacation for second choice\r\n\tdo\r\n\t{\r\n\t\tvar choice2 = VACATIONS[randomNumber(0, max)];\r\n\t} \r\n\twhile (choice1 == choice2);\r\n\r\n\t//Display choices on radio buttons\r\n\t$html(\"optSpan1\", choice1);\r\n\t$html(\"optSpan2\", choice2);\r\n\t\r\n\t//Set values of radio buttons\r\n\t$value(\"optRadio1\", choice1);\r\n\t$value(\"optRadio2\", choice2);\r\n\t\r\n\t//Deselect both radio buttons\r\n\t$checked(\"optRadio1\", false);\r\n\t$checked(\"optRadio2\", false);\r\n}", "function voting(event) {\n voteTracker -= 1;\n for (var i = 0; i < imgArr.length; i++) {\n if (event.target.name === imgArr[i].name) {\n imgArr[i].votes += 1;\n }\n }\n if (voteTracker > 0) {\n refresh();\n } else {\n imgOneEl.classList.add('noHover');\n imgTwoEl.classList.add('noHover');\n imgThreeEl.classList.add('noHover');\n disableVoting();\n storeData();\n addButton();\n genTableResults();\n genChartResults();\n }\n}", "function doPresidentalElections() {\r\n\tallElements = document.getElementById('contentRow').children[1];\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Presidential Elections/,\"总统竞选\");\r\n\t\r\n\ttmp = allElements.children[1];\r\n\tif (tmp.innerHTML) {\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Your vote has been casted successfully/,\"投票成功\");\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/You have already casted your vote/,\"你已经投票\");\r\n\t}\r\n\t\r\n\tallElements = document.getElementById('presidentalElectionsForm');\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Country:/,\"国家:\");\r\n\ttmp = allElements.children[3];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Date:/,\"时期:\");\r\n\t\r\n\tresults = getElements(document, \"//table[@class='dataTable']\");\r\n\tfor (i = 0; i < results.snapshotLength; i++) {\r\n\t\tobj = results.snapshotItem(i).children[0].children[0];\r\n\t\tobj.innerHTML=obj.innerHTML.replace(/Candidate/,\"候选人\");\r\n\t\tobj.innerHTML=obj.innerHTML.replace(/Presentation/,\"竞选演说\");\r\n\t\tobj.innerHTML=obj.innerHTML.replace(/Total votes/,\"总票数\");\r\n\r\n\t\tobj = results.snapshotItem(i).children[0];\r\n\t\tobj.innerHTML=obj.innerHTML.replace(/No candidates/,\"无候选人\");\r\n\t\tobj.innerHTML=obj.innerHTML.replace(/Presentation/,\"竞选演说\");\r\n\t\tobj.innerHTML=obj.innerHTML.replace(/No presentation/,\"无\");\r\n\t\tobj.innerHTML=obj.innerHTML.replace(/Your candidate/,\"已投票\");\r\n\t}\r\n\r\n\tallElements = document.getElementById('command');\r\n\tif (allElements && allElements.innerHTML.match(\"Link to presentation\")) {\r\n\t\ttmp = allElements.children[1];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Link to presentation:/,\"演说链接:\");\r\n\t\ttmp = allElements.parentNode.childNodes[5];\r\n\t\ttmp.nodeValue=tmp.nodeValue.replace(/Candidating for president costs/,\"申请总统候选人需要花费\");\r\n\t}\r\n\r\n\treplaceLinkByHref({\r\n\t\t\"http://wiki.e-sim.org/en/Presidental elections\":[\"Presidential elections tutorial\",\"关于囧统竞选\"]\r\n\t});\r\n\treplaceInputByValue({\r\n\t\t\"Vote\":[\"Vote\",\"投票\"],\r\n\t\t\"Show\":[\"Show\",\"显示\"],\r\n\t\t\"Candidate for president\":[\"Candidate for president\",\"提交候选人申请\"]\r\n\t});\r\n}", "function getResult() {\n console.log(\"getResult ran\");\n wrong = total - correct;\n $(\"#end_total_right b\").text(correct);\n $(\"#end_total_wrong b\").text(wrong);\n var answer_percent = correct / total;\n if (answer_percent >= 0.67) {\n $(\"#end\").prepend(responses[0]);\n } else if (answer_percent >= 0.34) {\n $(\"#end\").prepend(responses[1]);\n } else {\n $(\"#end\").prepend(responses[2]);\n }\n }", "async function getUpvotes (userJSON) {\n const postArray = userJSON.posts; \n //get the # of upvote of each post \n var upvoteNumber = 0;\n //stores an array of promises that promise to return each post's upvote number\n var promiseArray = [];\n postArray.forEach(post => {\n promiseArray.push(upvoteNum(post));\n });\n //Waits for the resolved values of the single promise that promise.all creates to resolve all the promises\n //Will be an array of upvotes of each post \n const promisedArray = await Promise.all(promiseArray).then(upvotes => {return upvotes}); \n promisedArray.forEach(value => {upvoteNumber += value});\n return upvoteNumber;\n}", "function confirmFinished(nid, language) {\n sleep(time * 1000).then(() => {\n // Check if this language has finished.\n jQuery.ajax({url: '/ajax/ibm_tmgmt_concurrency/status_semaphore/check/' + route + '/' + nid + '/' + language + '/' + Date.now()}).done(function (checkResponse) {\n if (checkResponse.proceed) {\n // This element has already finished.\n jQuery('#negotiation_message').hide();\n userSubmitted = false;\n jQuery(targetButtonSelector).prop('disabled', false);\n }\n else {\n confirmFinished(nid, language);\n }\n }\n );\n });\n }", "function getUserVoting2(){\n\tMongoClient.connect(url, (err, db) => {\n\t\tsumVoting(db, (result) => {\n\t\t\tdb.close();\n\t\t\tconsole.log(\"getUserVoting2\", result);\n\t\t});\n\t});\n\tvar sumVoting = (db, callback) => {\n\t\tvar tod = Date.now() - 1000*60*60*24;\n\t\tvar tod1 = Date.now();\n\t\tvar agr = [\n\t\t\t{$match: {account: {$exists:true, $ne: null}}},\n\t\t\t{$match : {date : {$gt:tod, $lt:tod1} }},\n\t\t\t{$group: {_id:\"$account\", vote : { $sum : 1}}}];\n\t\tvar dbo = db.db(\"heroku_dg3d93pq\");\n\t\tvar cursor = dbo.collection('voting').aggregate(agr).toArray( (err, res) => {\n\t\t\t//console.log(res);\n\t\t\ttotalUser = res.length;\n\t\t\t//update each users token in their wallet\n\t\t\tgetTotalVoting(res);\n\t\t\tfor(i = 0; i < res.length;i++){\n\t\t\t\tsetWallet(res[i]._id, res[i].vote,votingDistributionForDay);\n\t\t\t}\n\t\t});\n\t};\n}", "function tally() {\n\n // Ethereum Account needs to be unlocked.\n if(!addressChosen) {\n alert(\"Please unlock your Ethereum address\");\n return;\n }\n\n // Make sure we are in the correct phase.\n if(state != 2) {\n alert(\"Please wait until VOTE Phase\");\n return;\n }\n var reg = anonymousvotingAddr.totalregistered();\n var voted = anonymousvotingAddr.totalvoted();\n\n // Make sure everyone has voted!\n if(!reg.equals(voted)) {\n alert(\"Please wait for everyone to vote\");\n return;\n }\n\n //TODO: Check that all votes have been cast..\n // Can do this by checking the public 'votecast' mapping...\n web3.personal.unlockAccount(web3.eth.accounts[accountindex],password);\n var res = anonymousvotingAddr.computeTally.sendTransaction({from:web3.eth.accounts[accountindex], gas: 4200000});\n document.getElementById(\"tallybutton\").innerHTML = \"Waiting for Ethereum to confirm tally\";\n txlist(\"Compute Tally: \" + res);\n}", "async function controlResults(){\n tv = await constructRequest(\"tv\", searchQuery);\n // // console.log(tv);\n movies = await constructRequest(\"movie\", searchQuery);\n // // console.log(movies);\n people = await constructRequest(\"person\", searchQuery);\n // // console.log(people);\n collections = await constructRequest(\"collection\", searchQuery);\n // // console.log(collections);\n\n var topList;\n \n if(tv.results.length && movies.results.length) topList = tv.results[0].vote_average > movies.results[0].vote_average? \"tv\" : \"movies\";\n else topList = tv.results.length? \"tv\" : \"movies\";\n\n constructOptionList(topList, \n [\n {name: \"TV Shows\", number: tv.total_results, list: tv}, \n {name: \"Movies\", number: movies.total_results, list: movies}, \n {name: \"People\", number: people.total_results, list: people}, \n {name: \"Collections\", number: collections.total_results, list: collections}\n ]);\n\n if(topList == \"tv\") {\n currentList = tv;\n currentType = \"TV Shows\";\n controlContentList(\"TV Shows\");\n }\n else {\n currentList = movies;\n currentType = \"Movies\";\n controlContentList(\"Movies\");\n }\n}", "function doOpVote(opid) {\n\tvar a = 0;\n\tvar vuser = $(\".user\").val();\n\tvar vselection = $(\".selection\"+opid+\":checked\").val();\n\tvar element = 'reloadButton' + opid;\n\t//Call VoteOp.java Serlvet\n $.ajax({\n url: 'voteop',\n type: 'POST',\n data: {\n id: opid,\n user: vuser,\n selection: vselection\n },\n success: function(data) {\n // alert('Update Success');\n \ta = 1;\n \t//Creates Snackbar Message\n \tsmessage(a);\n \t//Closes overlay vote box\n \tvoteopBox(opid, 'close');\n \t//Reloads Button for text\n \t$(\"#\"+element).load(\" #\"+element+\" > *\");\n \n },\n failure: function(data) {\n \tsmessage(a);\n \tvoteopBox(opid, close);\n // alert('Update Failed');\n }\n });\n}", "TryAddVote(player, vote) {\n if (!(vote == \"b\" || vote == \"r\" || vote == \"c\")) {\n return [false, \"Invalid voting option\"];\n }\n if (this.isVoting == false) {\n return [false, \"Voting is not currently taking place! Join the queue to play a game!\"];\n }\n // If the player is in the queue.\n if (this.queue.includes(player)) {\n if (this.votes.length == 5) {\n var [b_count, r_count, c_count] = this.GetVoteCounts();\n if ((vote == \"b\" && b_count < 2) || (vote == \"r\" && r_count < 2) || (vote == \"c\" && c_count < 2)) {\n return [false, \"Invalid voting option. Please vote for one of the options with 2 votes already.\\n\\n\" +\n `Random count: **${r_count}**\\n` +\n `Balanced count: **${b_count}**\\n` +\n `Captains count: **${c_count}**`];\n }\n }\n // On development, let us vote as many times as we like.\n if (Environment == \"Development\") {\n this.votes.push(vote);\n this.hasVoted.push(player);\n }\n else\n {\n if (!this.hasVoted.includes(player)) {\n this.votes.push(vote);\n this.hasVoted.push(player);\n console.log(this.votes);\n console.log(this.hasVoted);\n }\n else {\n return [false, \"You have already voted!\"];\n }\n }\n \n }\n else {\n return [false, \"You can't vote when you're not in the queue!\"];\n }\n return [true, null];\n }", "async function distributeVotingButtons(player, name, gameid, token) {\n const response = await app.client.chat.postMessage({\n token: token,\n channel: player,\n text: \"Time to vote! Should \" + name + \"live or die?\",\n blocks: [\n {\n type: \"section\",\n text: {\n type: \"mrkdwn\",\n text: \"Time to vote! Should \" + name + \" live or die?\"\n }\n },\n {\n type: \"actions\",\n block_id: gameid,\n elements: [\n {\n type: \"static_select\",\n placeholder: {\n type: \"plain_text\",\n text: \"Select Live or Die\",\n emoji: true\n },\n options: [\n {\n text: {\n type: \"plain_text\",\n text: \"Live\",\n emoji: true\n },\n value: \"live\"\n },\n {\n text: {\n type: \"plain_text\",\n text: \"Die\",\n emoji: true\n },\n value: \"die\"\n }\n ],\n action_id: \"submitvote\"\n }\n ]\n },\n {\n type: \"context\",\n elements: [\n {\n type: \"mrkdwn\",\n text: \"(Werewolf game <#\" + (await getGameChannel(gameid)) + \">)\"\n }\n ]\n }\n ]\n });\n}", "function gotPoses(results) {\n poses = results;\n}", "function userSelection() {\n stopCountdown();\n if ($(this).attr(\"data-name\") == correctAnswers[questionSelector]) {\n rightWrong = true;\n correct++;\n var newScore = score += points;\n $(\"#score\").text(newScore);\n } else {\n incorrect++ \n }\n showResult();\n nextQuestion();\n }", "function onVoteSuccess(data) {\n updateAgreeDisagreeCount(data.uniqueId, data.updatedAgreeCount, data.updatedDisagreeCount, data.voteState);\n}", "function pollIntermediaryResults() {\n // First get recommendations from the web\n client.getContentRecommendations(contentId, webRecommendationsFilter, (error, webRecommendations) => {\n console.log('Web ecommenations so far:');\n console.log(webRecommendations.ratings);\n // Now book recommendations\n client.getContentRecommendations(contentId, bookRecommendationsFilter, (error, bookRecommendations) => {\n console.log('Book ecommenations so far:');\n console.log(bookRecommendations.ratings);\n\n if (keepPolling) {\n setTimeout(pollIntermediaryResults, POLLING_INTERVAL_MS);\n } else {\n console.log('These are the final results');\n }\n });\n });\n}", "function submitAnswer() {\n\tif (answer !== '') {\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.onreadystatechange = function() {\n\t\t\tif (xhr.status == 200 ) {\n\t\t\t\tdocument.getElementById('activities').innerHTML = xhr.responseText;\n\t\t\t}\n\t\t};\n\n\t\txhr.open('GET','get_winter_vote.php?winter_activity='+answer, true);\n\t\txhr.send(null);\t\n\t} else {\n\n\n\t\talert('No selection made. Please make a selection.');\n\t}\n}", "function startNextRound() {\r\n// log(\"snr:\"+currentRound);\r\n var remainingRounds = FIRST_ACTUAL_ROUND+numRounds-currentRound-1;\r\n// alert(remainingRounds);\r\n// if (currentRound < (FIRST_ACTUAL_ROUND+numRounds-1)) {\r\n if (remainingRounds > 0) {\r\n initializeRound(currentRound+1);\r\n } else {\r\n hideGame(); // must do this the first time\r\n $('#q1').show(); // 1st survey question\r\n// showResults(); // called in q1\r\n }\r\n}", "tallyVote(votingPlayer, votedPlayer, gs) {\n var votingAgain = votingPlayer.votedFor(votedPlayer, this);\n this.clearVotesFromPlayer(votingPlayer);\n votedPlayer.tallyVoteFromPlayer(this.getNameFromPlayer(votingPlayer), gs, votingAgain);\n }", "async function userVote(userId, opts) {\n //check user data first\n bot.editMessageText(\"Вашему запросу присвоен ID: \" + transactionId, opts);\n\n bot.sendMessage(opts.chat_id, \"[\" + transactionId + \"]: \" + \"Проверяем кошелек, ожидайте...\");\n\n getUserKeys(userId, opts, function(userKeys) {\n //first check if already voted...\n var voteData = getVotingData(userKeys);\n if (voteData.voted) {\n var candidateInfo = getCandidateInfo(voteData.votedFor);\n var text = \"Вы уже проголосовали за кандидата: \" + (voteData.votedFor+1) + \" - \" + candidateInfo.name + \"\\r\\n\";\n bot.sendMessage(opts.chat_id, \"[\" + transactionId + \"]: \" + text);\n } else {\n bot.sendMessage(opts.chat_id, \"[\" + transactionId + \"]: \" + \"Получаем список кандидатов, ожидайте...\");\n showCandidateList(opts);\n }\n });\n}", "function sendVote(condition) {\n switch (condition) {\n case 'notAtAll':\n bot.replyPrivate(message, 'Sorry! 你沒有參與任何投票案');\n break;\n case 'hasDone':\n bot.replyPrivate(message, '你已經投過票囉!');\n break;\n case 'notJoin':\n bot.replyPrivate(message, 'Sorry! 你沒有參與此投票案');\n break;\n case 'notOpen':\n bot.replyPrivate(message, 'Oops! 還沒有到達投票的人數門檻喔:slightly_frowning_face:');\n break;\n case 'caseNotExist':\n bot.replyPrivate(message, '此投票案不存在');\n break;\n case 'overDue':\n bot.replyPrivate(message, '此投票案已經過期。使用 `/result ' + case_id + '`指令查看結果');\n break;\n default:\n if (case_type == 'poll') {\n pollCase.createOption(controller, case_id, message.team_id, message.user, function(data) {\n bot.replyPrivate(message, data);\n });\n } else if (case_type == 'input_number') {\n pollCase.askNumber(controller, bot, message, case_id, message.user, function(choice, unique_ticket) {\n userCase.updateCase(controller, message.user, case_id, choice, unique_ticket);\n });\n }\n break;\n }\n\n }", "function gotPoses(results) {\n poses = results;\n}", "function gotPoses(results) {\n poses = results;\n}", "function gotPoses(results) {\n poses = results;\n}", "function roundComplete() {\n\n\t// player wins if total score = random number\n\tif (totalScore === rdmNum) {\n\t\twinCount++;\n\t\t$(\"#winCount\").html(winCount);\n\t\tresetNums();\n\t}\n\n\t// player loses if exceeds random number\n\tif (totalScore > rdmNum) {\n\t\tlossCount++;\n\t\talert(\"ha! \" + totalScore + \" doesn't equal \" + rdmNum + \".\");\n\t\t$(\"#lossCount\").html(lossCount);\n\t\tresetNums();\n\t}\n}", "async ValidateProposal(ctx,prop_id, voter_id, vote, message) {\n console.log(prop_id, voter_id, vote, message);\n let proposal = await ctx.stub.getState(prop_id);\n try{\n proposal = JSON.parse(proposal);\n } catch (e) {\n console.log('error to get proposal' + prop_id);\n }\n //check whether the voter votes for his own proposal\n const ownProposal = await this.CheckOwnProposal(ctx, proposal.AuthorID, voter_id);\n if(ownProposal === true) {\n return ('Sorry you can not vote for your own proposal!');\n }\n //check whether the voter already voted once\n const acceptVID = 'acceptVoter'+prop_id.substring(8);\n const rejectVID = 'acceptVoter' + prop_id.substring(8);\n console.log('****AcceptVoterID'+acceptVID);\n let acceptVoter = await ctx.stub.getState(acceptVID);\n let rejectVoter = await ctx.stub.getState(rejectVID);\n console.log('****************11111');\n // Here should also be a check, whether a voter has already voted once. If yes, he cannot vote gain.\n // However, for the easy of test of the system performance we comment the CheckVoteTwice function\n // Please cancel the comment if you need this check\n /*const voteTwice = await this.CheckVoteTwice(ctx, acceptVoter, rejectVoter, voter_id);\n if(voteTwice===true) {\n return ('Sorry you have already vote for ' + prop_id);\n }*/\n //check whether the vote comes from a lobe owner && within 24 hours since proposal has been ongoing\n let lobeownerVote = await this.CheckLobeOwnerPower(ctx, prop_id, voter_id, vote);\n console.log('The result*****' + lobeownerVote);\n try {\n if (lobeownerVote === 'TimeOut') {\n return ('********Lobe Owner cannot vote after 24 hours since the proposal is ongoing');\n }\n if(lobeownerVote === 'LO') {\n // A lobe owner votes within 24 hour, so his vote decide the result of the proposal\n // thus, EndProposal() is triggered\n console.log('*******' + proposal.URI);\n if(vote === 'accept') {\n await ctx.stub.putState('latestDR', Buffer.from(JSON.stringify(proposal.URI)));\n }\n await this.EndProposal(ctx, prop_id, vote);\n return ('*******Lobe Owner Successfully Vote for proposal!');\n }\n } catch(e){\n console.log('********Problems when checking Lobe Owners Voting power'+e);\n }\n //Handle votes from normal experts\n let total_members = await ctx.stub.getState('total_members');\n total_members = JSON.parse(total_members);\n //collect result of this vote\n const totalVotes = proposal.AcceptedVotes + proposal.RejectedVotes +1;\n if (vote === 'accept') {\n acceptVoter = JSON.parse(acceptVoter);\n acceptVoter.push({ID: voter_id, Message: message});\n proposal.AcceptedVotes = parseInt(proposal.AcceptedVotes) + 1;\n } else if (vote === 'reject'){\n rejectVoter = JSON.parse(rejectVoter);\n rejectVoter.push({ID: voter_id, Message: message});\n proposal.RejectedVotes = parseInt(proposal.RejectedVotes) + 1;\n }\n await ctx.stub.putState(prop_id, Buffer.from(JSON.stringify(proposal)));\n await ctx.stub.putState('acceptVoter'+prop_id.substring(8), Buffer.from(JSON.stringify(acceptVoter)));\n await ctx.stub.putState('rejectVoter'+prop_id.substring(8), Buffer.from(JSON.stringify(rejectVoter)));\n console.log('***check more than half of members voted');\n // Check whether already majority members have voted fo the proposal\n // If yes, the will check the result of the proposal and then close it.\n // Here we take 50% as majority\n if(totalVotes > total_members/2) {\n let result = await this.ProposalVoteResult(ctx,proposal.Type, voter_id ,proposal.ID, parseInt(proposal.AcceptedVotes), parseInt(proposal.RejectedVotes), proposal.URI);\n return ('*************Invoke Result Checking Function*********' + result + totalVotes);\n }\n return('Successfully Vote for proposal!');\n }", "function verifyAnswer() {\n // if clicked button's 'value' attr does not match correct answer\n if (this.value !== quizQuestions[index].correct) {\n // cut off 2 seconds from time\n timerCount -= 2;\n }\n\n // increment index by 1\n index++;\n\n // if index matches length of questions array\n if (index === quizQuestions.length) {\n // end quiz\n quizOver(); \n } else {\n // get next question\n getQuestions();\n }\n}", "async function confirmVote(transactionHash, initialText, opts) {\n while (true) {\n let receipt = web3.eth.getTransactionReceipt(transactionHash);\n if (receipt) {\n console.log(\"Transaction \" + transactionHash + \" confirmed\");\n console.log(receipt);\n var resultText = initialText + \"Статус транзакции \" + receipt.status;\n bot.sendMessage(opts.chat_id, \"[\" + transactionId + \"]: \" + resultText);\n break;\n }\n console.log(\"Waiting a mined block to include your transaction... currently in block \" + web3.eth.blockNumber);\n await sleep(4000);\n }\n}", "function getResult() {\n let getIndex = Math.floor(Math.random() * Math.floor(3));;\n opponentChoice = choices[getIndex];\n if (\n (userChoice == ROCK && opponentChoice == SCISSORS) ||\n (userChoice == SCISSORS && opponentChoice == PAPER) ||\n (userChoice == PAPER && opponentChoice == ROCK)\n ) {\n const index = counter++;\n opponent.textContent = opponentChoice;\n result.className = \"result-win\";\n result.textContent = \"You've won!\";\n progressBar[index].className = \"result-win\";\n progressBar[index].textContent = \"W\";\n counterWins++;\n isFinished();\n } else if (userChoice == opponentChoice) {\n const index = counter++;\n opponent.textContent = opponentChoice;\n result.className = \"result-draw\";\n result.textContent = \"It's a draw!\";\n progressBar[index].className = \"result-draw\";\n progressBar[index].textContent = \"D\";\n counterDraws++;\n isFinished();\n } else {\n const index = counter++;\n opponent.textContent = opponentChoice;\n result.className = \"result-loss\";\n result.textContent = \"You've lost.\";\n progressBar[index].className = \"result-loss\";\n progressBar[index].textContent = \"L\";\n counterLosses++;\n isFinished();\n }\n}", "function wait() {\n\tif ( questionCounter < 7 ) {\n\t\tquestionCounter++;\n\t\tgenerateHTML();\n\t\tcounter = 30;\n\t\ttimerWrapper();\n\t} else {\n\t\tfinalScreen();\n\t}\n}" ]
[ "0.7091946", "0.6542191", "0.65351", "0.65130377", "0.6359948", "0.62800115", "0.62660664", "0.62589645", "0.6181286", "0.61379194", "0.6132812", "0.606086", "0.60488003", "0.6034855", "0.60305", "0.59969145", "0.5965054", "0.595701", "0.5953736", "0.5937811", "0.5917191", "0.5909133", "0.5900721", "0.5889731", "0.58852226", "0.5880554", "0.5872103", "0.58720374", "0.586136", "0.58567", "0.5846087", "0.58383465", "0.5837018", "0.58350205", "0.58094186", "0.5806058", "0.58002645", "0.5800185", "0.57953817", "0.57941043", "0.5781445", "0.5780102", "0.57769156", "0.57683784", "0.57579535", "0.5745056", "0.5729489", "0.5721462", "0.5702535", "0.5692618", "0.5689805", "0.56896955", "0.56837136", "0.56820506", "0.5668909", "0.5668238", "0.5647775", "0.563754", "0.5637059", "0.56229794", "0.5622723", "0.56190586", "0.56180596", "0.56155056", "0.56111914", "0.5611041", "0.56077576", "0.5604591", "0.56003886", "0.5595586", "0.55921733", "0.5586777", "0.5585658", "0.5580225", "0.5576083", "0.5567051", "0.556612", "0.55635417", "0.5558098", "0.5553146", "0.5548292", "0.55465156", "0.55389595", "0.5534611", "0.5524621", "0.5523068", "0.55222476", "0.552173", "0.5510385", "0.5507352", "0.55043435", "0.55019945", "0.5500347", "0.5500347", "0.5500347", "0.54993904", "0.5495523", "0.54940975", "0.54841334", "0.54831254", "0.54819316" ]
0.0
-1